bRAWcap 1.0.1
b-plus Technologies - Ethernet Performance Transmitter Receiver
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
Statistics

Types and functions for bRAWcap statistics. More...

Data Structures

struct  brawcap_stats_header_t
 Header describing given bRAWcap stats structure. More...
 
struct  brawcap_stats_rx_t
 The bRAWcap receive statistics. More...
 
struct  brawcap_stats_tx_t
 The bRAWcap transmit statistics. More...
 

Macros

#define BRAWCAP_STATS_RX_ADAPTER_RECEIVED_PACKETS_TOTAL_VALID(__stats_rx)    (__stats_rx.adapterValid & _BRAWCAP_STATS_RX_ADAPTER_RECEIVED_PACKETS_TOTAL_VALID)
 Indicates if the brawcap_stats_rx_t::adapterReceivedPacketsTotal member of the given receive stats is valid. This statistic is provided from the underlying network adapter driver and may be supported or not.
 
#define BRAWCAP_STATS_RX_ADAPTER_RECEIVED_BYTES_TOTAL_VALID(__stats_rx)    (__stats_rx.adapterValid & _BRAWCAP_STATS_RX_ADAPTER_RECEIVED_BYTES_TOTAL_VALID)
 Indicates if the brawcap_stats_rx_t::adapterReceivedBytesTotal member of the given receive stats is valid. This statistic is provided from the underlying network adapter driver and may be supported or not.
 
#define BRAWCAP_STATS_RX_ADAPTER_DROPPED_PACKETS_TOTAL_VALID(__stats_rx)    (__stats_rx.adapterValid & _BRAWCAP_STATS_RX_ADAPTER_DROPPED_PACKETS_TOTAL_VALID)
 Indicates if the brawcap_stats_rx_t::adapterDroppedPacketsTotal member of the given receive stats is valid. This statistic is provided from the underlying network adapter driver and may be supported or not.
 
#define BRAWCAP_STATS_TX_ADAPTER_COMPLETED_PACKETS_TOTAL_VALID(__stats_tx)    (__stats_tx.adapterValid & _BRAWCAP_STATS_TX_ADAPTER_COMPLETED_PACKETS_TOTAL_VALID)
 Indicates if the brawcap_stats_tx_t::adapterCompletedPacketsTotal member of the given transmit stats is valid. This statistic is provided from the underlying network adapter driver and may be supported or not.
 
#define BRAWCAP_STATS_TX_ADAPTER_COMPLETED_BYTES_TOTAL_VALID(__stats_tx)    (__stats_tx.adapterValid & _BRAWCAP_STATS_TX_ADAPTER_COMPLETED_BYTES_TOTAL_VALID)
 Indicates if the brawcap_stats_tx_t::adapterCompletedBytesTotal member of the given transmit stats is valid. This statistic is provided from the underlying network adapter driver and may be supported or not.
 
#define BRAWCAP_STATS_TX_ADAPTER_CANCELED_PACKETS_TOTAL_VALID(__stats_tx)    (__stats_tx.adapterValid & _BRAWCAP_STATS_TX_ADAPTER_CANCELED_PACKETS_TOTAL_VALID )
 Indicates if the brawcap_stats_tx_t::adapterCanceledPacketsTotal member of the given transmit stats is valid. This statistic is provided from the underlying network adapter driver and may be supported or not.
 
#define BRAWCAP_STATS_RX_SIZEOF_REVISION_1   _BRAWCAP_SIZEOF_STRUCT(brawcap_stats_rx_t, handleDroppedPacketsToLong)
 Returns the size of receive statistics revision 1.
 
#define BRAWCAP_STATS_TX_SIZEOF_REVISION_1   _BRAWCAP_SIZEOF_STRUCT(brawcap_stats_tx_t, handleCompletedBytesTotal)
 Returns the size of transmit statistics revision 1.
 

Enumerations

enum  brawcap_stats_type_t {
  BRAWCAP_STATS_TYPE_RX = 1 ,
  BRAWCAP_STATS_TYPE_TX = 2
}
 List of all available statistic types. More...
 
enum  brawcap_stats_rx_revision_t { BRAWCAP_STATS_RX_REVISION_1 = 1 }
 List of all available receive statistic revisions. More...
 
enum  brawcap_stats_tx_revision_t { BRAWCAP_STATS_TX_REVISION_1 = 1 }
 List of all available transmit statistic revisions. More...
 

Functions

brawcap_status_t brawcap_stats_rx (brawcap_handle_t *const pHandle, brawcap_stats_rx_t *const pStats)
 Reads out the available receive statistic counters for the specified handle.
 
brawcap_status_t brawcap_stats_tx (brawcap_handle_t *const pHandle, brawcap_stats_tx_t *const pStats)
 Reads out the available transmit statistic counters for the specified handle.
 

Detailed Description

Types and functions for bRAWcap statistics.


Data Structure Documentation

◆ brawcap_stats_header_t

struct brawcap_stats_header_t

Header describing given bRAWcap stats structure.

