zapret/nfq/params.h

61 lines
1.6 KiB
C
Raw Normal View History

2021-03-04 11:30:38 +00:00
#pragma once
#include "params.h"
#include "strpool.h"
2021-03-18 14:21:25 +00:00
#include "conntrack.h"
2021-03-04 11:30:38 +00:00
#include "desync.h"
#include <sys/param.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#define Q_RCVBUF (128*1024) // in bytes
#define Q_SNDBUF (64*1024) // in bytes
#define RAW_SNDBUF (64*1024) // in bytes
#define Q_MAXLEN 1024 // in packets
#define BADSEQ_INCREMENT_DEFAULT -10000
#define BADSEQ_ACK_INCREMENT_DEFAULT -65000
2021-03-04 11:30:38 +00:00
struct params_s
{
bool debug;
2021-03-12 11:33:48 +00:00
uint16_t wsize,wssize;
uint8_t wscale,wsscale;
2021-12-27 13:51:30 +00:00
char wssize_cutoff_mode; // n - packets, d - data packets, s - relative sequence
2021-03-18 14:21:25 +00:00
unsigned int wssize_cutoff;
2021-03-04 11:30:38 +00:00
#ifdef __linux__
int qnum;
#elif defined(BSD)
uint16_t port; // divert port
#endif
bool hostcase, hostnospace, domcase;
char hostspell[4];
2021-04-07 09:13:46 +00:00
enum dpi_desync_mode desync_mode0,desync_mode,desync_mode2;
2021-03-04 11:30:38 +00:00
bool desync_retrans,desync_skip_nosni,desync_any_proto;
int desync_repeats,desync_split_pos;
2021-12-27 13:51:30 +00:00
char desync_cutoff_mode; // n - packets, d - data packets, s - relative sequence
unsigned int desync_cutoff;
2021-12-10 19:08:52 +00:00
uint8_t desync_ttl, desync_ttl6;
2021-03-04 11:30:38 +00:00
uint8_t desync_tcp_fooling_mode;
uint32_t desync_fwmark; // unused in BSD
uint32_t desync_badseq_increment, desync_badseq_ack_increment;
2021-03-04 11:30:38 +00:00
char hostfile[256];
strpool *hostlist;
2021-12-26 17:43:16 +00:00
uint8_t fake_http[1432],fake_tls[1432],fake_unknown[1432];
size_t fake_http_size,fake_tls_size,fake_unknown_size;
2021-03-04 11:30:38 +00:00
bool droproot;
uid_t uid;
gid_t gid;
2021-03-18 14:21:25 +00:00
unsigned int ctrack_t_syn, ctrack_t_est, ctrack_t_fin;
t_conntrack conntrack;
2021-03-04 11:30:38 +00:00
};
extern struct params_s params;
#define DLOG(format, ...) {if (params.debug) printf(format, ##__VA_ARGS__);}