mirror of
https://github.com/bol-van/zapret2.git
synced 2026-03-13 22:03:09 +00:00
update docs
This commit is contained in:
@@ -1390,6 +1390,7 @@ All multi-byte numeric values are automatically converted from network byte orde
|
||||
| :------------ | :----- | :--------------------------------------------------------------- |
|
||||
| ip | table | IPv4 header |
|
||||
| ip6 | table | IPv6 header |
|
||||
| frag_off | number | IP fragment offset. present only if IP is fragmented. |
|
||||
| tcp | table | TCP header |
|
||||
| udp | table | UDP header |
|
||||
| icmp | table | ICMP header |
|
||||
@@ -2100,8 +2101,8 @@ function reconstruct_dissect(dissect[, reconstruct_opts])
|
||||
|
||||
Returns `raw_ip`. All checksums are calculated automatically. L4 checksums are intentionally corrupted if `badsum` is specified in `reconstruct_opts`.
|
||||
|
||||
Reconstructing dissects with IP fragmentation involves a specific interaction between Lua and C code.
|
||||
The Lua code must prepare a dissect of the full packet intended for fragmentation, but fill certain fields as they should appear in the fragment:
|
||||
1. if the "frag_off" field is present, tcp/udp/icmp headers are ignored, payload contains raw ip payload. Incoming fragmented packets come in this form. nfqws2 does not defragment at the IP layer. But this is very persistently done by Linux systems - in order for a fragment to come to nfqws2, you need to try hard by inserting "notrack" into prerouting or output. Dissects in this form can be reconstructed as is. But preparing them in Lua is extremely inconvenient, since you will have to go through the black magic of working with a binary representation.
|
||||
2. If the "frag_off" field is absent, fragment reconstruction is performed on the entire packet dissect involving both Lua and C code. Lua code must prepare a dissect of the full packet intended for fragmentation, but fill certain fields as they should appear in the fragment:
|
||||
|
||||
- **ipv4**: `ip.ip_len` must be calculated as it should appear in the fragment.
|
||||
The C code uses `ip.ip_len` to determine the size of the fragmented portion.
|
||||
|
||||
@@ -1530,6 +1530,7 @@ ipv6 extension headers и tcp options представляются в форме
|
||||
| :------------ | :----- | :--------------------------------------------------------------- |
|
||||
| ip | table | заголовок ipv4 |
|
||||
| ip6 | table | заголовок ipv6 |
|
||||
| frag_off | number | смещение IP фрагмента. только если присутствует IP фрагментация. |
|
||||
| tcp | table | заголовок tcp |
|
||||
| udp | table | заголовок udp |
|
||||
| icmp | table | заголовок icmp |
|
||||
@@ -2248,8 +2249,10 @@ function reconstruct_dissect(dissect[, reconstruct_opts])
|
||||
|
||||
Возвращает raw_ip. Все чексуммы считаются автоматически. L4 чексуммы портятся, если задан badsum в reconstruct_opts.
|
||||
|
||||
Реконструкция диссектов с IP фрагментацией происходит особым образом - с участием как Lua, так и C кода.
|
||||
Lua код должен подготовить диссект полного пакета, подлежащего фрагментации, но заполнить некоторые поля такими, какими они должны быть во фрагменте.
|
||||
Реконструкция диссектов с IP фрагментацией происходит особым образом. Есть 2 варианта.
|
||||
|
||||
1. Если присутствует поле "frag_off", tcp/udp/icmp хедеры игнорируются, payload содержит raw ip payload. В таком виде приходят диссекты фрагментированных IP пакетов. nfqws2 не выполняет дефрагментацию на IP уровне. Но это очень настойчиво делают Linux системы - чтобы пришел фрагмент в nfqws2 надо сильно постараться, вставив в prerouting или output "notrack". Диссекты в таком виде могут быть реконструированы как есть. Но готовить их в Lua крайне неудобно, поскольку придется проходить через черную магию работы с бинарным представлением.
|
||||
2. Если поле "frag_off" отсутствует, реконструкция фрагментов выполняется диссекта целого пакета с участием как Lua, так и C кода. Lua код должен подготовить диссект полного пакета, подлежащего фрагментации, но заполнить некоторые поля такими, какими они должны быть во фрагменте.
|
||||
|
||||
- ipv4 : ip.ip_len должен быть рассчитан таким, каким он должен быть во фрагменте.
|
||||
По ip.ip_len С код определяет размер фрагментированной части.
|
||||
|
||||
Reference in New Issue
Block a user