Loading...
Searching...
No Matches
MIB2 statistics
APIs » "raw" APIs » Network interface (NETIF)

## Data Structures

struct | stats_mib2_netif_ctrs

## Macros

#define | MIB2_STATS_NETIF_INC(n, x)
#define | MIB2_STATS_NETIF_ADD(n, x, val)
#define | MIB2_INIT_NETIF(netif, type, speed)

## Enumerations

enum | snmp_ifType

## Detailed Description

## Macro Definition Documentation

## MIB2_INIT_NETIF

#define MIB2_INIT_NETIF | ( |  | netif,
|  |  | type,
|  |  | speed )

Value:
do { \
(netif)->link_type = (type); \
(netif)->link_speed = (speed);\
(netif)->ts = 0; \
(netif)->mib2_counters.ifinoctets = 0; \
(netif)->mib2_counters.ifinucastpkts = 0; \
(netif)->mib2_counters.ifinnucastpkts = 0; \
(netif)->mib2_counters.ifindiscards = 0; \
(netif)->mib2_counters.ifinerrors = 0; \
(netif)->mib2_counters.ifinunknownprotos = 0; \
(netif)->mib2_counters.ifoutoctets = 0; \
(netif)->mib2_counters.ifoutucastpkts = 0; \
(netif)->mib2_counters.ifoutnucastpkts = 0; \
(netif)->mib2_counters.ifoutdiscards = 0; \
(netif)->mib2_counters.ifouterrors = 0; } while(0)
netif
Definition netif.h:269

Init MIB2 statistic counters in netif

Parameters

  netif | Netif to init
  type | one of enum snmp_ifType
  speed | your link speed here (units: bits per second)

## MIB2_STATS_NETIF_ADD

#define MIB2_STATS_NETIF_ADD | ( |  | n,
|  |  | x,
|  |  | val )

Value:
do { (n)->mib2_counters.x += (val); } while(0)

Add value to stats member for SNMP MIB2 stats (struct stats_mib2_netif_ctrs)

## MIB2_STATS_NETIF_INC

#define MIB2_STATS_NETIF_INC | ( |  | n,
|  |  | x )

Value:
do { ++(n)->mib2_counters.x; } while(0)

Increment stats member for SNMP MIB2 stats (struct stats_mib2_netif_ctrs)

## Enumeration Type Documentation

## snmp_ifType

enum snmp_ifType

See also
  RFC1213, "MIB-II, 6. Definitions"