byedpi/params.h

62 lines
1.1 KiB
C
Raw Normal View History

2023-06-12 07:00:33 +03:00
#include <stdio.h>
2024-02-18 23:20:52 +03:00
#ifdef _WIN32
#include <ws2tcpip.h>
#else
#include <arpa/inet.h>
#endif
#if __ANDROID_NDK__
2024-02-24 16:19:47 +03:00
#include <android/log.h>
#endif
2023-06-12 07:00:33 +03:00
2023-06-03 22:52:10 +03:00
enum demode {
DESYNC_NONE,
DESYNC_SPLIT,
DESYNC_DISORDER,
DESYNC_FAKE
};
struct params {
char de_known;
2023-06-03 22:52:10 +03:00
int ttl;
int split;
size_t sfdelay;
enum demode attack;
char split_host;
int def_ttl;
2023-10-16 15:44:24 +03:00
char custom_ttl;
2023-06-03 22:52:10 +03:00
int mod_http;
2024-02-18 17:19:11 +03:00
char tlsrec;
int tlsrec_pos;
char tlsrec_sni;
2023-06-03 22:52:10 +03:00
char ipv6;
char resolve;
int max_open;
int debug;
size_t bfsize;
struct sockaddr_in6 baddr;
2023-06-03 22:52:10 +03:00
};
extern struct params params;
struct packet {
ssize_t size;
char *data;
2023-06-03 22:52:10 +03:00
};
extern struct packet fake_tls;
extern struct packet fake_http;
#if __ANDROID_NDK__
2024-02-24 17:18:19 +03:00
#define LOG_S ANDROID_LOG_DEBUG
#define LOG_L ANDROID_LOG_VERBOSE
2024-02-24 16:19:47 +03:00
#define LOG(s, str, ...) \
2024-02-24 17:18:19 +03:00
__android_log_print(s, "proxy", str, ##__VA_ARGS__)
2024-02-24 16:19:47 +03:00
#else
#define LOG_S 1
#define LOG_L 2
#define LOG(s, str, ...) \
if (params.debug >= s) printf(str, ##__VA_ARGS__)
#endif