tc

package
v0.0.0-...-362dc38 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package tc plans ownership-safe traffic-control netem operations.

Index

Constants

View Source
const (
	// PumbaRootHandle identifies a qdisc tree owned by Pumba. It is deliberately
	// unusual so Pumba never mistakes a user-managed qdisc for its own state.
	PumbaRootHandle = "504d:"
)

Variables

This section is empty.

Functions

func Start

func Start(r *NetemRequest) []string

Start returns arguments for `sh -ec` that inspect the root qdisc before any mutation and install only Pumba-owned qdiscs. A foreign root fails closed.

func Stop

func Stop(r *NetemRequest) []string

Stop returns arguments for `sh -ec` that verify Pumba ownership before cleanup. An absent/default qdisc has no Pumba state and succeeds.

Types

type NetemRequest

type NetemRequest struct {
	Interface string
	Command   []string
	IPs       []string
	SPorts    []string
	DPorts    []string
}

NetemRequest contains the tc-specific portion of a netem request.

func (*NetemRequest) HasFilters

func (r *NetemRequest) HasFilters() bool

HasFilters reports whether this request needs Pumba's scoped prio topology.

Jump to

Keyboard shortcuts

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