netstack3_ip::device

Trait DadContext

Source
pub trait DadContext<BC: DadBindingsTypes>:
    IpDeviceAddressIdContext<Ipv6>
    + DeviceIdContext<AnyDevice>
    + CoreTimerContext<DadTimerId<Self::WeakDeviceId, Self::WeakAddressId>, BC>
    + CoreEventContext<DadEvent<Self::DeviceId>> {
    type DadAddressCtx<'a>: DadAddressContext<BC, DeviceId = Self::DeviceId, AddressId = Self::AddressId>;

    // Required methods
    fn with_dad_state<O, F: FnOnce(DadStateRef<'_, Self::DadAddressCtx<'_>, BC>) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        addr: &Self::AddressId,
        cb: F,
    ) -> O;
    fn send_dad_packet(
        &mut self,
        bindings_ctx: &mut BC,
        device_id: &Self::DeviceId,
        dst_ip: MulticastAddr<Ipv6Addr>,
        message: NeighborSolicitation,
        nonce: NdpNonce<&[u8]>,
    ) -> Result<(), ()>;
}
Expand description

The execution context for DAD.

Required Associated Types§

Source

type DadAddressCtx<'a>: DadAddressContext<BC, DeviceId = Self::DeviceId, AddressId = Self::AddressId>

The inner address context.

Required Methods§

Source

fn with_dad_state<O, F: FnOnce(DadStateRef<'_, Self::DadAddressCtx<'_>, BC>) -> O>( &mut self, device_id: &Self::DeviceId, addr: &Self::AddressId, cb: F, ) -> O

Calls the function with the DAD state associated with the address.

Source

fn send_dad_packet( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, dst_ip: MulticastAddr<Ipv6Addr>, message: NeighborSolicitation, nonce: NdpNonce<&[u8]>, ) -> Result<(), ()>

Sends an NDP Neighbor Solicitation message for DAD to the local-link.

The message will be sent with the unspecified (all-zeroes) source address.

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§