bRAWcap 1.0.1
b-plus Technologies - Ethernet Performance Transmitter Receiver
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations
brawcap_types_shared.h File Reference

bRAWcap API - Shared types. More...

Go to the source code of this file.

Data Structures

struct  brawcap_version_fragments_t
 Struct containing the separated version parts. More...
 
union  brawcap_version_t
 bRAWcap version. More...
 
struct  brawcap_bpf_insn_t
 A single BPF pseudo-instruction. More...
 
struct  brawcap_bpf_program_t
 A BPF pseudo-assembly program. More...
 
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_HANDLES_PER_ADAPTER_MAX   5
 Specifies the maximum supported bRAWcap handles per adapter.
 
#define BRAWCAP_SUCCESS(status)   (status == 0)
 Checks if the returned status indicates a success with no additional info.
 
#define BRAWCAP_ERROR(status)   (status < 0)
 Checks if the returned status is a error.
 
#define BRAWCAP_WARNING(status)   (status > 0 && status < 2000)
 Checks if the returned status is a warning.
 
#define BRAWCAP_INFO(status)   (status >= 2000 && status < 4000)
 Checks if the returned status is a info.
 
#define BRAWCAP_TIMESTAMP_MODE_SYSL_AVAILABLE(_capabilities)   (_capabilities & 0x01)
 Checks if timestamp mode system low precision is supported.
 
#define BRAWCAP_TIMESTAMP_MODE_SYSH_AVAILABLE(_capabilities)   (_capabilities & 0x02)
 Checks if timestamp mode system high precision is supported.
 
#define BRAWCAP_TIMESTAMP_MODE_SW_AVAILABLE(_capabilities)   (_capabilities & 0x04)
 Checks if timestamp mode software is supported.
 
#define BRAWCAP_TIMESTAMP_MODE_ADAPTER_SYS_AVAILABLE(_capabilities)   (_capabilities & 0x08)
 Checks if timestamp mode adapter system is supported.
 
#define BRAWCAP_TIMESTAMP_MODE_ADAPTER_SW_AVAILABLE(_capabilities)   (_capabilities & 0x10)
 Checks if timestamp mode adapter software is supported.
 
#define BRAWCAP_TIMESTAMP_MODE_ADAPTER_HW_AVAILABLE(_capabilities)   (_capabilities & 0x20)
 Checks if timestamp mode adapter hardware is supported.
 
#define BRAWCAP_TIMESTAMP_RESOLUTION_UNKNOWN   0
 If a timestamp resolution is set to this value, it´s resolution is unknown - could not be resolved.
 
#define BRAWCAP_TIMESTAMP_NS_PER_SEC   1000000000
 Number of nanoseconds per second.
 
#define BRAWCAP_TIMESTAMP_US_PER_SEC   1000000
 Number of microseconds per second.
 
#define BRAWCAP_TIMESTAMP_MS_PER_SEC   1000
 Number of milliseconds per second.
 
#define BRAWCAP_TIMESTAMP_NS_PER_US   1000
 Number of nanoseconds per microsecond.
 
#define BRAWCAP_TIMESTAMP_NS_PER_MS   1000000
 Number of nanoseconds per millisecond.
 
#define BRAWCAP_PACKET_SIZE_MAX   9018
 The maximum supported (byte) size for a single packet payload.
 
#define BRAWCAP_PACKET_SIZE_MIN   14
 The minimum required (byte) size for a single packet payload.
 
#define BRAWCAP_BUFFER_PACKETS_MAX   100000
 The maximum amount of packets, which can be stored in a packet buffer.
 
#define BRAWCAP_BUFFER_PACKETS_MIN   1
 The minimum amount of packets, which a packet buffer must have.
 
#define BRAWCAP_FILTER_BYTE_MAX_LENGTH   64U
 The maximum supported filter byte mask length in bytes.
 
#define BRAWCAP_RX_COPY_PACKETS_DEFAULT   0
 Default minimum packets to copy value which has to be received before any receive function return even if configured timeout exceeds.
 
#define BRAWCAP_RX_TIMEOUT_MS_DEFAULT   10
 Default timeout in milliseconds after which a bRAWcap receive returns, even if buffer is not yet full but the configured receive min packets to copy must be reached.
 
