ThingWorx C SDK
|
ThingWorx tunneling structure definitions and function prototypes. More...
Go to the source code of this file.
Classes | |
struct | twActiveTunnel |
Active tunnel structure definition. More... | |
Typedefs | |
typedef void(* | tunnel_cb) (char started, const char *tid, const char *thingName, const char *peerName, const char *host, int16_t port, DATETIME startTime, DATETIME endTime, uint64_t bytesSent, uint64_t bytesRcvd, const char *type, const char *msg, void *userdata) |
Signature of a callback function that is registered to be called when a tunnel state changes. More... | |
typedef twList | twActiveTunnelList |
typedef struct twActiveTunnel | twActiveTunnel |
Active tunnel structure definition. | |
Functions | |
int | twTunnelManager_Create () |
Creates the tunnel manager singleton. More... | |
int | twTunnelManager_Delete () |
Frees all memory associated with the tunnel manager singleton and all its owned substructures. More... | |
void | twTunnelManager_TaskerFunction (DATETIME now, void *params) |
Executes all functions required for proper operation of tunnels. More... | |
int | twTunnelManager_StopTunnel (char *id, char *msg) |
Shuts down a tunnel. More... | |
int | twTunnelManager_StopAllTunnels () |
Shuts down all tunnels. More... | |
int | twTunnelManager_UpdateTunnelServerInfo (char *host, uint16_t port, char *appkey) |
Updates the host, port, and appkey of the tunnels related to connecting to the server. More... | |
int | twTunnelManager_RegisterTunnelCallback (tunnel_cb cb, char *id, void *userdata) |
Registers a function to be called when a tunnel state changes. More... | |
int | twTunnelManager_UnregisterTunnelCallback (tunnel_cb cb, char *id, void *userdata) |
Unregisters a tunnel callback function that was registered via twTunnelManager_RegisterTunnelCallback(). More... | |
twActiveTunnelList * | twTunnelManager_ListActiveTunnels () |
Return a list of the currently active tunnels. More... | |
void | twTunnelManager_SetProxyInfo (char *proxyHost, uint16_t proxyPort, char *proxyUser, char *proxyPass) |
Sets the proxy information to be used when making a connection. More... | |
void | twTunnelManager_SetSelfSignedOk (char state) |
Passthru to notify the TLS library to accept self-signed certificates. More... | |
void | twTunnelManager_EnableFipsMode (char state) |
Passthru to enable FIPS mode for TLS providers that support to. More... | |
void | twTunnelManager_DisableCertValidation (char state) |
Passthru to notify the TLS library to not validate the server certificate. More... | |
void | twTunnelManager_DisableEncryption (char state) |
Passthru to notify the TLS library to disable encryption. More... | |
void | twTunnelManager_SetX509Fields (char *subject_cn, char *subject_o, char *subject_ou, char *issuer_cn, char *issuer_o, char *issuer_ou) |
Defines which fields of an X509 certificate will be validated. NULL parameteres will not be checked against the deceived certificate. More... | |
void | twTunnelManager_LoadCACert (const char *file, int type) |
Loads the local PEM or DER formatted certificate file used to validate the server. More... | |
void | twTunnelManager_LoadClientCert (char *file) |
Loads the local PEM or DER formatted certificate file used to validate the client to the server. More... | |
void | twTunnelManager_SetClientKey (const char *file, char *passphrase, int type) |
Sets the key of the client. More... | |
ThingWorx tunneling structure definitions and function prototypes.
Contains structure type definitions and function prototypes for the ThingWorx API tunneling operations.
typedef void(* tunnel_cb) (char started, const char *tid, const char *thingName, const char *peerName, const char *host, int16_t port, DATETIME startTime, DATETIME endTime, uint64_t bytesSent, uint64_t bytesRcvd, const char *type, const char *msg, void *userdata) |
Signature of a callback function that is registered to be called when a tunnel state changes.
[in] | started | #TRUE if the tunnel is started, #FALSE if the tunnel has ended. |
[in] | tid | Unique ID of the tunnel. |
[in] | thingName | The name of the thing the tunnel is targeted at. |
[in] | peerName | The name of the peer user of the tunnel. |
[in] | host | The hostname of the local connection that is tunneled to. |
[in] | port | The port number of the local connection that is tunneled to. |
[in] | startTime | The time the tunnel started (0 if it hasn't started). |
[in] | endTime | The time the tunnel ended (0 if it hasn't ended). |
[in] | bytesSent | The total number of bytes that were sent to the peer. |
[in] | bytesRcvd | The total number of bytes that were received from the peer. |
[in] | type | The type of the tunnel. |
[in] | userdata | An opaque pointer that is passed in when the callback is registered. |
int twTunnelManager_Create | ( | ) |
Creates the tunnel manager singleton.
int twTunnelManager_Delete | ( | ) |
Frees all memory associated with the tunnel manager singleton and all its owned substructures.
void twTunnelManager_DisableCertValidation | ( | char | state | ) |
Passthru to notify the TLS library to not validate the server certificate.
void twTunnelManager_DisableEncryption | ( | char | state | ) |
Passthru to notify the TLS library to disable encryption.
void twTunnelManager_EnableFipsMode | ( | char | state | ) |
Passthru to enable FIPS mode for TLS providers that support to.
twActiveTunnelList* twTunnelManager_ListActiveTunnels | ( | ) |
void twTunnelManager_LoadCACert | ( | const char * | file, |
int | type | ||
) |
Loads the local PEM or DER formatted certificate file used to validate the server.
[in] | file | The full path to the file containing the certificate. |
[in] | type | Definition is dependent on the underlying TLS library (may be set to 0 for AxTLS). |
void twTunnelManager_LoadClientCert | ( | char * | file | ) |
Loads the local PEM or DER formatted certificate file used to validate the client to the server.
[in] | file | The full path to the file containing the certificate. |
int twTunnelManager_RegisterTunnelCallback | ( | tunnel_cb | cb, |
char * | id, | ||
void * | userdata | ||
) |
Registers a function to be called when a tunnel state changes.
[in] | cb | The function to register. |
[in] | id | ID of tunnel to callback on state change ("*" or NULL signifies all tunnels). |
[in] | userdata | An opaque pointer that is passed in when the callback is registered. |
void twTunnelManager_SetClientKey | ( | const char * | file, |
char * | passphrase, | ||
int | type | ||
) |
Sets the key of the client.
[in] | file | The full path to the file containing the key. |
[in] | passphrase | The passphrase used to open the file. |
[in] | type | Definition is dependent on the underlying TLS library (may be set to 0 for AxTLS). |
void twTunnelManager_SetProxyInfo | ( | char * | proxyHost, |
uint16_t | proxyPort, | ||
char * | proxyUser, | ||
char * | proxyPass | ||
) |
Sets the proxy information to be used when making a connection.
[in] | proxyHost | The host name of the proxy. |
[in] | proxyPort | The port used by the proxy. |
[in] | proxyUser | The username to supply to the proxy (NULL if authentication is disabled). |
[in] | proxyPass | The password to supply to the proxy (NULL if authentication is disabled). |
void twTunnelManager_SetSelfSignedOk | ( | char | state | ) |
Passthru to notify the TLS library to accept self-signed certificates.
void twTunnelManager_SetX509Fields | ( | char * | subject_cn, |
char * | subject_o, | ||
char * | subject_ou, | ||
char * | issuer_cn, | ||
char * | issuer_o, | ||
char * | issuer_ou | ||
) |
Defines which fields of an X509 certificate will be validated. NULL parameteres will not be checked against the deceived certificate.
[in] | subject_cn | The common name of the subject in the certificate. |
[in] | subject_o | The organization of the subject in the certificate. |
[in] | subject_ou | The organizational unit of the subject in the certificate. |
[in] | issuer_cn | The common name of the issuer in the certificate. |
[in] | issuer_o | The organization of the issuer in the certificate. |
[in] | issuer_ou | The organizational unit of the issuer in the certificate. |
int twTunnelManager_StopAllTunnels | ( | ) |
Shuts down all tunnels.
int twTunnelManager_StopTunnel | ( | char * | id, |
char * | msg | ||
) |
Shuts down a tunnel.
[in] | id | The ID of the tunnel to shutdown. |
[in] | msg | Message to be logged. |
void twTunnelManager_TaskerFunction | ( | DATETIME | now, |
void * | params | ||
) |
Executes all functions required for proper operation of tunnels.
[in] | now | The current timestamp. |
[in] | params | Required by the tasker function signature but currently not used. |
int twTunnelManager_UnregisterTunnelCallback | ( | tunnel_cb | cb, |
char * | id, | ||
void * | userdata | ||
) |
Unregisters a tunnel callback function that was registered via twTunnelManager_RegisterTunnelCallback().
[in] | cb | Pointer to the function to be unregistered. |
[in] | id | ID of the tunnel that the callback was registered to. |
[in] | userdata | An opaque pointer that is passed in when the callback is registered. |
int twTunnelManager_UpdateTunnelServerInfo | ( | char * | host, |
uint16_t | port, | ||
char * | appkey | ||
) |
Updates the host, port, and appkey of the tunnels related to connecting to the server.
[in] | host | The new host name to use. |
[in] | port | The new port to use. |
[in] | appkey | The new appkey to use. |