netstack3_ip

Trait BaseTransportIpContext

Source
pub trait BaseTransportIpContext<I: IpExt, BC>: DeviceIdContext<AnyDevice> {
    type DevicesWithAddrIter<'s>: Iterator<Item = Self::DeviceId>;

    // Required methods
    fn with_devices_with_assigned_addr<O, F: FnOnce(Self::DevicesWithAddrIter<'_>) -> O>(
        &mut self,
        addr: SpecifiedAddr<I::Addr>,
        cb: F,
    ) -> O;
    fn get_default_hop_limits(
        &mut self,
        device: Option<&Self::DeviceId>,
    ) -> HopLimits;
    fn get_original_destination(
        &mut self,
        tuple: &Tuple<I>,
    ) -> Option<(I::Addr, u16)>;
}
Expand description

The base execution context provided by the IP layer to transport layer protocols.

Required Associated Types§

Required Methods§

Source

fn with_devices_with_assigned_addr<O, F: FnOnce(Self::DevicesWithAddrIter<'_>) -> O>( &mut self, addr: SpecifiedAddr<I::Addr>, cb: F, ) -> O

Is this one of our local addresses, and is it in the assigned state?

Calls cb with an iterator over all the local interfaces for which addr is an associated address, and, for IPv6, for which it is in the “assigned” state.

Source

fn get_default_hop_limits( &mut self, device: Option<&Self::DeviceId>, ) -> HopLimits

Get default hop limits.

If device is not None and exists, its hop limits will be returned. Otherwise the system defaults are returned.

Source

fn get_original_destination( &mut self, tuple: &Tuple<I>, ) -> Option<(I::Addr, u16)>

Gets the original destination for the tracked connection indexed by tuple, which includes the source and destination addresses and transport-layer ports as well as the transport protocol number.

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.

Implementations on Foreign Types§

Source§

impl<I: IpExt, C, P: DeviceIdContext<AnyDevice>> BaseTransportIpContext<I, C> for UninstantiableWrapper<P>

Source§

type DevicesWithAddrIter<'s> = UninstantiableWrapper<Empty<<P as DeviceIdContext<AnyDevice>>::DeviceId>>

Source§

fn with_devices_with_assigned_addr<O, F: FnOnce(Self::DevicesWithAddrIter<'_>) -> O>( &mut self, _addr: SpecifiedAddr<I::Addr>, _cb: F, ) -> O

Source§

fn get_default_hop_limits( &mut self, _device: Option<&Self::DeviceId>, ) -> HopLimits

Source§

fn get_original_destination( &mut self, _tuple: &Tuple<I>, ) -> Option<(I::Addr, u16)>

Implementors§

Source§

impl<I: IpLayerIpExt, BC: FilterBindingsContext, CC: IpDeviceContext<I> + IpSocketHandler<I, BC> + IpStateContext<I> + FilterIpContext<I, BC> + UseTransportIpContextBlanket> BaseTransportIpContext<I, BC> for CC

Source§

type DevicesWithAddrIter<'s> = AssignedAddressDeviceIterator<<CC as IpDeviceContext<I>>::DeviceAndAddressStatusIter<'s>, I, <CC as DeviceIdContext<AnyDevice>>::DeviceId>