![]() |
| | #1 |
| Registered User Join Date: Feb 2005
Posts: 23
| However, when I compare my sniffer with tcpdump, tcpdump gets different sequence and acknowledgement numbers than my sniffer. Now to the question: Do I need to use ntohs() on the other fields? (I am assuming no, because all the other fields are declared outside of the Pre-Processor if-else sequence relating to the endian) Or maybe is it normal that I get different seq and ack numbers than tcpdump; because I have tried with both ntohs() and without, and have gotten different numbers anyway. (Yes, I used the -S option on tcpdump). And also, If I am totally out in the blue, could someone give me a shove in the right direction? Thanks!!! |
| peradox is offline | |
| | #2 | |
| Registered User Join Date: Sep 2004 Location: California
Posts: 3,020
| Quote:
| |
| bithub is offline | |
| | #3 | |
| Registered User Join Date: Feb 2005
Posts: 23
| Quote:
| |
| peradox is offline | |
| | #4 |
| Registered User Join Date: Sep 2004 Location: California
Posts: 3,020
| oops, somehow I missed that. Are your sequence numbers correct in their incrementation, or are they off? Do they match the ACK numbers? |
| bithub is offline | |
| | #5 |
| Registered User Join Date: Feb 2005
Posts: 23
| Yes, they are correct, as they match the ACK numbers, etc... They are just not the same as tcpdump... I'm going to try how it is with ethereal... |
| peradox is offline | |
| | #6 |
| Registered User Join Date: Sep 2004 Location: California
Posts: 3,020
| ethereal uses the same packet capture library as tcpdump, so the results should be the same. |
| bithub is offline | |
| | #7 |
| Registered User Join Date: Sep 2004
Posts: 197
| With network packets, every thing but the data itself (and sometimes even then, depends on the applications protocol) is in network (big endian I believe) byte order, so yes, you do need to use the network to host calls. Now on some archetectures, its not required, since they already use that format, but its better to use them any ways, so your program can be compiled on other archs with less hassle. So IP header, TCP header, UDP, SCTP, all should have thier sections in network byte order.
__________________ If any part of my post is incorrect, please correct me. This post is not guarantied to be correct, and is not to be taken as a matter of fact, but of opinion or a guess, unless otherwise noted. |
| Xipher is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem referencing structure elements by pointer | trillianjedi | C Programming | 19 | 06-13-2008 05:46 PM |
| How to call a function several times, but with a different structure as argument? | mabuhay | C Programming | 5 | 02-14-2006 09:04 AM |
| Dikumud | maxorator | C++ Programming | 1 | 10-01-2005 06:39 AM |
| Serial Communications in C | ExDigit | Windows Programming | 7 | 01-09-2002 10:52 AM |
| C structure within structure problem, need help | Unregistered | C Programming | 5 | 11-30-2001 05:48 PM |