pub trait Ipv6DeviceHandler<BC>: IpDeviceHandler<Ipv6, BC> {
type LinkLayerAddr: AsRef<[u8]>;
// Required methods
fn get_link_layer_addr_bytes(
&mut self,
device_id: &Self::DeviceId,
) -> Option<Self::LinkLayerAddr>;
fn set_discovered_retrans_timer(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
retrans_timer: NonZeroDuration,
);
fn handle_received_dad_neighbor_solicitation(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
addr: UnicastAddr<Ipv6Addr>,
nonce: Option<NdpNonce<&[u8]>>,
) -> IpAddressState;
fn handle_received_neighbor_advertisement(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
addr: UnicastAddr<Ipv6Addr>,
) -> IpAddressState;
fn set_link_mtu(&mut self, device_id: &Self::DeviceId, mtu: Mtu);
fn update_discovered_ipv6_route(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
route: Ipv6DiscoveredRoute,
lifetime: Option<NonZeroNdpLifetime>,
);
fn apply_slaac_update(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
prefix: Subnet<Ipv6Addr>,
preferred_lifetime: Option<NonZeroNdpLifetime>,
valid_lifetime: Option<NonZeroNdpLifetime>,
);
fn receive_mld_packet<B: SplitByteSlice>(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
src_ip: Ipv6SourceAddr,
dst_ip: SpecifiedAddr<Ipv6Addr>,
packet: MldPacket<B>,
);
}
Expand description
An implementation of an IPv6 device.
Required Associated Types§
Sourcetype LinkLayerAddr: AsRef<[u8]>
type LinkLayerAddr: AsRef<[u8]>
A link-layer address.
Required Methods§
Sourcefn get_link_layer_addr_bytes(
&mut self,
device_id: &Self::DeviceId,
) -> Option<Self::LinkLayerAddr>
fn get_link_layer_addr_bytes( &mut self, device_id: &Self::DeviceId, ) -> Option<Self::LinkLayerAddr>
Gets the device’s link-layer address bytes, if the device supports link-layer addressing.
Sourcefn set_discovered_retrans_timer(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
retrans_timer: NonZeroDuration,
)
fn set_discovered_retrans_timer( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, retrans_timer: NonZeroDuration, )
Sets the discovered retransmit timer for the device.
Sourcefn handle_received_dad_neighbor_solicitation(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
addr: UnicastAddr<Ipv6Addr>,
nonce: Option<NdpNonce<&[u8]>>,
) -> IpAddressState
fn handle_received_dad_neighbor_solicitation( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, addr: UnicastAddr<Ipv6Addr>, nonce: Option<NdpNonce<&[u8]>>, ) -> IpAddressState
Handles a received neighbor solicitation that has been determined to be
due to a node performing duplicate address detection for addr
. Removes
addr
from device_id
if it is determined addr
is a duplicate
tentative address.
Returns the assignment state of addr
on the interface, if there was
one before any action was taken.
Sourcefn handle_received_neighbor_advertisement(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
addr: UnicastAddr<Ipv6Addr>,
) -> IpAddressState
fn handle_received_neighbor_advertisement( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, addr: UnicastAddr<Ipv6Addr>, ) -> IpAddressState
Handles a received neighbor advertisement.
Takes action in response to a received neighbor advertisement for the
specified address. Returns the assignment state of the address on the
given interface, if there was one before any action was taken. That is,
this method returns Some(Tentative {..})
when the address was
tentatively assigned (and now removed), Some(Assigned)
if the address
was assigned (and so not removed), otherwise None
.
Sourcefn set_link_mtu(&mut self, device_id: &Self::DeviceId, mtu: Mtu)
fn set_link_mtu(&mut self, device_id: &Self::DeviceId, mtu: Mtu)
Sets the link MTU for the device.
Sourcefn update_discovered_ipv6_route(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
route: Ipv6DiscoveredRoute,
lifetime: Option<NonZeroNdpLifetime>,
)
fn update_discovered_ipv6_route( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, route: Ipv6DiscoveredRoute, lifetime: Option<NonZeroNdpLifetime>, )
Updates a discovered IPv6 route.
Sourcefn apply_slaac_update(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
prefix: Subnet<Ipv6Addr>,
preferred_lifetime: Option<NonZeroNdpLifetime>,
valid_lifetime: Option<NonZeroNdpLifetime>,
)
fn apply_slaac_update( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, prefix: Subnet<Ipv6Addr>, preferred_lifetime: Option<NonZeroNdpLifetime>, valid_lifetime: Option<NonZeroNdpLifetime>, )
Applies a SLAAC update.
Sourcefn receive_mld_packet<B: SplitByteSlice>(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
src_ip: Ipv6SourceAddr,
dst_ip: SpecifiedAddr<Ipv6Addr>,
packet: MldPacket<B>,
)
fn receive_mld_packet<B: SplitByteSlice>( &mut self, bindings_ctx: &mut BC, device: &Self::DeviceId, src_ip: Ipv6SourceAddr, dst_ip: SpecifiedAddr<Ipv6Addr>, packet: MldPacket<B>, )
Receives an MLD packet for processing.
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.