-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.hpp
150 lines (113 loc) · 2.63 KB
/
main.hpp
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//
// Created by mc on 2/23/18.
//
#ifndef PRPR_MAIN_H
#define PRPR_MAIN_H
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <list>
#include <functional>
#include <algorithm>
#include <tuple>
#include <sys/socket.h> //socket
#include <sys/un.h> //sockaddr_un
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h> //close()
#include <csignal>
#include <fcntl.h>
#include <netdb.h>
#include <ev++.h>
#include <cstdlib>
#include <atomic>
#include <thread>
#include <time.h>
#include <openssl/aes.h>
#include <openssl/sha.h>
#define UCHAR unsigned char
#define CHECK(a, b, c, d) if ( (a) b ){ cout << c << endl; return d;}
#define CHECK_DO(a, b, c, d) if ( (a) b ){ cout << c << endl; d;}
#define DEBUG(a) if (false) {a}
#define MAX_BUFFER_SIZE 2048
#define READ_BUFFER_SIZE 100
#define LOWEST_CONNECTION 8
#define RESEND_PERIOD 3
#define ACK_CHANCE 50
#define DEFAULT_TIMEOUT 30
#define TOTP_INTERVAL 5
struct SOCKS_Version_Client{
UCHAR ver;
UCHAR nmethods;
UCHAR methods[255];
};
struct SOCKS_Version_Server{
UCHAR ver;
UCHAR method;
};
struct SOCKS_Request_Client{
UCHAR ver;
UCHAR cmd;
UCHAR rsv;
UCHAR atyp;
UCHAR dst[1 + 255 + 2]; //use SOCKS_Address_
};
struct SOCKS_Request_Server{
UCHAR ver;
UCHAR rep;
UCHAR rsv;
UCHAR atyp;
UCHAR bnd[1 + 255 + 2]; //use SOCKS_Address_
};
struct Packet_Meta{
uint16_t dispatcher;
uint16_t signal;
uint16_t sequence;
uint16_t size;
};
using namespace std;
class Container;
class Encryption;
class Packet;
class Proxy_Peer;
class Timeout_Listener;
class Command_Listener;
class Async_Connect;
class Async_Accept;
class Async_Read;
class Async_Write;
class Client_A;
class Client_B;
class Peer_A;
class Peer_B;
class Client_Core;
class Peer_Core;
class Socks_Core;
class Channel;
class Handshake;
#include "utility/Container.hpp"
#include "utility/Encryption.hpp"
#include "utility/Packet.hpp"
#include "utility/Proxy_Peer.hpp"
#include "connection/Async_Connect.hpp"
#include "connection/Async_Accept.hpp"
#include "connection/Async_Read.hpp"
#include "connection/Async_Write.hpp"
#include "utility/Timeout_Listener.hpp"
#include "utility/Command_Listener.hpp"
#include "utility/File_Streamer.hpp"
#include "interface/Client_A.hpp"
#include "interface/Client_B.hpp"
#include "interface/Peer_A.hpp"
#include "interface/Peer_B.hpp"
#include "program/Client_Core.hpp"
#include "program/Peer_Core.hpp"
#include "program/Socks_Core.hpp"
#include "socks5/Channel.hpp"
#include "socks5/Handshake.hpp"
#endif //PRPR_MAIN_H