SAMV71 Xplained Ultra Software Package 1.3

inet_chksum.c File Reference

#include "lwip/opt.h"
#include "lwip/inet_chksum.h"
#include "lwip/inet.h"
#include <stddef.h>

Go to the source code of this file.

Defines

#define LWIP_CHKSUM   lwip_standard_chksum
#define LWIP_CHKSUM_ALGORITHM   0
#define SWAP_BYTES_IN_WORD(w)   ((w & 0xff) << 8) | ((w & 0xff00) >> 8)
#define FOLD_U32T(u)   ((u >> 16) + (u & 0x0000ffffUL))

Functions

u16_t inet_chksum_pseudo (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t proto, u16_t proto_len)
u16_t inet_chksum (void *dataptr, u16_t len)
u16_t inet_chksum_pbuf (struct pbuf *p)

Detailed Description

Incluse internet checksum functions.

Definition in file inet_chksum.c.


Define Documentation

#define FOLD_U32T (   u  )     ((u >> 16) + (u & 0x0000ffffUL))

Split an u32_t in two u16_ts and add them up

Definition at line 78 of file inet_chksum.c.

#define SWAP_BYTES_IN_WORD (   w  )     ((w & 0xff) << 8) | ((w & 0xff00) >> 8)

Like the name says...

Definition at line 74 of file inet_chksum.c.


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 417 of file inet_chksum.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines