Struct libarp::client::ArpClient [−][src]
pub struct ArpClient { /* fields omitted */ }Expand description
Struct that encapsulates interaction with (R)ARP messages, such as sending and receiving.
Implementations
Create an ARP client on the interface with the name iface_name.
Create an ARP client on the interface given.
pub async fn send_message(
&mut self,
timeout: Option<Duration>,
message: ArpMessage
) -> Result<ArpMessage, Error>[src]
pub async fn send_message(
&mut self,
timeout: Option<Duration>,
message: ArpMessage
) -> Result<ArpMessage, Error>[src]Send an ARP message with the given timeout.
Returns the next ARP message received. (must not necessarily be related to your message sent)
pub async fn send_message_with_check<T>(
&mut self,
timeout: Option<Duration>,
message: ArpMessage,
check_answer: &dyn Fn(ArpMessage) -> Option<T>
) -> Result<T, Error>[src]
pub async fn send_message_with_check<T>(
&mut self,
timeout: Option<Duration>,
message: ArpMessage,
check_answer: &dyn Fn(ArpMessage) -> Option<T>
) -> Result<T, Error>[src]Send an ARP message with the given timeout, and perform an arbitrary check check_answer on the answer.
Using check_answer, you can check if the received tmessage is related to your previously sent message if needed.
Returns the first ARP message received that satisfies check_answer.
Resolves a given ip_addr to a MAC address.
To achieve this, sends an ARP request with a timeout.
Resolves a given mac_addr to an IPv4 address.
To achieve this, sends an RARP request with a timeout.
Sends arp_message on the interface belonging to this client.
Returns the next ARP message received. Doesn’t return if no ARP message is received.
Auto Trait Implementations
impl !RefUnwindSafe for ArpClientimpl !UnwindSafe for ArpClient