Trait SocketOpsFilter

Source
pub trait SocketOpsFilter<D: StrongDeviceIdentifier, T> {
    // Required methods
    fn on_egress<I: FilterIpExt, P: IpPacket<I> + PartialSerializer>(
        &self,
        packet: &P,
        device: &D,
        tx_metadata: &T,
        marks: &Marks,
    ) -> SocketEgressFilterResult;
    fn on_ingress(
        &self,
        packet: &FragmentedByteSlice<'_, &[u8]>,
        device: &D,
        cookie: SocketCookie,
        marks: &Marks,
    ) -> SocketIngressFilterResult;
}
Expand description

Trait for a socket operations filter.

Required Methods§

Source

fn on_egress<I: FilterIpExt, P: IpPacket<I> + PartialSerializer>( &self, packet: &P, device: &D, tx_metadata: &T, marks: &Marks, ) -> SocketEgressFilterResult

Called on every outgoing packet originated from a local socket.

Source

fn on_ingress( &self, packet: &FragmentedByteSlice<'_, &[u8]>, device: &D, cookie: SocketCookie, marks: &Marks, ) -> SocketIngressFilterResult

Called on every incoming packet handled by a local socket.

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§