Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Enumerations | Functions
Switch Statistics [OPENAPI_STATS]

Enumerations

enum  OPEN_COUNTER_ID_t {
  OPEN_CTR_RESERVED = 0, OPEN_CTR_RX_TOTAL_BYTES = 1, OPEN_CTR_RX_64 = 2, OPEN_CTR_RX_65_127 = 3,
  OPEN_CTR_RX_128_255 = 4, OPEN_CTR_RX_256_511 = 5, OPEN_CTR_RX_512_1023 = 6, OPEN_CTR_RX_1024_1518 = 7,
  OPEN_CTR_RX_1519_1530 = 8, OPEN_CTR_RX_GOOD_OVERSIZE = 9, OPEN_CTR_RX_ERROR_OVERSIZE = 10, OPEN_CTR_RX_GOOD_UNDERSIZE = 11,
  OPEN_CTR_RX_ERROR_UNDERSIZE = 12, OPEN_CTR_RX_UCAST_FRAMES = 13, OPEN_CTR_RX_MCAST_FRAMES = 14, OPEN_CTR_RX_BCAST_FRAMES = 15,
  OPEN_CTR_RX_ALIGN_ERRORS = 16, OPEN_CTR_RX_FCS_ERRORS = 17, OPEN_CTR_RX_OVERRUNS = 18, OPEN_CTR_RX_FRAME_TOO_LONG = 19,
  OPEN_CTR_TX_TOTAL_BYTES = 20, OPEN_CTR_TX_64 = 21, OPEN_CTR_TX_65_127 = 22, OPEN_CTR_TX_128_255 = 23,
  OPEN_CTR_TX_256_511 = 24, OPEN_CTR_TX_512_1023 = 25, OPEN_CTR_TX_1024_1518 = 26, OPEN_CTR_TX_1519_1530 = 27,
  OPEN_CTR_TX_UCAST_FRAMES = 28, OPEN_CTR_TX_MCAST_FRAMES = 29, OPEN_CTR_TX_BCAST_FRAMES = 30, OPEN_CTR_TX_FCS_ERRORS = 31,
  OPEN_CTR_TX_OVERSIZED = 32, OPEN_CTR_TX_UNDERRUN_ERRORS = 33, OPEN_CTR_TX_ONE_COLLISION = 34, OPEN_CTR_TX_MULTIPLE_COLLISION = 35,
  OPEN_CTR_TX_EXCESSIVE_COLLISION = 36, OPEN_CTR_TX_LATE_COLLISION = 37, OPEN_CTR_TX_RX_64 = 38, OPEN_CTR_TX_RX_65_127 = 39,
  OPEN_CTR_TX_RX_128_255 = 40, OPEN_CTR_TX_RX_256_511 = 41, OPEN_CTR_TX_RX_512_1023 = 42, OPEN_CTR_TX_RX_1024_1518 = 43,
  OPEN_CTR_TX_RX_1519_1522 = 44, OPEN_CTR_TX_RX_1523_2047 = 45, OPEN_CTR_TX_RX_2048_4095 = 46, OPEN_CTR_TX_RX_4096_9216 = 47,
  OPEN_CTR_ETHER_STATS_DROP_EVENTS = 48, OPEN_CTR_SNMPIFOUTDISCARD_FRAMES = 49, OPEN_CTR_SNMPIFINDISCARD_FRAMES = 50, OPEN_CTR_RX_TOTAL_FRAMES = 51,
  OPEN_CTR_RX_TOTAL_ERROR_FRAMES = 52, OPEN_CTR_TX_TOTAL_FRAMES = 53, OPEN_CTR_TX_TOTAL_ERROR_FRAMES = 54, OPEN_CTR_TX_TOTAL_COLLISION_FRAMES = 55,
  OPEN_CTR_RX_CRC_ERRORS = 56, OPEN_CTR_RX_TOTAL_MAC_ERROR_FRAMES = 57, OPEN_CTR_RX_RATE_BITS = 58, OPEN_CTR_TX_RATE_BITS = 59,
  OPEN_CTR_RX_RATE_FRAMES = 60, OPEN_CTR_TX_RATE_FRAMES = 61, OPEN_CTR_ETHER_STATS_HOLD = 62, OPEN_CTR_RX_JABBER_FRAMES = 63,
  OPEN_CTR_PORT_LINK_DOWN_COUNTER = 64
}
 Interface Counter IDs. More...
 

Functions

