mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-29 05:04:50 +00:00
netinet: Define IPv6 ECN mask
Define a mask for the code point used for ECN in the Traffic Class field
(2 bits) of an IPv6 header.
BE: 0 0 3 0 0 0 0 0
Bit: 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic Class | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
For BE (Big Endian), or network-byte order, this corresponds to 0x00300000.
For Little Endian, it corresponds to 0x00003000.
Reviewed by: imp, markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/879
(cherry picked from commit b0e13f785b
)
This commit is contained in:
parent
8ac8b0b6aa
commit
d14bf9de60
|
@ -97,10 +97,12 @@ struct ip6_hdr {
|
|||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
#define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */
|
||||
#define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */
|
||||
#define IPV6_ECN_MASK 0x00300000 /* ECN code point (2 bits) */
|
||||
#else
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
#define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */
|
||||
#define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */
|
||||
#define IPV6_ECN_MASK 0x00003000 /* ECN code point (2 bits) */
|
||||
#endif /* LITTLE_ENDIAN */
|
||||
#endif
|
||||
#define IPV6_FLOWLABEL_LEN 20
|
||||
|
|
Loading…
Reference in a new issue