struct

Filament::Capture::PcapHeader

Inherits Struct < Value < Object

Represents the global header at the start of every PCAP file. This tells us everything we need to know about how to interpret the rest of the file: byte order, version, snap length, and link type.

reader = Filament::Capture::PcapReader.new("capture.pcap")
puts reader.header.link_type # => 1 (Ethernet)
puts reader.header.snaplen   # => 65535

Constructors

Instance methods

magic_number

The magic number. In a properly read file this will always be PCAP_MAGIC_NATIVE (we normalize it during reading).

Source
sigfigs

Accuracy of timestamps. Also always zero in practice. The PCAP format spec was aspirational about precision tracking.

Source
snaplen

Maximum number of bytes captured per packet. Common values are 65535 (capture everything) or 96 (just headers). Packets longer than this get truncated.

Source
supported_version?

Checks whether the file version is one we know how to read. Currently we only support version 2.4, which is the only version that has ever existed in the wild.

Source
thiszone

GMT to local timezone correction, in seconds. In practice this is always zero because nobody actually sets it.

Source
version_major

Major and minor version of the PCAP format. Almost always 2.4. If you see anything else, something weird is going on.

Source
version_minor
Source