pub trait ArpIpLayerContext<D: ArpDevice, BC>: DeviceIdContext<D> {
// Required method
fn on_arp_packet(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
frame_src: D::Address,
sender_hwaddr: UnicastAddr<D::Address>,
sender_addr: Ipv4Addr,
target_addr: Ipv4Addr,
is_arp_probe: bool,
) -> bool;
}Expand description
An execution context for ARP providing functionality from the IP layer.
Required Methods§
Sourcefn on_arp_packet(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
frame_src: D::Address,
sender_hwaddr: UnicastAddr<D::Address>,
sender_addr: Ipv4Addr,
target_addr: Ipv4Addr,
is_arp_probe: bool,
) -> bool
fn on_arp_packet( &mut self, bindings_ctx: &mut BC, device: &Self::DeviceId, frame_src: D::Address, sender_hwaddr: UnicastAddr<D::Address>, sender_addr: Ipv4Addr, target_addr: Ipv4Addr, is_arp_probe: bool, ) -> bool
Dispatches a received ARP Request or Reply to the IP layer.
The IP layer may use this packet to update internal state, such as facilitating Address Conflict Detection (RFC 5227).
frame_src is the link address in the L2 Frame that carried this ARP
packet, while sender_hwaddr is the sender_hardware_addr field from the
ARP header.
Returns whether the target_addr is assigned on the device. This is
used by ARP to send responses to the packet (if applicable).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".