![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Rtos API example
inet_chksum.h File Reference
IP checksum calculation functions. More...
Go to the source code of this file.
Functions | |
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). | |
u16_t | lwip_chksum_copy (void *dst, const void *src, u16_t len) |
Safe but slow: first call MEMCPY, then call LWIP_CHKSUM. | |
u16_t | ip6_chksum_pseudo (struct pbuf *p, u8_t proto, u16_t proto_len, const ip6_addr_t *src, const ip6_addr_t *dest) |
Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain. | |
u16_t | ip6_chksum_pseudo_partial (struct pbuf *p, u8_t proto, u16_t proto_len, u16_t chksum_len, const ip6_addr_t *src, const ip6_addr_t *dest) |
Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain. |
Detailed Description
IP checksum calculation functions.
Definition in file inet_chksum.h.
Function Documentation
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).
- Parameters:
-
p pbuf chain over that the checksum should be calculated
- Returns:
- checksum (as u16_t) to be saved directly in the protocol header
Definition at line 568 of file lwip_inet_chksum.c.
u16_t ip6_chksum_pseudo | ( | struct pbuf * | p, |
u8_t | proto, | ||
u16_t | proto_len, | ||
const ip6_addr_t * | src, | ||
const ip6_addr_t * | dest | ||
) |
Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain.
IPv6 addresses are expected to be in network byte order.
- Parameters:
-
p chain of pbufs over that a checksum should be calculated (ip data part) proto ipv6 protocol/next header (used for checksum of pseudo header) proto_len length of the ipv6 payload (used for checksum of pseudo header) src source ipv6 address (used for checksum of pseudo header) dest destination ipv6 address (used for checksum of pseudo header)
- Returns:
- checksum (as u16_t) to be saved directly in the protocol header
Definition at line 343 of file lwip_inet_chksum.c.
u16_t ip6_chksum_pseudo_partial | ( | struct pbuf * | p, |
u8_t | proto, | ||
u16_t | proto_len, | ||
u16_t | chksum_len, | ||
const ip6_addr_t * | src, | ||
const ip6_addr_t * | dest | ||
) |
Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain.
IPv6 addresses are expected to be in network byte order. Will only compute for a portion of the payload.
- Parameters:
-
p chain of pbufs over that a checksum should be calculated (ip data part) proto ipv6 protocol/next header (used for checksum of pseudo header) proto_len length of the ipv6 payload (used for checksum of pseudo header) chksum_len number of payload bytes used to compute chksum src source ipv6 address (used for checksum of pseudo header) dest destination ipv6 address (used for checksum of pseudo header)
- Returns:
- checksum (as u16_t) to be saved directly in the protocol header
Definition at line 491 of file lwip_inet_chksum.c.
u16_t lwip_chksum_copy | ( | void * | dst, |
const void * | src, | ||
u16_t | len | ||
) |
Safe but slow: first call MEMCPY, then call LWIP_CHKSUM.
For architectures with big caches, data might still be in cache when generating the checksum after copying.
Definition at line 604 of file lwip_inet_chksum.c.
Generated on Sun Jul 17 2022 08:25:34 by
![doxygen](doxygen.png)