forked from dosgo/ngrok-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathngrok.h
42 lines (32 loc) · 1.65 KB
/
ngrok.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef __NGROK_H__
#define __NGROK_H__
#include "config.h"
#include <string>
#include <map>
#include "sendmsg.h"
#include "nonblocking.h"
#include "cJSON.h"
#if OPENSSL
typedef SSL ssl_context;
#include "openssl/ssl.h"
#else
#if ISMBEDTLS
#include <mbedtls/ssl.h>
typedef mbedtls_ssl_context ssl_context;
#else
#include "polarssl/ssl.h"
#endif // ISMBEDTLS
#endif
int ControlUdp(int port);
int UdpCmd(int udpsocket);
int ReqProxy(struct sockaddr_in server_addr,map<int,sockinfo*>*socklist);
int NewTunnel(cJSON *json,list<TunnelInfo*>*tunnellist,map<string,TunnelReq*> *tunneladdr);
int InitTunnelList(list<TunnelInfo*>*tunnellist,map<string,TunnelReq*>*tunneladdr);
int SetLocalAddrInfo(char *url,char *ReqId,int istunnel,list<TunnelInfo*>*tunnellist,map<string,TunnelReq*> *tunneladdr);
int RemoteSslInit(map<int, sockinfo*>::iterator *it1,sockinfo *tempinfo,string &ClientId,map<int,sockinfo*>*socklist);
int LocalToRemote(map<int, sockinfo*>::iterator *it1,sockinfo *tempinfo1,ssl_info *sslinfo1,map<int,sockinfo*>*socklist);
int RemoteToLocal(ssl_info *sslinfo1,sockinfo *tempinfo1,map<int, sockinfo*>::iterator *it1,map<int,sockinfo*>*socklist);
int ConnectLocal(ssl_info *sslinfo1,map<int, sockinfo*>::iterator *it1,sockinfo *tempinfo1,map<int,sockinfo*>*socklist,map<string,TunnelReq*> *tunneladdr);
int CmdSock(int *mainsock,sockinfo *tempinfo,map<int,sockinfo*>*socklist,struct sockaddr_in server_addr,string *ClientId,char * authtoken,list<TunnelInfo*>*tunnellist,map<string,TunnelReq*> *tunneladdr);
int ConnectMain(int *mainsock,struct sockaddr_in server_addr,ssl_info **mainsslinfo,string *ClientId,map<int,sockinfo*>*socklist,char *authtoken,char *password);
#endif