open_error_t openapiInterfaceStatsBufSizeGet (openapiClientHandle_t *client_handle, uint32_t *bufSize)
 Get the size of the interface counter array buffer. More...
 
open_error_t openapiInterfaceStatsGet (openapiClientHandle_t *client_handle, uint32_t ifNum, open_buffdesc *counterArray)
 Gets the entire set of 64-bit counters for an interface. More...
 
open_error_t openapiInterfaceStatsReset (openapiClientHandle_t *client_handle, uint32_t ifNum)
 Resets (sets to 0) all interface counters for the specified interface. More...
 
open_error_t openapiInterfaceStatsResetTimeGet (openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *lastResetSecs)
 Get number of seconds since all interface counters were last reset. More...
 
open_error_t openapiStatGet (openapiClientHandle_t *client_handle, OPEN_COUNTER_ID_t counterId, uint32_t ifNum, uint64_t *counterValue)
 Gets a 64 bit interface counter. More...
 
open_error_t openapiStatReset (openapiClientHandle_t *client_handle, OPEN_COUNTER_ID_t counterId, uint32_t ifNum)
 Resets (sets to 0) an interface counter. More...
 
open_error_t openapiStatStringGet (openapiClientHandle_t *client_handle, OPEN_COUNTER_ID_t counterId, uint32_t ifNum, open_buffdesc *counterValueStr)
 Gets a 64 bit interface counter as a string. More...
 

Detailed Description

Enumeration Type Documentation

Interface Counter IDs.

Enumerator
OPEN_CTR_RESERVED 

Reserved.

OPEN_CTR_RX_TOTAL_BYTES 

Total number of bytes received.

OPEN_CTR_RX_64 

Total number of packets of size 64 bytes received.

OPEN_CTR_RX_65_127 

Total number of packets of size 65 - 127 bytes received.

OPEN_CTR_RX_128_255 

Total number of packets of size 128 - 255 bytes received.

OPEN_CTR_RX_256_511 

Total number of packets of size 256 - 511 bytes received.

OPEN_CTR_RX_512_1023 

Total number of packets of size 512 - 1023 bytes received.

OPEN_CTR_RX_1024_1518 

Total number of packets of size 1024 - 1518 bytes received.

OPEN_CTR_RX_1519_1530 

Total number of packets of size 1519 - 1530 bytes received.

OPEN_CTR_RX_GOOD_OVERSIZE 

Total number of good oversized packets received.

OPEN_CTR_RX_ERROR_OVERSIZE 

Total number of error oversized packets received.

OPEN_CTR_RX_GOOD_UNDERSIZE 

Total number of good undersized packets received.

OPEN_CTR_RX_ERROR_UNDERSIZE 

Total number of error undersized packets received.

OPEN_CTR_RX_UCAST_FRAMES 

Total number of Unicast packets received.

OPEN_CTR_RX_MCAST_FRAMES 

Total number of Multicast packets received.

OPEN_CTR_RX_BCAST_FRAMES 

Total number of Broadcast packets received.

OPEN_CTR_RX_ALIGN_ERRORS 

Total number alignment errors in packets received.

OPEN_CTR_RX_FCS_ERRORS 

Total number of packets with FCS errors received.

OPEN_CTR_RX_OVERRUNS 

Total number of Overrun errors in packet received.

OPEN_CTR_RX_FRAME_TOO_LONG 

Total number of Frame-too-long errors in packet received.

OPEN_CTR_TX_TOTAL_BYTES 

Total number of bytes transmitted.

OPEN_CTR_TX_64 

Total number of packets of size 64 bytes transmitted.

OPEN_CTR_TX_65_127 

Total number of packets of size 65 - 127 bytes transmitted.

OPEN_CTR_TX_128_255 

Total number of packets of size 128 - 255 bytes transmitted.

OPEN_CTR_TX_256_511 

Total number of packets of size 256 - 511 bytes transmitted.

OPEN_CTR_TX_512_1023 

Total number of packets of size 512 - 1023 bytes transmitted.

OPEN_CTR_TX_1024_1518 

Total number of packets of size 1024 - 1518 bytes transmitted.

OPEN_CTR_TX_1519_1530 

Total number of packets of size 1519 - 1530 bytes transmitted.

OPEN_CTR_TX_UCAST_FRAMES 

Total number of Unicast packets transmitted.

OPEN_CTR_TX_MCAST_FRAMES 

Total number of Multicast packets transmitted.

OPEN_CTR_TX_BCAST_FRAMES 

Total number of Broadcast packets transmitted.

