Macros | |
#define | FOLD_U32T(u) (((u) >> 16) + ((u) & 0x0000ffffUL)) |
Split an u32_t in two u16_ts and add them up. More... | |
#define | LWIP_CHKSUM_COPY_ALGORITHM 0 |
#define | SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) |
Swap the bytes in an u16_t: much like htons() for little-endian. More... | |
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, ip_addr_t *src, ip_addr_t *dest, u8_t proto, u16_t proto_len) |
u16_t | inet_chksum_pseudo_partial (struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, u8_t proto, u16_t proto_len, u16_t chksum_len) |
#define FOLD_U32T | ( | u | ) | (((u) >> 16) + ((u) & 0x0000ffffUL)) |
Split an u32_t in two u16_ts and add them up.
Referenced by inet_chksum_pbuf(), inet_chksum_pseudo(), inet_chksum_pseudo_partial(), lwip_standard_chksum(), and tcp_output_segment().
#define LWIP_CHKSUM_COPY_ALGORITHM 0 |
#define SWAP_BYTES_IN_WORD | ( | w | ) | (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) |
Swap the bytes in an u16_t: much like htons() for little-endian.
Referenced by inet_chksum_pbuf(), inet_chksum_pseudo(), inet_chksum_pseudo_partial(), lwip_standard_chksum(), and tcp_output_segment().
References LWIP_CHKSUM.
Referenced by icmp_input(), icmp_send_response(), ip_frag(), ip_input(), ip_reass(), and tcp_write().
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.
Referenced by icmp_input().
u16_t inet_chksum_pseudo | ( | struct pbuf * | p, |
ip_addr_t * | src, | ||
ip_addr_t * | dest, | ||
u8_t | proto, | ||
u16_t | proto_len | ||
) |
References FOLD_U32T, htons, INET_DEBUG, ip4_addr_get_u32, pbuf::len, LWIP_CHKSUM, LWIP_DEBUGF, pbuf::next, NULL, pbuf::payload, SWAP_BYTES_IN_WORD, and X32_F.
Referenced by tcp_input(), tcp_keepalive(), tcp_output_segment(), tcp_rst(), tcp_send_empty_ack(), tcp_zero_window_probe(), and udp_input().
u16_t inet_chksum_pseudo_partial | ( | struct pbuf * | p, |
ip_addr_t * | src, | ||
ip_addr_t * | dest, | ||
u8_t | proto, | ||
u16_t | proto_len, | ||
u16_t | chksum_len | ||
) |
References FOLD_U32T, htons, INET_DEBUG, ip4_addr_get_u32, pbuf::len, LWIP_ASSERT, LWIP_CHKSUM, LWIP_DEBUGF, pbuf::next, NULL, pbuf::payload, SWAP_BYTES_IN_WORD, and X32_F.
Referenced by tcp_output_segment(), and udp_input().