glibc/inet
Dan Luedtke 72dfba1be4 inet: Add common IPv6 packet header macros
Adds commonly used IPv6 packet header macros similar to what is available
on NetBSD and FreeBSD in sys/netinet/ip6.h and Android in
libc/include/netinet/ip6.h

Usage example IPV6_VERSION_MASK and IPV6_VERSION:

    if ((ip6->ip6_vfc & IPV6_VERSION_MASK) == IPV6_VERSION)
        return true;

Usage example IPV6_FLOWINFO_MASK:

    ip6->ip6_flow = (flow & IPV6_FLOWINFO_MASK);

The relevant standard is RFC2460 (Internet Protocol, Version 6
Specification). It defines the Internet Protocol version (IPV6_VERSION)
and reduced the size of the flow label field from 24 to 20 bits
(IPV6_FLOWLABEL_MASK). The traffic class and flow label fields together
make up the flow information (IPV6_FLOWINFO_MASK).

Tested on x86_64 GNU/Linux

Signed-off-by: Dan Luedtke <danrl@google.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-01-13 10:54:38 -03:00
..
arpa Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
netinet inet: Add common IPv6 packet header macros 2025-01-13 10:54:38 -03:00
protocols
rpc
bindresvport.c
bug-if1.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
check_native.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
check_pf.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
deadline.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
etc.rpc
ether_aton_r.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ether_aton.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ether_line.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ether_ntoa_r.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ether_ntoa.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
getipv4sourcefilter.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
getsourcefilter.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
herrno-loc.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
herrno.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
htonl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
htons.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
htontest.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
idna_name_classify.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
idna.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
if_index.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ifaddrs.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ifaddrs.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ifreq.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
in6_addr.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
inet6_opt.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
inet6_option.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
inet6_rth.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
inet6_scopeid_pton.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
inet_lnaof.c
inet_mkadr.c
inet_net.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
inet_netof.c
inet_ntoa.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
Makefile Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
net-internal.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
rcmd.c
rexec.c
ruserpass.c
setipv4sourcefilter.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
setsourcefilter.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
test_ifindex.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
test-hnto-types.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
test-ifaddrs.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
test-inet6_opt.c
tst-checks-posix.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-checks.c
tst-deadline.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-ether_aton.c
tst-ether_line.c
tst-getni1.c
tst-getni2.c
tst-idna_name_classify.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-if_index-long.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-if_nameindex.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-inet6_rth.c
tst-inet6_scopeid_pton.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-network.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-ntoa.c
tst-sockaddr.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
Versions