pub struct Ipv6HeaderExt<'a> {
pub header: &'a Ipv6Header,
pub raw_extensions: &'a [u8],
}Expand description
IPv6 Header with extension headers
Fields§
§header: &'a Ipv6Header§raw_extensions: &'a [u8]Implementations§
Source§impl<'a> Ipv6HeaderExt<'a>
impl<'a> Ipv6HeaderExt<'a>
Sourcepub fn extensions(&'a self) -> Ipv6ExtensionHeadersIter<'a> ⓘ
pub fn extensions(&'a self) -> Ipv6ExtensionHeadersIter<'a> ⓘ
Get IPv6 extension headers iterator
Sourcepub fn ext_headers_len(&self) -> usize
pub fn ext_headers_len(&self) -> usize
Get the total header length including extensions
Methods from Deref<Target = Ipv6Header>§
Sourcepub fn traffic_class(&self) -> u8
pub fn traffic_class(&self) -> u8
Returns the Traffic Class (8 bits) Equivalent to DSCP + ECN in IPv4
Sourcepub fn flow_label(&self) -> u32
pub fn flow_label(&self) -> u32
Returns the Flow Label (20 bits) Used for QoS and flow identification
Sourcepub fn payload_length(&self) -> usize
pub fn payload_length(&self) -> usize
Returns the payload length in bytes Note: This does NOT include the IPv6 header itself (40 bytes)
Sourcepub fn total_length(&self) -> usize
pub fn total_length(&self) -> usize
Returns the total packet length (header + payload)
Sourcepub fn next_header(&self) -> IpProto
pub fn next_header(&self) -> IpProto
Returns the next header type This indicates the protocol of the next header (TCP, UDP, extension header, etc.)
Sourcepub fn src_ip_raw(&self) -> [u8; 16]
pub fn src_ip_raw(&self) -> [u8; 16]
Returns the source IPv6 address as raw bytes
Sourcepub fn dst_ip_raw(&self) -> [u8; 16]
pub fn dst_ip_raw(&self) -> [u8; 16]
Returns the destination IPv6 address as raw bytes
Sourcepub fn has_extension_headers(&self) -> bool
pub fn has_extension_headers(&self) -> bool
Check if this packet uses extension headers
Sourcepub fn is_transport_protocol(&self) -> bool
pub fn is_transport_protocol(&self) -> bool
Check if the next header is a transport protocol (TCP/UDP)
Sourcepub fn total_header_len(&self, buf: &[u8], bytes_available: usize) -> usize
pub fn total_header_len(&self, buf: &[u8], bytes_available: usize) -> usize
Calculate the total header length including extension headers
Returns the total length of IPv6 header + all extension headers, or 0 if the packet is fragmented or if there’s an error parsing.
buf should start at the beginning of the IPv6 header and contain
at least bytes_available bytes.
Sourcepub fn upper_layer_protocol(
&self,
buf: &[u8],
bytes_available: usize,
) -> Option<(IpProto, bool)>
pub fn upper_layer_protocol( &self, buf: &[u8], bytes_available: usize, ) -> Option<(IpProto, bool)>
Get the upper layer protocol after skipping all extension headers Returns the protocol number and whether fragmentation was encountered
Sourcepub fn should_parse_extensions(&self) -> bool
pub fn should_parse_extensions(&self) -> bool
Check if there are extension headers to parse
Trait Implementations§
Source§impl<'a> Clone for Ipv6HeaderExt<'a>
impl<'a> Clone for Ipv6HeaderExt<'a>
Source§fn clone(&self) -> Ipv6HeaderExt<'a>
fn clone(&self) -> Ipv6HeaderExt<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more