Function Prototypes:tfPacketChecksum

Jump to: navigation, search

Table of Contents >> Compile Time Macros


tt16Bit tfPacketChecksum (
ttPacketPtr packetPtr,
ttPktLen totalDataLength,
tt16BitPtr pshHdrPtr,
tt16Bit pshLen
);


Function Description

This function calculates the checksum of (IP, ICMP, IGMP, UDP and TCP) packets. If the user has defined TM_USER_OCS or TM_CUSTOM_OCS in trsystem.h, then they must define an implementation of this function.


Parameters

  • packetPtr
    Pointer to a ttPacket structure. packetPtr->pktLinkDataPtr points to the data to be checksummed.
  • length
    Length of data to be checksummed.
  • pshHdrPtr
    Pointer to the pseudo header.
  • pshLen
    Length of the pseudo-header.


Returns

  • tt16Bit
    The 16-bit one's complement checksum.


Table of Contents >> Compile Time Macros