diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-08-08 23:27:22 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-08-09 22:14:53 +0200 |
commit | 949e50e02bb1af911dca820f21a11232f615e106 (patch) | |
tree | 54df2271d331ba2b268d264fe690512e250ab319 /ggsn/checksum.h | |
parent | 714a41bf66932bb6b383cd4573d1eff51aaf50dd (diff) |
IPv6: Implement IPv6 prefix assignment via ICMPv6 router advertisement
The 3GPP specs are quite strange when it comes to how an IPv6 address
or rather prefix is assigned to an IPv6 PDP context. The designated
method for allocating the IPv6 address via the PDP EUA (End User
Address) Information Element in the GTP signalling plane is *not*
used to allocate the address/prefix. Instead, the EUA is used to
allocate an "interface identifier" to the MS, which it the uses
to derive its link-local source address to send a router solicitation.
The GGSN subsequently answers witha router advertisement, advertising
a single/64 prefix, whihcthe MS then uses to generate it's real IPv6
source address for subsequent communication.
Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f
Diffstat (limited to 'ggsn/checksum.h')
-rw-r--r-- | ggsn/checksum.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ggsn/checksum.h b/ggsn/checksum.h new file mode 100644 index 0000000..4b22431 --- /dev/null +++ b/ggsn/checksum.h @@ -0,0 +1,13 @@ +#pragma once +#include <stdint.h> +#include <netinet/in.h> + +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); |