forked from b23r0/rsocx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTunnel.h
64 lines (44 loc) · 1.03 KB
/
Tunnel.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#include <set>
#include <map>
#include <iostream>
#include "socks/SocksParser.h"
#include "common/public.h"
#ifdef LINUX
#define INVALID_SOCKET -1
#else
#endif
typedef std::set<int> SOCKET_SET;
typedef std::map<int,int> NEXUS_MAP;
typedef struct
{
int s1;
int s2;
LPVOID lpParameter;
}TUNNEL_CONFIG,*PTUNNEL_CONFIG;
class CTunnel
{
DECLARE_SINGLETON(CTunnel)
public:
bool Begin(int ,int);
void Wait();
void Close();
private:
bool BindTunnel(int, int);
bool WaitTunnel();
static DWORD WINAPI Worker(LPVOID lpParameter);
DWORD WINAPI WorkerProc();
static DWORD WINAPI Tunnel(LPVOID lpParameter);
DWORD WINAPI TunnelProc();
static DWORD WINAPI TCPTunnel(LPVOID lpParameter);
DWORD WINAPI TCPTunnelProc(LPVOID lpParameter);
static DWORD WINAPI TCP_C2S(LPVOID );
static DWORD WINAPI TCP_S2C(LPVOID );
static DWORD WINAPI CheckMgr(LPVOID);
DWORD WINAPI CheckMgrProc(LPVOID);
public:
int m_s2;
int m_s1;
int m_sMgr;
int m_port;
};