Struct zero_packet::datalink::arp::ArpParser
source · pub struct ArpParser<'a> {
pub data: &'a [u8],
}
Fields§
§data: &'a [u8]
Implementations§
source§impl<'a> ArpParser<'a>
impl<'a> ArpParser<'a>
sourcepub fn new(data: &'a [u8]) -> Result<Self, &'static str>
pub fn new(data: &'a [u8]) -> Result<Self, &'static str>
Creates a new Arp
from the given slice.
sourcepub fn htype(&self) -> u16
pub fn htype(&self) -> u16
Returns the hardware type field.
Specifies the type of hardware used for the network (e.g. Ethernet).
sourcepub fn ptype(&self) -> u16
pub fn ptype(&self) -> u16
Returns the protocol type field.
Specifies the type of protocol address (e.g. IPv4).
sourcepub fn hlen(&self) -> u8
pub fn hlen(&self) -> u8
Returns the hardware length field.
Specifies the length of the hardware address in bytes.
sourcepub fn plen(&self) -> u8
pub fn plen(&self) -> u8
Returns the protocol length field.
Specifies the length of the protocol address in bytes.
sourcepub fn oper(&self) -> u16
pub fn oper(&self) -> u16
Returns the operation field.
Specifies the operation being performed (e.g. request, reply).
sourcepub fn sha(&self) -> &[u8]
pub fn sha(&self) -> &[u8]
Returns the sender hardware address field.
Specifies the hardware address of the sender.
sourcepub fn spa(&self) -> &[u8]
pub fn spa(&self) -> &[u8]
Returns the sender protocol address field.
Specifies the protocol address of the sender.
sourcepub fn tha(&self) -> &[u8]
pub fn tha(&self) -> &[u8]
Returns the target hardware address field.
Specifies the hardware address of the receiver
sourcepub fn tpa(&self) -> &[u8]
pub fn tpa(&self) -> &[u8]
Returns the target protocol address field.
Specifies the protocol address of the receiver.
sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the header length in bytes.