Types and enumerations

Data Structures

struct  TC_PACKET_HEADER
 Header prepended to each packet during reception and transmission. More...
struct  TC_LINK_INFO
 Link information on a physical port. More...
struct  PTC_AUTONEG_PARAMETERS
 Structure used with TcPortQueryAutonegotiationParameters and TcPortSetAutonegotiationParameters. More...

Defines

#define TC_PH_FLAGS_CHECKSUM   0x00000001
 The packet contain the FCS at the end of the packet.
#define TC_TX_SCHEDULING_MODE_NO_SCHED   0x00
 The packet will be transmitted without any scheduling policy i.e. as soon as possible, respecting the minimum interframe gap (IFG) of the link layer. The TC_PACKET_HEADER::Timestamp field is ignored by the transmission scheduler.
#define TC_TX_SCHEDULING_MODE_HW_REF   0x01
 Reserved.
#define TC_TX_SCHEDULING_MODE_SW_REF   0x02
 Reserved.
#define TC_PH_FLAGS_TX_SCHEDULING_MODE(a)   ((a)<<24)
 Macro used to define the transmission scheduling policy for a packet.
#define TC_PH_FLAGS_RX_PORT_ID(flags)   ((UCHAR)((flags)>>24))
 Macro used to get the port ID a packet was received from.
#define TC_PH_ERROR_CHECKSUM   0x00000001
 On reception, the received packet has an invalid frame check sequence (FCS).
#define TC_PH_ERROR_SEQUENCE   0x00000002
 On reception, the received packet had a sequence error. A valid delimiter sequence consists of idle->start-of-frame(SOF)->data, ->pad(optional)->end-of-frame(EOF)-fill(optional)->idle.
#define TC_PH_ERROR_SYMBOL   0x00000004
 On reception, the received packet had a symbol error.
#define TC_PH_ERROR_DATA   0x00000008
 On reception, the received packet had a data error.
#define TC_ALIGN_USHORT_TO_64BIT(a)   ((USHORT)(((USHORT)(a) + 7) & ((USHORT)0xFFF8)))
 Macro to align a 16 bit quantity on a 64bit boundary. Used when processing the packets contained in a packets buffer when TcPacketsBufferGetBuffer is used.

Typedefs

typedef TC_PACKET_HEADERPTC_PACKET_HEADER
typedef HANDLE TC_BOARD
 Handle to a physical TurboCap board on the system.
typedef TC_BOARDPTC_BOARD
typedef HANDLE TC_PORT
 Handle to a TurboCap port.
typedef TC_PORTPTC_PORT
typedef HANDLE TC_INSTANCE
 Handle to a capture/injection port instance.
typedef TC_INSTANCEPTC_INSTANCE
typedef HANDLE TC_PACKETS_BUFFER
 Handle to a buffer containing packets to be received or transmitted.
typedef TC_PACKETS_BUFFERPTC_PACKETS_BUFFER
typedef HANDLE TC_STATISTICS
 Handle to a statistics object containing counters related to a port or an instance.
typedef TC_STATISTICSPTC_STATISTICS
typedef TC_LINK_INFOPTC_LINK_INFO
typedef ULONG TC_STATUS

Enumerations

enum  TC_PORT_TYPE {
  TC_PORT_TYPE_UNKNOWN = 0,
  TC_PORT_TYPE_PHYSICAL = 1,
  TC_PORT_TYPE_BAP = 2,
  TC_PORT_TYPE_TCAP = 3
}
 

A list of the port types supported by the TurboCap library.

More...
enum  TC_BOARD_TYPE {
  TC_BOARD_TYPE_UNKNOWN = 0,
  TC_BOARD_TYPE_9402PT = 1
}
 

A list of the board types supported by the TurboCap2 library.

More...
enum  TC_LINK_DUPLEX_TYPE {
  TC_UNKNOWN_DUPLEX = 0,
  TC_FULL_DUPLEX = 1,
  TC_HALF_DUPLEX = 2
}
 

Duplex setting of a port when the link is up.

More...
enum  TC_SPEED_CONFIGURATION {
  TC_SPEED_CONF_10MB_FD = 0x00000001,
  TC_SPEED_CONF_10MB_HD = 0x00000002,
  TC_SPEED_CONF_100MB_FD = 0x00000004,
  TC_SPEED_CONF_100MB_HD = 0x00000008,
  TC_SPEED_CONF_1000MB_FD = 0x00000010,
  TC_SPEED_CONF_ALL = 0x0000001F
}
 

Available link speeds that can be configured for the autonegotiation or to force the link speed when autonegotation is disabled. Used in conjunction with TC_AUTONEG_PARAMETERS.

More...

Functions

 C_ASSERT (sizeof(TC_AUTONEG_PARAMETERS)==12)

Define Documentation

#define TC_PH_FLAGS_CHECKSUM   0x00000001

The packet contain the FCS at the end of the packet.

#define TC_TX_SCHEDULING_MODE_NO_SCHED   0x00

The packet will be transmitted without any scheduling policy i.e. as soon as possible, respecting the minimum interframe gap (IFG) of the link layer. The TC_PACKET_HEADER::Timestamp field is ignored by the transmission scheduler.

#define TC_TX_SCHEDULING_MODE_HW_REF   0x01

Reserved.

#define TC_TX_SCHEDULING_MODE_SW_REF   0x02

Reserved.

#define TC_PH_FLAGS_TX_SCHEDULING_MODE (  )     ((a)<<24)

Macro used to define the transmission scheduling policy for a packet.

The result of this macro should be OR combined with the TC_PACKET_HEADER::Flags field.

Parameters:
a One of these values

#define TC_PH_FLAGS_RX_PORT_ID ( flags   )     ((UCHAR)((flags)>>24))

Macro used to get the port ID a packet was received from.

The macro should be applied to the TC_PACKET_HEADER::Flags field. The result is an 8bit index in the array of physical ports returned by TcPortQueryAggregatedPortList. In case the packet was captured on a physical port, the port Id is always 0.

#define TC_PH_ERROR_CHECKSUM   0x00000001

On reception, the received packet has an invalid frame check sequence (FCS).

#define TC_PH_ERROR_SEQUENCE   0x00000002

On reception, the received packet had a sequence error. A valid delimiter sequence consists of idle->start-of-frame(SOF)->data, ->pad(optional)->end-of-frame(EOF)-fill(optional)->idle.

#define TC_PH_ERROR_SYMBOL   0x00000004

On reception, the received packet had a symbol error.

#define TC_PH_ERROR_DATA   0x00000008

On reception, the received packet had a data error.

#define TC_ALIGN_USHORT_TO_64BIT (  )     ((USHORT)(((USHORT)(a) + 7) & ((USHORT)0xFFF8)))

Macro to align a 16 bit quantity on a 64bit boundary. Used when processing the packets contained in a packets buffer when TcPacketsBufferGetBuffer is used.


Typedef Documentation

typedef HANDLE TC_BOARD

Handle to a physical TurboCap board on the system.

Note:
  • It's not possible to open or close a board handle. Board handles are returned by the following methods:
  • In order to check if two board handles correspond to the same physical board on the system, you must use the function TcBoardIsEqual
typedef TC_BOARD* PTC_BOARD
typedef HANDLE TC_PORT

Handle to a TurboCap port.

A port can be a physical port on a board, or an aggregating port. There are two kinds of aggregating ports:

  • TurboCap Aggregating Port (TcAP). This port aggregates the traffic coming from all the TurboCap physical ports on the system. There is only one TcAP port per system.
  • Board Aggregating Port (BAP). This port aggregates the traffic coming from all the physical ports of a board. There is one single BAP port per board on the system.
Note:
typedef TC_PORT* PTC_PORT
typedef HANDLE TC_INSTANCE

Handle to a capture/injection port instance.

When you need to send or receive traffic on a port, you need to have a TC_INSTANCE, i.e. an open instance to a port. Multiple instances can be opened against the same port, each one with its own reception/transmission parameters.

typedef HANDLE TC_PACKETS_BUFFER

Handle to a buffer containing packets to be received or transmitted.

