pub struct Ipv6PacketMut<'a> { /* private fields */ }Expand description
A structurally validated mutable IPv6 base-header view.
Implementations§
Source§impl<'a> Ipv6PacketMut<'a>
impl<'a> Ipv6PacketMut<'a>
Sourcepub fn icmpv6_mut(
&mut self,
) -> Result<Option<Icmpv6MessageMut<'_>>, Ipv6DispatchError>
pub fn icmpv6_mut( &mut self, ) -> Result<Option<Icmpv6MessageMut<'_>>, Ipv6DispatchError>
Parses mutable ICMPv6 after traversing supported IPv6 extension headers.
Sourcepub fn udp_mut(
&mut self,
) -> Result<Option<UdpDatagramMut<'_>>, Ipv6DispatchError>
pub fn udp_mut( &mut self, ) -> Result<Option<UdpDatagramMut<'_>>, Ipv6DispatchError>
Parses mutable UDP after traversing supported IPv6 extension headers.
Sourcepub fn tcp_mut(
&mut self,
) -> Result<Option<TcpSegmentMut<'_>>, Ipv6DispatchError>
pub fn tcp_mut( &mut self, ) -> Result<Option<TcpSegmentMut<'_>>, Ipv6DispatchError>
Parses mutable TCP after traversing supported IPv6 extension headers.
Source§impl<'a> Ipv6PacketMut<'a>
impl<'a> Ipv6PacketMut<'a>
Sourcepub fn parse(bytes: &'a mut [u8]) -> Result<Self, ParseError>
pub fn parse(bytes: &'a mut [u8]) -> Result<Self, ParseError>
Validates the fixed header, version, and any nonzero declared payload extent.
Sourcepub fn traffic_class(&self) -> u8
pub fn traffic_class(&self) -> u8
Returns the eight-bit traffic class.
Sourcepub fn flow_label(&self) -> u32
pub fn flow_label(&self) -> u32
Returns the 20-bit flow label.
Sourcepub fn payload_length(&self) -> Ipv6PayloadLength
pub fn payload_length(&self) -> Ipv6PayloadLength
Interprets the Payload Length field without resolving Jumbo Payload options.
Sourcepub fn raw_payload_length(&self) -> u16
pub fn raw_payload_length(&self) -> u16
Returns the raw 16-bit Payload Length field.
Sourcepub fn next_header(&self) -> Ipv6NextHeader
pub fn next_header(&self) -> Ipv6NextHeader
Returns the Next Header value, preserving unknown values.
Sourcepub fn source(&self) -> Ipv6Address
pub fn source(&self) -> Ipv6Address
Returns the source address.
Sourcepub fn destination(&self) -> Ipv6Address
pub fn destination(&self) -> Ipv6Address
Returns the destination address.
Sourcepub fn payload(&self) -> &[u8]
pub fn payload(&self) -> &[u8]
Returns bytes after the fixed header, with zero-field ambiguity as documented on Ipv6Packet.
Sourcepub fn payload_mut(&mut self) -> &mut [u8] ⓘ
pub fn payload_mut(&mut self) -> &mut [u8] ⓘ
Returns bytes after the fixed header mutably.
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Returns all represented bytes mutably.
Sourcepub fn set_traffic_class(&mut self, value: u8)
pub fn set_traffic_class(&mut self, value: u8)
Replaces the traffic class while preserving version and flow-label bits.
Sourcepub fn set_flow_label(&mut self, value: u32) -> Result<(), Ipv6PacketBuildError>
pub fn set_flow_label(&mut self, value: u32) -> Result<(), Ipv6PacketBuildError>
Replaces the flow label, or leaves the packet unchanged when it exceeds 20 bits.
Sourcepub fn set_next_header(&mut self, value: Ipv6NextHeader)
pub fn set_next_header(&mut self, value: Ipv6NextHeader)
Replaces the Next Header value.
Sourcepub fn set_hop_limit(&mut self, value: u8)
pub fn set_hop_limit(&mut self, value: u8)
Replaces the hop limit.
Sourcepub fn set_source(&mut self, value: Ipv6Address)
pub fn set_source(&mut self, value: Ipv6Address)
Replaces the source address.
Sourcepub fn set_destination(&mut self, value: Ipv6Address)
pub fn set_destination(&mut self, value: Ipv6Address)
Replaces the destination address.