friendev EtherDune TCP/IP library
|
Contains functions to perform IP checksum operations. More...
#include <Checksum.h>
Static Public Member Functions | |
static uint16_t | add (uint16_t a, uint16_t b) |
Adds two checksums, taking carry into account. More... | |
static uint16_t | add (uint16_t a, uint16_t b, bool odd) |
Adds two checksums, taking carry into account and whether the second one starts at an odd index More... | |
static uint16_t | calc (uint16_t len, const uint8_t *data) |
Calculates the checksum of the specified buffer in memory More... | |
static uint16_t | calc (uint16_t checksum, uint16_t len, const uint8_t *data) |
Calculates the checksum of the specified buffer in memory, as a continuation of a previoulsy calculated checksum More... | |
Contains functions to perform IP checksum operations.
Implements memory-efficient algorithm to calculate total and partial network checksums
Definition at line 26 of file Checksum.h.
|
static |
Adds two checksums, taking carry into account.
a | the first checksum value |
b | The second checksum value to add |
Definition at line 25 of file Checksum.cpp.
|
static |
Adds two checksums, taking carry into account and whether the second one starts at an odd index
a | the first checksum value |
b | The second checksum value to add |
odd | Whether the second value (b) starts at an odd index |
Definition at line 43 of file Checksum.cpp.
|
static |
Calculates the checksum of the specified buffer in memory
len | length of the buffer |
data | The data. |
Definition at line 59 of file Checksum.cpp.
|
static |
Calculates the checksum of the specified buffer in memory, as a continuation of a previoulsy calculated checksum
checksum | Previous checksum to add to |
len | length of the buffer |
data | The data. |
Definition at line 89 of file Checksum.cpp.