EtherLib/prefab/packet_parsers/tcp_udp_common.h
Wiesner András ac5fc9c529 -IP reassembler added
-PcktSieve special return functionality added
-ARP multicast learning bug fixed
-include guards have been refactored
-Doxygen style tweaked
2023-02-04 11:04:26 +01:00

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