rnithyanand / dpkt

Automatically exported from code.google.com/p/dpkt
Other
0 stars 0 forks source link

pcap.Reader can't read from pipes #103

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

(run tcpdump and pipe the output to stdin)
packet_capture = dpkt.pcap.Reader(sys.stdin)
iter(packet_capture).next()

What is the expected output? What do you see instead?
  File "/usr/lib/pymodules/python2.7/dpkt/pcap.py", line 133, in __iter__
    self.__f.seek(FileHdr.__hdr_len__)
IOError: [Errno 29] Illegal seek

What version of the product are you using? On what operating system?

dpkt 1.6+svn54 on Debian unstable

Please provide any additional information below.

I've attached a one-liner that allows Reader to work with pipes.

Original issue reported on code.google.com by ryan.now...@gmail.com on 23 Feb 2013 at 5:59

Attachments:

GoogleCodeExporter commented 9 years ago
Updated patch

Original comment by ryan.now...@gmail.com on 25 Feb 2013 at 7:09

Attachments: