the size of the Ip works, but when I get the tcp packet, things don't work
as planned--it gives invalid ports.
----- Original Message -----
From: "Gisle Vanem" <[email protected]>
To: <[email protected]>
Sent: Thursday, February 19, 2009 1:29 AM
Subject: Re: [tcpdump-workers] help with packet tracer
"Tyler Littlefield" <[email protected]> wrote:
I rewrote my callback function to work a bit differently, but it's still
giving me weird sizes.
What do you mean exactly?
in capt_h():
ip_hdr* ip=(ip_hdr*)(packet+sizeof(ether_hdr));
cout << "From: " << inet_ntoa(ip->ip_src) << "\t\t" << "to: " <<
inet_ntoa(ip->ip_dst) << ".\n" <<endl;
cout << "Id: " << ip->ip_id << endl;
You seem to think everything is IP. There is ARP and lots of other
protocols too.
--gv
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.