Skip to main content

GenericInterfaceCounters

Struct GenericInterfaceCounters 

Source
pub struct GenericInterfaceCounters {
Show 19 fields pub if_index: u32, pub if_type: u32, pub if_speed: u64, pub if_direction: u32, pub if_status: u32, pub if_in_octets: u64, pub if_in_ucast_pkts: u32, pub if_in_multicast_pkts: u32, pub if_in_broadcast_pkts: u32, pub if_in_discards: u32, pub if_in_errors: u32, pub if_in_unknown_protos: u32, pub if_out_octets: u64, pub if_out_ucast_pkts: u32, pub if_out_multicast_pkts: u32, pub if_out_broadcast_pkts: u32, pub if_out_discards: u32, pub if_out_errors: u32, pub if_promiscuous_mode: u32,
}
Expand description

Generic Interface Counters - Format (0,1)

Standard interface statistics (RFC 2233)

§XDR Definition (sFlow v5)

/* Generic Interface Counters - see RFC 2233 */
/* opaque = counter_data; enterprise = 0; format = 1 */

struct if_counters {
    unsigned int ifIndex;
    unsigned int ifType;
    unsigned hyper ifSpeed;
    unsigned int ifDirection;
    unsigned int ifStatus;
    unsigned hyper ifInOctets;
    unsigned int ifInUcastPkts;
    unsigned int ifInMulticastPkts;
    unsigned int ifInBroadcastPkts;
    unsigned int ifInDiscards;
    unsigned int ifInErrors;
    unsigned int ifInUnknownProtos;
    unsigned hyper ifOutOctets;
    unsigned int ifOutUcastPkts;
    unsigned int ifOutMulticastPkts;
    unsigned int ifOutBroadcastPkts;
    unsigned int ifOutDiscards;
    unsigned int ifOutErrors;
    unsigned int ifPromiscuousMode;
}

Fields§

§if_index: u32

Interface index

§if_type: u32

Interface type (from IANAifType)

§if_speed: u64

Interface speed in bits per second

§if_direction: u32

Interface direction (1=full-duplex, 2=half-duplex, 3=in, 4=out)

§if_status: u32

Interface status (bit 0=admin, bit 1=oper)

§if_in_octets: u64

Total octets received

§if_in_ucast_pkts: u32

Total unicast packets received

§if_in_multicast_pkts: u32

Total multicast packets received

§if_in_broadcast_pkts: u32

Total broadcast packets received

§if_in_discards: u32

Total discarded inbound packets

§if_in_errors: u32

Total inbound errors

§if_in_unknown_protos: u32

Total inbound packets with unknown protocol

§if_out_octets: u64

Total octets transmitted

§if_out_ucast_pkts: u32

Total unicast packets transmitted

§if_out_multicast_pkts: u32

Total multicast packets transmitted

§if_out_broadcast_pkts: u32

Total broadcast packets transmitted

§if_out_discards: u32

Total discarded outbound packets

§if_out_errors: u32

Total outbound errors

§if_promiscuous_mode: u32

Promiscuous mode (1=true, 2=false)

Trait Implementations§

Source§

impl Clone for GenericInterfaceCounters

Source§

fn clone(&self) -> GenericInterfaceCounters

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for GenericInterfaceCounters

Source§

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

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

impl Eq for GenericInterfaceCounters

Source§

impl PartialEq for GenericInterfaceCounters

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for GenericInterfaceCounters

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.