Trait netstack3_ip::device::Ipv6DeviceHandler

source ·
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§

source

type LinkLayerAddr: AsRef<[u8]>

A link-layer address.

Required Methods§

Gets the device’s link-layer address bytes, if the device supports link-layer addressing.

source

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.

source

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.

source

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.

Sets the link MTU for the device.

source

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.

source

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.

source

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.

Object Safety§

This trait is not object safe.

Implementors§