pub trait IcmpIpExt: IpProtoExt {
type IcmpPacketTypeRaw<B: SplitByteSliceMut>: IcmpPacketTypeRaw<B, Self> + GenericOverIp<Self, Type = Self::IcmpPacketTypeRaw<B>> + GenericOverIp<Ipv4, Type = Icmpv4PacketRaw<B>> + GenericOverIp<Ipv6, Type = Icmpv6PacketRaw<B>>;
type IcmpMessageType: IcmpMessageType + GenericOverIp<Self, Type = Self::IcmpMessageType> + GenericOverIp<Ipv4, Type = Icmpv4MessageType> + GenericOverIp<Ipv6, Type = Icmpv6MessageType>;
type ParameterProblemCode: PartialEq + Send + Sync + Debug;
type ParameterProblemPointer: PartialEq + Send + Sync + Debug;
type HeaderLen: PartialEq + Send + Sync + Debug;
const ICMP_IP_PROTO: <Self as IpProtoExt>::Proto;
const ECHO_REPLY: Self::IcmpMessageType;
const ECHO_REQUEST: Self::IcmpMessageType;
// Required method
fn header_len(bytes: &[u8]) -> usize;
}
Expand description
An extension trait adding ICMP-related functionality to Ipv4
and Ipv6
.
Required Associated Constants§
Sourceconst ICMP_IP_PROTO: <Self as IpProtoExt>::Proto
const ICMP_IP_PROTO: <Self as IpProtoExt>::Proto
The identifier for this ICMP version.
This value will be found in an IPv4 packet’s Protocol field (for ICMPv4 packets) or an IPv6 fixed header’s or last extension header’s Next Heeader field (for ICMPv6 packets).
Sourceconst ECHO_REPLY: Self::IcmpMessageType
const ECHO_REPLY: Self::IcmpMessageType
Icmp{v4,v6}MessageType::EchoReply.
Sourceconst ECHO_REQUEST: Self::IcmpMessageType
const ECHO_REQUEST: Self::IcmpMessageType
Icmp{v4,v6}MessageType::EchoRequest.
Required Associated Types§
Sourcetype IcmpPacketTypeRaw<B: SplitByteSliceMut>: IcmpPacketTypeRaw<B, Self> + GenericOverIp<Self, Type = Self::IcmpPacketTypeRaw<B>> + GenericOverIp<Ipv4, Type = Icmpv4PacketRaw<B>> + GenericOverIp<Ipv6, Type = Icmpv6PacketRaw<B>>
type IcmpPacketTypeRaw<B: SplitByteSliceMut>: IcmpPacketTypeRaw<B, Self> + GenericOverIp<Self, Type = Self::IcmpPacketTypeRaw<B>> + GenericOverIp<Ipv4, Type = Icmpv4PacketRaw<B>> + GenericOverIp<Ipv6, Type = Icmpv6PacketRaw<B>>
The ICMP packet type for this IP version.
Sourcetype IcmpMessageType: IcmpMessageType + GenericOverIp<Self, Type = Self::IcmpMessageType> + GenericOverIp<Ipv4, Type = Icmpv4MessageType> + GenericOverIp<Ipv6, Type = Icmpv6MessageType>
type IcmpMessageType: IcmpMessageType + GenericOverIp<Self, Type = Self::IcmpMessageType> + GenericOverIp<Ipv4, Type = Icmpv4MessageType> + GenericOverIp<Ipv6, Type = Icmpv6MessageType>
The type of ICMP messages.
For Ipv4
, this is Icmpv4MessageType
, and for Ipv6
, this is
Icmpv6MessageType
.
Sourcetype ParameterProblemCode: PartialEq + Send + Sync + Debug
type ParameterProblemCode: PartialEq + Send + Sync + Debug
The type of an ICMP parameter problem code.
For Ipv4
, this is Icmpv4ParameterProblemCode
, and for Ipv6
this
is Icmpv6ParameterProblemCode
.
Required Methods§
Sourcefn header_len(bytes: &[u8]) -> usize
fn header_len(bytes: &[u8]) -> usize
Computes the length of the header of the packet prefix stored in
bytes
.
Given the prefix of a packet stored in bytes
, compute the length of
the header of that packet, or bytes.len()
if bytes
does not contain
the entire header. If the version is IPv6, the returned length should
include all extension headers.
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.