30 #ifndef TINS_CHECKSUM_UTILS_H 31 #define TINS_CHECKSUM_UTILS_H 34 #include <tins/macros.h> 53 TINS_API uint32_t
do_checksum(
const uint8_t* start,
const uint8_t* end);
65 TINS_API uint16_t
sum_range(
const uint8_t* start,
const uint8_t* end);
101 TINS_API uint32_t
crc32(
const uint8_t* data, uint32_t data_size);
106 #endif // TINS_CHECKSUM_UTILS_H TINS_API uint32_t crc32(const uint8_t *data, uint32_t data_size)
Returns the 32 bit crc of the given buffer.
Definition: checksum_utils.cpp:112
The Tins namespace.
Definition: address_range.h:38
TINS_API uint16_t sum_range(const uint8_t *start, const uint8_t *end)
Computes the 16 bit sum of the input buffer.
Definition: checksum_utils.cpp:49
Abstraction of an IPv4 address.
Definition: ip_address.h:45
TINS_API uint32_t do_checksum(const uint8_t *start, const uint8_t *end)
Does the 16 bits sum of all 2 bytes elements between start and end.
Definition: checksum_utils.cpp:45
Definition: ipv6_address.h:45
TINS_API uint32_t pseudoheader_checksum(IPv4Address source_ip, IPv4Address dest_ip, uint16_t len, uint16_t flag)
Performs the pseudo header checksum used in TCP and UDP PDUs.
Definition: checksum_utils.cpp:94