IOTC Platform  Ver: 4.3.6.2-0-ge1f616e
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
NebulaP2PTunnelAPIs.h File Reference
#include "IOTCAPIs.h"
#include "P2PTunnelAPIs.h"

Macros

#define TUNNEL_API_DEPRECATED
 

Functions

TUNNEL_API int32_t P2PTunnelServer_Start_By_Nebula (NebulaDeviceCtx *pDeviceCtx, tunnelSessionInfoExCB pfxSessionInfoExFn, const void *pArg)
 Start a tunnel server with DTLS mode by Nebula.
 
TUNNEL_API int32_t P2PTunnelAgent_Connect_By_Nebula (NebulaClientCtx *pClientCtx, const char *cszAmToken, const char *cszRealm, uint32_t nTimeoutMs)
 Connect to a tunnel server with DTLS mode by Nebula.
 
TUNNEL_API int32_t P2PTunnelAgent_Connect_By_Nebula_Ex (NebulaClientCtx *pClientCtx, const char *cszValidation, const char *cszRealm, uint32_t nTimeoutMs)
 Connect to a tunnel server with DTLS mode by Nebula.
 
TUNNEL_API int32_t P2PTunnelAgent_Connect_Stop_By_Nebula (NebulaClientCtx *pClientCtx)
 It's to stop the progressing of connection for Nebula.
 

Macro Definition Documentation

#define TUNNEL_API_DEPRECATED

Function Documentation

TUNNEL_API int32_t P2PTunnelAgent_Connect_By_Nebula ( NebulaClientCtx pClientCtx,
const char *  cszAmToken,
const char *  cszRealm,
uint32_t  nTimeoutMs 
)

Connect to a tunnel server with DTLS mode by Nebula.

This function used by a tunnel agent to connect the tunnel server with specified NebulaClientCtx

Parameters
pClientCtx[in] The pointer of NebulaClientCtx that try to connect tunnel server
cszAmToken[in] The rental token from AM server
cszRealm[in] The realm of rental server needed for device
nTimeoutMs[in] The timeout for this function in unit of millisecond, give 0 means return immediately
Returns
Tunnel Session ID if return value >= 0
TUNNEL_ER_NoERROR if connect successfully
Error code if return value < 0
TUNNEL_API int32_t P2PTunnelAgent_Connect_By_Nebula_Ex ( NebulaClientCtx pClientCtx,
const char *  cszValidation,
const char *  cszRealm,
uint32_t  nTimeoutMs 
)

Connect to a tunnel server with DTLS mode by Nebula.

This function used by a tunnel agent to connect the tunnel server with specified NebulaClientCtx

Parameters
pClientCtx[in] The pointer of NebulaClientCtx that try to connect tunnel server
cszValidation[in] The validation for authentication
cszRealm[in] The realm of rental server needed for device
nTimeoutMs[in] The timeout for this function in unit of millisecond, give 0 means return immediately
Returns
Tunnel Session ID if return value >= 0
TUNNEL_ER_NoERROR if connect successfully
Error code if return value < 0
TUNNEL_API int32_t P2PTunnelAgent_Connect_Stop_By_Nebula ( NebulaClientCtx pClientCtx)

It's to stop the progressing of connection for Nebula.

This API is for a client to stop connecting to a device. We can use it to stop connecting when client blocks in P2PTunnelAgent_Connect_By_Nebula().

Parameters
pClientCtx[in] The NebulaClientCtx of tunnel connection
Returns
0 if success
Error code if return value < 0
TUNNEL_API int32_t P2PTunnelServer_Start_By_Nebula ( NebulaDeviceCtx pDeviceCtx,
tunnelSessionInfoExCB  pfxSessionInfoExFn,
const void *  pArg 
)

Start a tunnel server with DTLS mode by Nebula.

This function will start a tunnel server with given NebulaDeviceCtx

Parameters
pDeviceCtx[in] The pointer of NebulaDeviceCtx
pfxSessionInfoExFn[in] The function pointer to get tunnel session information function. Can be NULL.
pArg[in] User can give data pointer to pass to pfxTunnelServerAuthFn and pfxSessionInfoExFn when this call back function is triggered. Can be NULL.
Returns
TUNNEL_ER_NoERROR if start successfully
Error code if return value < 0