Documentation ¶
Index ¶
- Constants
- func IFBClose() error
- func IFBFlush() error
- func IFBInit() error
- type Action
- type CMD
- type Class
- type ClassAttrs
- type CmdTC
- func (m *CmdTC) ClassAdd(class Class) error
- func (m *CmdTC) ClassDel(class Class) error
- func (m *CmdTC) Close() error
- func (m *CmdTC) FilterAdd(filter Filter) error
- func (m *CmdTC) FilterDel(filter Filter) error
- func (m *CmdTC) QDiscAdd(qdiscDesc QDisc) error
- func (m *CmdTC) QDiscDel(qdiscDesc QDisc) error
- type ConformExceed
- type Filter
- type FilterAttrs
- type HTBClass
- type HTBQDisc
- type Handle
- type Ingress
- type MirredAction
- type MirredActionType
- type PfifoQDisc
- type PoliceAction
- type Protocol
- type QDisc
- type QDiscAttrs
- type TC
- type TFBQDisc
- type U32
- type U32Key
Constants ¶
View Source
const ( Continue ConformExceed = iota Drop Shot Ok Pass Pipe // These values are stolen from linux kernel. EgressRedir MirredActionType = 1 EgressMirror = 2 IngressRedir = 3 IngressMirror = 4 )
View Source
const ( HandleNone Handle = netlink.HANDLE_NONE HandleRoot = netlink.HANDLE_ROOT HandleIngress = netlink.HANDLE_INGRESS )
View Source
const ( TCActionAdd = "add" TCActionDel = "del" )
Variables ¶
This section is empty.
Functions ¶
func IFBClose ¶
func IFBClose() error
IFBClose unloads the Intermediate Functional Block device kernel module.
Types ¶
type CMD ¶
type CMD interface { // Cmd creates and returns "tc" sub-command using this qdisc. Cmd() []string }
CMD represents "tc" commands and sub-commands that can be described using "tc"
type Class ¶
type Class interface { // Kind returns this class's type. Kind() string // Attrs returns basic attributes of this filter. Attrs() ClassAttrs // Cmd creates and returns "tc" sub-command using this qdisc. Cmd() []string }
type ConformExceed ¶
type ConformExceed int32
func (ConformExceed) String ¶
func (m ConformExceed) String() string
type Filter ¶
type Filter interface { // Kind returns this filter's type. Kind() string // Attrs returns basic attributes of this filter. Attrs() FilterAttrs // Cmd creates and returns "tc" sub-command using this filter. Cmd() []string }
type FilterAttrs ¶
Note that lower Priority means a higher priority.
type HTBClass ¶
type HTBClass struct { ClassAttrs Rate uint64 Ceil uint64 }
func (*HTBClass) Attrs ¶
func (m *HTBClass) Attrs() ClassAttrs
type HTBQDisc ¶
type HTBQDisc struct {
QDiscAttrs
}
func (*HTBQDisc) Attrs ¶
func (m *HTBQDisc) Attrs() QDiscAttrs
type Handle ¶
type Handle uint32
Handle specifies both qdisc, class and filter ID.
type Ingress ¶
type Ingress struct {
QDiscAttrs
}
func (*Ingress) Attrs ¶
func (m *Ingress) Attrs() QDiscAttrs
type MirredAction ¶
type MirredAction struct { Dev netlink.Link Action MirredActionType }
MirredAction is the action that allows packet mirroring or redirecting the packet it receives.
func (*MirredAction) Cmd ¶
func (m *MirredAction) Cmd() []string
func (*MirredAction) Kind ¶
func (m *MirredAction) Kind() string
type MirredActionType ¶
type MirredActionType int
func (MirredActionType) String ¶
func (m MirredActionType) String() string
type PfifoQDisc ¶
type PfifoQDisc struct { QDiscAttrs // Limit constrains the queue size as measured in packets. Limit uint32 }
PfifoQDisc represents packet limited First In, First Out queue.
func (*PfifoQDisc) Attrs ¶
func (m *PfifoQDisc) Attrs() QDiscAttrs
func (*PfifoQDisc) Cmd ¶
func (m *PfifoQDisc) Cmd() []string
func (*PfifoQDisc) Type ¶
func (m *PfifoQDisc) Type() string
type PoliceAction ¶
type PoliceAction struct { // The maximum traffic rate of packets passing this action. Rate uint64 // Set the maximum allowed burst in bytes. Burst uint64 // This is the maximum packet size handled by the policer. MTU uint32 // PeakRate sets the maximum bucket depletion rate, exceeding rate. PeakRate uint64 // Overhead accounts for protocol overhead of encapsulating output devices // when computing rate and peakrate. Overhead uint64 // Define how to handle packets which exceed or conform the configured // bandwidth limit. ConformExceed ConformExceed }
func (*PoliceAction) Cmd ¶
func (m *PoliceAction) Cmd() []string
func (*PoliceAction) Kind ¶
func (m *PoliceAction) Kind() string
type QDisc ¶
type QDisc interface { // Type returns this qdisc name, for example "tbf", "htb", etc. Type() string // Attrs returns basic attributes of this qdisc. Attrs() QDiscAttrs // Cmd creates and returns "tc" sub-command using this qdisc. Cmd() []string }
QDisc describes traffic control queueing discipline.
type TC ¶
type TC interface { QDiscAdd(qdisc QDisc) error QDiscDel(qdisc QDisc) error ClassAdd(class Class) error ClassDel(class Class) error FilterAdd(filter Filter) error FilterDel(filter Filter) error Close() error }
func NewDefaultTC ¶
type TFBQDisc ¶
type TFBQDisc struct { QDiscAttrs // Rate in bits per second. Rate uint64 // Size of bucket in bytes. Burst uint64 // Latency in microseconds. Latency uint32 }
func (*TFBQDisc) Attrs ¶
func (m *TFBQDisc) Attrs() QDiscAttrs
type U32 ¶
type U32 struct { FilterAttrs FlowID Handle Selector U32Key Actions []Action }
U32 represents the Universal/Ugly 32bit filter classifier.
func (*U32) Attrs ¶
func (m *U32) Attrs() FilterAttrs
Click to show internal directories.
Click to hide internal directories.