tc

package
v0.0.0-...-4adfca9 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAllQdisc

func DeleteAllQdisc(interfaceName string) error

delete all qdiscs attached to this interface

func GetQdiscList

func GetQdiscList(interfaceName string) ([]netlink.Qdisc, error)

get all qdiscs of this interface

func SetNetem

func SetNetem(interfaceName string, delay uint32, loss float32, duplicate float32, reorderProb float32, corruptProb float32) error

attach a Network Emulator qdisc to this network interface delay: millisecond loss: percentage duplicate: percentage reorderProb: percentage corruptProb: percentage

func SetTbf

func SetTbf(interfaceName string, bandwidth uint64, latencyInMillis float64) error

attach a token bucket filter qdisc to this network interface to limit its bandwidth bandwidth: rate in bytes/s latencyInMillis: latency in milliseconds referenced from https://github.com/AliyunContainerService/terway/blob/master/pkg/tc/tc.go

Types

type NetemArgs

type NetemArgs struct {
	InterfaceName string
	Delay         uint32
	Loss          float32
	Duplicate     float32
	ReorderProb   float32
	CorruptProb   float32
}

type NetemReply

type NetemReply struct {
}

type ResetArgs

type ResetArgs struct {
	InterfaceName string
}

type ResetReply

type ResetReply struct {
}

type TbfArgs

type TbfArgs struct {
	InterfaceName   string
	Bandwidth       uint64
	LatencyInMillis float64
}

type TbfReply

type TbfReply struct {
}

type TrafficControlService

type TrafficControlService struct{}

func (*TrafficControlService) ResetRPC

func (t *TrafficControlService) ResetRPC(r *http.Request, args *ResetArgs, reply *ResetReply) error

func (*TrafficControlService) SetNetemRPC

func (t *TrafficControlService) SetNetemRPC(r *http.Request, args *NetemArgs, reply *NetemReply) error

func (*TrafficControlService) SetTbfRPC

func (t *TrafficControlService) SetTbfRPC(r *http.Request, args *TbfArgs, reply *TbfReply) error

Jump to

Keyboard shortcuts

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