-
Notifications
You must be signed in to change notification settings - Fork 118
/
params.h
130 lines (108 loc) · 2.09 KB
/
params.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
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
#ifndef PARAMS_H
#define PARAMS_H
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
#include "mpool.h"
#ifdef _WIN32
#include <ws2tcpip.h>
#else
#include <arpa/inet.h>
#include <netinet/in.h>
#include <unistd.h>
#include <sys/socket.h>
#endif
#if defined(__linux__) || defined(_WIN32)
#define FAKE_SUPPORT 1
#define TIMEOUT_SUPPORT 1
#endif
#define OFFSET_END 1
#define OFFSET_MID 2
#define OFFSET_RAND 4
#define OFFSET_SNI 8
#define OFFSET_HOST 16
#define OFFSET_START 32
#define DETECT_HTTP_LOCAT 1
#define DETECT_TLS_ERR 2
#define DETECT_TORST 8
#define AUTO_NOBUFF -1
#define AUTO_NOSAVE 0
enum demode {
DESYNC_NONE,
DESYNC_SPLIT,
DESYNC_DISORDER,
DESYNC_OOB,
DESYNC_DISOOB,
DESYNC_FAKE
};
#ifdef STR_MODE
char *demode_str[] = {
"DESYNC_NONE",
"DESYNC_SPLIT",
"DESYNC_DISORDER",
"DESYNC_OOB",
"DESYNC_DISOOB",
"DESYNC_FAKE"
};
#endif
struct part {
int m;
int flag;
long pos;
int r, s;
};
struct packet {
ssize_t size;
char *data;
};
struct desync_params {
int ttl;
char *ip_options;
ssize_t ip_options_len;
bool md5sig;
struct packet fake_data;
int udp_fake_count;
int fake_offset;
bool drop_sack;
char oob_char[2];
int parts_n;
struct part *parts;
int mod_http;
int tlsrec_n;
struct part *tlsrec;
int proto;
int detect;
struct mphdr *hosts;
uint16_t pf[2];
int rounds[2];
char *file_ptr;
ssize_t file_size;
};
struct params {
int dp_count;
struct desync_params *dp;
bool wait_send;
int def_ttl;
bool custom_ttl;
bool tfo;
unsigned int timeout;
int auto_level;
long cache_ttl;
bool ipv6;
bool resolve;
bool udp;
int max_open;
int debug;
size_t bfsize;
struct sockaddr_in6 baddr;
struct sockaddr_in6 laddr;
bool transparent;
struct mphdr *mempool;
char *protect_path;
};
extern struct params params;
extern struct packet fake_tls;
extern struct packet fake_http;
extern struct packet fake_udp;
extern char ip_option[1];
#endif