Trait netstack3_ip::IpLayerHandler
source · pub trait IpLayerHandler<I: IpExt, 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: Serializer + IpPacket<I>,
S::Buffer: BufferMut;
}
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: Serializer + IpPacket<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: Serializer + IpPacket<I>,
S::Buffer: BufferMut,
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
.
Object Safety§
This trait is not object safe.