byedpi/params.h

109 lines
1.7 KiB
C
Raw Permalink Normal View History

2023-06-12 04:00:33 +00:00
#include <stdio.h>
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
#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
};
#ifdef STR_MODE
char *demode_str[] = {
"DESYNC_NONE",
"DESYNC_SPLIT",
"DESYNC_DISORDER",
"DESYNC_OOB",
"DESYNC_FAKE"
};
#endif
struct part {
int m;
int flag;
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;
int parts_n;
struct part *parts;
2024-04-23 05:47:27 +00:00
2023-06-03 19:52:10 +00:00
int mod_http;
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-04-27 23:50:46 +00:00
char *file_ptr;
ssize_t file_size;
2024-04-16 17:55:41 +00:00
char to_ip;
struct sockaddr_in6 addr;
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-04-16 17:55:41 +00:00
char late_conn;
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;
struct sockaddr_in6 baddr;
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-03-16 21:19:14 +00:00
extern char ip_option[1];