mpcapng

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter creates a new PCAPNG Writer that writes to the given io.Writer.

func (*Writer) WriteHeader

func (pw *Writer) WriteHeader(app string, in *net.Interface, expr string, snaplen int) error

WriteHeader writes a Section Header Block (SHB) and an Interface Description Block (IDB) to the pcapng file.

The SHB contains metadata about the capture, and the IDB describes the interface that the packets were captured on.

func (*Writer) WritePacket

func (pw *Writer) WritePacket(timestamp time.Time, data []byte) error

WritePacket writes an Enhanced Packet Block (EPB) to the file.

https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-05.html#name-enhanced-packet-block

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL