Struct rips_packets::arp::ArpPacket
[−]
[src]
pub struct ArpPacket<'a>(_);
Methods
impl<'a> ArpPacket<'a>
[src]
pub const MIN_LEN: usize
MIN_LEN: usize = 28
The minimum number of bytes in this type of packet. Usually equal to the header size of the protocol.
pub fn new(data: &'a [u8]) -> Option<ArpPacket<'a>>
[src]
Creates a new immutable packet based on the given backing slice. Returns None
if
the buffer is shorter than the minimum length of this packet.
pub unsafe fn new_unchecked(data: &'a [u8]) -> ArpPacket<'a>
[src]
Creates a new immutable packet based on the given backing slice without checking its length first. If the slice is too short, a subsequent read from a field might result in invalid memory access.
pub fn data(&self) -> &[u8]
[src]
Returns a reference to the slice backing this packet.
pub fn header(&self) -> &[u8]
[src]
Returns a slice to the part of the backing data that represents the header.
This is simply everything up until min_len()
.
pub fn payload(&self) -> &[u8]
[src]
Returns a slice to the payload part of the backing data. This is simply everything after the header.
impl<'a> ArpPacket<'a>
[src]
pub fn hardware_type(&self) -> HardwareType
[src]
pub fn protocol_type(&self) -> EtherType
[src]
pub fn hardware_length(&self) -> u8
[src]
pub fn protocol_length(&self) -> u8
[src]
pub fn operation(&self) -> Operation
[src]
pub fn sender_mac_addr(&self) -> MacAddr
[src]
pub fn sender_ip_addr(&self) -> Ipv4Addr
[src]
pub fn target_mac_addr(&self) -> MacAddr
[src]
pub fn target_ip_addr(&self) -> Ipv4Addr
[src]
Trait Implementations
impl<'a> Debug for ArpPacket<'a>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a> Copy for ArpPacket<'a>
[src]
impl<'a> Clone for ArpPacket<'a>
[src]
fn clone(&self) -> ArpPacket<'a>
[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<'a> Eq for ArpPacket<'a>
[src]
impl<'a> PartialEq for ArpPacket<'a>
[src]
fn eq(&self, __arg_0: &ArpPacket<'a>) -> 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<'a>) -> bool
[src]
This method tests for !=
.