pcap

package
v0.17.5 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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