9 #ifndef AIOT_TUNNEL_API_H_ 10 #define AIOT_TUNNEL_API_H_ 12 #if defined(__cplusplus) 21 #define STATE_TUNNEL_BASE (-0x1C80) 25 #define STATE_TUNNEL_INNER_ERROR (-0x1C81) 29 #define STATE_TUNNEL_CONNECT_FAILED (-0x1C82) 33 #define STATE_TUNNEL_CONNECT_REPEATED (-0x1C83) 37 #define STATE_TUNNEL_DISCONNECT_REPEATED (-0x1C84) char * host
Definition: aiot_tunnel_api.h:75
当tunnel实例连接代理通道成功, 触发此事件
Definition: aiot_tunnel_api.h:46
void aiot_tunnel_deinit(void **tunnel)
删除隧道,回收内存资源
char * path
Definition: aiot_tunnel_api.h:77
void * aiot_tunnel_init(char *tunnel_id)
初始化隧道并设置默认参数
char * token
Definition: aiot_tunnel_api.h:78
本地代理服务信息
Definition: aiot_tunnel_api.h:60
int32_t aiot_tunnel_set_event_callback(void *tunnel, aiot_tunnel_event_callback_t callback, void *userdata)
设置隧道的的事件回调,一般为隧道状态变更时调用
int32_t aiot_tunnel_connect(void *tunnel)
隧道建连
int32_t aiot_tunnel_set_connect_params(void *tunnel, const aiot_tunnel_connect_param_t *params)
设置隧道的建连参数
隧道建连需要的参数
Definition: aiot_tunnel_api.h:74
int32_t aiot_tunnel_disconnect(void *tunnel)
隧道断连
unsigned int port
服务端口号
Definition: aiot_tunnel_api.h:68
uint16_t port
Definition: aiot_tunnel_api.h:76
aiot_tunnel_event_type
tunnel内部事件类型
Definition: aiot_tunnel_api.h:42
int32_t aiot_tunnel_add_proxy_service(void *tunnel, char *proxy_type, const aiot_tunnel_proxy_params_t *params)
添加本地代理服务的session类型,如ssh、ftp等tcp服务
当tunnel实例从代理通道断开, 触发此事件
Definition: aiot_tunnel_api.h:50
void(* aiot_tunnel_event_callback_t)(void *handle, const aiot_tunnel_event_type event, void *userdata)
隧道内部事件回调函数原型, 可通过 aiot_tunnel_set_event_callback 配置
Definition: aiot_tunnel_api.h:88
char * ip
服务IP地址/host
Definition: aiot_tunnel_api.h:64
隧道认证信息已经过期,需要重新连接
Definition: aiot_tunnel_api.h:54