pub struct Arp {Show 13 fields
pub dst_mac: mac_addr_t,
pub src_mac: mac_addr_t,
pub ethernet_type: u16,
pub vlan_id: u16,
pub hardware_type: u16,
pub protocol_type: u16,
pub hw_addr_len: u8,
pub proto_addr_len: u8,
pub operation: u16,
pub arp_sha: mac_addr_t,
pub arp_spa: Ipv4Addr,
pub arp_tha: mac_addr_t,
pub arp_tpa: Ipv4Addr,
}Fields§
§dst_mac: mac_addr_t§src_mac: mac_addr_t§ethernet_type: u16§vlan_id: u16§hardware_type: u16§protocol_type: u16§hw_addr_len: u8§proto_addr_len: u8§operation: u16§arp_sha: mac_addr_t§arp_spa: Ipv4Addr§arp_tha: mac_addr_t§arp_tpa: Ipv4AddrImplementations§
Source§impl Arp
impl Arp
pub fn from_packet(pkt: &[u8]) -> Option<Arp>
pub fn new(arp_op: u16, dst_mac: &mac_addr_t, src_mac: &mac_addr_t) -> Arp
pub fn set_tpa(&mut self, ipv4: &Ipv4Addr)
pub fn set_spa(&mut self, ipv4: &Ipv4Addr)
pub fn to_ethernet_packet(&mut self) -> Vec<u8> ⓘ
pub fn to_arp_payload(&mut self) -> Vec<u8> ⓘ
pub fn is_gratuitous_arp(&self) -> bool
pub fn is_arp_announcement(&self) -> bool
pub fn is_arp_request(&self) -> bool
pub fn to_string(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Arp
impl RefUnwindSafe for Arp
impl Send for Arp
impl Sync for Arp
impl Unpin for Arp
impl UnwindSafe for Arp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more