DropReason

Enum DropReason 

Source
#[repr(u32)]
pub enum DropReason {
Show 64 variants NetUnreachable = 0, HostUnreachable = 1, ProtocolUnreachable = 2, PortUnreachable = 3, FragNeeded = 4, SrcRouteFailed = 5, DstNetUnknown = 6, DstHostUnknown = 7, SrcHostIsolated = 8, DstNetProhibited = 9, DstHostProhibited = 10, DstNetTosUnreachable = 11, DstHostTosUnreachable = 12, CommAdminProhibited = 13, HostPrecedenceViolation = 14, PrecedenceCutoff = 15, Unknown = 256, TtlExceeded = 257, Acl = 258, NoBufferSpace = 259, Red = 260, TrafficShaping = 261, PktTooBig = 262, SrcMacIsMulticast = 263, VlanTagMismatch = 264, IngressVlanFilter = 265, IngressSpanningTreeFilter = 266, PortListIsEmpty = 267, PortLoopbackFilter = 268, BlackholeRoute = 269, NonIp = 270, UcDipOverMcDmac = 271, DipIsLoopbackAddress = 272, SipIsMc = 273, SipIsLoopbackAddress = 274, IpHeaderCorrupted = 275, Ipv4SipIsLimitedBc = 276, Ipv6McDipReservedScope = 277, Ipv6McDipInterfaceLocalScope = 278, UnresolvedNeigh = 279, McReversePathForwarding = 280, NonRoutablePacket = 281, DecapError = 282, OverlaySmacIsMc = 283, UnknownL2 = 284, UnknownL3 = 285, UnknownL3Exception = 286, UnknownBuffer = 287, UnknownTunnel = 288, UnknownL4 = 289, SipIsUnspecified = 290, MlagPortIsolation = 291, BlackholeArpNeigh = 292, SrcMacIsDmac = 293, DmacIsReserved = 294, SipIsClassE = 295, McDmacMismatch = 296, SipIsDip = 297, DipIsLocalNetwork = 298, DipIsLinkLocal = 299, OverlaySmacIsDmac = 300, EgressVlanFilter = 301, UcReversePathForwarding = 302, SplitHorizon = 303,
}
Expand description

Drop reason codes for discarded packets

§XDR Definition (sFlow Drops)

/* The drop_reason enumeration may be expanded over time.
   sFlow collectors must be prepared to receive discard_packet
   structures with unrecognized drop_reason values.

   This document expands on the discard reason codes 0-262 defined
   in the sFlow Version 5 [1] interface typedef and this expanded list
   should be regarded as an expansion of the reason codes in the
   interface typdef and are valid anywhere the typedef is referenced.

   Codes 263-288 are defined in Devlink Trap [2]. Drop reason / group
   names from the Devlink Trap document are preserved where they define
   new reason codes, or referenced as comments where they map to existing
   codes.

   Codes 289-303 are reasons that have yet to be upstreamed to Devlink Trap,
   but the intent is that they will eventually be upstreamed and documented as
   part of the Linux API [2], and so they have been reserved.

   The authoritative list of drop reasons will be maintained
   at sflow.org */

