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