Documentation
¶
Overview ¶
Package pcapfile loads an Ethernet capture into a form the transmit loop can replay without allocating.
It uses gopacket's pure-Go pcapgo reader, so Wireblast has no libpcap or cgo dependency and a static binary works anywhere.
The whole file is read and validated before the dataplane starts. A broken or unsupported capture should cost you an error message, never a bounced link and a half-started run.
Index ¶
- Constants
- type File
- func (f *File) Bytes() int
- func (f *File) Describe() string
- func (f *File) Frame(i int) ([]byte, time.Duration)
- func (f *File) Len() int
- func (f *File) MaxLen() int
- func (f *File) MeanLen() int
- func (f *File) MinLen() int
- func (f *File) Span() time.Duration
- func (f *File) Truncated() int
- func (f *File) Warnings() []string
Constants ¶
const ( // MinFrame is the smallest thing that can be an Ethernet frame: two MAC // addresses and an EtherType. MinFrame = 14 // MaxFrame is the largest frame that can be transmitted. It matches the // biggest UMEM frame Wireblast will configure. MaxFrame = 16384 // MaxPackets bounds how much of a capture is loaded into memory, so // pointing Wireblast at a 40 GB capture fails politely instead of // exhausting the machine. MaxPackets = 2_000_000 )
Limits on what will be loaded.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is a loaded capture, ready to replay.
Frames live in one contiguous byte slice with an index alongside, so replay is a slice expression and a copy — no per-packet allocation, and the frames stay adjacent in memory for the cache's benefit.
func (*File) Frame ¶
Frame returns the i-th frame and the gap the capture recorded before it. The returned slice aliases the backing store and must not be modified.