Typedefs | |
typedef VOID(* | TcInstanceEvtLinkStatusChange )(TC_INSTANCE instance, TC_LINK_INFO linkInfo, PVOID context) |
This event callback function processes a link status change event. | |
Functions | |
TC_STATUS | TcInstanceOpenByPort (TC_PORT port, PTC_INSTANCE pInstance) |
It opens a reception/transmission instance of a port given a port handle. | |
TC_STATUS | TcInstanceOpenByName (PCHAR name, PTC_INSTANCE pInstance) |
It opens a reception/transmission instance of a port given the port unique name. | |
TC_STATUS | TcInstanceClose (TC_INSTANCE instance) |
It closes an reception/transmission instance. | |
TC_PORT | TcInstanceGetPort (TC_INSTANCE instance) |
It returns the underlying port handle of an instance. | |
TC_STATUS | TcInstanceRegisterEvtLinkStatusChange (TC_INSTANCE instance, TcInstanceEvtLinkStatusChange eventHandler, PVOID context) |
It registers an event handler that gets called whenever the link status changes. | |
TC_STATUS | TcInstanceSetFeature (TC_INSTANCE instance, ULONG feature, ULONG value) |
It sets a specific feature on the instance. | |
TC_STATUS | TcInstanceQueryFeature (TC_INSTANCE instance, ULONG feature, PULONG pValue) |
It queries a specific feature on the instance. | |
TC_STATUS | TcInstanceReceivePackets (TC_INSTANCE instance, PTC_PACKETS_BUFFER pBuffer) |
It receives packets from a specific port. | |
HANDLE | TcInstanceGetReceiveWaitHandle (TC_INSTANCE instance) |
It returns a Windows waitable handle that gets signalled when some packets are available to be received. | |
TC_STATUS | TcInstanceTransmitPackets (TC_INSTANCE instance, TC_PACKETS_BUFFER buffer) |
It transmits a packets buffer on the port described by a given instance. | |
TC_STATUS | TcInstanceQueryStatistics (TC_INSTANCE instance, PTC_STATISTICS pStatistics) |
It queries the statistics of an instance. |
typedef VOID( * TcInstanceEvtLinkStatusChange)(TC_INSTANCE instance, TC_LINK_INFO linkInfo, PVOID context) |
This event callback function processes a link status change event.
instance | Instance handle on which the event callback function was registered. | |
linkInfo | The new status of the link. | |
context | Context parameter registered when calling TcInstanceRegisterEvtLinkStatusChange. |
TC_STATUS TcInstanceOpenByPort | ( | TC_PORT | port, | |
PTC_INSTANCE | pInstance | |||
) |
It opens a reception/transmission instance of a port given a port handle.
port | port that the open instance handle will correspond to to. | |
pInstance | pointer to a caller allocated instance handle. On success it will contain an handle to the opened instance. |
Thread safety: this function is thread safe i.e. it can be called from multiple threads concurrently.
TC_STATUS TcInstanceOpenByName | ( | PCHAR | name, | |
PTC_INSTANCE | pInstance | |||
) |
It opens a reception/transmission instance of a port given the port unique name.
name | Unique name of the port to open, as returned by TcPortGetName. | |
pInstance | pointer to a caller allocated instance handle. On success it will contain an handle to the opened instance. |
Thread safety: this function is thread safe i.e. it can be called from multiple threads concurrently.
TC_STATUS TcInstanceClose | ( | TC_INSTANCE | instance | ) |
It closes an reception/transmission instance.
instance | Handle to the instance to close. |
Thread safety: this function is thread safe if called on different instance handles (TC_INSTANCE). Calling this function on the same instance from concurrent threads must be synchronized.
TC_PORT TcInstanceGetPort | ( | TC_INSTANCE | instance | ) |
It returns the underlying port handle of an instance.
instance | Instance handle |
Thread safety: this function is thread safe if called on different instance handles (TC_INSTANCE). Calling this function on the same instance from concurrent threads must be synchronized.
TC_STATUS TcInstanceRegisterEvtLinkStatusChange | ( | TC_INSTANCE | instance, | |
TcInstanceEvtLinkStatusChange | eventHandler, | |||
PVOID | context | |||
) |
It registers an event handler that gets called whenever the link status changes.
instance | Instance handle | |
eventHandler | Pointer to a function that will be invoked when the link status of the port changes. | |
context | A context parameter that gets passed unmodified to the eventHandler when the handler gets invoked. |
Thread safety: this function is thread safe if called on different instance handles (TC_INSTANCE). Calling this function on the same instance from concurrent threads must be synchronized.
TC_STATUS TcInstanceSetFeature | ( | TC_INSTANCE | instance, | |
ULONG | feature, | |||
ULONG | value | |||
) |
It sets a specific feature on the instance.
instance | Instance handle | |
feature | Identifier of the feature. A list of the available features can be found in section Features. | |
value | Value of the feature to be set. Please refer to the documentation of the specific feature you are trying to set in section Features. |
Thread safety: this function is thread safe if called on different instance handles (TC_INSTANCE). Calling this function on the same instance from concurrent threads must be synchronized.
TC_STATUS TcInstanceQueryFeature | ( | TC_INSTANCE | instance, | |
ULONG | feature, | |||
PULONG | pValue | |||
) |
It queries a specific feature on the instance.
instance | Instance handle | |
feature | Identifier of the feature. A list of the available features can be found in section Features. | |
pValue | Pointer to a 32bit integer. On success it will return the value of the feature. Please refer to the documentation in section Features to know what values can be returned by querying a specific feature. |
Thread safety: this function is thread safe if called on different instance handles (TC_INSTANCE). Calling this function on the same instance from concurrent threads must be synchronized.
TC_STATUS TcInstanceReceivePackets | ( | TC_INSTANCE | instance, | |
PTC_PACKETS_BUFFER | pBuffer | |||
) |
It receives packets from a specific port.
instance | Instance handle | |
pBuffer | Pointer to a caller allocated packets buffer handle. On success, if some packets were received, it will contain a valid packets buffer instance. Otherwise it will be set to NULL. On failure, the pointer is not touched. |
Thread safety: this function is thread safe. It's possible to call this function on the same instance from concurrent threads at the same time. Moreover, the returned packets buffers returned by this function can be destroyed (with TcPacketsBufferDestroy) on an arbitrary thread without the need of any synchronization, with the condition that the instance must not be destroyed in the meantime. Also, it's safe to call this function and TcInstanceQueryStatistics from different threads concurrently.
HANDLE TcInstanceGetReceiveWaitHandle | ( | TC_INSTANCE | instance | ) |
It returns a Windows waitable handle that gets signalled when some packets are available to be received.
instance | Instance handle |
Thread safety: this function is thread safe if called on different instance handles (TC_INSTANCE). Calling this function on the same instance from concurrent threads must be synchronized.
TC_STATUS TcInstanceTransmitPackets | ( | TC_INSTANCE | instance, | |
TC_PACKETS_BUFFER | buffer | |||
) |
It transmits a packets buffer on the port described by a given instance.
instance | Instance handle to the port that has to be used to transmit packets. | |
buffer | Handle to the packets buffer that has to be transmitted. |
Thread safety: this function is thread safe if called on different instance handles (TC_INSTANCE). Calling this function on the same instance from concurrent threads must be synchronized.
TC_STATUS TcInstanceQueryStatistics | ( | TC_INSTANCE | instance, | |
PTC_STATISTICS | pStatistics | |||
) |
It queries the statistics of an instance.
instance | Instance handle | |
pStatistics | Pointer to a caller allocated statistics handle. On success it will return a valid statistics handle. In case of success, the returned statistics handle should be released with TcStatisticsDestroy. |
Thread safety: this function is thread safe if called on different instance handles (TC_INSTANCE). Calling this function on the same instance from concurrent threads must be synchronized. Also, it's safe to call this function and TcInstanceReceivePackets from different threads concurrently.
TurboCap API documentation. Copyright (c) 2007-2008 CACE Technologies. All rights reserved.