Compare commits

...

12 Commits

Author SHA1 Message Date
bol-van
9e84bf7a42 changes.txt: readme markdown info 2024-11-03 17:03:48 +03:00
bol-van
4559169e78 readme: remove ___ 2024-11-03 16:56:39 +03:00
bol-van
1987209613 readme: fix readme links 2024-11-03 16:53:15 +03:00
bol-van
913372a574 readme.en.md: eng=>en 2024-11-03 16:51:35 +03:00
bol-van
0ea4709726 Merge branch 'md' 2024-11-03 16:48:49 +03:00
bol-van
9eef0ca113 work on readme.md 2024-11-03 16:45:43 +03:00
bol-van
88d7fd4088 work on readme.md 2024-11-03 16:43:06 +03:00
bol-van
1144f9afdc rename doc files 2024-11-03 16:19:20 +03:00
bol-van
380d104407 rename doc files 2024-11-03 16:09:38 +03:00
bol-van
31d4eaaa14 nfqws,tpws: remove @<config_file> function from OpenBSD 2024-11-03 15:32:51 +03:00
Farit Shamardanov
b2f94b083c Review fixes README 2024-11-03 13:04:29 +03:00
Farit Shamardanov
4bdce508af User md insted of txt for readme 2024-11-03 02:44:27 +03:00
9 changed files with 1052 additions and 980 deletions

View File

@ -355,3 +355,7 @@ config: <HOSTLIST_NOAUTO> marker
binaries: remove zapret-winws. add win32. binaries: remove zapret-winws. add win32.
blockcheck, install_easy.sh: preserve user environment variables during elevation blockcheck, install_easy.sh: preserve user environment variables during elevation
blockcheck: do not require root if SKIP_PKTWS=1 blockcheck: do not require root if SKIP_PKTWS=1
v68:
readme.md : move russian version to markdown

View File