Attention
If your create a new bRAWcap stats structure you must always initialize the header first before make use of it. This is required to allow backward compatibility for applications using older versions.
Data Fields
BYTE type Indicates which type of stats it is.
BYTE revision Indicates the revision of the stats.
Note
It is preferred to always use the latest version available in your bRAWcap header file. But you can also use older versions if you dont want to access members added in the newer versions.
UINT16 size Should be set to the size of the structure depending on it´s type and revision. You should use the BRAWCAP_STATS_..._SIZEOF_REVISION_X macros for initializing this member.

◆ brawcap_stats_rx_t

struct brawcap_stats_rx_t

The bRAWcap receive statistics.

This can be used to retrieve all available bRAWcap statistics and counters related to receive path. After creating the structure, its header has to be initialized.

The brawcap_stats_header_t::type shall be set to BRAWCAP_STATS_TYPE_RX.

The brawcap_stats_header_t::revision shall be set to one of the following values:

The brawcap_stats_header_t::size shall be set depending on your selected version by using the macro:

Attention
User is responsible for initializing the structure header before using it. Otherwise it may lead to undefined behaviour.
Examples
06_filter_firewall.c.
Data Fields
brawcap_stats_header_t header Header for receive statistics. This has to be always initialized by the user after creation before using it.
UINT32 adapterValid Bitfield indicating which counters provided by the underlying network adapter driver are valid.
UINT64 adapterReceivedPacketsTotal Total number of received packets by the underlying network adapter.
Note
You should check if the network adapter supports this counter with BRAWCAP_STATS_RX_ADAPTER_RECEIVED_PACKETS_TOTAL_VALID. If the counter is not supported it will be always zero.
UINT64 adapterReceivedBytesTotal Total number of received bytes by the underlying network adapter.
Note
You should check if the network adapter supports this counter with BRAWCAP_STATS_RX_ADAPTER_RECEIVED_BYTES_TOTAL_VALID. If the counter is not supported it will be always zero.
UINT64 adapterDroppedPacketsTotal Total number of received bytes by the underlying network adapter.
Note
You should check if the network adapter supports this counter with BRAWCAP_STATS_RX_ADAPTER_DROPPED_PACKETS_TOTAL_VALID. If the counter is not supported it will be always zero.
UINT64 driverIndicatedPacketsTotal The total number of indicated packets to the upper network stack by bRAWcap on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter.
UINT64 driverReceivedPacketsTotal The total number of received packets by bRAWcap on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter..
UINT64 handleReceivedPacketsTotal The total number of received packets by the given bRAWcap handle.
Note
This counter relates to a handle and will be deleted when the handle is closed.
UINT64 handleReceivedPacketsMatched The total number of packets which have matched the given bRAWcap handle filter.
Note
This counter relates to a handle and will be deleted when the handle is closed.
UINT64 handleReceivedPacketsQueued The total number of packets which was queued to the handles driver queue.
Note
This counter relates to a handle and will be deleted when the handle is closed.
UINT64 handleReceivedPacketsDirect The total number of packets which could be directly delivered to user space memory.
Note
This counter relates to a handle and will be deleted when the handle is closed.
UINT64 handleReceivedBytesTotal The total number of received bytes by the given bRAWcap handle.
Note
This counter relates to a handle and will be deleted when the handle is closed
UINT64 handleDroppedPacketsTotal The total number of packets which was dropped for the handle (sum of all reasons).
Note
This counter relates to a handle and will be deleted when the handle is closed.
UINT64 handleDroppedPacketsQueue The total number of packets which was dropped for the handle because of resources (driver queue overrun).
Note
This counter relates to a handle and will be deleted when the handle is closed.
UINT64 handleDroppedPacketsToLong The total number of packets which was dropped for the handle their length exceeds the handles configured max packet size.
Note
This counter relates to a handle and will be deleted when the handle is closed.

◆ brawcap_stats_tx_t

struct brawcap_stats_tx_t

The bRAWcap transmit statistics.

This can be used to retrieve all available bRAWcap statistics and counters related to transmit path. After creating the structure, its header has to be initialized.

The brawcap_stats_header_t::type shall be set to BRAWCAP_STATS_TYPE_TX.

The brawcap_stats_header_t::revision shall be set to one of the following values:

The brawcap_stats_header_t::size shall be set depending on your selected version by using the macro:

