pub trait FilterHandler<I: FilterIpExt, BC: FilterBindingsTypes>: IpDeviceAddressIdContext<I, DeviceId: InterfaceProperties<BC::DeviceClass>> {
// Required methods
fn ingress_hook<P, M>(
&mut self,
bindings_ctx: &mut BC,
packet: &mut P,
interface: &Self::DeviceId,
metadata: &mut M,
) -> IngressVerdict<I>
where P: FilterIpPacket<I>,
M: FilterIpMetadata<I, Self::WeakAddressId, BC>;
fn local_ingress_hook<P, M>(
&mut self,
bindings_ctx: &mut BC,
packet: &mut P,
interface: &Self::DeviceId,
metadata: &mut M,
) -> Verdict<DropOrReject>
where P: FilterIpPacket<I>,
M: FilterIpMetadata<I, Self::WeakAddressId, BC>;
fn forwarding_hook<P, M>(
&mut self,
packet: &mut P,
in_interface: &Self::DeviceId,
out_interface: &Self::DeviceId,
metadata: &mut M,
) -> Verdict<DropOrReject>
where P: FilterIpPacket<I>,
M: FilterIpMetadata<I, Self::WeakAddressId, BC>;
fn local_egress_hook<P, M>(
&mut self,
bindings_ctx: &mut BC,
packet: &mut P,
interface: &Self::DeviceId,
metadata: &mut M,
) -> Verdict<DropOrReject>
where P: FilterIpPacket<I>,
M: FilterIpMetadata<I, Self::WeakAddressId, BC>;
fn egress_hook<P, M>(
&mut self,
bindings_ctx: &mut BC,
packet: &mut P,
interface: &Self::DeviceId,
metadata: &mut M,
) -> (Verdict<DropPacket>, ProofOfEgressCheck)
where P: FilterIpPacket<I>,
M: FilterIpMetadata<I, Self::WeakAddressId, BC>;
}Expand description
An implementation of packet filtering logic, providing entry points at various stages of packet processing.
Required Methods§
Sourcefn ingress_hook<P, M>(
&mut self,
bindings_ctx: &mut BC,
packet: &mut P,
interface: &Self::DeviceId,
metadata: &mut M,
) -> IngressVerdict<I>
fn ingress_hook<P, M>( &mut self, bindings_ctx: &mut BC, packet: &mut P, interface: &Self::DeviceId, metadata: &mut M, ) -> IngressVerdict<I>
The ingress hook intercepts incoming traffic before a routing decision has been made.
Sourcefn local_ingress_hook<P, M>(
&mut self,
bindings_ctx: &mut BC,
packet: &mut P,
interface: &Self::DeviceId,
metadata: &mut M,
) -> Verdict<DropOrReject>
fn local_ingress_hook<P, M>( &mut self, bindings_ctx: &mut BC, packet: &mut P, interface: &Self::DeviceId, metadata: &mut M, ) -> Verdict<DropOrReject>
The local ingress hook intercepts incoming traffic that is destined for the local host.
Sourcefn forwarding_hook<P, M>(
&mut self,
packet: &mut P,
in_interface: &Self::DeviceId,
out_interface: &Self::DeviceId,
metadata: &mut M,
) -> Verdict<DropOrReject>
fn forwarding_hook<P, M>( &mut self, packet: &mut P, in_interface: &Self::DeviceId, out_interface: &Self::DeviceId, metadata: &mut M, ) -> Verdict<DropOrReject>
The forwarding hook intercepts incoming traffic that is destined for another host.
Sourcefn local_egress_hook<P, M>(
&mut self,
bindings_ctx: &mut BC,
packet: &mut P,
interface: &Self::DeviceId,
metadata: &mut M,
) -> Verdict<DropOrReject>
fn local_egress_hook<P, M>( &mut self, bindings_ctx: &mut BC, packet: &mut P, interface: &Self::DeviceId, metadata: &mut M, ) -> Verdict<DropOrReject>
The local egress hook intercepts locally-generated traffic before a routing decision has been made.
Sourcefn egress_hook<P, M>(
&mut self,
bindings_ctx: &mut BC,
packet: &mut P,
interface: &Self::DeviceId,
metadata: &mut M,
) -> (Verdict<DropPacket>, ProofOfEgressCheck)
fn egress_hook<P, M>( &mut self, bindings_ctx: &mut BC, packet: &mut P, interface: &Self::DeviceId, metadata: &mut M, ) -> (Verdict<DropPacket>, ProofOfEgressCheck)
The egress hook intercepts all outgoing traffic after a routing decision has been made.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".