kbandla / dpkt

fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
Other
1.08k stars 270 forks source link

add universal pcap reader (fixes #594) #595

Closed obormot closed 2 years ago

obormot commented 3 years ago

Added class dpkt.pcap.UniversalReader that attempts to read the given file object

  1. first in libpcap format,
  2. if that fails, attempt the pcapng format,
  3. if that also fails, raise an exception.

Disclaimer: I've just slapped something working together quickly. There could be a better name or a more logical home for this, or it can be a function instead of a class.. open to suggestions here

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.0005%) to 99.814% when pulling 5d1b32eaa69bb5f9a993a0f73bd9b6b6061ecf9d on fix-#594 into 6a71d6336cd609a406fb2812e1aa9c71864fdb75 on master.