Enum etherparse::icmpv4::DestUnreachableHeader
source · 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
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§
source§impl DestUnreachableHeader
impl DestUnreachableHeader
sourcepub fn from_values(
code_u8: u8,
next_hop_mtu: u16
) -> Option<DestUnreachableHeader>
pub fn from_values(
code_u8: u8,
next_hop_mtu: u16
) -> Option<DestUnreachableHeader>
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.
Trait Implementations§
source§impl Clone for DestUnreachableHeader
impl Clone for DestUnreachableHeader
source§fn clone(&self) -> DestUnreachableHeader
fn clone(&self) -> DestUnreachableHeader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more