bRAWcap 1.0.1
b-plus Technologies - Ethernet Performance Transmitter Receiver
Loading...
Searching...
No Matches
Functions
brawcap.h File Reference

bRAWcap API - Functions. More...

#include "brawcap_types_um.h"

Go to the source code of this file.

Functions

brawcap_status_t brawcap_log_level_set (const brawcap_log_type_t type, const brawcap_log_level_t level, const char *pKey)
 Sets the current log level for the given log type to the specified log level.
 
brawcap_status_t brawcap_log_levels_set (const UINT32 type, const UINT32 level, const char *pKey)
 Sets the current log levels for the given log types to the specified log levels.
 
brawcap_status_t brawcap_log_level_get (const brawcap_log_type_t type, brawcap_log_level_t *const pLevel)
 Reads the level(s) for the given log type.
 
brawcap_status_t brawcap_open (const brawcap_adapter_name_t name, brawcap_handle_t **const pHandle)
 Opens a new bRAWcap handle on the adapter, specified by it´s name.
 
brawcap_status_t brawcap_close (brawcap_handle_t *pHandle)
 Closes the specified bRAWcap handle.
 
brawcap_status_t brawcap_last_status ()
 Reads the last status appeared in bRAWcap, for the calling thread.
 
brawcap_status_t brawcap_version_api (brawcap_version_t *const pVersion)
 Returns loaded bRAWcap library version.
 
brawcap_status_t brawcap_version_driver (brawcap_handle_t *const pHandle, brawcap_version_t *const pVersion)
 Reads current version of loaded bRAWcap driver.
 
brawcap_status_t brawcap_timestamp_mode_get (brawcap_timestamp_t *const pTimestamp, brawcap_timestamp_mode_t *const pMode)
 Reads out the mode of the specified timestamp.
 
brawcap_status_t brawcap_timestamp_resolution_ns_get (brawcap_timestamp_t *const pTimestamp, brawcap_timestamp_resolution_ns_t *const pResolution_ns)
 Reads out the timestamp resolution of the specified timestamp.
 
brawcap_status_t brawcap_timestamp_value_ns_get (brawcap_timestamp_t *const pTimestamp, UINT64 *const pSeconds, UINT32 *const pNanoseconds)
 Reads out the timestamp value in seconds and nanoseconds.
 
brawcap_status_t brawcap_timestamp_value_ns_set (brawcap_timestamp_t *const pTimestamp, const UINT64 seconds, const UINT32 nanoseconds)
 Sets the timestamp value in seconds and nanoseconds.
 
brawcap_status_t brawcap_timestamp_value_us_get (brawcap_timestamp_t *const pTimestamp, UINT64 *const pSeconds, UINT32 *const pMicroseconds)
 Reads out the timestamp value in seconds and microseconds.
 
brawcap_status_t brawcap_timestamp_value_us_set (brawcap_timestamp_t *const pTimestamp, const UINT64 seconds, const UINT32 microseconds)
 Sets the timestamp value in seconds and microseconds.
 
brawcap_status_t brawcap_timestamp_value_ms_get (brawcap_timestamp_t *const pTimestamp, UINT64 *const pSeconds, UINT32 *const pMilliseconds)
 Reads out the timestamp value in seconds and milliseconds.
 
brawcap_status_t brawcap_timestamp_value_ms_set (brawcap_timestamp_t *const pTimestamp, const UINT64 seconds, const UINT32 milliseconds)
 Sets the timestamp value in seconds and milliseconds.
 
brawcap_status_t brawcap_packet_create (brawcap_packet_t **const pPacket, const brawcap_packet_size_t maxSize)
 Creates a new packet.
 
brawcap_status_t brawcap_packet_free (brawcap_packet_t *pPacket)
 Frees the specified packet. When this function is called the specified packet becomes invalid and it´s memory is released.
 
brawcap_status_t brawcap_packet_status_get (brawcap_packet_t *const pPacket, brawcap_status_t *const pStatus)
 Reads out the status for the specified packet. The status will be set updated during reception/transmission. It indicates the status of the packet depending on the operation.
 
