-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.h
74 lines (52 loc) · 1.84 KB
/
constants.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
65
66
67
68
69
70
71
72
73
74
#ifndef TS_CONSTANTS_H
#define TS_CONSTANTS_H
#include <string>
#include <stdint.h>
namespace constants {
const std::string serverAddrStr = "127.0.0.1";
// const int serverListenPort = 20443;
const int serverListenPort = 443;
const std::string clientAddrStr = "127.0.0.1";
const int clientListenPort = 11080;
const int clientBindToLoopback = 0;
enum MsgType {
FirstHandShakeMsg = 1,
SecondHandShakeMsg = 2,
ThirdHandShakeMsg = 3,
DebugC2SMsg = 4,
DebugS2CMsg = 5,
SocksTcpRequestMsg = 6,
SocksTcpReplyMsg = 7,
SocksTrafficRequestMsg = 8,
SocksTrafficReplyMsg = 9
};
const int serverNonBlocking = 1;
const int clientNonBlocking = 1;
const int ConnectNeedBlock = -17;
const uint8_t SocksVersion = 0x5;
const int SocksMaxMethods = 0xff;
const int SocksDomainMaxLength = 0xff;
enum SocksRequestCmdType {
SocksConnectCmd = 0x01,
SocksBindCmd = 0x02,
SocksUdpAssoCmd = 0x03
};
const uint8_t SocksNoAuthMethod = 0x00;
const uint8_t SocksGSSAPIMethod = 0x01;
const uint8_t SocksUnamePwMethod = 0x02;
const uint8_t SocksNoSupportMethod = 0xff;
const uint8_t SocksAddrIpv4Type = 0x01;
const uint8_t SocksAddrDomainType = 0x03;
const uint8_t SocksAddrIpv6Type = 0x04;
const uint8_t TSPacketContentType = 0x17;
const uint16_t TSPacketVersion = 0x0303;
const size_t MAX_MSG_DATA_LENGTH = 65536 - 20;
const size_t PACKET_BUFFER_SIZE = 65536;
const size_t TS_PACKET_PAYLOAD_LENGTH = 65536;
const size_t AES_MAX_DATA_LENGTH = MAX_MSG_DATA_LENGTH - 32;
const time_t ClientTimeOutSeconds = 60 * 2;
const time_t SocketTimeOutSeconds = 60 * 3;
const char uuidKey[37] = "9D72C5C8-DC4B-47A6-890F-CBD6F128A82F";
int getKey(char (&dst)[16]);
};
#endif