tc

package
v2.3.20181123+incompat... Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TC_H_UNSPEC  uint32 = 0
	TC_H_ROOT    uint32 = 0xFFFFFFFF
	TC_H_INGRESS uint32 = 0xFFFFFFF1
	TC_H_CLSACT  uint32 = TC_H_INGRESS
)

Taken from iproute2 include/linux/pkt_sched.h

View Source
const TIME_UNIT_PER_SECOND uint64 = 1000000

Variables

This section is empty.

Functions

func ParseRate

func ParseRate(s string) (bytesPerSec uint64, err error)

func ParseSize

func ParseSize(s string) (bytes uint64, err error)

func ParseTime

func ParseTime(s string) (us uint64, err error)

func PrintRate

func PrintRate(bytesPerSec uint64) string

TODO rename to SprintfXXX

func PrintSize

func PrintSize(bytes uint64) string

func PrintTime

func PrintTime(us uint64) string

func TcTbfBurstNormalize

func TcTbfBurstNormalize(bytesPerSec uint64, burst uint64) uint64

Types

type IQdisc

type IQdisc interface {
	IsRoot() bool
	Initialized() error
	BaseQdisc() *Qdisc
	Equals(IQdisc) bool
	DeleteLine(ifname string) string
	ReplaceLine(ifname string) string
}

func NewQdisc

func NewQdisc(chunks []string) (IQdisc, error)

func NewQdiscFromString

func NewQdiscFromString(s string) (IQdisc, error)

type Qdisc

type Qdisc struct {
	Kind   string
	Handle uint32
	Parent uint32
}

func NewBaseQdisc

func NewBaseQdisc(chunks []string) (*Qdisc, error)

func (*Qdisc) BaseQdisc

func (q *Qdisc) BaseQdisc() *Qdisc

func (*Qdisc) DeleteLine

func (q *Qdisc) DeleteLine(ifname string) string

func (*Qdisc) Equals

func (q *Qdisc) Equals(qi IQdisc) bool

func (*Qdisc) Initialized

func (q *Qdisc) Initialized() error

func (*Qdisc) IsRoot

func (q *Qdisc) IsRoot() bool

func (*Qdisc) ReplaceLine

func (q *Qdisc) ReplaceLine(ifname string) string

type QdiscFqCodel

type QdiscFqCodel struct {
	*Qdisc
}

func NewQdiscFqCodel

func NewQdiscFqCodel(chunks []string) (*QdiscFqCodel, error)

func (*QdiscFqCodel) Equals

func (q *QdiscFqCodel) Equals(qi IQdisc) bool

type QdiscTbf

type QdiscTbf struct {
	*Qdisc
	Rate    uint64
	Burst   uint64
	Cell    uint64
	Latency uint64
	Mpu     uint64
}

func NewQdiscTbf

func NewQdiscTbf(chunks []string) (*QdiscTbf, error)

func (*QdiscTbf) Equals

func (q *QdiscTbf) Equals(qi IQdisc) bool

func (*QdiscTbf) ReplaceLine

func (q *QdiscTbf) ReplaceLine(ifname string) string

func (*QdiscTbf) TcNormalizeBurst

func (q *QdiscTbf) TcNormalizeBurst() error

type QdiscTree

type QdiscTree struct {
	// contains filtered or unexported fields
}

func NewQdiscTree

func NewQdiscTree(qs []IQdisc) (*QdiscTree, error)

func NewQdiscTreeFromString

func NewQdiscTreeFromString(s string) (*QdiscTree, error)

func (*QdiscTree) BatchReplaceLines

func (qt *QdiscTree) BatchReplaceLines(ifname string) []string

func (*QdiscTree) Equals

func (qt *QdiscTree) Equals(qt2 *QdiscTree) bool

func (*QdiscTree) IsLeaf

func (qt *QdiscTree) IsLeaf() bool

func (*QdiscTree) IsRoot

func (qt *QdiscTree) IsRoot() bool

func (*QdiscTree) String

func (qt *QdiscTree) String() string

type TcCli

type TcCli struct {
	// contains filtered or unexported fields
}

func NewTcCli

func NewTcCli() *TcCli

func (*TcCli) Batch

func (tc *TcCli) Batch(ctx context.Context, input string) (stdout string, stderr string, err error)

func (*TcCli) Details

func (tc *TcCli) Details(details bool) *TcCli

func (*TcCli) Force

func (tc *TcCli) Force(force bool) *TcCli

func (*TcCli) QdiscShow

func (tc *TcCli) QdiscShow(ctx context.Context, ifname string) (*QdiscTree, error)

Jump to

Keyboard shortcuts

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