pcap

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 3 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
}

Writer writes raw RTP packets to a pcap file. Each packet is wrapped in fake Ethernet/IPv4/UDP headers so Wireshark auto-dissects the contents as RTP without manual "Decode As" configuration.

func New

func New(path string) (*Writer, error)

New creates a pcap file at path and writes the 24-byte global header.

func (*Writer) Close

func (w *Writer) Close() error

Close closes the underlying file.

func (*Writer) WritePacket

func (w *Writer) WritePacket(data []byte, ts time.Time) error

WritePacket writes a single raw RTP packet to the pcap file. ts is the capture timestamp (typically time.Now() at packet arrival).

Jump to

Keyboard shortcuts

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