pub struct NeighborAdvertPacket<'p> { /* private fields */ }
Expand description
A structure enabling manipulation of on the wire packets
Implementations§
Source§impl<'a> NeighborAdvertPacket<'a>
impl<'a> NeighborAdvertPacket<'a>
Sourcepub fn new<'p>(packet: &'p [u8]) -> Option<NeighborAdvertPacket<'p>>
pub fn new<'p>(packet: &'p [u8]) -> Option<NeighborAdvertPacket<'p>>
Constructs a new NeighborAdvertPacket. If the provided buffer is less than the minimum required packet size, this will return None.
Sourcepub fn owned(packet: Vec<u8>) -> Option<NeighborAdvertPacket<'static>>
pub fn owned(packet: Vec<u8>) -> Option<NeighborAdvertPacket<'static>>
Constructs a new NeighborAdvertPacket. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the NeighborAdvertPacket will own its own data and the underlying buffer will be dropped when the NeighborAdvertPacket is.
Sourcepub fn to_immutable<'p>(&'p self) -> NeighborAdvertPacket<'p>
pub fn to_immutable<'p>(&'p self) -> NeighborAdvertPacket<'p>
Maps from a NeighborAdvertPacket to a NeighborAdvertPacket
Sourcepub fn consume_to_immutable(self) -> NeighborAdvertPacket<'a>
pub fn consume_to_immutable(self) -> NeighborAdvertPacket<'a>
Maps from a NeighborAdvertPacket to a NeighborAdvertPacket 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: &NeighborAdvert) -> usize
pub fn packet_size(_packet: &NeighborAdvert) -> usize
The size (in bytes) of a NeighborAdvert instance when converted into a byte-array
Sourcepub fn get_icmpv6_type(&self) -> Icmpv6Type
pub fn get_icmpv6_type(&self) -> Icmpv6Type
Get the value of the icmpv6_type field
Sourcepub fn get_icmpv6_code(&self) -> Icmpv6Code
pub fn get_icmpv6_code(&self) -> Icmpv6Code
Get the value of the icmpv6_code field
Sourcepub fn get_checksum(&self) -> u16
pub fn get_checksum(&self) -> u16
Get the checksum field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_reserved(&self) -> u32
pub fn get_reserved(&self) -> u32
Get the reserved field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_target_addr(&self) -> Ipv6Addr
pub fn get_target_addr(&self) -> Ipv6Addr
Get the value of the target_addr field
Sourcepub fn get_options_raw(&self) -> &[u8] ⓘ
pub fn get_options_raw(&self) -> &[u8] ⓘ
Get the raw &u8 value of the options field, without copying
Sourcepub fn get_options(&self) -> Vec<NdpOption>
pub fn get_options(&self) -> Vec<NdpOption>
Get the value of the options field (copies contents)
Sourcepub fn get_options_iter(&self) -> NdpOptionIterable<'_> ⓘ
pub fn get_options_iter(&self) -> NdpOptionIterable<'_> ⓘ
Get the value of the options field as iterator