tcpdump mailing list archives

Re: help with packet tracer


From: "Tyler Littlefield" <tyler () tysdomain com>
Date: Thu, 19 Feb 2009 05:31:44 -0700

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" <gvanem () broadpark no>
To: <tcpdump-workers () lists tcpdump org>
Sent: Thursday, February 19, 2009 1:29 AM
Subject: Re: [tcpdump-workers] help with packet tracer


"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.

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: