Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-19 15:55:48 +00:00

zapret-auto: reset parameter to standard_detector

This commit is contained in:
bol-van
2025-12-23 10:27:23 +03:00
parent 347c35e588
commit a6e11540ff
2 changed files with 37 additions and 0 deletions

View File

@@ -762,6 +762,33 @@ function fix_ip6_next(ip6, last_proto)
end
end
-- reverses ip addresses, ports and seq/ack
function dis_reverse(dis)
local temp
if dis.ip then
temp = dis.ip.ip_src
dis.ip.ip_src = dis.ip.ip_dst
dis.ip.ip_dst = temp
end
if dis.ip6 then
temp = dis.ip6.ip6_src
dis.ip6.ip6_src = dis.ip6.ip6_dst
dis.ip6.ip6_dst = temp
end
if dis.tcp then
temp = dis.tcp.th_sport
dis.tcp.th_sport = dis.tcp.th_dport
dis.tcp.th_dport = temp
temp = dis.tcp.th_ack
dis.tcp.th_ack = dis.tcp.th_seq
dis.tcp.th_seq = temp
end
if dis.udp then
temp = dis.udp.uh_sport
dis.udp.uh_sport = dis.udp.uh_dport
dis.udp.uh_dport = temp
end
end
-- parse autottl : delta,min-max
function parse_autottl(s)