MCPcopy
hub / github.com/google/gopacket / Reader

Struct Reader

pcapgo/read.go:32–46  ·  view source on GitHub ↗

Reader wraps an underlying io.Reader to read packet data in PCAP format. See http://wiki.wireshark.org/Development/LibpcapFileFormat for information on the file format. We currenty read v2.4 file format with nanosecond and microsecdond timestamp resolution in little-endian and big-endian encoding.

Source from the content-addressed store, hash-verified

30// If the PCAP data is gzip compressed it is transparently uncompressed
31// by wrapping the given io.Reader with a gzip.Reader.
32type Reader struct {
33 r io.Reader
34 byteOrder binary.ByteOrder
35 nanoSecsFactor uint32
36 versionMajor uint16
37 versionMinor uint16
38 // timezone
39 // sigfigs
40 snaplen uint32
41 linkType layers.LinkType
42 // reusable buffer
43 buf [16]byte
44 // buffer for ZeroCopyReadPacketData
45 packetBuf []byte
46}
47
48const magicNanoseconds = 0xA1B23C4D
49const magicMicrosecondsBigendian = 0xD4C3B2A1

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected