tcpdump mailing list archives

Re: help with packet tracer


From: Gisle Vanem <gvanem () broadpark no>
Date: Thu, 19 Feb 2009 09:29:22 +0100

"Tyler Littlefield" <tyler () tysdomain com> 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.


Current thread: