pub trait SocketOpsFilter<D>where
D: StrongDeviceIdentifier,{
// Required methods
fn on_egress<I, P>(
&self,
packet: &P,
device: &D,
cookie: SocketCookie,
marks: &MarkStorage<Mark>,
) -> SocketEgressFilterResult
where I: FilterIpExt,
P: IpPacket<I> + PartialSerializer;
fn on_ingress(
&self,
ip_version: IpVersion,
packet: FragmentedByteSlice<'_, &[u8]>,
device: &D,
cookie: SocketCookie,
marks: &MarkStorage<Mark>,
) -> SocketIngressFilterResult;
}Expand description
Trait for a socket operations filter.
Required Methods§
Sourcefn on_egress<I, P>(
&self,
packet: &P,
device: &D,
cookie: SocketCookie,
marks: &MarkStorage<Mark>,
) -> SocketEgressFilterResult
fn on_egress<I, P>( &self, packet: &P, device: &D, cookie: SocketCookie, marks: &MarkStorage<Mark>, ) -> SocketEgressFilterResult
Called on every outgoing packet originated from a local socket.
Sourcefn on_ingress(
&self,
ip_version: IpVersion,
packet: FragmentedByteSlice<'_, &[u8]>,
device: &D,
cookie: SocketCookie,
marks: &MarkStorage<Mark>,
) -> SocketIngressFilterResult
fn on_ingress( &self, ip_version: IpVersion, packet: FragmentedByteSlice<'_, &[u8]>, device: &D, cookie: SocketCookie, marks: &MarkStorage<Mark>, ) -> 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.