Struct pnet::packet::icmpv6::echo_reply::EchoReplyPacket
source · pub struct EchoReplyPacket<'p> { /* private fields */ }
Expand description
A structure enabling manipulation of on the wire packets
Implementations§
source§impl<'a> EchoReplyPacket<'a>
impl<'a> EchoReplyPacket<'a>
sourcepub fn new<'p>(packet: &'p [u8]) -> Option<EchoReplyPacket<'p>>
pub fn new<'p>(packet: &'p [u8]) -> Option<EchoReplyPacket<'p>>
Constructs a new EchoReplyPacket. If the provided buffer is less than the minimum required packet size, this will return None.
sourcepub fn owned(packet: Vec<u8>) -> Option<EchoReplyPacket<'static>>
pub fn owned(packet: Vec<u8>) -> Option<EchoReplyPacket<'static>>
Constructs a new EchoReplyPacket. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the EchoReplyPacket will own its own data and the underlying buffer will be dropped when the EchoReplyPacket is.
sourcepub fn to_immutable<'p>(&'p self) -> EchoReplyPacket<'p>
pub fn to_immutable<'p>(&'p self) -> EchoReplyPacket<'p>
Maps from a EchoReplyPacket to a EchoReplyPacket
sourcepub fn consume_to_immutable(self) -> EchoReplyPacket<'a>
pub fn consume_to_immutable(self) -> EchoReplyPacket<'a>
Maps from a EchoReplyPacket to a EchoReplyPacket 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: &EchoReply) -> usize
pub fn packet_size(_packet: &EchoReply) -> usize
The size (in bytes) of a EchoReply 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_identifier(&self) -> u16
pub fn get_identifier(&self) -> u16
Get the identifier field. This field is always stored big-endian within the struct, but this accessor returns host order.
sourcepub fn get_sequence_number(&self) -> u16
pub fn get_sequence_number(&self) -> u16
Get the sequence_number field. This field is always stored big-endian within the struct, but this accessor returns host order.
Trait Implementations§
source§impl<'p> Debug for EchoReplyPacket<'p>
impl<'p> Debug for EchoReplyPacket<'p>
source§impl<'p> FromPacket for EchoReplyPacket<'p>
impl<'p> FromPacket for EchoReplyPacket<'p>
source§impl<'a> Packet for EchoReplyPacket<'a>
impl<'a> Packet for EchoReplyPacket<'a>
source§impl<'a> PacketSize for EchoReplyPacket<'a>
impl<'a> PacketSize for EchoReplyPacket<'a>
source§fn packet_size(&self) -> usize
fn packet_size(&self) -> usize
source§impl<'p> PartialEq for EchoReplyPacket<'p>
impl<'p> PartialEq for EchoReplyPacket<'p>
source§fn eq(&self, other: &EchoReplyPacket<'p>) -> bool
fn eq(&self, other: &EchoReplyPacket<'p>) -> bool
self
and other
values to be equal, and is used
by ==
.