2024-08-07 11:25:26 +00:00
|
|
|
#ifndef PARAMS_H
|
|
|
|
#define PARAMS_H
|
|
|
|
|
2024-07-29 19:14:57 +00:00
|
|
|
#include <stdint.h>
|
2023-06-12 04:00:33 +00:00
|
|
|
#include <stdio.h>
|
2024-07-29 19:14:57 +00:00
|
|
|
|
2024-05-02 16:36:29 +00:00
|
|
|
#include "mpool.h"
|
2024-02-18 20:20:52 +00:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#include <ws2tcpip.h>
|
|
|
|
#else
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#endif
|
2023-06-12 04:00:33 +00:00
|
|
|
|
2024-03-17 23:23:10 +00:00
|
|
|
#if defined(__linux__) || defined(_WIN32)
|
|
|
|
#define FAKE_SUPPORT 1
|
|
|
|
#define TIMEOUT_SUPPORT 1
|
|
|
|
#endif
|
|
|
|
|
2024-03-05 20:22:12 +00:00
|
|
|
#define OFFSET_SNI 1
|
|
|
|
#define OFFSET_HOST 2
|
|
|
|
|
2024-04-03 19:51:02 +00:00
|
|
|
#define DETECT_HTTP_LOCAT 1
|
|
|
|
#define DETECT_HTTP_CLERR 2
|
|
|
|
#define DETECT_TLS_INVSID 4
|
|
|
|
#define DETECT_TLS_ALERT 8
|
2024-04-04 01:19:40 +00:00
|
|
|
#define DETECT_TORST 16
|
2024-04-03 19:51:02 +00:00
|
|
|
|
2023-06-03 19:52:10 +00:00
|
|
|
enum demode {
|
|
|
|
DESYNC_NONE,
|
|
|
|
DESYNC_SPLIT,
|
|
|
|
DESYNC_DISORDER,
|
2024-02-29 17:07:59 +00:00
|
|
|
DESYNC_OOB,
|
2023-06-03 19:52:10 +00:00
|
|
|
DESYNC_FAKE
|
|
|
|
};
|
|
|
|
|
2024-03-21 18:44:17 +00:00
|
|
|
#ifdef STR_MODE
|
|
|
|
char *demode_str[] = {
|
|
|
|
"DESYNC_NONE",
|
|
|
|
"DESYNC_SPLIT",
|
|
|
|
"DESYNC_DISORDER",
|
|
|
|
"DESYNC_OOB",
|
|
|
|
"DESYNC_FAKE"
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2024-03-04 01:49:08 +00:00
|
|
|
struct part {
|
|
|
|
int m;
|
2024-03-05 20:22:12 +00:00
|
|
|
int flag;
|
2024-03-04 01:49:08 +00:00
|
|
|
long pos;
|
|
|
|
};
|
|
|
|
|
2024-04-23 05:47:27 +00:00
|
|
|
struct packet {
|
|
|
|
ssize_t size;
|
|
|
|
char *data;
|
|
|
|
};
|
|
|
|
|
2024-03-08 00:37:02 +00:00
|
|
|
struct desync_params {
|
2023-06-03 19:52:10 +00:00
|
|
|
int ttl;
|
2024-03-20 22:01:36 +00:00
|
|
|
char *ip_options;
|
|
|
|
ssize_t ip_options_len;
|
2024-03-26 14:15:34 +00:00
|
|
|
char md5sig;
|
2024-04-23 05:47:27 +00:00
|
|
|
struct packet fake_data;
|
2024-07-29 09:26:42 +00:00
|
|
|
int udp_fake_count;
|
2024-04-23 05:47:27 +00:00
|
|
|
|
2024-03-05 20:22:12 +00:00
|
|
|
int parts_n;
|
2024-03-04 01:49:08 +00:00
|
|
|
struct part *parts;
|
2024-04-23 05:47:27 +00:00
|
|
|
|
2023-06-03 19:52:10 +00:00
|
|
|
int mod_http;
|
2024-03-05 20:22:12 +00:00
|
|
|
int tlsrec_n;
|
2024-03-04 12:30:23 +00:00
|
|
|
struct part *tlsrec;
|
2024-04-23 05:47:27 +00:00
|
|
|
|
|
|
|
int proto;
|
2024-04-03 19:51:02 +00:00
|
|
|
int detect;
|
2024-04-16 17:55:41 +00:00
|
|
|
struct mphdr *hosts;
|
2024-07-29 13:08:35 +00:00
|
|
|
uint16_t pf[2];
|
2024-04-16 17:55:41 +00:00
|
|
|
|
2024-04-27 23:50:46 +00:00
|
|
|
char *file_ptr;
|
|
|
|
ssize_t file_size;
|
2024-03-08 00:37:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct params {
|
|
|
|
int dp_count;
|
|
|
|
struct desync_params *dp;
|
|
|
|
long sfdelay;
|
2024-03-20 22:01:36 +00:00
|
|
|
char wait_send;
|
2024-03-08 00:37:02 +00:00
|
|
|
int def_ttl;
|
|
|
|
char custom_ttl;
|
2023-06-03 19:52:10 +00:00
|
|
|
|
2024-03-19 23:23:56 +00:00
|
|
|
char tfo;
|
2024-03-13 19:18:16 +00:00
|
|
|
unsigned int timeout;
|
2024-03-08 18:33:25 +00:00
|
|
|
long cache_ttl;
|
2023-06-03 19:52:10 +00:00
|
|
|
char ipv6;
|
|
|
|
char resolve;
|
2024-04-23 05:47:27 +00:00
|
|
|
char udp;
|
2023-06-03 19:52:10 +00:00
|
|
|
int max_open;
|
|
|
|
int debug;
|
|
|
|
size_t bfsize;
|
2023-10-08 11:43:34 +00:00
|
|
|
struct sockaddr_in6 baddr;
|
2024-04-25 22:15:02 +00:00
|
|
|
struct sockaddr_in6 laddr;
|
2024-03-08 00:37:02 +00:00
|
|
|
struct mphdr *mempool;
|
2024-04-27 23:50:46 +00:00
|
|
|
|
|
|
|
char *protect_path;
|
2023-06-03 19:52:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct params params;
|
|
|
|
|
|
|
|
extern struct packet fake_tls;
|
|
|
|
extern struct packet fake_http;
|
2024-02-29 17:07:59 +00:00
|
|
|
extern struct packet oob_data;
|
2024-07-29 09:26:42 +00:00
|
|
|
extern struct packet fake_udp;
|
2024-03-16 21:19:14 +00:00
|
|
|
|
2024-08-07 11:25:26 +00:00
|
|
|
extern char ip_option[1];
|
|
|
|
|
|
|
|
#endif
|