IPv6 Segment Routing Header (SRH) as defined in RFC 8754.
More...
#include <srv6_header.hxx>
|
| constexpr auto | header_length_bytes () const noexcept -> uint16_t |
| constexpr auto | last_entry_index () const noexcept -> uint8_t |
| constexpr auto | segments_count () const noexcept -> uint8_t |
| constexpr auto | tag () const noexcept -> uint16_t |
| constexpr auto | routing_type_value () const noexcept -> uint8_t |
| constexpr bool | is_valid_routing_type () const noexcept |
| constexpr auto | segment_list_ptr () const noexcept -> const uint8_t * |
| constexpr auto | segment_at (uint8_t idx) const noexcept -> std::span< const uint8_t, 16 > |
| constexpr auto | segment_list_bytes_len () const noexcept -> uint16_t |
| constexpr auto | tlv_offset () const noexcept -> uint16_t |
| constexpr auto | max_last_entry () const noexcept -> uint8_t |
| | Return the maximum valid Last Entry derived from Hdr Ext Len.
|
| constexpr bool | validate_srh_bounds (uint16_t packet_remaining_len) const noexcept |
| | Validate SRH structural metadata against available packet bytes.
|
| constexpr auto | tlv_bytes_len () const noexcept -> uint16_t |
| constexpr auto | tlv_first_ptr () const noexcept -> const uint8_t * |
| constexpr auto | safe_tlv_region (uint16_t packet_remaining_len) const noexcept -> std::optional< std::span< const uint8_t > > |
| | Return a bounded TLV-byte view when SRH validation succeeds.
|
| constexpr auto | safe_segment_at (uint8_t idx, uint16_t packet_remaining_len) const noexcept -> std::optional< std::span< const uint8_t, 16 > > |
| | Return a segment view only when SRH validation succeeds.
|
IPv6 Segment Routing Header (SRH) as defined in RFC 8754.
- See also
- IANA IPv6 Parameters — Segment Routing Header TLVs & Routing Types: https://www.iana.org/assignments/ipv6-parameters/)
-
RFC 8754: https://datatracker.ietf.org/doc/rfc8754/
◆ header_length_bytes()
| auto vbvx::SRv6Header::header_length_bytes |
( |
| ) |
const -> uint16_t |
|
inlineconstexprnoexcept |
◆ is_valid_routing_type()
| bool vbvx::SRv6Header::is_valid_routing_type |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ last_entry_index()
| auto vbvx::SRv6Header::last_entry_index |
( |
| ) |
const -> uint8_t |
|
inlineconstexprnoexcept |
◆ max_last_entry()
| auto vbvx::SRv6Header::max_last_entry |
( |
| ) |
const -> uint8_t |
|
inlineconstexprnoexcept |
Return the maximum valid Last Entry derived from Hdr Ext Len.
For SRH, max_LE is computed as (Hdr Ext Len / 2) - 1.
◆ routing_type_value()
| auto vbvx::SRv6Header::routing_type_value |
( |
| ) |
const -> uint8_t |
|
inlineconstexprnoexcept |
◆ safe_segment_at()
| auto vbvx::SRv6Header::safe_segment_at |
( |
uint8_t | idx, |
|
|
uint16_t | packet_remaining_len ) const -> std::optional< std::span< const uint8_t, 16 > > |
|
inlineconstexprnoexcept |
Return a segment view only when SRH validation succeeds.
- Parameters
-
| idx | Segment index in encoded SRH Segment List order. |
| packet_remaining_len | Bytes available from this SRH pointer to the end of packet buffer. |
- Returns
- Segment span on success; std::nullopt when invalid/out-of-range.
◆ safe_tlv_region()
| auto vbvx::SRv6Header::safe_tlv_region |
( |
uint16_t | packet_remaining_len | ) |
const -> std::optional< std::span< const uint8_t > > |
|
inlineconstexprnoexcept |
Return a bounded TLV-byte view when SRH validation succeeds.
- Parameters
-
| packet_remaining_len | Bytes available from this SRH pointer to the end of packet buffer. |
- Returns
- TLV span on success; std::nullopt for invalid SRH metadata.
◆ segment_at()
| auto vbvx::SRv6Header::segment_at |
( |
uint8_t | idx | ) |
const -> std::span< const uint8_t, 16 > |
|
inlineconstexprnoexcept |
◆ segment_list_bytes_len()
| auto vbvx::SRv6Header::segment_list_bytes_len |
( |
| ) |
const -> uint16_t |
|
inlineconstexprnoexcept |
◆ segment_list_ptr()
| auto vbvx::SRv6Header::segment_list_ptr |
( |
| ) |
const -> const uint8_t * |
|
inlineconstexprnoexcept |
◆ segments_count()
| auto vbvx::SRv6Header::segments_count |
( |
| ) |
const -> uint8_t |
|
inlineconstexprnoexcept |
◆ tag()
| auto vbvx::SRv6Header::tag |
( |
| ) |
const -> uint16_t |
|
inlineconstexprnoexcept |
◆ tlv_bytes_len()
| auto vbvx::SRv6Header::tlv_bytes_len |
( |
| ) |
const -> uint16_t |
|
inlineconstexprnoexcept |
◆ tlv_first_ptr()
| auto vbvx::SRv6Header::tlv_first_ptr |
( |
| ) |
const -> const uint8_t * |
|
inlineconstexprnoexcept |
◆ tlv_offset()
| auto vbvx::SRv6Header::tlv_offset |
( |
| ) |
const -> uint16_t |
|
inlineconstexprnoexcept |
◆ validate_srh_bounds()
| bool vbvx::SRv6Header::validate_srh_bounds |
( |
uint16_t | packet_remaining_len | ) |
const |
|
inlineconstexprnoexcept |
Validate SRH structural metadata against available packet bytes.
- Parameters
-
| packet_remaining_len | Bytes available from this SRH pointer to the end of packet buffer. |
- Returns
- true when SRH metadata is internally consistent and bounded.
◆ flags
| uint8_t vbvx::SRv6Header::flags |
◆ hdr_ext_len
| uint8_t vbvx::SRv6Header::hdr_ext_len |
◆ last_entry
| uint8_t vbvx::SRv6Header::last_entry |
◆ next_header
| uint8_t vbvx::SRv6Header::next_header |
◆ routing_type
| uint8_t vbvx::SRv6Header::routing_type |
◆ segments_left
| uint8_t vbvx::SRv6Header::segments_left |
◆ tag_be
| uint16_t vbvx::SRv6Header::tag_be |
The documentation for this struct was generated from the following file: