]>
git.proxmox.com Git - mirror_frr.git/blob - lib/checksum.h
1 #ifndef _FRR_CHECKSUM_H
2 #define _FRR_CHECKSUM_H
5 #include <netinet/in.h>
12 /* IPv4 pseudoheader */
19 } __attribute__((packed
));
21 /* IPv6 pseudoheader */
28 } __attribute__((packed
));
30 extern int in_cksum(void *data
, int nbytes
);
31 extern int in_cksum_with_ph4(struct ipv4_ph
*ph
, void *data
, int nbytes
);
32 extern int in_cksum_with_ph6(struct ipv6_ph
*ph
, void *data
, int nbytes
);
34 #define FLETCHER_CHECKSUM_VALIDATE 0xffff
35 extern uint16_t fletcher_checksum(uint8_t *, const size_t len
,
36 const uint16_t offset
);
42 #endif /* _FRR_CHECKSUM_H */