Struct netsim_embed::arp::ArpPacket  
source · pub struct ArpPacket<'p> { /* private fields */ }Expand description
A structure enabling manipulation of on the wire packets
Implementations§
source§impl<'a> ArpPacket<'a>
 
impl<'a> ArpPacket<'a>
sourcepub fn new<'p>(packet: &'p [u8]) -> Option<ArpPacket<'p>>
 
pub fn new<'p>(packet: &'p [u8]) -> Option<ArpPacket<'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, Global>) -> Option<ArpPacket<'static>>
 
pub fn owned(packet: Vec<u8, Global>) -> Option<ArpPacket<'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) -> ArpPacket<'p>
 
pub fn to_immutable<'p>(&'p self) -> ArpPacket<'p>
Maps from a #name to a #imm_name
sourcepub fn consume_to_immutable(self) -> ArpPacket<'a>
 
pub fn consume_to_immutable(self) -> ArpPacket<'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: &Arp) -> usize
 
pub fn packet_size(_packet: &Arp) -> usize
The size (in bytes) of a #base_name instance when converted into a byte-array
sourcepub fn get_hardware_type(&self) -> ArpHardwareType
 
pub fn get_hardware_type(&self) -> ArpHardwareType
Get the value of the {name} field
sourcepub fn get_protocol_type(&self) -> EtherType
 
pub fn get_protocol_type(&self) -> EtherType
Get the value of the {name} field
sourcepub fn get_hw_addr_len(&self) -> u8
 
pub fn get_hw_addr_len(&self) -> u8
Get the hw_addr_len field. This field is always stored big-endian within the struct, but this accessor returns host order.
sourcepub fn get_proto_addr_len(&self) -> u8
 
pub fn get_proto_addr_len(&self) -> u8
Get the proto_addr_len field. This field is always stored big-endian within the struct, but this accessor returns host order.
sourcepub fn get_operation(&self) -> ArpOperation
 
pub fn get_operation(&self) -> ArpOperation
Get the value of the {name} field
sourcepub fn get_sender_hw_addr(&self) -> MacAddr
 
pub fn get_sender_hw_addr(&self) -> MacAddr
Get the value of the {name} field
sourcepub fn get_sender_proto_addr(&self) -> Ipv4Addr
 
pub fn get_sender_proto_addr(&self) -> Ipv4Addr
Get the value of the {name} field
sourcepub fn get_target_hw_addr(&self) -> MacAddr
 
pub fn get_target_hw_addr(&self) -> MacAddr
Get the value of the {name} field
sourcepub fn get_target_proto_addr(&self) -> Ipv4Addr
 
pub fn get_target_proto_addr(&self) -> Ipv4Addr
Get the value of the {name} field
sourcepub fn get_payload(&self) -> Vec<u8, Global>
 
pub fn get_payload(&self) -> Vec<u8, Global>
Get the value of the {name} field (copies contents)