mirror of
https://github.com/bol-van/zapret2.git
synced 2026-03-14 06:13:09 +00:00
rename seq_over_2G to rseq_over_2G
This commit is contained in:
@@ -1220,7 +1220,7 @@ track.pos содержит еще одно поле - `dt`. Время полу
|
||||
| tcp.seq0 | начальный sequence соединения | |
|
||||
| tcp.seq | sequence текущего пакета | |
|
||||
| tcp.rseq | relative sequence текущего пакета | вычисляется как seq-seq0 |
|
||||
| tcp.seq_over_2G | был переход за границу 2 GB | s и p позиции больше нельзя учитывать |
|
||||
| tcp.rseq_over_2G | был переход rseq за границу 2 GB | s и p позиции больше нельзя учитывать |
|
||||
| tcp.pos | relative sequence верхней границы текущего пакета | вычисляется как rseq+payload_size |
|
||||
| tcp.uppos | максимальный pos в соединении | |
|
||||
| tcp.uppos_prev | uppos в предыдущем пакете с данными | полезно для определения ретрансмиссий |
|
||||
|
||||
@@ -238,7 +238,7 @@ end
|
||||
function pos_counter_overflow(desync, mode, reverse)
|
||||
if not desync.track or not desync.track.tcp or (mode~='s' and mode~='p') then return false end
|
||||
local track_pos = reverse and desync.track.pos.reverse or desync.track.pos.direct
|
||||
return track_pos.tcp.seq_over_2G
|
||||
return track_pos.tcp.rseq_over_2G
|
||||
end
|
||||
-- these functions duplicate range check logic from C code
|
||||
-- mode must be n,d,b,s,x,a
|
||||
|
||||
@@ -156,10 +156,10 @@ static void ConntrackApplyPos(const struct tcphdr *tcp, t_ctrack *t, bool bRever
|
||||
if (mss && !direct->mss) direct->mss = mss;
|
||||
if (scale != SCALE_NONE) direct->scale = scale;
|
||||
|
||||
if (!direct->seq_over_2G && ((direct->seq_last - direct->seq0) & 0x80000000))
|
||||
direct->seq_over_2G = true;
|
||||
if (!reverse->seq_over_2G && ((reverse->seq_last - reverse->seq0) & 0x80000000))
|
||||
reverse->seq_over_2G = true;
|
||||
if (!direct->rseq_over_2G && ((direct->seq_last - direct->seq0) & 0x80000000))
|
||||
direct->rseq_over_2G = true;
|
||||
if (!reverse->rseq_over_2G && ((reverse->seq_last - reverse->seq0) & 0x80000000))
|
||||
reverse->rseq_over_2G = true;
|
||||
}
|
||||
|
||||
// non-tcp packets are passed with tcphdr=NULL but len_payload filled
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct
|
||||
uint16_t mss;
|
||||
uint32_t winsize_calc; // calculated window size
|
||||
uint8_t scale; // last seen window scale factor. SCALE_NONE if none
|
||||
bool seq_over_2G;
|
||||
bool rseq_over_2G;
|
||||
} t_ctrack_position;
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -507,7 +507,7 @@ static uint8_t ct_new_postnat_fix(const t_ctrack *ctrack, const struct dissect *
|
||||
|
||||
static bool pos_overflow(const t_ctrack_position *pos, char mode)
|
||||
{
|
||||
return (mode=='s' || mode=='p') && pos && pos->seq_over_2G;
|
||||
return (mode=='s' || mode=='p') && pos && pos->rseq_over_2G;
|
||||
}
|
||||
static uint64_t pos_get(const t_ctrack_position *pos, char mode)
|
||||
{
|
||||
|
||||
@@ -1286,6 +1286,7 @@ void lua_pushf_ctrack_pos(const t_ctrack *ctrack, const t_ctrack_position *pos)
|
||||
lua_pushf_lint("seq0", pos->seq0);
|
||||
lua_pushf_lint("seq", pos->seq_last);
|
||||
lua_pushf_lint("rseq", pos->seq_last - pos->seq0);
|
||||
lua_pushf_bool("rseq_over_2G", pos->rseq_over_2G);
|
||||
lua_pushf_int("pos", pos->pos - pos->seq0);
|
||||
lua_pushf_int("uppos", pos->uppos - pos->seq0);
|
||||
lua_pushf_int("uppos_prev", pos->uppos_prev - pos->seq0);
|
||||
@@ -1293,7 +1294,6 @@ void lua_pushf_ctrack_pos(const t_ctrack *ctrack, const t_ctrack_position *pos)
|
||||
lua_pushf_int("winsize_calc", pos->winsize_calc);
|
||||
lua_pushf_int("scale", pos->scale);
|
||||
lua_pushf_int("mss", pos->mss);
|
||||
lua_pushf_bool("seq_over_2G", pos->seq_over_2G);
|
||||
lua_rawset(params.L,-3);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user