pub trait IpDeviceHandler<I: IpDeviceIpExt, BC>: DeviceIdContext<AnyDevice> {
// Required methods
fn is_router_device(&mut self, device_id: &Self::DeviceId) -> bool;
fn set_default_hop_limit(
&mut self,
device_id: &Self::DeviceId,
hop_limit: NonZeroU8,
);
fn handle_received_dad_packet(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
addr: SpecifiedAddr<I::Addr>,
packet_data: I::ReceivedPacketData<'_>,
) -> Option<IpAddressState>;
}Expand description
An implementation of an IP device.
Required Methods§
Sourcefn is_router_device(&mut self, device_id: &Self::DeviceId) -> bool
fn is_router_device(&mut self, device_id: &Self::DeviceId) -> bool
Returns whether the device is a router.
Sourcefn set_default_hop_limit(
&mut self,
device_id: &Self::DeviceId,
hop_limit: NonZeroU8,
)
fn set_default_hop_limit( &mut self, device_id: &Self::DeviceId, hop_limit: NonZeroU8, )
Sets the device’s default hop limit.
Sourcefn handle_received_dad_packet(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
addr: SpecifiedAddr<I::Addr>,
packet_data: I::ReceivedPacketData<'_>,
) -> Option<IpAddressState>
fn handle_received_dad_packet( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, addr: SpecifiedAddr<I::Addr>, packet_data: I::ReceivedPacketData<'_>, ) -> Option<IpAddressState>
Handles a received Duplicate Address Detection Packet.
Takes action in response to a received DAD packet for the given address.
Returns the assignment state of the address on the given interface, if
there was one before any action was taken. That is, this method returns
IpAddressState::Tentative when the address was tentatively assigned
(and now removed), IpAddressState::Assigned if the address was
assigned (and possibly removed), IpAddressState::Unassigned if the
address was uninitialized, and None if the address wasn’t associated
with the interface
For IPv4, a DAD packet is either an ARP request or response. For IPv6 a DAD packet is either a Neighbor Solicitation or a Neighbor Advertisement.