netstack3_ip::device

Trait DadHandler

Source
pub trait DadHandler<I: IpDeviceIpExt, BC>: DeviceIdContext<AnyDevice> + IpDeviceAddressIdContext<I> {
    const INITIAL_ADDRESS_STATE: IpAddressState;

    // Required methods
    fn start_duplicate_address_detection(
        &mut self,
        bindings_ctx: &mut BC,
        device_id: &Self::DeviceId,
        addr: &Self::AddressId,
    );
    fn stop_duplicate_address_detection(
        &mut self,
        bindings_ctx: &mut BC,
        device_id: &Self::DeviceId,
        addr: &Self::AddressId,
    );
    fn handle_incoming_dad_neighbor_solicitation(
        &mut self,
        bindings_ctx: &mut BC,
        device_id: &Self::DeviceId,
        addr: &Self::AddressId,
        nonce: Option<NdpNonce<&[u8]>>,
    ) -> DadAddressStateLookupResult;
}
Expand description

An implementation for Duplicate Address Detection.

Required Associated Constants§

Source

const INITIAL_ADDRESS_STATE: IpAddressState

The initial address state for newly added addresses.

Required Methods§

Source

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

Starts duplicate address detection.

§Panics

Panics if tentative state for the address is not found.

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_dad_neighbor_solicitation( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, addr: &Self::AddressId, nonce: Option<NdpNonce<&[u8]>>, ) -> DadAddressStateLookupResult

Handles an incoming neighbor solicitation that was determined to be sent as part of a node (possibly ourselves) performing duplicate address detection.

If the incoming solicitation is determined to be a looped-back probe that we ourselves sent, updates DAD state accordingly to send additional probes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<BC, CC> DadHandler<Ipv4, BC> for CC

Source§

const INITIAL_ADDRESS_STATE: IpAddressState = IpAddressState::Assigned

Source§

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

Source§

const INITIAL_ADDRESS_STATE: IpAddressState = IpAddressState::Tentative