IPv6 header types and helper functions.
More...
IPv6 header types and helper functions.
|
file | hdr.h |
| IPv6 header type and helper function definitions.
|
|
◆ ipv6_hdr_get_fl()
static uint32_t ipv6_hdr_get_fl |
( |
const ipv6_hdr_t * |
hdr | ) |
|
|
inlinestatic |
Gets the value of the flow label field of hdr
.
- Parameters
-
[in] | hdr | Pointer to an IPv6 header. |
- Returns
- Value of the flow label field of
hdr
.
Definition at line 261 of file hdr.h.
◆ ipv6_hdr_get_tc()
static uint8_t ipv6_hdr_get_tc |
( |
const ipv6_hdr_t * |
hdr | ) |
|
|
inlinestatic |
Gets the value of the traffic class field of hdr
.
- Parameters
-
[in] | hdr | Pointer to an IPv6 header. |
- Returns
- Value of the traffic class field of
hdr
.
Definition at line 195 of file hdr.h.
◆ ipv6_hdr_get_tc_dscp()
static uint8_t ipv6_hdr_get_tc_dscp |
( |
const ipv6_hdr_t * |
hdr | ) |
|
|
inlinestatic |
Gets the value of the Differentiated Service Codepoint (DSCP) part of the traffic class field of hdr
.
The field is needed e.g. in context of 6LoWPAN header compression
- See also
- RFC 2474, section 3
- Parameters
-
[in] | hdr | Pointer to an IPv6 header. |
- Returns
- Value of the DSCP part of the traffic class field of
hdr
.
Definition at line 235 of file hdr.h.
◆ ipv6_hdr_get_tc_ecn()
static uint8_t ipv6_hdr_get_tc_ecn |
( |
const ipv6_hdr_t * |
hdr | ) |
|
|
inlinestatic |
Gets the value of the Explicit Congestion Notification (ECN) part of the traffic class field of hdr
.
The field is needed e.g. in context of 6LoWPAN header compression
- See also
- RFC 3168, section 5
- Parameters
-
[in] | hdr | Pointer to an IPv6 header. |
- Returns
- Value of the ECN part of the traffic class field of
hdr
.
Definition at line 215 of file hdr.h.
◆ ipv6_hdr_get_version()
static uint8_t ipv6_hdr_get_version |
( |
const ipv6_hdr_t * |
hdr | ) |
|
|
inlinestatic |
Gets the value of the version field of hdr
.
- Parameters
-
[in] | hdr | Pointer to an IPv6 header. |
- Returns
- Value of the version field of
hdr
.
Definition at line 114 of file hdr.h.
◆ ipv6_hdr_inet_csum()
static uint16_t ipv6_hdr_inet_csum |
( |
uint16_t |
sum, |
|
|
ipv6_hdr_t * |
hdr, |
|
|
uint8_t |
prot_num, |
|
|
uint16_t |
len |
|
) |
| |
|
inlinestatic |
Calculates the Internet Checksum for the IPv6 Pseudo Header.
- See also
- RFC 8200, section 8.1
- Parameters
-
[in] | sum | Preinialized value of the sum. |
[in] | prot_num | The Protocol Numbers you want to calculate the checksum for. Can not be inferred from ipv6_hdr_t::nh, since it can be an IPv6 exentension header. |
[in] | hdr | An IPv6 header to derive the Pseudo Header from. |
[in] | len | The upper-layer packet length for the pseudo header. Can not be inferred from ipv6_hdr_t::len, since there can be extension headers between the IPv6 header and the payload. |
- Returns
- The non-normalized Internet Checksum of the given IPv6 pseudo header.
Definition at line 284 of file hdr.h.
◆ ipv6_hdr_is()
Checks if the version field is set to 6.
- Parameters
-
[in] | hdr | Pointer to an IPv6 header. |
- Returns
- true, if version field is 6
-
false, otherwise
Definition at line 127 of file hdr.h.
◆ ipv6_hdr_print()
Outputs an IPv6 header to stdout.
- Parameters
-
◆ ipv6_hdr_set_fl()
static void ipv6_hdr_set_fl |
( |
ipv6_hdr_t * |
hdr, |
|
|
uint32_t |
fl |
|
) |
| |
|
inlinestatic |
Sets the flow label field of hdr
.
- Parameters
-
[out] | hdr | Pointer to an IPv6 header. |
[in] | fl | The new value for the flow label field in host byte order. |
Definition at line 247 of file hdr.h.
◆ ipv6_hdr_set_tc()
static void ipv6_hdr_set_tc |
( |
ipv6_hdr_t * |
hdr, |
|
|
uint8_t |
tc |
|
) |
| |
|
inlinestatic |
Sets the traffic class field of hdr
.
- Parameters
-
[out] | hdr | Pointer to an IPv6 header. |
[in] | tc | The new value for the traffic class field. |
Definition at line 138 of file hdr.h.
◆ ipv6_hdr_set_tc_dscp()
static void ipv6_hdr_set_tc_dscp |
( |
ipv6_hdr_t * |
hdr, |
|
|
uint8_t |
dscp |
|
) |
| |
|
inlinestatic |
Sets the value of the Differentiated Service Codepoint (DSCP) part of the traffic class field of hdr
.
The field is needed e.g. in context of 6LoWPAN header compression
- See also
- RFC 2474, section 3
- Parameters
-
[out] | hdr | Pointer to an IPv6 header. |
[in] | dscp | The new value for the 6-bit DSCP part of the traffic class field. |
Definition at line 180 of file hdr.h.
◆ ipv6_hdr_set_tc_ecn()
static void ipv6_hdr_set_tc_ecn |
( |
ipv6_hdr_t * |
hdr, |
|
|
uint8_t |
ecn |
|
) |
| |
|
inlinestatic |
Sets the value of the Explicit Congestion Notification (ECN) part of the traffic class field of hdr
.
The field is needed e.g. in context of 6LoWPAN header compression
- See also
- RFC 3168, section 5
- Parameters
-
[out] | hdr | Pointer to an IPv6 header. |
[in] | ecn | The new value for the 2-bit ECN part of the traffic class field. |
Definition at line 160 of file hdr.h.
◆ ipv6_hdr_set_version()
static void ipv6_hdr_set_version |
( |
ipv6_hdr_t * |
hdr | ) |
|
|
inlinestatic |
Sets the version field of hdr
to 6.
- Parameters
-
[out] | hdr | Pointer to an IPv6 header. |
Definition at line 101 of file hdr.h.