@ -1,3 +1,9 @@
# Multilanguage README
___
[![en](https://img.shields.io/badge/lang-en-red.svg)](https://github.com/bol-van/zapret/tree/master/docs/readme.en.md)
[![ru](https://img.shields.io/badge/lang-ru-green.svg)](https://github.com/bol-van/zapret/tree/master/docs/readme.md)
## What is it for ## What is it for
A stand-alone (without 3rd party servers) DPI circumvention tool. A stand-alone (without 3rd party servers) DPI circumvention tool.
@ -149,7 +155,7 @@ follows all standards. For example, we are routed to squid. Connection goes thro
## nfqws ## nfqws
This program is a packet modifier and a NFQUEUE queue handler. This program is a packet modifier and a NFQUEUE queue handler.
For BSD systems there is dvtws. Its built from the same source and has almost the same parameters (see bsd.eng.md). For BSD systems there is dvtws. Its built from the same source and has almost the same parameters (see bsd.en.md).
nfqws takes the following parameters: nfqws takes the following parameters:
``` ```
@ -302,7 +308,7 @@ Split mode is very similar to disorder but without segment reordering :
Mode `split2` disables sending of fake segments. It can be used as a faster alternative to --wsize. Mode `split2` disables sending of fake segments. It can be used as a faster alternative to --wsize.
In `disorder2` and 'split2` modes no fake packets are sent, so ttl and fooling options are not required. In `disorder2` and `split2` modes no fake packets are sent, so ttl and fooling options are not required.
`seqovl` adds to the first sent original segment (1st for split, 2nd for disorder) seqovl bytes to the beginning and decreases `seqovl` adds to the first sent original segment (1st for split, 2nd for disorder) seqovl bytes to the beginning and decreases
sequence number. sequence number.
@ -477,7 +483,7 @@ to extract the host name. But it works with auto hostlist profiles.
`--dpi-desync-cutoff` allows you to set the threshold at which it stops applying dpi-desync. `--dpi-desync-cutoff` allows you to set the threshold at which it stops applying dpi-desync.
Can be prefixed with 'n', 'd', 's' symbol the same way as `--wssize-cutoff`. Can be prefixed with 'n', 'd', 's' symbol the same way as `--wssize-cutoff`.
Useful with `--dpi-desync-any-protocol=1`. Useful with `--dpi-desync-any-protocol=1`.
If the connection falls out of the conntrack and --dpi-desync-cutoff is set, dpi desync will not be applied. If the connection falls out of the conntrack and `--dpi-desync-cutoff` is set, `dpi desync` will not be applied.
Set conntrack timeouts appropriately. Set conntrack timeouts appropriately.
@ -1274,11 +1280,11 @@ Now its possible to run `/data/local/tmp/zapret/tpws` from any app such as taske
### FreeBSD, OpenBSD, MacOS ### FreeBSD, OpenBSD, MacOS
see docs/bsd.eng.md see docs/bsd.en.md
### Windows (WSL) ### Windows (WSL)
see docs/windows.eng.md see docs/windows.en.md
### Other devices ### Other devices

File diff suppressed because it is too large Load Diff

View File

@ -552,14 +552,18 @@ static bool parse_ws_scale_factor(char *s, uint16_t *wsize, uint8_t *wscale)
#ifndef __OpenBSD__
static void cleanup_args() static void cleanup_args()
{ {
wordfree(&params.wexp); wordfree(&params.wexp);
} }
#endif
static void cleanup_params(void) static void cleanup_params(void)
{ {
#ifndef __OpenBSD__
cleanup_args(); cleanup_args();
#endif
ConntrackPoolDestroy(&params.conntrack); ConntrackPoolDestroy(&params.conntrack);
@ -851,7 +855,9 @@ static unsigned int hash_jen(const void *data,unsigned int len)
static void exithelp(void) static void exithelp(void)
{ {
printf( printf(
#ifndef __OpenBSD__
" @<config_file>|$<config_file>\t\t\t; read file for options. must be the only argument. other options are ignored.\n\n" " @<config_file>|$<config_file>\t\t\t; read file for options. must be the only argument. other options are ignored.\n\n"
#endif
" --debug=0|1|syslog|@<filename>\n" " --debug=0|1|syslog|@<filename>\n"
#ifdef __linux__ #ifdef __linux__
" --qnum=<nfqueue_number>\n" " --qnum=<nfqueue_number>\n"
@ -982,6 +988,7 @@ bool parse_tlspos(const char *s, enum tlspos *pos)
return true; return true;
} }
#ifndef __OpenBSD__
// no static to not allow optimizer to inline this func (save stack) // no static to not allow optimizer to inline this func (save stack)
void config_from_file(const char *filename) void config_from_file(const char *filename)
{ {
@ -1006,6 +1013,7 @@ void config_from_file(const char *filename)
exit_clean(1); exit_clean(1);
} }
} }
#endif
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
@ -1071,12 +1079,14 @@ int main(int argc, char **argv)
} }
#endif #endif
#ifndef __OpenBSD__
if (argc>=2 && (argv[1][0]=='@' || argv[1][0]=='$')) if (argc>=2 && (argv[1][0]=='@' || argv[1][0]=='$'))
{ {
config_from_file(argv[1]+1); config_from_file(argv[1]+1);
argv=params.wexp.we_wordv; argv=params.wexp.we_wordv;
argc=params.wexp.we_wordc; argc=params.wexp.we_wordc;
} }
#endif
const struct option long_options[] = { const struct option long_options[] = {
{"debug",optional_argument,0,0}, // optidx=0 {"debug",optional_argument,0,0}, // optidx=0
@ -1826,7 +1836,9 @@ int main(int argc, char **argv)
} }
// do not need args from file anymore // do not need args from file anymore
#ifndef __OpenBSD__
cleanup_args(); cleanup_args();
#endif
argv=NULL; argc=0; argv=NULL; argc=0;
#ifdef __linux__ #ifdef __linux__

View File

@ -14,7 +14,9 @@
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <sys/queue.h> #include <sys/queue.h>
#ifndef __OpenBSD__
#include <wordexp.h> #include <wordexp.h>
#endif
#define TLS_PARTIALS_ENABLE true #define TLS_PARTIALS_ENABLE true
@ -96,7 +98,9 @@ bool dp_list_have_autohostlist(struct desync_profile_list_head *head);
struct params_s struct params_s
{ {
#ifndef __OpenBSD__
wordexp_t wexp; // for file based config wordexp_t wexp; // for file based config
#endif
enum log_target debug_target; enum log_target debug_target;
char debug_logfile[PATH_MAX]; char debug_logfile[PATH_MAX];

View File

@ -6,7 +6,9 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/queue.h> #include <sys/queue.h>
#include <time.h> #include <time.h>
#ifndef __OpenBSD__
#include <wordexp.h> #include <wordexp.h>
#endif
#include "tpws.h" #include "tpws.h"
#include "pools.h" #include "pools.h"
@ -81,7 +83,9 @@ void dp_list_destroy(struct desync_profile_list_head *head);
struct params_s struct params_s
{ {
#ifndef __OpenBSD__
wordexp_t wexp; // for file based config wordexp_t wexp; // for file based config
#endif
int debug; int debug;
enum log_target debug_target; enum log_target debug_target;

View File

@ -122,7 +122,9 @@ static int get_default_ttl(void)
static void exithelp(void) static void exithelp(void)
{ {
printf( printf(
#ifndef __OpenBSD__
" @<config_file>|$<config_file>\t\t; read file for options. must be the only argument. other options are ignored.\n\n" " @<config_file>|$<config_file>\t\t; read file for options. must be the only argument. other options are ignored.\n\n"
#endif
" --bind-addr=<v4_addr>|<v6_addr>\t; for v6 link locals append %%interface_name\n" " --bind-addr=<v4_addr>|<v6_addr>\t; for v6 link locals append %%interface_name\n"
" --bind-iface4=<interface_name>\t\t; bind to the first ipv4 addr of interface\n" " --bind-iface4=<interface_name>\t\t; bind to the first ipv4 addr of interface\n"
" --bind-iface6=<interface_name>\t\t; bind to the first ipv6 addr of interface\n" " --bind-iface6=<interface_name>\t\t; bind to the first ipv6 addr of interface\n"
@ -215,13 +217,17 @@ static void exithelp(void)
); );
exit(1); exit(1);
} }
#ifndef __OpenBSD__
static void cleanup_args() static void cleanup_args()
{ {
wordfree(&params.wexp); wordfree(&params.wexp);
} }
#endif
static void cleanup_params(void) static void cleanup_params(void)
{ {
#ifndef __OpenBSD__
cleanup_args(); cleanup_args();
#endif
dp_list_destroy(&params.desync_profiles); dp_list_destroy(&params.desync_profiles);
@ -364,6 +370,7 @@ static bool parse_pf_list(char *opt, struct port_filters_head *pfl)
return true; return true;
} }
#ifndef __OpenBSD__
// no static to not allow optimizer to inline this func (save stack) // no static to not allow optimizer to inline this func (save stack)
void config_from_file(const char *filename) void config_from_file(const char *filename)
{ {
@ -388,6 +395,7 @@ void config_from_file(const char *filename)
exit_clean(1); exit_clean(1);
} }
} }
#endif
void parse_params(int argc, char *argv[]) void parse_params(int argc, char *argv[])
{ {
@ -427,12 +435,14 @@ void parse_params(int argc, char *argv[])
dp = &dpl->dp; dp = &dpl->dp;
dp->n = ++desync_profile_count; dp->n = ++desync_profile_count;
#ifndef __OpenBSD__
if (argc>=2 && (argv[1][0]=='@' || argv[1][0]=='$')) if (argc>=2 && (argv[1][0]=='@' || argv[1][0]=='$'))
{ {
config_from_file(argv[1]+1); config_from_file(argv[1]+1);
argv=params.wexp.we_wordv; argv=params.wexp.we_wordv;
argc=params.wexp.we_wordc; argc=params.wexp.we_wordc;
} }
#endif
const struct option long_options[] = { const struct option long_options[] = {
{ "help",no_argument,0,0 },// optidx=0 { "help",no_argument,0,0 },// optidx=0
@ -1133,8 +1143,10 @@ void parse_params(int argc, char *argv[])
IpsetsDebug(); IpsetsDebug();
VPRINT("\n"); VPRINT("\n");
#ifndef __OpenBSD__
// do not need args from file anymore // do not need args from file anymore
cleanup_args(); cleanup_args();
#endif
} }