OPEN_CTR_TX_FCS_ERRORS 

Total number of packets with FCS errors transmitted.

OPEN_CTR_TX_OVERSIZED 

Total number of oversized packets transmitted.

OPEN_CTR_TX_UNDERRUN_ERRORS 

Total number of packets transmitted with underrun errors.

OPEN_CTR_TX_ONE_COLLISION 

Total number of packets transmitted with single collision errors.

OPEN_CTR_TX_MULTIPLE_COLLISION 

Total number of packets transmitted with multiple collision errors.

OPEN_CTR_TX_EXCESSIVE_COLLISION 

Total number of packets transmitted with excessive collision errors.

OPEN_CTR_TX_LATE_COLLISION 

Total number of packets transmitted with late collision errors.

OPEN_CTR_TX_RX_64 

Total number of packets of size 64 bytes received and transmitted.

OPEN_CTR_TX_RX_65_127 

Total number of packets of size 65 - 127 bytes received and transmitted.

OPEN_CTR_TX_RX_128_255 

Total number of packets of size 128 - 255 bytes received and transmitted.

OPEN_CTR_TX_RX_256_511 

Total number of packets of size 256 - 511 bytes received and transmitted.

OPEN_CTR_TX_RX_512_1023 

Total number of packets of size 512 - 1023 bytes received and transmitted.

OPEN_CTR_TX_RX_1024_1518 

Total number of packets of size 1024 - 1518 bytes received and transmitted.

OPEN_CTR_TX_RX_1519_1522 

Total number of packets of size 1519 - 1522 bytes received and transmitted.

OPEN_CTR_TX_RX_1523_2047 

Total number of packets of size 1523 - 2047 bytes received and transmitted.

OPEN_CTR_TX_RX_2048_4095 

Total number of packets of size 2048 - 4095 bytes received and transmitted.

OPEN_CTR_TX_RX_4096_9216 

Total number of packets of size 4096 - 9216 bytes received and transmitted.

OPEN_CTR_ETHER_STATS_DROP_EVENTS 

Total number of events in which packets were dropped.

OPEN_CTR_SNMPIFOUTDISCARD_FRAMES 

Total number of SNMP packets discarded while transmission.

OPEN_CTR_SNMPIFINDISCARD_FRAMES 

Total number of SNMP packets discarded while reception.

OPEN_CTR_RX_TOTAL_FRAMES 

Total numver of packets received.

OPEN_CTR_RX_TOTAL_ERROR_FRAMES 

Total numver of packets with errors received.

OPEN_CTR_TX_TOTAL_FRAMES 

Total numver of packets transmitted.

OPEN_CTR_TX_TOTAL_ERROR_FRAMES 

Total numver of packets with errors transmitted.

OPEN_CTR_TX_TOTAL_COLLISION_FRAMES 

Total numver of packets with collision errors transmitted.

OPEN_CTR_RX_CRC_ERRORS 

Total numver of packets with CRC errors received.

OPEN_CTR_RX_TOTAL_MAC_ERROR_FRAMES 

Total numver of packets with MAC errors received.

OPEN_CTR_RX_RATE_BITS 

Packet receive rate in bits/sec.

OPEN_CTR_TX_RATE_BITS 

Packet transmit rate in bits/sec.

OPEN_CTR_RX_RATE_FRAMES 

Received rate in packets/sec.

OPEN_CTR_TX_RATE_FRAMES 

Transmit rate in packets/sec.

OPEN_CTR_ETHER_STATS_HOLD 

Head of Line Blocking Drops (HOLD)

OPEN_CTR_RX_JABBER_FRAMES 

Number of received jabber frames.

OPEN_CTR_PORT_LINK_DOWN_COUNTER 

Number of link down events.

Definition at line 49 of file openapi_stats.h.

Function Documentation

open_error_t openapiInterfaceStatsBufSizeGet ( openapiClientHandle_t client_handle,
uint32_t *  bufSize 
)

Get the size of the interface counter array buffer.

Parameters
[in]client_handleClient handle from registration API
[out]bufSizeBuffer size required
Return values
OPEN_E_NONEValue returned successfully.
OPEN_E_PARAMError in parameter passed.
Note
Use this API to determine the minimum size buffer to pass to openapiInterfaceStatsGet() to retrieve all counters for an interface.

OpEN API Version: 1.18

Examples:
intf_stats_example.c.
open_error_t openapiInterfaceStatsGet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
open_buffdesc counterArray 
)

