Trait DadHandler

Source
pub trait DadHandler<I: IpDeviceIpExt, BC>: DeviceIdContext<AnyDevice> + IpDeviceAddressIdContext<I> {
    // Required methods
    fn initialize_duplicate_address_detection<'a>(
        &mut self,
        bindings_ctx: &mut BC,
        device_id: &'a Self::DeviceId,
        addr: &'a Self::AddressId,
    ) -> NeedsDad<'a, Self::AddressId, Self::DeviceId>;
    fn start_duplicate_address_detection<'a>(
        &mut self,
        bindings_ctx: &mut BC,
        start_dad: StartDad<'_, Self::AddressId, Self::DeviceId>,
    );
    fn stop_duplicate_address_detection(
        &mut self,
        bindings_ctx: &mut BC,
        device_id: &Self::DeviceId,
        addr: &Self::AddressId,
    );
    fn handle_incoming_packet(
        &mut self,
        bindings_ctx: &mut BC,
        device_id: &Self::DeviceId,
        addr: &Self::AddressId,
        data: I::ReceivedPacketData<'_>,
    ) -> DadIncomingPacketResult<I>;
}
Expand description

An implementation for Duplicate Address Detection.

Required Methods§

Source

fn initialize_duplicate_address_detection<'a>( &mut self, bindings_ctx: &mut BC, device_id: &'a Self::DeviceId, addr: &'a Self::AddressId, ) -> NeedsDad<'a, Self::AddressId, Self::DeviceId>

Initializes the DAD state for the given device and address.

If DAD is required, the return value holds a [StartDad] token that can be used to start the DAD algorithm.

Source

fn start_duplicate_address_detection<'a>( &mut self, bindings_ctx: &mut BC, start_dad: StartDad<'_, Self::AddressId, Self::DeviceId>, )

Starts duplicate address detection.

The provided [StartDad] token is proof that DAD is required for the address & device.

Source

fn stop_duplicate_address_detection( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, addr: &Self::AddressId, )

Stops duplicate address detection.

Does nothing if DAD is not being performed on the address.

Source

fn handle_incoming_packet( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, addr: &Self::AddressId, data: I::ReceivedPacketData<'_>, ) -> DadIncomingPacketResult<I>

Handles an incoming duplicate address detection packet.

This packet is indicative of the sender (possibly ourselves, if the packet was looped back) performing duplicate address detection.

The returned state indicates the address’ state on ourself.

Implementors§

Source§

impl<BC: DadBindingsContext<CC::OuterEvent>, CC: DadContext<Ipv4, BC>> DadHandler<Ipv4, BC> for CC

Source§

impl<BC: DadBindingsContext<CC::OuterEvent>, CC: DadContext<Ipv6, BC>> DadHandler<Ipv6, BC> for CC
where for<'a> CC::DadAddressCtx<'a>: Ipv6DadAddressContext<BC>,