diff options
author | Dan Luedtke <danrl@google.com> | 2024-12-04 11:50:22 -0800 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2025-01-13 10:54:38 -0300 |
commit | 72dfba1be426f449a7f1c913c3656ff8b400ba9e (patch) | |
tree | ee4dde94aa3cf90ab7974149575e75a8f993d168 /sysdeps/unix/sysv/linux | |
parent | e59bdf63cbe16b018f8b9b38f1daf9ece2329ab8 (diff) | |
download | glibc-72dfba1be426f449a7f1c913c3656ff8b400ba9e.zip glibc-72dfba1be426f449a7f1c913c3656ff8b400ba9e.tar.gz glibc-72dfba1be426f449a7f1c913c3656ff8b400ba9e.tar.bz2 |
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>
Diffstat (limited to 'sysdeps/unix/sysv/linux')
0 files changed, 0 insertions, 0 deletions