From 1c8ae666548d350701c3645a97792776203ff200 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 9 Apr 2020 18:51:05 +0200 Subject: Move icmpv6 and checksum files from ggsn/ dir to lib/ They will be required by sgsnemu to implement ICMPv6 Router Soliciations. Change-Id: Ie878604f0fc0169cc98a1e9eee64b14d76be2c45 --- lib/checksum.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/checksum.h (limited to 'lib/checksum.h') diff --git a/lib/checksum.h b/lib/checksum.h new file mode 100644 index 0000000..4b22431 --- /dev/null +++ b/lib/checksum.h @@ -0,0 +1,13 @@ +#pragma once +#include +#include + +uint16_t ip_fast_csum(const void *iph, unsigned int ihl); +uint32_t csum_partial(const void *buff, int len, uint32_t wsum); +uint16_t ip_compute_csum(const void *buff, int len); + +uint16_t csum_ipv6_magic(const struct in6_addr *saddr, + const struct in6_addr *daddr, + uint32_t len, uint8_t proto, uint32_t csum); + +uint16_t csum_fold(uint32_t csum); -- cgit v1.2.3