byedpi/params.h

132 lines
2.1 KiB
C
Raw Normal View History

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-09-14 23:30:23 +03:00
#include <stdbool.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>
#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-10-15 04:33:20 +03:00
#define OFFSET_END 1
#define OFFSET_MID 2
#define OFFSET_RAND 4
#define OFFSET_SNI 8
#define OFFSET_HOST 16
2024-10-20 18:50:08 +03:00
#define OFFSET_START 32
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
2024-10-20 18:50:08 +03:00
#define AUTO_NOBUFF -1
#define AUTO_NOSAVE 0
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
};
#ifdef STR_MODE
char *demode_str[] = {
"DESYNC_NONE",
"DESYNC_SPLIT",
"DESYNC_DISORDER",
"DESYNC_OOB",
2024-08-16 19:08:22 +03:00
"DESYNC_DISOOB",
"DESYNC_FAKE"
};
#endif
struct part {
int m;
int flag;
long pos;
2024-10-17 08:45:50 +03:00
int r, s;
};
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-09-14 23:30:23 +03:00
bool 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-09-14 23:30:23 +03:00
bool drop_sack;
2024-08-16 19:08:22 +03:00
char oob_char[2];
2024-04-23 08:47:27 +03:00
int parts_n;
struct part *parts;
2024-04-23 08:47:27 +03:00
2023-06-03 22:52:10 +03:00
int mod_http;
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-10-20 18:50:08 +03:00
int rounds[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-09-14 23:30:23 +03:00
bool wait_send;
2024-03-08 03:37:02 +03:00
int def_ttl;
2024-09-14 23:30:23 +03:00
bool custom_ttl;
2023-06-03 22:52:10 +03:00
2024-09-14 23:30:23 +03:00
bool tfo;
2024-03-13 22:18:16 +03:00
unsigned int timeout;
int auto_level;
2024-03-08 21:33:25 +03:00
long cache_ttl;
2024-09-14 23:30:23 +03:00
bool ipv6;
bool resolve;
bool udp;
2023-06-03 22:52:10 +03:00
int max_open;
int debug;
size_t bfsize;
struct sockaddr_in6 baddr;
struct sockaddr_in6 laddr;
2024-09-14 23:30:23 +03:00
bool transparent;
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