Trait IpDeviceHandler

Source
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<'_>,
    ) -> IpAddressState;
}
Expand description

An implementation of an IP device.

Required Methods§

Source

fn is_router_device(&mut self, device_id: &Self::DeviceId) -> bool

Returns whether the device is a router.

Source

fn set_default_hop_limit( &mut self, device_id: &Self::DeviceId, hop_limit: NonZeroU8, )

Sets the device’s default hop limit.

Source

fn handle_received_dad_packet( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, addr: SpecifiedAddr<I::Addr>, packet_data: I::ReceivedPacketData<'_>, ) -> 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 so not removed), otherwise IpAddressState::Unassigned.

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.

Implementors§