#define BRAWCAP_RX_TIMESTAMP_MODE_DEFAULT   BRAWCAP_TIMESTAMP_MODE_SYSTEM_LOWPREC
 Default receive timestamp mode which will be used.
 
#define BRAWCAP_RX_VLAN_TAGGING_DEFAULT   FALSE
 Default VLAN tagging mode which will be used.
 
#define BRAWCAP_RX_DRIVER_QUEUE_SIZE_DEFAULT   4096
 Default size for driver receive queues in number of packets.
 
#define BRAWCAP_RX_TIMEOUT_MS_MAX   5000
 Maximum supported receive timeout in number of milliseconds.
 
#define BRAWCAP_RX_DRIVER_QUEUE_SIZE_MAX   40000
 Maximum size (in number of packets) supported for driver receive queues.
 
#define BRAWCAP_RX_DIRECTION_DEFAULT   BRAWCAP_RX_DIRECTION_BOTH
 Default receive direction which will be used.
 
#define BRAWCAP_TX_DRIVER_QUEUE_SIZE_DEFAULT   512
 Default size in number of packets for driver transmit queues.
 
#define BRAWCAP_TX_DRIVER_QUEUE_SIZE_MIN   256
 Minimum size in number of packets supported for driver transmit queues.
 
#define BRAWCAP_TX_DRIVER_QUEUE_SIZE_MAX   4096
 Maximum size in number of packets supported for driver transmit queues.
 
#define BRAWCAP_TX_TIMESTAMP_MODE_DEFAULT   BRAWCAP_TIMESTAMP_MODE_NO_TIMESTAMP
 Default timestamp mode for transmitted packets.
 
#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.
 

Typedefs

typedef UINT32 brawcap_queue_size_t
 The number of packets which can be (temporary) buffered by the bRAWcap driver queue.
 
typedef UINT32 brawcap_timestamp_capabilities_t
 Type used for indicating the supported timestamp modes.
 
typedef UINT32 brawcap_timestamp_resolution_ns_t
 Represents the timestamp resolution in nanoseconds.
 
typedef struct _brawcap_timestamp brawcap_timestamp_t
 bRAWcap timestamp object.
 
typedef UINT16 brawcap_packet_size_t
 Type for handling the number of payload bytes per packet.
 
typedef struct _brawcap_packet brawcap_packet_t
 bRAWcap packet object.
 
typedef UINT32 brawcap_buffer_packet_count_t
 Type for handling the number of packets which can be stored in a packet buffer.
 
typedef struct _brawcap_buffer brawcap_buffer_t
 bRAWcap packet buffer object.
 
typedef struct _brawcap_buffer_iterator brawcap_buffer_iterator_t
 bRAWcap packet buffer iterator object.
 
typedef UINT8 brawcap_filter_mask_array_t[BRAWCAP_FILTER_BYTE_MAX_LENGTH]
 Fixed size array for storing a filter byte mask.
 
typedef UINT8 brawcap_filter_ignore_bits_array_t[BRAWCAP_FILTER_BYTE_MAX_LENGTH]
 Fixed size array for storing a byte wise bitfield.
 
typedef brawcap_packet_size_t brawcap_filter_byte_length_t
 Type for specifying the byte filter length.
 
typedef struct _brawcap_filter brawcap_filter_t
 bRAWcap filter object.
 
typedef UINT16 brawcap_rx_timeout_t
 Type for handling receive timeouts in number of milliseconds. The timeout specifies the maximum blocking time in milliseconds for pending bRAWcap receives. If a packet is received or the receive buffer is full before the timeout is reached, receive will return earlier.
 
typedef UINT32 brawcap_rx_min_packets_t
 Type for handling the minimum amount of packets to copy before a bRAWcap receive will return. It specifies how many packets should be received before a pending receive returns. Reading more packets in a single call can improve the performance but leads to higher latency.
 

Enumerations

