mbuftestenv

package
v0.0.0-...-6c4fd92 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: NIST-PD-fallback Imports: 4 Imported by: 0

Documentation

Overview

Package mbuftestenv contains helper functions to construct mbufs in test code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectMempool

func DirectMempool() *pktmbuf.Pool

DirectMempool returns a mempool created from DIRECT template.

func IndirectMempool

func IndirectMempool() *pktmbuf.Pool

IndirectMempool returns a mempool created from INDIRECT template.

func MakePacket

func MakePacket(args ...any) (pkt *pktmbuf.Packet)

MakePacket creates a packet. *pktmbuf.Pool specifies where to allocate memory from; the default is the Direct pool. Headroom sets headroom in each segment. []byte or hexadecimal string becomes a segment. [][]byte or []string is flattened. Caller is responsible for releasing the packet.

Types

type Headroom

type Headroom int

Headroom sets segment headroom for MakePacket.

Jump to

Keyboard shortcuts

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