brawcap_status_t brawcap_packet_timestamp_get (brawcap_packet_t *const pPacket, brawcap_timestamp_t **const pTimestamp)
 Reads out the timestamp object for the specified packet.
 
brawcap_status_t brawcap_packet_length_on_wire_get (brawcap_packet_t *const pPacket, brawcap_packet_size_t *const pLengthOnWire)
 Reads out the length on wire of the specified packet. This value is especially useful for received packets. It indicates the total packet payload byte size of the packet on wire. This may not equal to the captured payload byte size. Because the payload byte size depends on the configured filter and it´s bytes to capture parameters.
 
brawcap_status_t brawcap_packet_payload_max_size_get (brawcap_packet_t *const pPacket, brawcap_packet_size_t *const pMaxPayloadSize)
 Reads out the max supported payload byte size of the specified packet. This value was set during packet creation (or buffer creation if it´s a buffered packet).
 
brawcap_status_t brawcap_packet_payload_size_get (brawcap_packet_t *const pPacket, brawcap_packet_size_t *const pLength)
 Reads out the captured payload byte size of the specified packet. This indicates the total byte size of the (captured - if received) packet payload.
 
brawcap_status_t brawcap_packet_payload_get (brawcap_packet_t *const pPacket, const char **const pPayload, brawcap_packet_size_t *const pLength)
 Reads out the payload of the specified packet.
 
brawcap_status_t brawcap_packet_payload_set (brawcap_packet_t *const pPacket, const char *const pPayload, const brawcap_packet_size_t length)
 Sets the packet payload of the specified packet.
 
brawcap_status_t brawcap_buffer_create (brawcap_buffer_t **const pBuffer, const brawcap_packet_size_t maxPacketPayloadSize, const brawcap_buffer_packet_count_t numPackets)
 Creates a new packet buffer.
 
brawcap_status_t brawcap_buffer_free (brawcap_buffer_t *pBuffer)
 Frees the specified packet buffer. When this function is called the specified packet buffer becomes invalid and it´s memory will be released.
 
brawcap_status_t brawcap_buffer_clear (brawcap_buffer_t *const pBuffer)
 Clears the specified packet buffer.
 
brawcap_status_t brawcap_buffer_add_back (brawcap_buffer_t *const pBuffer, const brawcap_packet_t *const pPacket)
 Adds the specified packet at the end of the specified packet buffer.
 
brawcap_status_t brawcap_buffer_add_front (brawcap_buffer_t *const pBuffer, const brawcap_packet_t *const pPacket)
 Adds the specified packet at the front of the specified packet buffer.
 
brawcap_status_t brawcap_buffer_add_at_index (brawcap_buffer_t *const pBuffer, const brawcap_packet_t *const pPacket, const brawcap_buffer_packet_count_t index)
 Inserts the specified packet at index/position into the specified packet buffer.
 
brawcap_status_t brawcap_buffer_at_index (brawcap_buffer_t *const pBuffer, const brawcap_buffer_packet_count_t index, brawcap_packet_t **const pPacket)
 Reads out a buffered packet at the index of the specified packet buffer.
 
brawcap_status_t brawcap_buffer_front (brawcap_buffer_t *const pBuffer, brawcap_packet_t **const pPacket)
 Reads out the first buffered packet of the specified packet buffer.
 
brawcap_status_t brawcap_buffer_back (brawcap_buffer_t *const pBuffer, brawcap_packet_t **const pPacket)
 Reads out the last buffered packet of the specified packet buffer.
 
brawcap_status_t brawcap_buffer_count (brawcap_buffer_t *const pBuffer, brawcap_buffer_packet_count_t *const pPacketCount)
 Reads out the number of currently buffered packets in the specified packet buffer.
 
brawcap_status_t brawcap_buffer_capacity (brawcap_buffer_t *const pBuffer, brawcap_buffer_packet_count_t *const pPacketCapacity)
 Reads out the total number of packets which can be buffered by the specified packet buffer. This value represents the packet buffer capacity, which is set during buffer creation.
 
