pub enum DestUnreachableCode {
    NoRoute,
    Prohibited,
    BeyondScope,
    Address,
    Port,
    SourceAddressFailedPolicy,
    RejectRoute,
}
Expand description

“Destination Unreachable” ICMPv6 code containing a reason why a destination could not be reached.

RFC 4443 Description:

A Destination Unreachable message SHOULD be generated by a router, or by the IPv6 layer in the originating node, in response to a packet that cannot be delivered to its destination address for reasons other than congestion. (An ICMPv6 message MUST NOT be generated if a packet is dropped due to congestion.)

Variants

NoRoute

No route to destination

Prohibited

Communication with destination administratively prohibited

BeyondScope

Beyond scope of source address

Address

Address unreachable

Port

Port unreachable

SourceAddressFailedPolicy

Source address failed ingress/egress policy

RejectRoute

Reject route to destination

Implementations

Converts the u8 code value from an ICMPv6 “destination unreachable” packet to an icmpv6::DestUnreachableCode enum.

Example Usage:
use etherparse::{icmpv6, icmpv6::DestUnreachableCode};
let icmp_packet: [u8;8] = [
    icmpv6::TYPE_DST_UNREACH, icmpv6::CODE_DST_UNREACH_PORT, 0, 0,
    0, 0, 0, 0,
];

if icmpv6::TYPE_DST_UNREACH == icmp_packet[0] {
    let dst = icmpv6::DestUnreachableCode::from_u8(
        icmp_packet[1]
    );
    assert_eq!(dst, Some(icmpv6::DestUnreachableCode::Port));
}

Returns the code value of the destination unreachable packet.

This is the second byte of an ICMPv6 packet.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.