[tcpdump-workers] Wrong tcp sequence numbers???

2004-09-21 Thread Claudio Lavecchia
Hello ppl, I got a quite easy question for you guys: I am using a libpcap based packet dissector to sniff WLAN traffic: I read tcp packets using the structure: struct sniff_tcp { u_short th_sport; /* source port */ u_short th_dport; /* desti

Re: [tcpdump-workers] Wrong tcp sequence numbers???

2004-09-21 Thread Jefferson Ogata
Claudio Lavecchia wrote: I am using a libpcap based packet dissector to sniff WLAN traffic: I read tcp packets using the structure: struct sniff_tcp { u_short th_sport; /* source port */ u_short th_dport; /* destination port */ tcp_se

Re: [tcpdump-workers] Wrong tcp sequence numbers???

2004-09-21 Thread ronnie sahlberg
On Tue, 21 Sep 2004 10:38:27 -0400, Jefferson Ogata [snip] > > but in my code when I try to read the tcp sequence numbers, I get very > > odd values of sequence number. Here follows the code snippet I use to > > read sequence number. The values I get do not correspond to the ones I > > read using

Re: [tcpdump-workers] Wrong tcp sequence numbers???

2004-09-22 Thread Claudio Lavecchia
Jefferson Ogata wrote: Claudio Lavecchia wrote: I am using a libpcap based packet dissector to sniff WLAN traffic: I read tcp packets using the structure: struct sniff_tcp { u_short th_sport; /* source port */ u_short th_dport; /* destinatio

Re: [tcpdump-workers] Wrong tcp sequence numbers???

2004-09-22 Thread Jefferson Ogata
Claudio Lavecchia wrote: Jefferson Ogata wrote: Claudio Lavecchia wrote: I am using a libpcap based packet dissector to sniff WLAN traffic: I read tcp packets using the structure: struct sniff_tcp { u_short th_sport; /* source port */ u_short th_dport;

Re: [tcpdump-workers] Wrong tcp sequence numbers???

2004-09-22 Thread Guy Harris
Claudio Lavecchia wrote: 3. How do you calculate size_ip? int size_ip = sizeof(struct sniff_ip); Do any of the packets have IP options? If so, then that's *not* the size of the IP header. You should get the IP header length from the header length/version field from the IP header (and should che