brawcap_status_t brawcap_buffer_iterator_create (brawcap_buffer_iterator_t **const pIterator, brawcap_buffer_t *const pBuffer, brawcap_buffer_packet_count_t startPosition)
 Creates a new iterator for the specified buffer.
 
brawcap_status_t brawcap_buffer_iterator_free (brawcap_buffer_iterator_t *const pIterator)
 Frees the specified iterator. When this function is called the specified iterator becomes invalid and it´s memory will be released.
 
brawcap_status_t brawcap_buffer_iterator_next (brawcap_buffer_iterator_t *const pIterator)
 Increments the iterator to the next buffered packet.
 
brawcap_status_t brawcap_buffer_iterator_prev (brawcap_buffer_iterator_t *const pIterator)
 Decreases the iterator to the previous buffered packet.
 
brawcap_packet_tbrawcap_buffer_iterator_eval (brawcap_buffer_iterator_t *const pIterator)
 Returns the buffered packet for the specified iterator.
 
brawcap_status_t brawcap_adapter_list_update ()
 Updates the list of supported adapters. This function searches the current machine for supported adapters and add them to the adapter list.
 
brawcap_status_t brawcap_adapter_list_count (brawcap_adapter_count_t *const pCount)
 Reads out the current number of supported adapters in the adapter list.
 
brawcap_status_t brawcap_adapter_list_at (const brawcap_adapter_count_t index, brawcap_adapter_name_t name)
 Reads out the adapter name of the adapter at the adapter list index.
 
brawcap_status_t brawcap_adapter_notify_register (brawcap_adapter_notify_callback_t const callback, void *const pUser)
 Registers the calling process for receiving adapter change notifications.
 
brawcap_status_t brawcap_adapter_notify_unregister ()
 Unregisters the calling process from receiving adapter change notifications.
 
brawcap_status_t brawcap_adapter_notify_handle_register (brawcap_handle_t *const pHandle, brawcap_adapter_notify_handle_callback_t const callback, void *const pUser)
 Registers the specified handle for receiving adapter change notifications.
 
brawcap_status_t brawcap_adapter_notify_handle_unregister (brawcap_handle_t *const pHandle)
 Unregisters the specified handle from receiving adapter change notifications.
 
brawcap_status_t brawcap_adapter_name_by_handle (brawcap_handle_t *const pHandle, brawcap_adapter_name_t name)
 Reads out the adapter name of the specified adapter.
 
brawcap_status_t brawcap_adapter_friendly_name (const brawcap_adapter_name_t name, char *const friendlyName, UINT32 *const pLength)
 Reads out the currently set adapter friendly name for the specified adapter.
 
brawcap_status_t brawcap_adapter_friendly_name_by_handle (brawcap_handle_t *const pHandle, char *const friendlyName, UINT32 *const pLength)
 Reads out the currently set friendly name of the specified adapter.
 
brawcap_status_t brawcap_adapter_description (const brawcap_adapter_name_t name, char *const description, UINT32 *const pLength)
 Reads out the description of the specified adapter.
 
brawcap_status_t brawcap_adapter_description_by_handle (brawcap_handle_t *const pHandle, char *const description, UINT32 *const pLength)
 Reads out the description of a network adapter based on the specified adapter.
 
brawcap_status_t brawcap_adapter_ipv4 (const brawcap_adapter_name_t name, brawcap_adapter_ipv4_t *const pIpv4)
 Reads out the currently set IPv4 address of the specified adapter.
 
brawcap_status_t brawcap_adapter_ipv4_by_handle (brawcap_handle_t *const pHandle, brawcap_adapter_ipv4_t *const pIpv4)
 Reads out the currently set IPv4 address of the specified adapter.
 
brawcap_status_t brawcap_adapter_ipv6 (const brawcap_adapter_name_t name, brawcap_adapter_ipv6_t *const pIpv6)
 Reads out the currently set IPv6 address of the specified adapter.
 
