Topic: Question about sniffer application TCP reconstruction - AdjustSequence
hey all,
I've been working with the sniffer application, and the following line baffles me:
(sniffer.c, AdjustSequence function):
~line 2090:
static int AdjustSequence(...)
if(real < *expected){
int overlap = *expected - real;
*sslFrame += overlap;
*sslBytes -= overlap;
}
if(reassemblyList) {
word32 newEnd = *expected + *sslBytes*
[b] if(newEnd > reassemblyList->begin){
/* remove bytes already on reassembly list */
*sslBytes -= newEnd - reassemblyList->begin;
}[/b]
to my understanding, after performing the overlap shifting in the beginning of the function, the sslFrame pointer points exactly to where NEW data begins and the sslBytes holds the number of NEW bytes (that is, the number of bytes in the packet which were not previously handled).
I am not sure to we have to perform the part in BOLD. it says, to what i understand - check whether the newly arrived packet ENDS after the last treated data BEGINS.
I think I lack the understanding to why reassemblyList->end is not exactly like *expected...
thanks in advance,
SheldonC