Packets are received in the form of buffer containing one or more packets. In the same fashion, packets that have to be transmitted should be assembled in a packets buffer and passed to the transmission functions of the library. Access to this buffer can be performed in two different ways:

  • (reception) through the provided APIs to scan the packets in the buffer or
  • (transmission) through the provided APIs to append a new packet to the buffer or
  • by retrieving the raw buffer pointer (throught the provided APIs) and manually reading/writing the packets in the buffer.

In the former case, the packets are accessed through TcPacketsBufferQueryNextPacket (reception) and TcPacketsBufferCommitNextPacket (transmission). In the latter case, the raw buffer is retrieved with TcPacketsBufferGetBuffer, its effective length (i.e. the number of bytes effectively used in the buffer) is obtained with TcPacketsBufferGetEffectiveLength (reception mode) and the maximum length with TcPacketsBufferGetLength.

Note:
In the current version of the TurboCap API, it's not possible to access the raw buffer of a packets buffer received from an aggregating instance, i.e. when capturing from a BAP or TcAP port. A call to TcPacketsBufferGetBuffer will return NULL, and TcPacketsBufferGetLength and TcPacketsBufferGetEffectiveLength will return 0.
typedef HANDLE TC_STATISTICS

Handle to a statistics object containing counters related to a port or an instance.

The underlying packet capture and transmission engine maintains a set of counters, like the number of received or transmitted packets. Two sets of counters are available.

  • Port statistics contain counters related to a physical port. Such counters are reset when the port is activated, i.e. at boot time or if the port (or the board containing it) is disabled and re-enabled.
  • Instance statistics contain counters related to a capture and transmission instance. Such counters are reset to zero when the instance is created with TcInstanceOpenByName or TcInstanceOpenByPort. You obtain a statistics object by querying the given port or instance with TcInstanceQueryStatistics or TcPortQueryStatistics. After a statistics handle is obtained, it's possible to query for the statistics of the object by calling TcStatisticsQueryValue. The counters stored in a statistics object are not updated automatically (i.e. querying for a specific value with TcStatisticsQueryValue doesn't update its value). You need to call TcStatisticsUpdate to update the counters.
typedef ULONG TC_STATUS

Enumeration Type Documentation

A list of the port types supported by the TurboCap library.

Enumerator:
TC_PORT_TYPE_UNKNOWN 

The port type is unknown.

TC_PORT_TYPE_PHYSICAL 

Physical port i.e. a port on a board.

TC_PORT_TYPE_BAP 

A Board Aggregating Port (BAP) i.e. a virtual port aggregating the traffic coming from all the ports of a board.

TC_PORT_TYPE_TCAP 

A TurboCap Aggregating Port (TCAP) i.e. a virtual port aggregating the traffic coming from all the physical ports of the system.

A list of the board types supported by the TurboCap2 library.

Enumerator:
TC_BOARD_TYPE_UNKNOWN 

The board type is unknown.

TC_BOARD_TYPE_9402PT 

The board is a Dual Port Gigabit copper card with an Intel Chipset.

Duplex setting of a port when the link is up.

Enumerator:
TC_UNKNOWN_DUPLEX 

The duplex setting is unknown.

TC_FULL_DUPLEX 

The port is in full duplex mode.

TC_HALF_DUPLEX 

The port is in half duplex mode.

Available link speeds that can be configured for the autonegotiation or to force the link speed when autonegotation is disabled. Used in conjunction with TC_AUTONEG_PARAMETERS.

Enumerator:
TC_SPEED_CONF_10MB_FD 

The port uses/must advertise a link speed of 10Mbps full duplex.

TC_SPEED_CONF_10MB_HD 

The port uses/must advertise a link speed of 10Mbps half duplex.

TC_SPEED_CONF_100MB_FD 

The port uses/must advertise a link speed of 100Mbps full duplex.

TC_SPEED_CONF_100MB_HD 

The port uses/must advertise a link speed of 100Mbps half duplex.

TC_SPEED_CONF_1000MB_FD 

The port uses/must advertise a link speed of 1Gbps full duplex.

TC_SPEED_CONF_ALL 

Function Documentation

C_ASSERT ( sizeof(TC_AUTONEG_PARAMETERS = =12  ) 

TurboCap API documentation. Copyright (c) 2007-2008 CACE Technologies. All rights reserved.