enum drop_reason {
   net_unreachable      = 0,
   host_unreachable     = 1,
   protocol_unreachable = 2,
   port_unreachable     = 3,
   frag_needed          = 4,
   src_route_failed     = 5,
   dst_net_unknown      = 6, /* ipv4_lpm_miss, ipv6_lpm_miss */
   dst_host_unknown     = 7,
   src_host_isolated    = 8,
   dst_net_prohibited   = 9, /* reject_route */
   dst_host_prohibited  = 10,
   dst_net_tos_unreachable  = 11,
   dst_host_tos_unreacheable = 12,
   comm_admin_prohibited = 13,
   host_precedence_violation = 14,
   precedence_cutoff    = 15,
   unknown              = 256,
   ttl_exceeded         = 257, /* ttl_value_is_too_small */
   acl                  = 258, /* ingress_flow_action_drop,
                                  egress_flow_action_drop
                                  group acl_drops */
   no_buffer_space      = 259, /* tail_drop */
   red                  = 260, /* early_drop */
   traffic_shaping      = 261,
   pkt_too_big          = 262, /* mtu_value_is_too_small */
   src_mac_is_multicast = 263,
   vlan_tag_mismatch    = 264,
   ingress_vlan_filter  = 265,
   ingress_spanning_tree_filter = 266,
   port_list_is_empty   = 267,
   port_loopback_filter = 268,
   blackhole_route      = 269,
   non_ip               = 270,
   uc_dip_over_mc_dmac  = 271,
   dip_is_loopback_address = 272,
   sip_is_mc            = 273,
   sip_is_loopback_address = 274,
   ip_header_corrupted  = 275,
   ipv4_sip_is_limited_bc = 276,
   ipv6_mc_dip_reserved_scope = 277,
   ipv6_mc_dip_interface_local_scope = 278,
   unresolved_neigh     = 279,
   mc_reverse_path_forwarding = 280,
   non_routable_packet  = 281,
   decap_error          = 282,
   overlay_smac_is_mc   = 283,
   unknown_l2           = 284, /* group l2_drops */
   unknown_l3           = 285, /* group l3_drops */
   unknown_l3_exception = 286, /* group l3_exceptions */
   unknown_buffer       = 287, /* group buffer_drops */
   unknown_tunnel       = 288, /* group tunnel_drops */
   unknown_l4           = 289,
   sip_is_unspecified   = 290,
   mlag_port_isolation  = 291,
   blackhole_arp_neigh  = 292,
   src_mac_is_dmac      = 293,
   dmac_is_reserved     = 294,
   sip_is_class_e       = 295,
   mc_dmac_mismatch     = 296,
   sip_is_dip           = 297,
   dip_is_local_network = 298,
   dip_is_link_local    = 299,
   overlay_smac_is_dmac = 300,
   egress_vlan_filter   = 301,
   uc_reverse_path_forwarding = 302,
   split_horizon        = 303
}

Variants§

§

NetUnreachable = 0

§

HostUnreachable = 1

§

ProtocolUnreachable = 2

§

PortUnreachable = 3

§

FragNeeded = 4

§

SrcRouteFailed = 5

§

DstNetUnknown = 6

§

DstHostUnknown = 7

§

SrcHostIsolated = 8

§

DstNetProhibited = 9

§

DstHostProhibited = 10

§

DstNetTosUnreachable = 11

§

DstHostTosUnreachable = 12

§

CommAdminProhibited = 13

§

HostPrecedenceViolation = 14

§

PrecedenceCutoff = 15

§

Unknown = 256

§

TtlExceeded = 257

§

Acl = 258

§

NoBufferSpace = 259

§

Red = 260

§

TrafficShaping = 261

§

PktTooBig = 262

§

SrcMacIsMulticast = 263

§

VlanTagMismatch = 264

§

IngressVlanFilter = 265

§

IngressSpanningTreeFilter = 266

§

PortListIsEmpty = 267

§

PortLoopbackFilter = 268

§

BlackholeRoute = 269

§

NonIp = 270

§

UcDipOverMcDmac = 271

§

DipIsLoopbackAddress = 272

§

SipIsMc = 273

§

SipIsLoopbackAddress = 274

§

IpHeaderCorrupted = 275

§

Ipv4SipIsLimitedBc = 276

§

Ipv6McDipReservedScope = 277

§

Ipv6McDipInterfaceLocalScope = 278

§

UnresolvedNeigh = 279

§

McReversePathForwarding = 280

§

NonRoutablePacket = 281

§

DecapError = 282

§

OverlaySmacIsMc = 283

§

UnknownL2 = 284

§

UnknownL3 = 285

§

UnknownL3Exception = 286

§

UnknownBuffer = 287

§

UnknownTunnel = 288

§

UnknownL4 = 289

§

SipIsUnspecified = 290

§

MlagPortIsolation = 291

§

BlackholeArpNeigh = 292

§

SrcMacIsDmac = 293

§

DmacIsReserved = 294

§

SipIsClassE = 295

§

McDmacMismatch = 296

§

SipIsDip = 297

§

DipIsLocalNetwork = 298

§

DipIsLinkLocal = 299

§

OverlaySmacIsDmac = 300

§

EgressVlanFilter = 301

§

UcReversePathForwarding = 302

§

SplitHorizon = 303

Implementations§

Source§

impl DropReason

Source

pub fn from_u32(value: u32) -> Option<Self>

Convert from u32 value to DropReason enum

This is a mechanical mapping of u32 values to enum variants defined in the sFlow specification. The function is tested with representative samples rather than exhaustively.

Trait Implementations§

Source§

impl Clone for DropReason

Source§

fn clone(&self) -> DropReason

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DropReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DropReason

Source§

fn eq(&self, other: &DropReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for DropReason

Source§

impl Eq for DropReason

Source§

impl StructuralPartialEq for DropReason

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.