netstack3_ip

Trait IpSasHandler

Source
pub trait IpSasHandler<I: IpDeviceIpExt, BT>: IpDeviceAddressIdContext<I> {
    // Required method
    fn get_local_addr_id_for_remote(
        &mut self,
        device_id: &Self::DeviceId,
        remote: Option<SpecifiedAddr<I::Addr>>,
    ) -> Option<Self::AddressId>;

    // Provided method
    fn get_local_addr_for_remote(
        &mut self,
        device_id: &Self::DeviceId,
        remote: Option<SpecifiedAddr<I::Addr>>,
    ) -> Option<IpDeviceAddr<I::Addr>> { ... }
}
Expand description

A handler for Source Address Selection.

This trait helps implement source address selection for a variety of traits, like [crate::IpDeviceStateContext].

A blanket implementation on IPv4 and IPv6 is provided for all types implementing IpDeviceStateContext.

Required Methods§

Source

fn get_local_addr_id_for_remote( &mut self, device_id: &Self::DeviceId, remote: Option<SpecifiedAddr<I::Addr>>, ) -> Option<Self::AddressId>

Returns a strongly-held reference to the best local address on device_id for communicating with remote.

Provided Methods§

Source

fn get_local_addr_for_remote( &mut self, device_id: &Self::DeviceId, remote: Option<SpecifiedAddr<I::Addr>>, ) -> Option<IpDeviceAddr<I::Addr>>

Returns the best local address on device_id for communicating with remote.

Implementors§