brawcap_status_t brawcap_adapter_ipv6_by_handle (brawcap_handle_t *const pHandle, brawcap_adapter_ipv6_t *const pIpv6)
 Reads out the currently set IPv6 address of the specified adapter.
 
brawcap_status_t brawcap_adapter_mac (const brawcap_adapter_name_t name, brawcap_adapter_mac_t mac)
 Reads out the MAC address of the specified adapter.
 
brawcap_status_t brawcap_adapter_mac_by_handle (brawcap_handle_t *const pHandle, brawcap_adapter_mac_t mac)
 Reads out the MAC address of the specified adapter.
 
brawcap_status_t brawcap_adapter_speed_rx (const brawcap_adapter_name_t name, brawcap_adapter_speed_t *const pSpeed)
 Reads out the current receive speed of the specified adapter.
 
brawcap_status_t brawcap_adapter_speed_rx_by_handle (brawcap_handle_t *const pHandle, brawcap_adapter_speed_t *const pSpeed)
 Reads out the current receive speed of the specified adapter.
 
brawcap_status_t brawcap_adapter_speed_tx (const brawcap_adapter_name_t name, brawcap_adapter_speed_t *const pSpeed)
 Reads out the current transmit speed of the specified adapter.
 
brawcap_status_t brawcap_adapter_speed_tx_by_handle (brawcap_handle_t *const pHandle, brawcap_adapter_speed_t *const pSpeed)
 Reads out the current transmit speed of the specified adapter.
 
brawcap_status_t brawcap_adapter_connection (const brawcap_adapter_name_t name, brawcap_adapter_connection_state_t *const pConnection)
 Reads out the current connection state of the specified adapter.
 
brawcap_status_t brawcap_adapter_connection_by_handle (brawcap_handle_t *const pHandle, brawcap_adapter_connection_state_t *const pConnection)
 Reads out the current connection state of the specified adapter.
 
brawcap_status_t brawcap_adapter_operation (const brawcap_adapter_name_t name, brawcap_adapter_operation_state_t *const pOperation)
 Reads out the current operation state of the specified adapter.
 
brawcap_status_t brawcap_adapter_operation_by_handle (brawcap_handle_t *const pHandle, brawcap_adapter_operation_state_t *const pOperation)
 Reads out the current operation state of the specified adapter.
 
brawcap_status_t brawcap_adapter_mtu (const brawcap_adapter_name_t name, brawcap_adapter_mtu_t *const pMtu)
 Reads out the configured MTU of the specified adapter.
 
brawcap_status_t brawcap_adapter_mtu_by_handle (brawcap_handle_t *const pHandle, brawcap_adapter_mtu_t *const pMtu)
 Reads out the configured MTU of the specified adapter.
 
brawcap_status_t brawcap_filter_create (brawcap_filter_t **const pFilter, const brawcap_filter_type_t type)
 Creates a new filter.
 
brawcap_status_t brawcap_filter_free (brawcap_filter_t *pFilter)
 Frees the specified filter. When this function is called the given filter becomes invalid and it´s memory will be released.
 
brawcap_status_t brawcap_filter_type_get (brawcap_filter_t *const pFilter, brawcap_filter_type_t *const pType)
 Reads out the type for the specified filter.
 
brawcap_status_t brawcap_filter_mask_set (brawcap_filter_t *const pFilter, const brawcap_filter_byte_length_t offset, const brawcap_filter_byte_length_t length, const brawcap_filter_mask_array_t mask, const brawcap_filter_ignore_bits_array_t ignoreBits)
 Sets the filter parameters for the specified filter.
 
brawcap_status_t brawcap_filter_mask_get (brawcap_filter_t *const pFilter, brawcap_filter_byte_length_t *const pOffset, brawcap_filter_byte_length_t *const pLength, brawcap_filter_mask_array_t *const pMask, brawcap_filter_ignore_bits_array_t *const pIgnoreBits)
 Reads out the filter mask parameters for the specified filter.
 