enum  brawcap_status_t {
  BRAWCAP_STATUS_SUCCESS = 0 ,
  BRAWCAP_STATUS_ERROR_FAILED = -1 ,
  BRAWCAP_STATUS_ERROR_NOT_AVAILABLE = -2 ,
  BRAWCAP_STATUS_ERROR_INVALID_POINTER = -3 ,
  BRAWCAP_STATUS_ERROR_INVALID_PARAM = -4 ,
  BRAWCAP_STATUS_ERROR_PARAM_OUT_OF_RANGE = -5 ,
  BRAWCAP_STATUS_ERROR_NOT_FOUND = -6 ,
  BRAWCAP_STATUS_ERROR_IN_USE = -7 ,
  BRAWCAP_STATUS_ERROR_BEYOND_MTU = -8 ,
  BRAWCAP_STATUS_ERROR_DRIVER_IO_FAILED = -9 ,
  BRAWCAP_STATUS_ERROR_DRIVER_NOT_AVAILABLE = -10 ,
  BRAWCAP_STATUS_ERROR_OVERRUN = -11 ,
  BRAWCAP_STATUS_WARNING_DEMO_MODE = 1 ,
  BRAWCAP_STATUS_WARNING_PENDING = 2 ,
  BRAWCAP_STATUS_WARNING_LIMIT_REACHED = 3 ,
  BRAWCAP_STATUS_WARNING_CANCELED = 4 ,
  BRAWCAP_STATUS_WARNING_NOT_ALL_PROCESSED = 5 ,
  BRAWCAP_STATUS_WARNING_NO_UPLINK = 6 ,
  BRAWCAP_STATUS_INFO_NOT_RUNNING = 2000 ,
  BRAWCAP_STATUS_INFO_NOT_ATTACHED = 2001 ,
  BRAWCAP_STATUS_INFO_NOT_REGISTERED = 2002 ,
  BRAWCAP_STATUS_INFO_ALREADY_REGISTERED = 2003 ,
  BRAWCAP_STATUS_INFO_NO_DATA = 2004 ,
  BRAWCAP_STATUS_INFO_TIMEOUT = 2005
}
 bRAWcap status/return codes. More...
 
enum  brawcap_timestamp_mode_t {
  BRAWCAP_TIMESTAMP_MODE_NO_TIMESTAMP = 0x00 ,
  BRAWCAP_TIMESTAMP_MODE_SYSTEM_LOWPREC = 0x01 ,
  BRAWCAP_TIMESTAMP_MODE_SYSTEM_HIGHPREC = 0x02 ,
  BRAWCAP_TIMESTAMP_MODE_SOFTWARE = 0x04 ,
  BRAWCAP_TIMESTAMP_MODE_ADAPTER_SYSTEM = 0x08 ,
  BRAWCAP_TIMESTAMP_MODE_ADAPTER_SOFTWARE = 0x10 ,
  BRAWCAP_TIMESTAMP_MODE_ADAPTER_HARDWARE = 0x20
}
 List of different timestamp modes. More...
 
enum  brawcap_filter_type_t {
  BRAWCAP_FILTER_TYPE_BYTE_MASK = 0 ,
  BRAWCAP_FILTER_TYPE_BPF = 1
}
 List of filter types. More...
 
enum  brawcap_rx_mode_t {
  BRAWCAP_RX_MODE_LIVE = 1 ,
  BRAWCAP_RX_MODE_DUMP = 2
}
 List of receive modes. More...
 
enum  brawcap_rx_direction_t {
  BRAWCAP_RX_DIRECTION_UNKNOWN = 0x00 ,
  BRAWCAP_RX_DIRECTION_IN = 0x01 ,
  BRAWCAP_RX_DIRECTION_OUT = 0x02 ,
  BRAWCAP_RX_DIRECTION_BOTH = 0x03
}
 List of supported receive directions. More...
 
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...
 

Detailed Description

bRAWcap API - Shared types.

The file includes all (data)types and defines used for bRAWcap (kernel and user space).

All rights exclusively reserved for b-plus GmbH, unless expressly otherwise agreed.

Redistribution in source or any other form, with or without modification, is not permitted.

You may use this code under the according license terms of b-plus. Please contact b-plus at servi.nosp@m.ces@.nosp@m.b-plu.nosp@m.s.co.nosp@m.m to get the appropriate terms and conditions.