Trait netstack3_ip::nud::NudContext

source ·
pub trait NudContext<I: Ip, D: LinkDevice, BC: NudBindingsTypes<D>>: DeviceIdContext<D> {
    type ConfigCtx<'a>: NudConfigContext<I>;
    type SenderCtx<'a>: NudSenderContext<I, D, BC, DeviceId = Self::DeviceId>;

    // Required methods
    fn with_nud_state_mut_and_sender_ctx<O, F: FnOnce(&mut NudState<I, D, BC>, &mut Self::SenderCtx<'_>) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        cb: F,
    ) -> O;
    fn with_nud_state_mut<O, F: FnOnce(&mut NudState<I, D, BC>, &mut Self::ConfigCtx<'_>) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        cb: F,
    ) -> O;
    fn with_nud_state<O, F: FnOnce(&NudState<I, D, BC>) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        cb: F,
    ) -> O;
    fn send_neighbor_solicitation(
        &mut self,
        bindings_ctx: &mut BC,
        device_id: &Self::DeviceId,
        lookup_addr: SpecifiedAddr<I::Addr>,
        remote_link_addr: Option<D::Address>,
    );
}
Expand description

The execution context for NUD for a link device.

Required Associated Types§

source

type ConfigCtx<'a>: NudConfigContext<I>

The inner configuration context.

source

type SenderCtx<'a>: NudSenderContext<I, D, BC, DeviceId = Self::DeviceId>

The inner send context.

Required Methods§

source

fn with_nud_state_mut_and_sender_ctx<O, F: FnOnce(&mut NudState<I, D, BC>, &mut Self::SenderCtx<'_>) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O

Calls the function with a mutable reference to the NUD state and the core sender context.

source

fn with_nud_state_mut<O, F: FnOnce(&mut NudState<I, D, BC>, &mut Self::ConfigCtx<'_>) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O

Calls the function with a mutable reference to the NUD state and NUD configuration for the device.

source

fn with_nud_state<O, F: FnOnce(&NudState<I, D, BC>) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O

Calls the function with an immutable reference to the NUD state.

source

fn send_neighbor_solicitation( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, lookup_addr: SpecifiedAddr<I::Addr>, remote_link_addr: Option<D::Address>, )

Sends a neighbor probe/solicitation message.

If remote_link_addr is provided, the message will be unicasted to that address; if it is None, the message will be multicast.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<I, D, BC, CC> NudContext<I, D, BC> for CC
where I: Ip, D: LinkDevice, BC: NudBindingsTypes<D>, CC: DelegateNudContext<I, Delegate<CC>: NudContext<I, D, BC, DeviceId = CC::DeviceId>> + UseDelegateNudContext + DeviceIdContext<D>,

§

type ConfigCtx<'a> = <<CC as DelegateNudContext<I>>::Delegate<CC> as NudContext<I, D, BC>>::ConfigCtx<'a>

§

type SenderCtx<'a> = <<CC as DelegateNudContext<I>>::Delegate<CC> as NudContext<I, D, BC>>::SenderCtx<'a>