-PcktSieve special return functionality added -ARP multicast learning bug fixed -include guards have been refactored -Doxygen style tweaked
24 lines
554 B
C
24 lines
554 B
C
#ifndef ETHERLIB_TCP_UDP_COMMON_H
|
|
#define ETHERLIB_TCP_UDP_COMMON_H
|
|
|
|
#include <stdint.h>
|
|
|
|
typedef struct {
|
|
uint32_t sourceIpAddr;
|
|
uint32_t destIpAddr;
|
|
uint8_t zero;
|
|
uint8_t protocol;
|
|
uint16_t udpLength;
|
|
} IPv4PseudoHeader;
|
|
|
|
/**
|
|
* Calculate TCP or UDP checksum.
|
|
* @param pseudoHeader pointer to IPv4 pseudo-header
|
|
* @param hdr pointer to data
|
|
* @param size size of data
|
|
* @return checksum
|
|
*/
|
|
uint16_t tcp_udp_checksum(const IPv4PseudoHeader *pseudoHeader, const uint8_t * hdr, uint32_t size);
|
|
|
|
#endif //ETHERLIB_TCP_UDP_COMMON_H
|