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§
Sourcefn 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 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.
Sourcefn start_duplicate_address_detection<'a>(
&mut self,
bindings_ctx: &mut BC,
start_dad: StartDad<'_, Self::AddressId, Self::DeviceId>,
)
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.
Sourcefn stop_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, )
Stops duplicate address detection.
Does nothing if DAD is not being performed on the address.
Sourcefn handle_incoming_packet(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
addr: &Self::AddressId,
data: I::ReceivedPacketData<'_>,
) -> DadIncomingPacketResult<I>
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.