IpTransportDispatchContext

Trait IpTransportDispatchContext 

Source
pub trait IpTransportDispatchContext<I: IpLayerIpExt, BC>: DeviceIdContext<AnyDevice> {
    type EarlyDemuxSocket: SocketMetadata<Self>;

    // Required methods
    fn early_demux<B: ParseBuffer>(
        &mut self,
        device: &Self::DeviceId,
        frame_dst: Option<FrameDestination>,
        src_ip: I::Addr,
        dst_ip: I::Addr,
        proto: I::Proto,
        body: B,
    ) -> Option<Self::EarlyDemuxSocket>;
    fn dispatch_receive_ip_packet<B: BufferMut, H: IpHeaderInfo<I>>(
        &mut self,
        bindings_ctx: &mut BC,
        device: &Self::DeviceId,
        src_ip: I::RecvSrcAddr,
        dst_ip: SpecifiedAddr<I::Addr>,
        proto: I::Proto,
        body: B,
        info: &LocalDeliveryPacketInfo<I, H>,
        early_demux_socket: Option<Self::EarlyDemuxSocket>,
    ) -> Result<(), TransportReceiveError>;
}
Expand description

The IP context providing dispatch to the available transport protocols.

This trait acts like a demux on the transport protocol for ingress IP packets.

Required Associated Types§

Source

type EarlyDemuxSocket: SocketMetadata<Self>

Early Demux result.

Required Methods§

Source

fn early_demux<B: ParseBuffer>( &mut self, device: &Self::DeviceId, frame_dst: Option<FrameDestination>, src_ip: I::Addr, dst_ip: I::Addr, proto: I::Proto, body: B, ) -> Option<Self::EarlyDemuxSocket>

Performs early demux result.

Source

fn dispatch_receive_ip_packet<B: BufferMut, H: IpHeaderInfo<I>>( &mut self, bindings_ctx: &mut BC, device: &Self::DeviceId, src_ip: I::RecvSrcAddr, dst_ip: SpecifiedAddr<I::Addr>, proto: I::Proto, body: B, info: &LocalDeliveryPacketInfo<I, H>, early_demux_socket: Option<Self::EarlyDemuxSocket>, ) -> Result<(), TransportReceiveError>

Dispatches a received incoming IP packet to the appropriate protocol.

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.

Implementors§