brawcap_status_t brawcap_filter_activate (brawcap_filter_t *const pFilter)
 Sets the specified filter to active.
 
brawcap_status_t brawcap_filter_deactivate (brawcap_filter_t *const pFilter)
 Sets the specified filter to inactive.
 
brawcap_status_t brawcap_filter_is_activated (brawcap_filter_t *const pFilter, BOOLEAN *const pActive)
 Reads out the current activation state of the specified filter.
 
brawcap_status_t brawcap_filter_bytes_to_capture_set (brawcap_filter_t *const pFilter, const brawcap_packet_size_t offset, const brawcap_packet_size_t length)
 Sets the bytes to capture of the specified filter.
 
brawcap_status_t brawcap_filter_bytes_to_capture_get (brawcap_filter_t *const pFilter, brawcap_packet_size_t *const pOffset, brawcap_packet_size_t *const pLength)
 Reads out the configured bytes to capture of the specified filter.
 
brawcap_status_t brawcap_filter_indicate_set (brawcap_filter_t *const pFilter, const BOOLEAN indicate)
 Specifies if packets which matched the specified filter should be indicated to the network stack.
 
brawcap_status_t brawcap_filter_indicate_get (brawcap_filter_t *const pFilter, BOOLEAN *const pIndicate)
 Reads out the current network stack indication state of the specified filter.
 
brawcap_status_t brawcap_rx_packet (brawcap_handle_t *const pHandle, brawcap_packet_t *const pPacket)
 Receives a single packet from the specified handle.
 
brawcap_status_t brawcap_rx_start (brawcap_handle_t *const pHandle, brawcap_rx_callback_t const callback, void *const pUser, const BOOLEAN indicateNoPackets)
 Starts the internal receive loop.
 
brawcap_status_t brawcap_rx_stop (brawcap_handle_t *const pHandle)
 Stops the internal receive loop.
 
brawcap_status_t brawcap_rx_buffer_attach (brawcap_handle_t *const pHandle, brawcap_buffer_t *const pBuffer)
 Attaches the specified bRAWcap packet buffer to the specified handle.
 
brawcap_status_t brawcap_rx_buffer_detach (brawcap_handle_t *const pHandle, brawcap_buffer_t *const pBuffer)
 Detaches the specified bRAWcap packet buffer from the specified handle.
 
brawcap_status_t brawcap_rx_direction_set (brawcap_handle_t *const pHandle, const brawcap_rx_direction_t direction)
 Sets the receive direction for the specified handle.
 
brawcap_status_t brawcap_rx_direction_get (brawcap_handle_t *const pHandle, brawcap_rx_direction_t *const pDirection)
 Reads out the currently configured receive direction of the specified handle.
 
brawcap_status_t brawcap_rx_min_packets_set (brawcap_handle_t *const pHandle, const brawcap_rx_min_packets_t minPackets)
 Sets the minimum amount of packets to receive for the specified handle.
 
brawcap_status_t brawcap_rx_min_packets_get (brawcap_handle_t *const pHandle, brawcap_rx_min_packets_t *const pMinPackets)
 Reads out the currently configured number of packets to receive for the specified handle.
 
brawcap_status_t brawcap_rx_timeout_set (brawcap_handle_t *const pHandle, const brawcap_rx_timeout_t timeout_ms)
 Configures the receive timeout for the specified handle.
 
brawcap_status_t brawcap_rx_timeout_get (brawcap_handle_t *const pHandle, brawcap_rx_timeout_t *const pTimeout_ms)
 Reads out the currently configured receive timeout for the specified handle.
 
brawcap_status_t brawcap_rx_filter_set (brawcap_handle_t *const pHandle, const brawcap_filter_t *const pFilter)
 Sets the specified filter to the specified handle.
 
brawcap_status_t brawcap_rx_filter_get (brawcap_handle_t *const pHandle, brawcap_filter_t *const pFilter)
 Reads out the currently configured filter for the specified handle.
 
