From f256fea2d874437a42b9b440cd209d1d68eb5b86 Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 20 Oct 2026 09:16:53 +0300 Subject: [PATCH] fix inconsistances in docs and comments --- docs/manual.en.md | 12 ++++++------ docs/manual.md | 14 +++++++------- lua/zapret-antidpi.lua | 4 ++-- lua/zapret-auto.lua | 7 ++++--- lua/zapret-lib.lua | 4 ++-- nfq2/nfqws.c | 4 ++-- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/docs/manual.en.md b/docs/manual.en.md index ace8fd3..a92ceba 100644 --- a/docs/manual.en.md +++ b/docs/manual.en.md @@ -696,8 +696,8 @@ MULTI-STRATEGY: LUA PACKET PASS MODE: --payload=type[,type] ; in-profile filter: payload filter for subsequent instances within the profile - --out-range=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)] ; in-profile filter: conntrack counter range for subsequent instances within the profile - outgoing direction - --in-range=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)] ; in-profile filter: conntrack counter range for subsequent instances within the profile - incoming direction + --out-range=[][(-|<)[]] ; in-profile filter: conntrack counter range for subsequent instances within the profile - outgoing direction + --in-range=[][(-|<)[]] ; in-profile filter: conntrack counter range for subsequent instances within the profile - incoming direction LUA DESYNC ACTION: --lua-desync=[:param1=val1[:param2=val2]] ; call a LUA instance with the specified parameters during profile processing if in-profile filter conditions are met @@ -1065,7 +1065,7 @@ Names are case-sensitive. These come in three types: `--payload`, `--in-range`, and `--out-range`. Filter values remain active from the moment they are specified until the next override. - `--payload=type1[,type2][,type3]...` accepts a comma-separated list of known [payloads](#protocol-detection), "all", or "known". The default is `--payload=all`. -- `--(in-range|out-range)=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)]` sets conntrack counter ranges for inbound and outbound directions. The default is `--in-range=x`, `--out-range=a`. +- `--(in-range|out-range)=[][(-|<)[]]` sets conntrack counter ranges for inbound and outbound directions. The default is `--in-range=x`, `--out-range=a`. Ranges are specified in the following formats: `mX-mY`, `mX](-|<)[(n|a|d|s|p)] ; внутрипрофильный фильтр : диапазон счетчиков conntrack для последующих инстансов внутри профиля - исходящее направление - --in-range=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)] ; внутрипрофильный фильтр : диапазон счетчиков conntrack для последующих инстансов внутри профиля - входящее направление + --out-range=[][(-|<)[]] ; внутрипрофильный фильтр : диапазон счетчиков conntrack для последующих инстансов внутри профиля - исходящее направление + --in-range=[][(-|<)[]] ; внутрипрофильный фильтр : диапазон счетчиков conntrack для последующих инстансов внутри профиля - входящее направление LUA DESYNC ACTION: --lua-desync=[:param1=val1[:param2=val2]] ; при обработке профиля вызвать LUA инстанс с указанными параметрами, если соблюдены условия внутрипрофильных фильтров @@ -794,7 +794,7 @@ LUA DESYNC ACTION: --wf-tcp-out=[~]port1[-port2] ; WinDivert конструктор : tcp порты или диапазоны портов для перехвата по исходящему направлению. список через запятую --wf-udp-in=[~]port1[-port2] ; WinDivert конструктор : udp порты или диапазоны портов для перехвата по входящему направлению. список через запятую --wf-udp-out=[~]port1[-port2] ; WinDivert конструктор : udp порты или диапазоны портов для перехвата по исходящему направлению. список через запятую - --wf-tcp-empty=[~]port1[-port2] ; WinDivert конструктор : перехватывать пустые tcp пакеты ACK. по умолчанию - нет. + --wf-tcp-empty=[0|1] ; WinDivert конструктор : перехватывать пустые tcp пакеты ACK. по умолчанию - нет. --wf-icmp-in=type[:code] ; WinDivert конструктор : icmp type и code по входящему направлению. если code не задан - любой code. список через запятую --wf-icmp-out=type[:code] ; WinDivert конструктор : icmp type и code по исходящему направлению. если code не задан - любой code. список через запятую --wf-ipp-in=type[:code] ; WinDivert конструктор : номера raw ip протоколов по входящему направлению. список через запятую @@ -1194,7 +1194,7 @@ Lua код выполняется с ограниченными правами, Значения фильтров действуют с момента их указания до следующего переопределения. - `--payload=type1[,type2][,type3]...` принимает список известных пейлоадов через запятую, "all" или "known". [Список известных пейлоадов](#распознавание-протоколов). По умолчанию `--payload=all`. -- `--(in-range|out-range)=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)]` задает диапазоны счетчиков conntrack по входящему и исходящему направлениям. По умолчанию `--in-range=x`, `--out-range=a`. +- `--(in-range|out-range)=[][(-|<)[]]` задает диапазоны счетчиков conntrack по входящему и исходящему направлениям. По умолчанию `--in-range=x`, `--out-range=a`. Диапазоны задаются в формах : `mX-mY`, `mX . position marker list. example : "1,host,midsld+1,-10" --- arg : seqovl=N . decrease seq number of the second segment in the original order by N and fill N bytes with pattern (default - all zero). N must be less than the first split pos. +-- arg : seqovl= . decrease seq number of the second segment in the original order by N and fill N bytes with pattern (default - all zero). N is resolved marker position and must be less than the first split pos. -- arg : seqovl_pattern= . override pattern -- arg : blob= - use this data instead of reasm_data -- arg : optional - skip if blob is absent. use zero pattern if seqovl_pattern blob is absent @@ -643,7 +643,7 @@ end -- nfqws1 : "--dpi-desync=multidisorder". segment ordering is the same as in nfqws1 -- standard args : direction, payload, fooling, ip_id, rawsend, reconstruct, ipfrag -- arg : pos= . position marker list. example : "1,host,midsld+1,-10" --- arg : seqovl=N . decrease seq number of the second segment in the original order by N and fill N bytes with pattern (default - all zero). N must be less than the first split pos. +-- arg : seqovl= . decrease seq number of the second segment in the original order by N and fill N bytes with pattern (default - all zero). N is resolved marker position and must be less than the first split pos. -- arg : seqovl_pattern= . override pattern -- arg : optional - use zero pattern if seqovl_pattern blob is absent function multidisorder_legacy(ctx, desync) diff --git a/lua/zapret-auto.lua b/lua/zapret-auto.lua index c6999e2..2eb416f 100644 --- a/lua/zapret-auto.lua +++ b/lua/zapret-auto.lua @@ -301,9 +301,10 @@ end -- each orchestrated instance must have strategy=N arg, where N starts from 1 and increment without gaps -- if 'final' arg is present in an orchestrated instance it stops rotation -- arg: fails=N - failture count threshold. default is 3 --- arg: time= - if last failure happened earlier than `maxtime` seconds ago - reset failure counter. default is 60. +-- arg: time= - if last failure happened earlier than `time` seconds ago - reset failure counter. default is 60. -- arg: success_detector - success detector function name -- arg: failure_detector - failure detector function name +-- arg: key - a string - table name inside autostate table. to allow multiple orchestrator instances to use single host storage -- arg: hostkey - hostkey generator function name -- args for failure detector - see standard_failure_detector or your own detector -- args for success detector - see standard_success_detector or your own detector @@ -409,7 +410,7 @@ end function cond_tcp_has_ts(desync) return desync.dis.tcp and find_tcp_option(desync.dis.tcp.options, TCP_KIND_TS) end --- exec lua code in "code" arg and return it's result +-- exec lua code in "cond_code" arg and return it's result function cond_lua(desync) if not desync.arg.cond_code then error("cond_lua: no 'cond_code' parameter") @@ -463,7 +464,7 @@ function condition(ctx, desync) end -- execute further desync instances. -- each instance must have "cond" arg and may optionally have "cond_neg" arg. --- "cond" - condition function. "neg" - invert condition function result +-- "cond" - condition function. "cond_neg" - invert condition function result -- arg: instances - how many instances execute conditionally. all if not defined function per_instance_condition(ctx, desync) orchestrate(ctx, desync) diff --git a/lua/zapret-lib.lua b/lua/zapret-lib.lua index a25bf68..45247e4 100644 --- a/lua/zapret-lib.lua +++ b/lua/zapret-lib.lua @@ -918,7 +918,7 @@ end -- tcp_seq=N - add N to tcp.th_seq -- tcp_ack=N - add N to tcp.th_ack -- tcp_ts=N - add N to timestamp value --- tcp_md5[=hex] - add MD5 header with optional 16-byte data. all zero by default. +-- tcp_md5[=hex] - add MD5 header with optional 16-byte data. random by default. -- tcp_flags_set= - set tcp flags in comma separated list -- tcp_flags_unset= - unset tcp flags in comma separated list -- tcp_ts_up - move timestamp tcp option to the top if it's present. this allows linux not to accept badack segments without badseq. this is very strange discovery but it works. @@ -1476,7 +1476,7 @@ end -- option : ipfrag_pos_udp - udp frag position. ipv4 : starting from L4 header. ipv6: starting from fragmentable part. must be multiple of 8. default 8 -- option : ipfrag_pos_tcp - tcp frag position. ipv4 : starting from L4 header. ipv6: starting from fragmentable part. must be multiple of 8. default 32 -- option : ipfrag_pos_icmp - icmp frag position. ipv4 : starting from L4 header. ipv6: starting from fragmentable part. must be multiple of 8. default 8 --- option : ipfrag_pos - icmp frag position for other L4. ipv4 : starting from L4 header. ipv6: starting from fragmentable part. must be multiple of 8. default 32 +-- option : ipfrag_pos - frag position for other L4. ipv4 : starting from L4 header. ipv6: starting from fragmentable part. must be multiple of 8. default 32 -- option : ipfrag_next - next protocol field in ipv6 fragment extenstion header of the second fragment. same as first by default. function ipfrag2(dis, ipfrag_options) local function frag_idx(exthdr) diff --git a/nfq2/nfqws.c b/nfq2/nfqws.c index ae4bef9..ce6063d 100644 --- a/nfq2/nfqws.c +++ b/nfq2/nfqws.c @@ -1914,8 +1914,8 @@ static void exithelp(void) " --hostlist-auto-debug=\t\t\t; debug auto hostlist positives (global parameter)\n" "\nLUA PACKET PASS MODE:\n" " --payload=type[,type]\t\t\t\t\t; set payload types following LUA functions should process : %s\n" - " --out-range=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)]\t; set outgoing packet range for following LUA functions. '-' - include end pos, '<' - not include. prefix meaning : n - packet number, d - data packet number, s - relative sequence, p - data position relative sequence, b - byte count, x - never, a - always\n" - " --in-range=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)]\t; set incoming packet range for following LUA functions. '-' - include end pos, '<' - not include. prefix meaning : n - packet number, d - data packet number, s - relative sequence, p - data position relative sequence, b - byte count, x - never, a - always\n" + " --out-range=[][(-|<)[]]\t\t; set outgoing packet range for following LUA functions. '-' - include end pos, '<' - not include. mode meaning : n - packet number, d - data packet number, s - relative sequence, p - data position relative sequence, b - byte count, x - never, a - always\n" + " --in-range=[][(-|<)[]]\t\t; set incoming packet range for following LUA functions. '-' - include end pos, '<' - not include. mode meaning : n - packet number, d - data packet number, s - relative sequence, p - data position relative sequence, b - byte count, x - never, a - always\n" "\nLUA DESYNC ACTION:\n" " --lua-desync=[:param1=val1[:param2=val2]]\t; call LUA function when packet received\n", #if defined(__linux__) || defined(SO_USER_COOKIE)