Attention
User is responsible for initializing the structure header before using it. Otherwise it may lead to undefined behaviour.
Data Fields
brawcap_stats_header_t header Header for transmit statistics. This has to be always initialized by the user after creation before using it.
UINT32 adapterValid Bitfield indicating which counters provided by the underlying network adapter driver are valid.
UINT64 adapterCompletedPacketsTotal Total number of (completed) transmitted packets by the underlying network adapter.
Note
You should check if the network adapter supports this counter with BRAWCAP_STATS_TX_ADAPTER_COMPLETED_PACKETS_TOTAL_VALID. If the counter is not supported it will be always zero.
UINT64 adapterCompletedBytesTotal Total number of (completed) transmitted bytes by the underlying network adapter.
Note
You should check if the network adapter supports this counter with BRAWCAP_STATS_TX_ADAPTER_COMPLETED_BYTES_TOTAL_VALID. If the counter is not supported it will be always zero.
UINT64 adapterCanceledPacketsTotal Total number of canceled transmitted packets by the underlying network adapter.
Note
You should check if the network adapter supports this counter with BRAWCAP_STATS_TX_ADAPTER_CANCELED_PACKETS_TOTAL_VALID. If the counter is not supported it will be always zero.
UINT64 driverInitiatedPacketsTotal Total number of initiated packets to transmit by the bRAWcap driver on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter.
UINT64 driverInitiatedPacketsStack Initiated packets to transmit from upper network stack detected by bRAWcap driver on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter.
UINT64 driverInitiatedPacketsHandles Initiated packets to transmit from bRAWcap driver itself on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter.
UINT64 driverCanceledPacketsTotal Total number of canceled packets to transmit by the bRAWcap driver on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter.
UINT64 driverCanceledPacketsStack Canceled packets to transmit from the upper network stack detected by bRAWcap driver on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter.
UINT64 driverCanceledPacketsHandles Canceled packets to transmit from bRAWcap driver itself on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter.
UINT64 driverCompletedPacketsTotal Total number of completed transmitted packets detected by bRAWcap driver on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter.
UINT64 driverCompletedPacketsStack Completed packets to transmit from the upper network stack detected by bRAWcap driver on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter.
UINT64 driverCompletedPacketsHandles Completed packets to transmit from the bRAWcap driver itself on the corresponding adapter.
Note
This counter will reset if bRAWcap driver is restarted, or it is deactivated on the adapter.
UINT64 handleInitiatedPacketsTotal Total number of initiated packets to transmit for the handle.
Note
This counter relates to a handle and will be deleted when the handle is closed.
UINT64 handleCanceledPacketsTotal Total number of canceled packets to transmit for the handle.
Note
This counter relates to a handle and will be deleted when the handle is closed.
UINT64 handleCompletedPacketsTotal Total number of completed transmitted packets for the handle.
Note
This counter relates to a handle and will be deleted when the handle is closed.
UINT64 handleCompletedBytesTotal

Enumeration Type Documentation

◆ brawcap_stats_type_t

#include <brawcap_types_shared.h>

List of all available statistic types.

Enumerator
BRAWCAP_STATS_TYPE_RX 

Type for receive stats.

BRAWCAP_STATS_TYPE_TX 

Type for transmit stats.

◆ brawcap_stats_rx_revision_t

#include <brawcap_types_shared.h>

List of all available receive statistic revisions.

Enumerator
BRAWCAP_STATS_RX_REVISION_1 

Revision 1 for receive stats.

◆ brawcap_stats_tx_revision_t

#include <brawcap_types_shared.h>

List of all available transmit statistic revisions.

Enumerator
BRAWCAP_STATS_TX_REVISION_1 

Revision 1 for transmit stats.

Function Documentation

◆ brawcap_stats_rx()

brawcap_status_t brawcap_stats_rx ( brawcap_handle_t *const  pHandle,
brawcap_stats_rx_t *const  pStats 
)

#include <brawcap.h>

Reads out the available receive statistic counters for the specified handle.

Parameters
[in]pHandlebRAWcap handle to read from.
[in,out]pStatsWill contain the current receive statistic counters, afterwards. The header of the statistic struct hast to be filled by the caller, before calling this function. If it is not filled or contains invalid data, the function will fail and return a error.
Returns
Status Description
BRAWCAP_STATUS_SUCCESS Success.
BRAWCAP_STATUS_ERROR_INVALID_POINTER At least one of the given pointer parameters was invalid.
BRAWCAP_STATUS_ERROR_INVALID_PARAM The header was invalid (type or revision).
BRAWCAP_STATUS_ERROR_PARAM_OUT_OF_RANGE The specified size in the header was invalid.
BRAWCAP_STATUS_ERROR_DRIVER_IO_FAILED Communicating with bRAWcap driver failed.
Examples
06_filter_firewall.c.

◆ brawcap_stats_tx()

brawcap_status_t brawcap_stats_tx ( brawcap_handle_t *const  pHandle,
brawcap_stats_tx_t *const  pStats 
)

#include <brawcap.h>

Reads out the available transmit statistic counters for the specified handle.

Parameters
[in]pHandlebRAWcap handle to read from.
[in,out]pStatsWill contain the current transmit statistic counters, afterwards. The header of the statistic struct hast to be filled by the caller, before calling this function. If it is not filled or contains invalid data, the function will fail and return a error.
Returns
Status Description
BRAWCAP_STATUS_SUCCESS Success.
BRAWCAP_STATUS_ERROR_INVALID_POINTER At least one of the given pointer parameters was invalid.
BRAWCAP_STATUS_ERROR_INVALID_PARAM The header was invalid (type or revision).
BRAWCAP_STATUS_ERROR_PARAM_OUT_OF_RANGE The specified size in the header was invalid.
BRAWCAP_STATUS_ERROR_DRIVER_IO_FAILED Communicating with bRAWcap driver failed.