Gets the entire set of 64-bit counters for an interface.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumID of the interface
[out]counterArrayCounter array buffer descriptor
Return values
OPEN_E_NONEOperation succeeded.
OPEN_E_FAILOperation failed.
OPEN_E_PARAMError in parameter passed. A null pointer or insufficient buffer size can cause this return code.
Note
The counterArray buffer descriptor refers to a caller-supplied output buffer that contains a list of uint64_t 64-bit counter values indexed by the counter IDs as defined by the OPEN_COUNTER_ID_t enumeration. Since the ID 0 position does not define an actual interface counter value, counterArray[0] contains the number of actual counter value entries in the array (i.e., the maximum array index value allowed).
Unlike openapiStatGet(), a failure to retrieve an individual counter value does not cause this API to fail. Instead, a counter value of 0 is provided. This can happen if a specific counter is not supported for this interface, or if there was a problem obtaining the counter value from the device.
Use openapiInterfaceStatsBufSizeGet() to determine the proper size of the counterArray output buffer. The caller is required to provide a buffer of at least this size to hold all of the interface counter values.

OpEN API Version: 1.18

Examples:
intf_stats_example.c.
open_error_t openapiInterfaceStatsReset ( openapiClientHandle_t client_handle,
uint32_t  ifNum 
)

Resets (sets to 0) all interface counters for the specified interface.

Parameters
[in]client_handleclient handle from registration API
[in]ifNumID of the interface.
Return values
OPEN_E_NONECounters reset.
OPEN_E_FAILCounters reset failed.

OpEN API Version: 1.1

Examples:
intf_stats_example.c.
open_error_t openapiInterfaceStatsResetTimeGet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
uint32_t *  lastResetSecs 
)

Get number of seconds since all interface counters were last reset.

Parameters
[in]client_handleClient handle from registration API.
[in]ifNumID of the interface.
[out]lastResetSecsSeconds since stats last reset.
Return values
OPEN_E_NONELast reset time value returned.
OPEN_E_FAILValue retrieval was unsuccessful.
OPEN_E_PARAMError in parameter passed.
OPEN_E_INTERNALInternal error encountered.

OpEN API Version: 1.18

Examples:
intf_stats_example.c.
open_error_t openapiStatGet ( openapiClientHandle_t client_handle,
OPEN_COUNTER_ID_t  counterId,
uint32_t  ifNum,
uint64_t *  counterValue 
)

Gets a 64 bit interface counter.

Parameters
[in]client_handleclient handle from registration API
[in]counterIdID of the counter.
[in]ifNumID of the interface.
[out]counterValuethe counter value.
Return values
OPEN_E_NONECounter value returned.
OPEN_E_FAILCounter retrieval failed.
OPEN_E_NOT_FOUNDCounter is not supported for this interface.
OPEN_E_PARAMError in parameter passed. Null pointer or invalid counter ID can cause this return code.

OpEN API Version: 1.1

Examples:
intf_stats_example.c.
open_error_t openapiStatReset ( openapiClientHandle_t client_handle,
OPEN_COUNTER_ID_t  counterId,
uint32_t  ifNum 
)

Resets (sets to 0) an interface counter.

Parameters
[in]client_handleclient handle from registration API
[in]counterIdID of the counter.
[in]ifNumID of the interface.
Return values
OPEN_E_NONECounter value reset.
OPEN_E_FAILCounter value reset failed.
OPEN_E_NOT_FOUNDCounter is not supported for this interface.
OPEN_E_PARAMError in parameter passed. Invalid counter ID can cause this return code.

OpEN API Version: 1.1

Examples:
intf_stats_example.c.
open_error_t openapiStatStringGet ( openapiClientHandle_t client_handle,
OPEN_COUNTER_ID_t  counterId,
uint32_t  ifNum,
open_buffdesc counterValueStr 
)

Gets a 64 bit interface counter as a string.

Parameters
[in]client_handleclient handle from registration API
[in]counterIdID of the counter.
[in]ifNumID of the interface.
[out]counterValueStrthe counter value as a string. Minuimum size is OPEN_MIN_U64_STR_BUFFER_SIZE
Return values
OPEN_E_NONECounter value returned.
OPEN_E_FAILCounter retrieval failed.
OPEN_E_NOT_FOUNDCounter is not supported for this interface.
OPEN_E_PARAMError in parameter passed.
OPEN_E_INTERNALInternal error encountered.

OpEN API Version: 1.15

Examples:
intf_stats_example.c.