brawcap_status_t brawcap_rx_promiscuous_mode_set (brawcap_handle_t *const pHandle, const BOOLEAN enable)
 Sets the current promiscuous mode flag for the specified handle.
 
brawcap_status_t brawcap_rx_promiscuous_mode_get (brawcap_handle_t *const pHandle, BOOLEAN *const pEnabled, BOOLEAN *const pEnabledAdapter)
 Reads out the current promiscuous mode state for the specified handle.
 
brawcap_status_t brawcap_rx_timestamp_capabilities (brawcap_handle_t *const pHandle, brawcap_timestamp_capabilities_t *const pCapabilities)
 Reads out the available receive timestamp modes for the specified handle.
 
brawcap_status_t brawcap_rx_timestamp_mode_get (brawcap_handle_t *const pHandle, brawcap_timestamp_mode_t *const pMode)
 Reads out the currently configured receive time stamping mode for the specified handle.
 
brawcap_status_t brawcap_rx_timestamp_mode_set (brawcap_handle_t *const pHandle, const brawcap_timestamp_mode_t mode)
 Configures the used receive time stamping mode for the specified handle.
 
brawcap_status_t brawcap_rx_vlan_tagging_set (brawcap_handle_t *const pHandle, const BOOLEAN enable)
 Sets the current VLAN tagging flag for the specified handle.
 
brawcap_status_t brawcap_rx_vlan_tagging_get (brawcap_handle_t *const pHandle, BOOLEAN *const pEnabled)
 Reads out the configured VLAN tagging state for the specified handle.
 
brawcap_status_t brawcap_rx_driver_queue_size_set (brawcap_handle_t *const pHandle, const brawcap_queue_size_t size)
 Sets the driver queue size (in number of packets) for the specified handle.
 
brawcap_status_t brawcap_rx_driver_queue_size_get (brawcap_handle_t *const pHandle, brawcap_queue_size_t *const pSize)
 Reads out the currently configured driver receive queue size for the specified handle.
 
brawcap_status_t brawcap_tx_packet (brawcap_handle_t *const pHandle, brawcap_packet_t *const pPacket)
 Transmits a single packet on the specified handle.
 
brawcap_status_t brawcap_tx_start (brawcap_handle_t *const pHandle, brawcap_tx_callback_t const callback, void *pUser)
 Starts the internal transmit loop.
 
brawcap_status_t brawcap_tx_stop (brawcap_handle_t *const pHandle)
 Stops the internal transmit loop.
 
brawcap_status_t brawcap_tx_buffer_send (brawcap_handle_t *const pHandle, brawcap_buffer_t *const pBuffer, const BOOLEAN synchronized)
 Pushes the specified buffer to the specified handle transmit queue.
 
brawcap_status_t brawcap_tx_driver_queue_size_set (brawcap_handle_t *const pHandle, const brawcap_queue_size_t size)
 Sets the driver queue size (in number of packets) for the specified handle.
 
brawcap_status_t brawcap_tx_driver_queue_size_get (brawcap_handle_t *const pHandle, brawcap_queue_size_t *const pSize)
 Reads out the currently configured driver transmit queue size for the specified handle.
 
brawcap_status_t brawcap_tx_timestamp_capabilities (brawcap_handle_t *const pHandle, brawcap_timestamp_capabilities_t *const pCapabilities)
 Reads out the available transmit timestamp modes for the specified handle.
 
brawcap_status_t brawcap_tx_timestamp_mode_set (brawcap_handle_t *const pHandle, const brawcap_timestamp_mode_t mode)
 Configures the used transmit time stamping mode for the specified handle.
 
brawcap_status_t brawcap_tx_timestamp_mode_get (brawcap_handle_t *const pHandle, brawcap_timestamp_mode_t *const pMode)
 Reads out the currently configured transmit time stamping mode for the specified handle.
 
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

bRAWcap API - Functions.

This file contains generic parts of the API and includes all specific bRAWcap parts.

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.