pub struct MutableIpv6Packet<'p> { /* private fields */ }
Expand description
A structure enabling manipulation of on the wire packets
Implementations§
Source§impl<'a> MutableIpv6Packet<'a>
impl<'a> MutableIpv6Packet<'a>
Sourcepub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableIpv6Packet<'p>>
pub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableIpv6Packet<'p>>
Constructs a new #name. If the provided buffer is less than the minimum required packet size, this will return None.
Sourcepub fn owned(packet: Vec<u8>) -> Option<MutableIpv6Packet<'static>>
pub fn owned(packet: Vec<u8>) -> Option<MutableIpv6Packet<'static>>
Constructs a new #name. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the #name will own its own data and the underlying buffer will be dropped when the #name is.
Sourcepub fn to_immutable<'p>(&'p self) -> Ipv6Packet<'p>
pub fn to_immutable<'p>(&'p self) -> Ipv6Packet<'p>
Maps from a #name to a #imm_name
Sourcepub fn consume_to_immutable(self) -> Ipv6Packet<'a>
pub fn consume_to_immutable(self) -> Ipv6Packet<'a>
Maps from a #name to a #imm_name while consuming the source
Sourcepub const fn minimum_packet_size() -> usize
pub const fn minimum_packet_size() -> usize
The minimum size (in bytes) a packet of this type can be. It’s based on the total size of the fixed-size fields.
Sourcepub fn packet_size(_packet: &Ipv6) -> usize
pub fn packet_size(_packet: &Ipv6) -> usize
The size (in bytes) of a #base_name instance when converted into a byte-array
Sourcepub fn get_version(&self) -> u4
pub fn get_version(&self) -> u4
Get the version field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_traffic_class(&self) -> u8
pub fn get_traffic_class(&self) -> u8
Get the traffic_class field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_flow_label(&self) -> u20be
pub fn get_flow_label(&self) -> u20be
Get the flow_label field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_payload_length(&self) -> u16be
pub fn get_payload_length(&self) -> u16be
Get the payload_length field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_next_header(&self) -> IpNextHeaderProtocol
pub fn get_next_header(&self) -> IpNextHeaderProtocol
Get the value of the {name} field
Sourcepub fn get_hop_limit(&self) -> u8
pub fn get_hop_limit(&self) -> u8
Get the hop_limit field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_source(&self) -> Ipv6Addr
pub fn get_source(&self) -> Ipv6Addr
Get the value of the {name} field
Sourcepub fn get_destination(&self) -> Ipv6Addr
pub fn get_destination(&self) -> Ipv6Addr
Get the value of the {name} field
Sourcepub fn get_payload(&self) -> Vec<u8> ⓘ
pub fn get_payload(&self) -> Vec<u8> ⓘ
Get the value of the {name} field (copies contents)
Sourcepub fn set_version(&mut self, val: u4)
pub fn set_version(&mut self, val: u4)
Set the version field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_traffic_class(&mut self, val: u8)
pub fn set_traffic_class(&mut self, val: u8)
Set the traffic_class field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_flow_label(&mut self, val: u20be)
pub fn set_flow_label(&mut self, val: u20be)
Set the flow_label field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_payload_length(&mut self, val: u16be)
pub fn set_payload_length(&mut self, val: u16be)
Set the payload_length field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_next_header(&mut self, val: IpNextHeaderProtocol)
pub fn set_next_header(&mut self, val: IpNextHeaderProtocol)
Set the value of the {name} field.
Sourcepub fn set_hop_limit(&mut self, val: u8)
pub fn set_hop_limit(&mut self, val: u8)
Set the hop_limit field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_source(&mut self, val: Ipv6Addr)
pub fn set_source(&mut self, val: Ipv6Addr)
Set the value of the {name} field.
Sourcepub fn set_destination(&mut self, val: Ipv6Addr)
pub fn set_destination(&mut self, val: Ipv6Addr)
Set the value of the {name} field.
Sourcepub fn set_payload(&mut self, vals: &[u8])
pub fn set_payload(&mut self, vals: &[u8])
Set the value of the {name} field (copies contents)