testutil

package
v0.16.6 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 5 Imported by: 0 modules, 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

Overview

Package testutil builds deterministic, fictional packet-pipeline fixtures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ethernet

func Ethernet(ip []byte) []byte

func Fragment

func Fragment(ip []byte, id uint32, start, end int, more bool) []byte

Fragment returns an IP fragment from an unfragmented datagram. start/end are offsets in the IP payload, so tests can deliberately create overlaps and holes.

func IP

func IP(v6, reverse bool, protocol layers.IPProtocol, payload []byte) []byte

func Packet

func Packet(raw []byte, index int, ordinal uint64) gopacket.Packet

func Serialize

func Serialize(parts ...gopacket.SerializableLayer) []byte

func TCP

func TCP(v6, reverse bool, seq, ack uint32, flags string, payload string) []byte

func Tunnel

func Tunnel(kind string, id uint32, inner []byte) []byte

Tunnel always uses the same outer direction, as mirrored ERSPAN/VXLAN do.

Types

This section is empty.

Jump to

Keyboard shortcuts

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