pub enum DestUnreachableHeader {
Show 16 variants Network, Host, Protocol, Port, FragmentationNeeded { next_hop_mtu: u16, }, SourceRouteFailed, NetworkUnknown, HostUnknown, Isolated, NetworkProhibited, HostProhibited, TosNetwork, TosHost, FilterProhibited, HostPrecedenceViolation, PrecedenceCutoff,
}
Expand description

“Destination Unreachable” ICMP header for IPv4 (without the invoking packet).

Description in RFC 792:

If, according to the information in the gateway’s routing tables, the network specified in the internet destination field of a datagram is unreachable, e.g., the distance to the network is infinity, the gateway may send a destination unreachable message to the internet source host of the datagram. In addition, in some networks, the gateway may be able to determine if the internet destination host is unreachable. Gateways in these networks may send destination unreachable messages to the source host when the destination host is unreachable.

If, in the destination host, the IP module cannot deliver the datagram because the indicated protocol module or process port is not active, the destination host may send a destination unreachable message to the source host.

Another case is when a datagram must be fragmented to be forwarded by a gateway yet the Don’t Fragment flag is on. In this case the gateway must discard the datagram and may return a destination unreachable message.

Codes 0, 1, 4, and 5 may be received from a gateway. Codes 2 and 3 may be received from a host.

Variants§

§

Network

Network unreachable error.

§

Host

Host unreachable error.

§

Protocol

Transport protocol not supported error.

§

Port

Port unreachable error.

§

FragmentationNeeded

Fields

§next_hop_mtu: u16

Fragmentation would be needed but the don’t fragment bit is set.

§

SourceRouteFailed

Source Route Failed

§

NetworkUnknown

Destination Network Unknown (from RFC 1122)

§

HostUnknown

Destination Host Unknown (no route to host known) (from RFC 1122)

§

Isolated

Source Host Isolated - obsolete (from RFC 1122)

§

NetworkProhibited

Communication with Destination Network is Administratively Prohibited (from RFC 1122)

§

HostProhibited

Communication with Destination Host is Administratively Prohibited (from RFC 1122)

§

TosNetwork

Destination Network Unreachable for Type of Service (from RFC 1122)

§

TosHost

Destination Host Unreachable for Type of Service (from RFC 1122)

§

FilterProhibited

Cannot forward because packet administratively filtered (from RFC 1812)

§

HostPrecedenceViolation

Required level of precidence not supported (from RFC 1812)

§

PrecedenceCutoff

Packet was below minimum precidence (from RFC 1812)

Implementations§

Tries to convert the code u8 value and next_hop_mtu to a DestUnreachableHeader value.

Returns None in case the code value is not known as a destination unreachable code.

Returns the icmp code value of the destination unreachable 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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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.