0

I want to read through a tcp dump file and print out the packet lengths and their start and end time or just time stamps. I know that pcap libraries can do this. But I could not find a concrete example of opening a dump file and processing it for that information. I am okay with any languages and platform.

Cœur
  • 37,241
  • 25
  • 195
  • 267
P basak
  • 4,874
  • 11
  • 40
  • 63

1 Answers1

0

You want pcap_open_offline(). There's a man page for it, and here's an example of using it.

whamma
  • 8,088
  • 1
  • 14
  • 19
  • Note that the example program is assuming that the file is an Ethernet capture (without bothering to check whether it is) and that there are neither IP or TCP options (i.e., neither the IP nor TCP header is guaranteed to be exactly 20 bytes long). –  Nov 22 '12 at 18:45