Trait netstack3_ip::IpDeviceStateContext

source ·
pub trait IpDeviceStateContext<I: IpLayerIpExt>: DeviceIdContext<AnyDevice> {
    // Required methods
    fn with_next_packet_id<O, F: FnOnce(&I::PacketIdState) -> O>(
        &self,
        cb: F,
    ) -> O;
    fn get_local_addr_for_remote(
        &mut self,
        device_id: &Self::DeviceId,
        remote: Option<SpecifiedAddr<I::Addr>>,
    ) -> Option<IpDeviceAddr<I::Addr>>;
    fn get_hop_limit(&mut self, device_id: &Self::DeviceId) -> NonZeroU8;
    fn address_status_for_device(
        &mut self,
        addr: SpecifiedAddr<I::Addr>,
        device_id: &Self::DeviceId,
    ) -> AddressStatus<I::AddressStatus>;
}
Expand description

Provides access to an IP device’s state for the IP layer.

Required Methods§

source

fn with_next_packet_id<O, F: FnOnce(&I::PacketIdState) -> O>(&self, cb: F) -> O

Calls the callback with the next packet ID.

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 for communicating with the remote.

source

fn get_hop_limit(&mut self, device_id: &Self::DeviceId) -> NonZeroU8

Returns the hop limit.

source

fn address_status_for_device( &mut self, addr: SpecifiedAddr<I::Addr>, device_id: &Self::DeviceId, ) -> AddressStatus<I::AddressStatus>

Gets the status of an address.

Only the specified device will be checked for the address. Returns AddressStatus::Unassigned if the address is not assigned to the device.

Object Safety§

This trait is not object safe.

Implementors§