The declarations in this header file correspond to the definitions in endpoint_manager.c.
More...
Go to the source code of this file.
|
typedef struct EndpointManagerGlobalState * | EndpointManagerGlobalHandle |
| Type used as the handle (pointer to an opaque structure) for Endpoint Manager global data.
|
|
typedef struct EndpointManagerState * | EndpointManagerHandle |
| Type used as the handle (pointer to an opaque structure) for a Endpoint Manager. Each handle represents a instance of a Endpoint Manager associated with a connection.
|
|
typedef struct CdiConnectionState | CdiConnectionState |
| Forward reference of structure to create pointers later.
|
|
typedef struct AdapterEndpointState | AdapterEndpointState |
| Forward reference of structure to create pointers later.
|
|
|
CdiReturnStatus | EndpointManagerCreate (CdiConnectionHandle handle, CdiCoreStatsCallback stats_cb_ptr, CdiUserCbParameter stats_user_cb_param, const CdiStatsConfigData *stats_config_ptr, EndpointManagerHandle *ret_handle_ptr) |
|
void | EndpointManagerDestroy (EndpointManagerHandle handle) |
|
EndpointManagerHandle | EndpointManagerConnectionToEndpointManager (CdiConnectionHandle handle) |
|
void | EndpointManagerRemoteEndpointInfoSet (CdiEndpointHandle handle, const struct sockaddr_in *remote_address_ptr, const char *stream_name_str) |
|
const char * | EndpointManagerEndpointStreamNameGet (CdiEndpointHandle handle) |
|
const char * | EndpointManagerEndpointRemoteIpGet (CdiEndpointHandle handle) |
|
int | EndpointManagerEndpointRemotePortGet (CdiEndpointHandle handle) |
|
const struct sockaddr_in * | EndpointManagerEndpointRemoteAddressGet (CdiEndpointHandle handle) |
|
CdiReturnStatus | EndpointManagerTxCreateEndpoint (EndpointManagerHandle handle, bool is_multi_stream, const char *dest_ip_addr_str, int dest_port, const char *stream_name_str, CdiEndpointHandle *ret_endpoint_handle_ptr) |
|
CdiReturnStatus | EndpointManagerRxCreateEndpoint (EndpointManagerHandle handle, int dest_port, const struct sockaddr_in *source_address_ptr, const char *stream_name_str, CdiEndpointHandle *ret_endpoint_handle_ptr) |
|
CdiReturnStatus | EndpointManagerProtocolVersionSet (CdiEndpointHandle handle, const CdiProtocolVersionNumber *remote_version_ptr) |
| Set the protocol version for the specified endpoint. The protocol version actually used is negotiated using the specified remote version and the current version of the CDI-SDK.
|
|
bool | EndpointManagerIsEndpoint (EndpointManagerHandle handle, CdiEndpointHandle endpoint_handle) |
|
CdiEndpointHandle | EndpointManagerGetFirstEndpoint (EndpointManagerHandle handle) |
|
CdiEndpointHandle | EndpointManagerGetNextEndpoint (CdiEndpointHandle handle) |
|
int | EndpointManagerEndpointGetCount (EndpointManagerHandle handle) |
|
AdapterEndpointHandle | EndpointManagerEndpointToAdapterEndpoint (CdiEndpointHandle handle) |
|
CdiSignalType | EndpointManagerThreadRegister (EndpointManagerHandle handle, const char *thread_name_str) |
|
void | EndpointManagerThreadWait (EndpointManagerHandle handle) |
|
bool | EndpointManagerPoll (CdiEndpointHandle *handle_ptr) |
|
bool | EndpointManagerPollThreadExit (EndpointManagerHandle handle) |
|
CdiSignalType | EndpointManagerGetNotificationSignal (EndpointManagerHandle handle) |
|
void | EndpointManagerQueueEndpointReset (CdiEndpointHandle handle) |
|
void | EndpointManagerQueueEndpointStart (CdiEndpointHandle handle) |
|
void | EndpointManagerEndpointDestroy (CdiEndpointHandle handle) |
|
void | EndpointManagerShutdownConnection (EndpointManagerHandle handle) |
|
bool | EndpointManagerIsConnectionShuttingDown (EndpointManagerHandle handle) |
|
void | EndpointManagerConnectionStateChange (CdiEndpointHandle handle, CdiConnectionStatus status_code, const char *error_msg_str) |
|
The declarations in this header file correspond to the definitions in endpoint_manager.c.
◆ EndpointManagerCommand
This enumeration is used in the EndpointManagerState structure to indicate what type of endpoint command to process.
Enumerator |
---|
kEndpointStateIdle | Endpoint Manager is idle. Nothing special to do.
|
kEndpointStateReset | Reset the endpoint.
|
kEndpointStateStart | Start the endpoint.
|
kEndpointStateShutdown | Shutdown the endpoint.
|
◆ EndpointManagerConnectionStateChange()
Notify the application of a connection state change using the user registered connection callback function, if the state has actually changed.
NOTE: This function is called from ProbeControlThread().
- Parameters
-
handle | Handle of endpoint. |
status_code | Connection status code (connected or disconnected). |
error_msg_str | Pointer to optional error message string to provide to the user registered callback function. |
◆ EndpointManagerConnectionToEndpointManager()
Return the Endpoint Manager associated with the specified connection.
- Parameters
-
handle | Handle of the connection. |
- Returns
- Endpoint Manager handle.
◆ EndpointManagerCreate()
Create an instance of the Endpoint Manager for the specified connection.
- Parameters
-
handle | Handle of connection. |
stats_cb_ptr | Address of stats callback function. |
stats_user_cb_param | User-defined parameter in structure passed to stats_cb_ptr. |
stats_config_ptr | Pointer to statistics configuration data. |
ret_handle_ptr | Address where to write returned Endpoint Manager handle. |
- Returns
- kCdiStatusOk if the operation was successful or a value that indicates the nature of the failure.
◆ EndpointManagerDestroy()
Destroys the resources used by the instance of the specified Endpoint Manager.
- Parameters
-
handle | Handle of Endpoint Manager. |
◆ EndpointManagerEndpointDestroy()
Destroy the specified endpoint. Thread will block until the endpoint is destroyed by EndpointManagerPoll().
- Parameters
-
handle | Handle of CDI endpoint. |
◆ EndpointManagerEndpointGetCount()
Return the number of endpoints associated with the specified Endpoint Manager.
- Parameters
-
handle | Handle of Endpoint Manager. |
- Returns
- Number of endpoints.
◆ EndpointManagerEndpointRemoteAddressGet()
const struct sockaddr_in * EndpointManagerEndpointRemoteAddressGet |
( |
CdiEndpointHandle | handle | ) |
|
Get the remote address structure (sockaddr_in) related to the provided endpoint.
- Parameters
-
handle | Handle of endpoint. |
- Returns
- Pointer to remote address structure.
◆ EndpointManagerEndpointRemoteIpGet()
Get the remote IP address related to the provided endpoint.
- Parameters
-
handle | Handle of endpoint. |
- Returns
- Pointer to IP address string.
◆ EndpointManagerEndpointRemotePortGet()
Get the remote port related to the provided endpoint.
- Parameters
-
handle | Handle of endpoint. |
- Returns
- Remote port as integer value.
◆ EndpointManagerEndpointStreamNameGet()
Get the stream name related to the provided endpoint. If the stream name empty, then NULL is returned.
- Parameters
-
handle | Handle of endpoint. |
- Returns
- Pointer to stream name or NULL if empty.
◆ EndpointManagerEndpointToAdapterEndpoint()
Return the adapter endpoint related to the specified CDI endpoint.
- Parameters
-
handle | Handle of CDI endpoint. |
- Returns
- Handle of adapter endpoint.
◆ EndpointManagerGetFirstEndpoint()
Returns the first endpoint in the list of endpoints associated with the specified Endpoint Manager.
- Parameters
-
handle | Handle of CDI Endpoint Manager. |
- Returns
- Handle of first endpoint in the list. Returns NULL if the list is empty.
◆ EndpointManagerGetNextEndpoint()
Returns the next endpoint in the list of endpoints associated with the specified CDI endpoint.
- Parameters
-
handle | Handle of CDI endpoint. |
- Returns
- Handle of next endpoint in the list. Returns NULL if no more endpoints.
◆ EndpointManagerGetNotificationSignal()
Return the signal that is used to notify registered threads that they must call EndpointManagerThreadWait() so a queued state change can be processed.
- Parameters
-
handle | Handle of endpoint. |
- Returns
- Returns the notification signal.
◆ EndpointManagerIsConnectionShuttingDown()
Return true if the connection is in the process of being shutdown.
- Parameters
-
handle | Handle of Endpoint Manager. |
- Returns
- Returns true if the connection is in the process of being shutdown, otherwise false is returned.
◆ EndpointManagerIsEndpoint()
Returns true if the specified endpoint exists within the specified Endpoint Manager.
- Parameters
-
handle | Handle of CDI Endpoint Manager. |
endpoint_handle | Handle of CDI endpoint. |
- Returns
- Handle of first endpoint in the list. Returns NULL if the list is empty.
◆ EndpointManagerPoll()
Perform Endpoint Manager polling and determine if adapter level poll APIs should be used or not.
- Parameters
-
handle_ptr | On entry, Address to handle of endpoint. On exit, handle of next endpoint is written to to address. |
- Returns
- true if poll thread should invoke adapter poll APIs, false if it should not.
◆ EndpointManagerPollThreadExit()
Called by poll thread when it is about to exit. Must continue to call this as part of the polling cycle until true is returned.
- Parameters
-
handle | Handle of Endpoint Manager. |
- Returns
- true if ok to exit.
◆ EndpointManagerProtocolVersionSet()
Set the protocol version for the specified endpoint. The protocol version actually used is negotiated using the specified remote version and the current version of the CDI-SDK.
- Parameters
-
handle | Handle of CDI endpoint. |
remote_version_ptr | Pointer to remote protocol version data. |
- Returns
- kCdiStatusOk if the operation was successful or a value that indicates the nature of the failure.
◆ EndpointManagerQueueEndpointReset()
Queue a request to reset the endpoint associated with the specified Endpoint Manager.
- Parameters
-
handle | Handle of endpoint. |
◆ EndpointManagerQueueEndpointStart()
Queue a request to start the endpoint associated with the specified Endpoint Manager.
- Parameters
-
handle | Handle of endpoint. |
◆ EndpointManagerRemoteEndpointInfoSet()
void EndpointManagerRemoteEndpointInfoSet |
( |
CdiEndpointHandle | handle, |
|
|
const struct sockaddr_in * | remote_address_ptr, |
|
|
const char * | stream_name_str ) |
Copy the specified information about the remote endpoint to the internal state data of the provided endpoint.
- Parameters
-
handle | Handle of endpoint. |
remote_address_ptr | Pointer to remote address (sockaddr_in) |
stream_name_str | Pointer to endpoint stream name. If the stream name is NULL, then a '\0' will be stored. |
◆ EndpointManagerRxCreateEndpoint()
Create resources used for a new Rx endpoint and add it to the list of endpoints managed by the specified Endpoint Manager.
- Parameters
-
handle | Handle of Endpoint Manager. |
dest_port | Destination port. |
source_address_ptr | Pointer to source address (from the sender). |
stream_name_str | Pointer to stream name string. |
ret_endpoint_handle_ptr | Address where to write the handle of the new endpoint. |
- Returns
- kCdiStatusOk if the operation was successful or a value that indicates the nature of the failure.
◆ EndpointManagerShutdownConnection()
◆ EndpointManagerThreadRegister()
Register a thread with the specified Endpoint Manager. This should be called once, at the start of each thread that uses resources associated with the connection. The Endpoint Manager keeps track of how many times this function is used (how many threads). When the Endpoint Manager receives a request via one of the Queue API functions, it will wait until the number of threads have called EndpointManagerThreadWait() and are blocked. Then, it can carry out the request and unblock the waiting threads after the request has completed.
- Parameters
-
handle | Handle of Endpoint Manager. |
thread_name_str | Name of thread. |
- Returns
- Returns the notification signal. Same value returned from EndpointManagerGetNotificationSignal().
◆ EndpointManagerThreadWait()
For all threads that have used EndpointManagerThreadRegister(), each must call this function whenever the signal obtained using EndpointManagerGetNotificationSignal() is set (it is set whenever one of the Queue API functions are used). This will block the thread until all registered threads have called this function. The threads are blocked until the pending state change request has completed.
- Parameters
-
handle | Handle of Endpoint Manager. |
◆ EndpointManagerTxCreateEndpoint()
Create resources used for a new Tx endpoint and add it to the list of endpoints managed by the specified Endpoint Manager.
- Parameters
-
handle | Handle of Endpoint Manager. |
is_multi_stream | True if the Tx endpoint is going to be used by multiple Tx streams. |
dest_ip_addr_str | Pointer to destination IP address string. |
dest_port | Destination port. |
stream_name_str | Pointer to stream name string. |
ret_endpoint_handle_ptr | Address where to write the handle of the new endpoint. |
- Returns
- kCdiStatusOk if the operation was successful or a value that indicates the nature of the failure.