forked from yaosj2k/dnsforwarder
-
Notifications
You must be signed in to change notification settings - Fork 11
/
tcpm.h
executable file
·48 lines (36 loc) · 1.1 KB
/
tcpm.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
#ifndef TCPM_C_INCLUDED
#define TCPM_C_INCLUDED
#include "mcontext.h"
#include "addresslist.h"
#include "socketpuller.h"
typedef struct _TcpM TcpM;
struct _TcpM {
/* private */
SOCKET Incoming;
Address_Type IncomingAddr;
SocketPuller Puller;
ModuleContext Context;
ThreadHandle WorkThread;
int IsServer;
const char *ServiceName;
AddressList ServiceList;
struct sockaddr **Services;
sa_family_t *ServiceFamilies;
SocketPuller QueryPuller;
SocketPuller **Agents;
const char *ProxyName;
AddressList SocksProxyList;
struct sockaddr **SocksProxies;
sa_family_t *SocksProxyFamilies;
SocketPuller ProxyPuller;
SocketPuller **Proxies;
/* TCP 3-way handshake is heavier. Connect all, and then choose. */
BOOL Parallel;
/* public */
int (*Send)(TcpM *m,
const char *Buffer,
int BufferLength
);
};
int TcpM_Init(TcpM *m, const char *Services, BOOL Parallel, const char *SocksProxies);
#endif /* TCPM_C_INCLUDED */