Documentation ¶
Index ¶
Constants ¶
View Source
const ( MagicNumber = 0xa1b2c3d4 VersionMajor = 2 VersionMinor = 4 TimestampCorrection = 0 TimestampAccuracy = 0 DefaultSnapLen = 65535 )
View Source
const ( GlobalHeaderByteLen = 24 RecordHeaderByteLen = 16 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datalink ¶
type Datalink uint32
Datalink defines the type of the first layer of the captured packet
type Header ¶
type Header struct { // SnapshotLength is the maximum length of captured packets SnapshotLength uint32 // Datalink is the type of header at the beginning of the packet Datalink Datalink }
Header contains the configurable parameters for the global pcap header
type Record ¶
type Record struct { // Timestamp is the time the packet was captured Timestamp time.Time // CaptureLength is the size of the captured packet CaptureLength uint32 // OriginalLength is the size of the original packet OriginalLength uint32 }
Record contains the configurable parameters for a record header
type RecordWriter ¶
type RecordWriter interface { // WriteHeader writes the global pcap header. This must be invoked before // WriteRecord is called. WriteHeader(header Header) error // WriteRecord writes a pcap record to the underlying stream. WriteRecord(record Record, packet []byte) error io.Closer }
RecordWriter defines the interface for pcap writers
type Writer ¶
type Writer struct {
io.WriteCloser
}
Writer wraps a io.WriteCloser to implement RecordWriter
func (*Writer) WriteHeader ¶
WriteHeader implements RecordWriter
Click to show internal directories.
Click to hide internal directories.