pub trait IpLayerHandler<I: IpExt + FragmentationIpExt, BC>: DeviceIdContext<AnyDevice> {
// Required methods
fn send_ip_packet_from_device<S>(
&mut self,
bindings_ctx: &mut BC,
meta: SendIpPacketMeta<I, &Self::DeviceId, Option<SpecifiedAddr<I::Addr>>>,
body: S,
) -> Result<(), IpSendFrameError<S>>
where S: TransportPacketSerializer<I>,
S::Buffer: BufferMut;
fn send_ip_frame<S>(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
destination: IpPacketDestination<I, &Self::DeviceId>,
body: S,
) -> Result<(), IpSendFrameError<S>>
where S: FragmentableIpSerializer<I, Buffer: BufferMut> + IpPacket<I>;
}
Expand description
Trait for abstracting the IP layer for locally-generated traffic. That is, traffic generated by the netstack itself (e.g. ICMP, IGMP, or MLD).
NOTE: Due to filtering rules, it is possible that the device provided in
meta
will not be the device that final IP packet is actually sent from.
Required Methods§
Sourcefn send_ip_packet_from_device<S>(
&mut self,
bindings_ctx: &mut BC,
meta: SendIpPacketMeta<I, &Self::DeviceId, Option<SpecifiedAddr<I::Addr>>>,
body: S,
) -> Result<(), IpSendFrameError<S>>where
S: TransportPacketSerializer<I>,
S::Buffer: BufferMut,
fn send_ip_packet_from_device<S>(
&mut self,
bindings_ctx: &mut BC,
meta: SendIpPacketMeta<I, &Self::DeviceId, Option<SpecifiedAddr<I::Addr>>>,
body: S,
) -> Result<(), IpSendFrameError<S>>where
S: TransportPacketSerializer<I>,
S::Buffer: BufferMut,
Encapsulate and send the provided transport packet and from the device
provided in meta
.
Sourcefn send_ip_frame<S>(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
destination: IpPacketDestination<I, &Self::DeviceId>,
body: S,
) -> Result<(), IpSendFrameError<S>>where
S: FragmentableIpSerializer<I, Buffer: BufferMut> + IpPacket<I>,
fn send_ip_frame<S>(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
destination: IpPacketDestination<I, &Self::DeviceId>,
body: S,
) -> Result<(), IpSendFrameError<S>>where
S: FragmentableIpSerializer<I, Buffer: BufferMut> + IpPacket<I>,
Send an IP packet that doesn’t require the encapsulation and other
processing of [send_ip_packet_from_device
] from the device specified
in meta
.
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.