pub trait IcmpIpExt: IpProtoExt {
    type IcmpMessageType: IcmpMessageType;
    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 Types§

source

type IcmpMessageType: IcmpMessageType

The type of ICMP messages.

For Ipv4, this is Icmpv4MessageType, and for Ipv6, this is Icmpv6MessageType.

source

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.

source

type ParameterProblemPointer: PartialEq + Send + Sync + Debug

The type of an ICMP parameter problem pointer.

For Ipv4, this is u8, and for Ipv6 this is u32.

source

type HeaderLen: PartialEq + Send + Sync + Debug

The type of an ICMP parameter header length.

For Ipv4, this is usize, and for Ipv6 this is ().

Required Associated Constants§

source

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).

source

const ECHO_REPLY: Self::IcmpMessageType

Icmp{v4,v6}MessageType::EchoReply.

source

const ECHO_REQUEST: Self::IcmpMessageType

Icmp{v4,v6}MessageType::EchoRequest.

Required Methods§

source

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl IcmpIpExt for Ipv4

source§

impl IcmpIpExt for Ipv6

Implementors§