GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CCSDS / V3-5-3 > ccsds_pkt_boot / rhel6-64


Interface   Data Structures   File List   Data Fields   Globals  

CCSDS_pkt_chksum.c File Reference

Function definitions for CCSDS packet checksum library. More...

#include <CCSDS/CCSDS_pkt.h>
#include <CCSDS_pkt_private.h>
#include <PBI/PTR.h>

Functions

Packet Checksum Functions


unsigned int CCSDS_pktChksumSizeof (void)
 Get the size of a CCSDS telecommand packet checksum.
unsigned short CCSDS_pktChksumCalc (const void *pkt, int size)
 Calculate a packet checksum value.
unsigned int CCSDS_pktChksumInsert (void *pkt, int size)
 Calculate and insert a packet checksum.
unsigned int CCSDS_pktChksumVerify (const void *pkt, int size)
 Verify a packet checksum value.


Detailed Description

Function definitions for CCSDS packet checksum library.

Author:
D.L. Wood

Function Documentation

unsigned short CCSDS_pktChksumCalc ( const void *  pkt,
int  size 
)

Calculate a packet checksum value.

Calculates the value of a packet checksum over a range of packet data. The algorithm is:

  1. Start with an initial checksum value of '0'.
  2. Add the next byte from the data to the running checksum value.
  3. Advance to the next word and go to step 2.

Parameters:
pkt A pointer to the beginning of the range to checksum.
size The number of bytes to checksum.
Returns:
The checksum value.

Referenced by CCSDS_pktChksumInsert(), and CCSDS_pktChksumVerify().

unsigned int CCSDS_pktChksumInsert ( void *  pkt,
int  size 
)

Calculate and insert a packet checksum.

Calculates the value of a packet checksum over a range of packet data. The checksum value is inserted at the proper location at the end of the packet application data.

Parameters:
pkt A pointer to the beginning of the range to checksum (packet header).
size The total number of bytes in the packet including packet header and checksum slot.
Returns:
A CSDS MSG value.

References CCSDS_PKT_MSG, CCSDS_pktChksumCalc(), and NULL.

unsigned int CCSDS_pktChksumSizeof ( void   ) 

Get the size of a CCSDS telecommand packet checksum.

Returns the size in bytes of a CCSDS telecommand packet checksum word.

Returns:
The checksum size.

References CCSDS_PKT_CHKSUM_SIZE.

unsigned int CCSDS_pktChksumVerify ( const void *  pkt,
int  size 
)

Verify a packet checksum value.

Calculates the value of a packet checksum over a range of packet data. The checksum value is compared to the value stored at the end of the packet application data.

Parameters:
pkt A pointer to the beginning of the range to checksum (packet header).
size The total number of bytes in the packet including packet header and checksum slot.
Returns:
A CSDS MSG value.

References CCSDS_PKT_MSG, CCSDS_pktChksumCalc(), and NULL.


Generated on Tue Nov 29 16:31:49 2011 by  doxygen 1.5.8