Incluse internet checksum functions.
#include "lwip/opt.h"
#include "lwip/inet_chksum.h"
#include "lwip/def.h"
#include <stddef.h>
#include <string.h>
Macros | |
#define | LWIP_CHKSUM lwip_standard_chksum |
#define | LWIP_CHKSUM_ALGORITHM 2 |
Functions | |
u16_t | inet_chksum (void *dataptr, u16_t len) |
u16_t | inet_chksum_pbuf (struct pbuf *p) |
Calculate a checksum over a chain of pbufs (without pseudo-header, much like inet_chksum only pbufs are used). More... | |
u16_t | inet_chksum_pseudo (struct pbuf *p, u8_t proto, u16_t proto_len, ip_addr_t *src, ip_addr_t *dest) |
u16_t | inet_chksum_pseudo_partial (struct pbuf *p, u8_t proto, u16_t proto_len, u16_t chksum_len, ip_addr_t *src, ip_addr_t *dest) |
static u16_t | inet_cksum_pseudo_base (struct pbuf *p, u8_t proto, u16_t proto_len, u32_t acc) |
Parts of the pseudo checksum which are common to IPv4 and IPv6. More... | |
static u16_t | inet_cksum_pseudo_partial_base (struct pbuf *p, u8_t proto, u16_t proto_len, u16_t chksum_len, u32_t acc) |
Parts of the pseudo checksum which are common to IPv4 and IPv6. More... | |
u16_t | lwip_standard_chksum (void *dataptr, int len) |
#define LWIP_CHKSUM lwip_standard_chksum |
Referenced by inet_chksum(), inet_chksum_pbuf(), inet_cksum_pseudo_base(), and inet_cksum_pseudo_partial_base().
#define LWIP_CHKSUM_ALGORITHM 2 |
References LWIP_CHKSUM.
Referenced by ip_input().
Calculate a checksum over a chain of pbufs (without pseudo-header, much like inet_chksum only pbufs are used).
p | pbuf chain over that the checksum should be calculated |
References FOLD_U32T, pbuf::len, LWIP_CHKSUM, pbuf::next, NULL, pbuf::payload, and SWAP_BYTES_IN_WORD.
u16_t inet_chksum_pseudo | ( | struct pbuf * | p, |
u8_t | proto, | ||
u16_t | proto_len, | ||
ip_addr_t * | src, | ||
ip_addr_t * | dest | ||
) |
References addr, FOLD_U32T, inet_cksum_pseudo_base(), and ip4_addr_get_u32.
u16_t inet_chksum_pseudo_partial | ( | struct pbuf * | p, |
u8_t | proto, | ||
u16_t | proto_len, | ||
u16_t | chksum_len, | ||
ip_addr_t * | src, | ||
ip_addr_t * | dest | ||
) |
References addr, FOLD_U32T, inet_cksum_pseudo_partial_base(), and ip4_addr_get_u32.
|
static |
Parts of the pseudo checksum which are common to IPv4 and IPv6.
References FOLD_U32T, htons, INET_DEBUG, pbuf::len, LWIP_CHKSUM, LWIP_DEBUGF, pbuf::next, NULL, pbuf::payload, SWAP_BYTES_IN_WORD, and X32_F.
Referenced by inet_chksum_pseudo().
|
static |
Parts of the pseudo checksum which are common to IPv4 and IPv6.
References FOLD_U32T, htons, INET_DEBUG, pbuf::len, LWIP_ASSERT, LWIP_CHKSUM, LWIP_DEBUGF, pbuf::next, NULL, pbuf::payload, SWAP_BYTES_IN_WORD, and X32_F.
Referenced by inet_chksum_pseudo_partial().
u16_t lwip_standard_chksum | ( | void * | dataptr, |
int | len | ||
) |
References FOLD_U32T, and SWAP_BYTES_IN_WORD.