Struct netsim::wire::ArpPacket
[−]
[src]
pub struct ArpPacket { /* fields omitted */ }
An ARP packet
Methods
impl ArpPacket
[src]
pub fn new_from_fields(fields: ArpFields) -> ArpPacket
[src]
Create a new ArpPacket
given the description provided by fields
.
pub fn write_to_buffer(buffer: &mut [u8], fields: ArpFields)
[src]
Write an ARP packet described by fields
to the given buffer.
pub fn from_bytes(buffer: Bytes) -> ArpPacket
[src]
Parse an ARP packet from the given buffer.
pub fn fields(&self) -> ArpFields
[src]
Parse the ARP packet into an ArpFields
.
pub fn source_mac(&self) -> MacAddr
[src]
Get the MAC address of the sender.
pub fn source_ip(&self) -> Ipv4Addr
[src]
Get the IP address of the sender.
pub fn dest_mac(&self) -> MacAddr
[src]
Get the MAC address of the destination.
pub fn dest_ip(&self) -> Ipv4Addr
[src]
Get the IP address of the destination.
pub fn as_bytes(&self) -> &Bytes
[src]
Return the underlying byte buffer of this packet.
pub fn into_bytes(self) -> Bytes
[src]
Consume the packet and return the underlying buffer
Trait Implementations
impl Clone for ArpPacket
[src]
fn clone(&self) -> ArpPacket
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for ArpPacket
[src]
fn eq(&self, __arg_0: &ArpPacket) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ArpPacket) -> bool
[src]
This method tests for !=
.