Versions in this module Expand all Collapse all v0 v0.3.2 Nov 18, 2021 v0.3.1 Nov 5, 2021 Changes in this version + const ActBind + const ActNoBind + const ActNoReplace + const ActNoUnbind + const ActOk + const ActPipe + const ActQueued + const ActReclassify + const ActRedirect + const ActRepeat + const ActReplace + const ActShot + const ActStolen + const ActTrap + const ActUnbind + const BpfActDirect + const CmpMatchTrans + const CmpMatchU16 + const CmpMatchU32 + const CmpMatchU8 + const EmatchCanID + const EmatchCmp + const EmatchContainer + const EmatchIPSet + const EmatchIPT + const EmatchLayerLink + const EmatchLayerNetwork + const EmatchLayerTransport + const EmatchMeta + const EmatchNByte + const EmatchOpndEq + const EmatchOpndGt + const EmatchOpndLt + const EmatchText + const EmatchU32 + const EmatchVLan + const HandleIngress + const HandleMinEgress + const HandleMinIngress + const HandleMinPriority + const HandleRoot + const IPSetDst + const IPSetSrc + const InHw + const MagicBlock + const NotInHw + const SkipHw + const SkipSw + const Verbose + var ErrInvalidArg = errors.New("invalid argument") + var ErrInvalidDev = errors.New("invalid device ID") + var ErrNoArg = errors.New("missing argument") + var ErrNoArgAlter = errors.New("argument cannot be altered") + var ErrNotImplemented = errors.New("functionality not yet implemented") + var ErrUnknownKind = errors.New("unknown kind") + type ActBpf struct + FD *uint32 + ID *uint32 + Name *string + Ops *[]byte + OpsLen *uint16 + Parms *ActBpfParms + Tag *[]byte + Tm *Tcft + type ActBpfParms struct + Action uint32 + Bindcnt uint32 + Capab uint32 + Index uint32 + Refcnt uint32 + type Action struct + Bpf *ActBpf + CSum *Csum + ConnMark *Connmark + Cookie *[]byte + Defact *Defact + Gact *Gact + Gate *Gate + Ife *Ife + Index uint32 + Ipt *Ipt + Kind string + Mirred *Mirred + Nat *Nat + Police *Police + Sample *Sample + Stats *GenStats + TunnelKey *TunnelKey + VLan *VLan + type Atm struct + Addr *AtmPvc + Excess *uint32 + FD *uint32 + State *uint32 + type AtmPvc struct + Itf byte + SapFamily byte + Vci byte + Vpi byte + type Attribute struct + Atm *Atm + BPF *Bpf + Basic *Basic + Bfifo *FifoOpt + Cake *Cake + Cbq *Cbq + Cgroup *Cgroup + Chain *uint32 + Choke *Choke + Codel *Codel + Drr *Drr + Dsmark *Dsmark + EgressBlock *uint32 + Flow *Flow + Flower *Flower + Fq *Fq + FqCodel *FqCodel + Fw *Fw + Hfsc *Hfsc + HfscQOpt *HfscQOpt + Hhf *Hhf + Htb *Htb + HwOffload *uint8 + IngressBlock *uint32 + Kind string + Matchall *Matchall + MqPrio *MqPrio + Netem *Netem + Pfifo *FifoOpt + Pie *Pie + Plug *Plug + Prio *Prio + Qfq *Qfq + Red *Red + Route4 *Route4 + Rsvp *Rsvp + Sfb *Sfb + Sfq *Sfq + Stab *Stab + Stats *Stats + Stats2 *Stats2 + Tbf *Tbf + U32 *U32 + XStats *XStats + type Basic struct + ClassID *uint32 + Ematch *Ematch + Police *Police + type Bpf struct + Action *Action + ClassID *uint32 + FD *uint32 + Flags *uint32 + FlagsGen *uint32 + ID *uint32 + Name *string + Ops *[]byte + OpsLen *uint16 + Police *Police + Tag *[]byte + type Cake struct + AckFilter *uint32 + Atm *uint32 + Autorate *uint32 + BaseRate *uint64 + DiffServMode *uint32 + FlowMode *uint32 + FwMark *uint32 + Ingress *uint32 + Memory *uint32 + Mpu *uint32 + Nat *uint32 + Overhead *uint32 + Raw *uint32 + Rtt *uint32 + SplitGso *uint32 + Target *uint32 + Wash *uint32 + type Cbq struct + FOpt *CbqFOpt + LssOpt *CbqLssOpt + OVLStrategy *CbqOvl + Police *CbqPolice + RTab []byte + Rate *RateSpec + WrrOpt *CbqWrrOpt + type CbqFOpt struct + Defchange uint32 + Defmap uint32 + Split uint32 + type CbqLssOpt struct + Avpkt uint32 + Change byte + EwmaLog byte + Flags byte + Level byte + Maxidle uint32 + Minidle uint32 + OffTime uint32 + type CbqOvl struct + Pad uint16 + Penalty uint32 + Priority2 byte + Strategy byte + type CbqPolice struct + Police byte + Res1 byte + Res2 uint16 + type CbqWrrOpt struct + Allot uint32 + CPriority byte + Flags byte + Priority byte + Reserved byte + Weight uint32 + type CbqXStats struct + AvgIdle int32 + Borrows uint32 + Overactions uint32 + Undertime int32 + type Cgroup struct + Action *Action + Ematch *Ematch + type Chain struct + func (c *Chain) Add(info *Object) error + func (c *Chain) Delete(info *Object) error + func (c *Chain) Get(i *Msg) ([]Object, error) + type Choke struct + MaxP *uint32 + Parms *RedQOpt + type ChokeXStats struct + Early uint32 + Marked uint32 + Matched uint32 + Other uint32 + PDrop uint32 + type Class struct + func (c *Class) Add(info *Object) error + func (c *Class) Delete(info *Object) error + func (c *Class) Get(i *Msg) ([]Object, error) + func (c *Class) Replace(info *Object) error + type CmpMatch struct + Align CmpMatchAlign + Flags CmpMatchFlag + Layer EmatchLayer + Mask uint32 + Off uint16 + Opnd EmatchOpnd + Val uint32 + type CmpMatchAlign uint8 + type CmpMatchFlag uint8 + type Codel struct + CEThreshold *uint32 + ECN *uint32 + Interval *uint32 + Limit *uint32 + Target *uint32 + type CodelXStats struct + CeMark uint32 + Count uint32 + DropNext int32 + DropOverlimit uint32 + Dropping uint32 + EcnMark uint32 + LDelay uint32 + LastCount uint32 + MaxPacket uint32 + type Config struct + Logger *log.Logger + NetNS int + type Connmark struct + Parms *ConnmarkParam + Tm *Tcft + type ConnmarkParam struct + Action uint32 + BindCnt uint32 + Capab uint32 + Index uint32 + RefCnt uint32 + Zone uint16 + type Csum struct + Parms *CsumParms + Tm *Tcft + type CsumParms struct + Action uint32 + BindCnt uint32 + Capab uint32 + Index uint32 + RefCnt uint32 + UpdateFlags uint32 + type Defact struct + Data *string + Parms *DefactParms + Tm *Tcft + type DefactParms struct + Action uint32 + BindCnt uint32 + Capab uint32 + Index uint32 + RefCnt uint32 + type Drr struct + Quantum *uint32 + type Dsmark struct + DefaultIndex *uint16 + Indices *uint16 + Mask *uint8 + SetTCIndex *bool + Value *uint8 + type Ematch struct + Hdr *EmatchTreeHdr + Matches *[]EmatchMatch + type EmatchHdr struct + Flags uint16 + Kind EmatchKind + MatchID uint16 + Pad uint16 + type EmatchKind uint16 + type EmatchLayer uint8 + type EmatchMatch struct + CmpMatch *CmpMatch + Hdr EmatchHdr + IPSetMatch *IPSetMatch + U32Match *U32Match + type EmatchOpnd uint8 + type EmatchTreeHdr struct + NMatches uint16 + ProgID uint16 + type ErrorFunc func(e error) int + type Ets struct + NBands *uint8 + NStrict *uint8 + PrioMap *[]uint8 + Quanta *[]uint32 + type FifoOpt struct + Limit uint32 + type Filter struct + func (f *Filter) Add(info *Object) error + func (f *Filter) Delete(info *Object) error + func (f *Filter) Get(i *Msg) ([]Object, error) + func (f *Filter) Replace(info *Object) error + type Flow struct + Addend *uint32 + BaseClass *uint32 + Divisor *uint32 + Ematch *Ematch + Keys *uint32 + Mask *uint32 + Mode *uint32 + PerTurb *uint32 + RShift *uint32 + XOR *uint32 + type Flower struct + Actions *[]*Action + ClassID *uint32 + Flags *uint32 + InHwCount *uint32 + Indev *string + KeyArpOp *uint8 + KeyArpOpMask *uint8 + KeyArpSIP *uint32 + KeyArpSIPMask *uint32 + KeyArpTIP *uint32 + KeyArpTIPMask *uint32 + KeyCVlanEthType *uint16 + KeyCVlanID *uint16 + KeyCVlanPrio *uint8 + KeyEncIPTOS *uint8 + KeyEncIPTOSMask *uint8 + KeyEncIPTTL *uint8 + KeyEncIPTTLMask *uint8 + KeyEncIPv4Dst *net.IP + KeyEncIPv4DstMask *net.IP + KeyEncIPv4Src *net.IP + KeyEncIPv4SrcMask *net.IP + KeyEncKeyID *uint32 + KeyEncUDPDstPort *uint16 + KeyEncUDPDstPortMask *uint16 + KeyEncUDPSrcPort *uint16 + KeyEncUDPSrcPortMask *uint16 + KeyEthDst *net.HardwareAddr + KeyEthDstMask *net.HardwareAddr + KeyEthSrc *net.HardwareAddr + KeyEthSrcMask *net.HardwareAddr + KeyEthType *uint16 + KeyFlags *uint32 + KeyFlagsMask *uint32 + KeyIPProto *uint8 + KeyIPTOS *uint8 + KeyIPTOSMask *uint8 + KeyIPTTL *uint8 + KeyIPTTLMask *uint8 + KeyIPv4Dst *net.IP + KeyIPv4DstMask *net.IP + KeyIPv4Src *net.IP + KeyIPv4SrcMask *net.IP + KeyIcmpv4Code *uint8 + KeyIcmpv4CodeMask *uint8 + KeyIcmpv4Type *uint8 + KeyIcmpv4TypeMask *uint8 + KeyIcmpv6Code *uint8 + KeyIcmpv6CodeMask *uint8 + KeyMplsBos *uint8 + KeyMplsLabel *uint32 + KeyMplsTTL *uint8 + KeyMplsTc *uint8 + KeySctpDst *uint16 + KeySctpSrc *uint16 + KeyTCPDst *uint16 + KeyTCPDstMask *uint16 + KeyTCPFlags *uint16 + KeyTCPFlagsMask *uint16 + KeyTCPSrc *uint16 + KeyTCPSrcMask *uint16 + KeyUDPDst *uint16 + KeyUDPDstMask *uint16 + KeyUDPSrc *uint16 + KeyUDPSrcMask *uint16 + KeyVlanEthType *uint16 + KeyVlanID *uint16 + KeyVlanPrio *uint8 + type Fq struct + BucketsLog *uint32 + CEThreshold *uint32 + FlowDefaultRate *uint32 + FlowMaxRate *uint32 + FlowPLimit *uint32 + FlowRefillDelay *uint32 + InitQuantum *uint32 + LowRateThreshold *uint32 + OrphanMask *uint32 + PLimit *uint32 + Quantum *uint32 + RateEnable *uint32 + type FqCodel struct + CEThreshold *uint32 + DropBatchSize *uint32 + ECN *uint32 + Flows *uint32 + Interval *uint32 + Limit *uint32 + MemoryLimit *uint32 + Quantum *uint32 + Target *uint32 + type FqCodelClStats struct + Count uint32 + Deficit int32 + DropNext int32 + Dropping uint32 + LDelay uint32 + LastCount uint32 + type FqCodelQdStats struct + CeMark uint32 + DropOverlimit uint32 + DropOvermemory uint32 + EcnMark uint32 + MaxPacket uint32 + MemoryUsage uint32 + NewFlowCount uint32 + NewFlowsLen uint32 + OldFlowsLen uint32 + type FqCodelXStats struct + Cl *FqCodelClStats + Qd *FqCodelQdStats + Type uint32 + type Fw struct + ClassID *uint32 + InDev *string + Mask *uint32 + Police *Police + type Gact struct + Parms *GactParms + Prob *GactProb + Tm *Tcft + type GactParms struct + Action uint32 + BindCnt uint32 + Capab uint32 + Index uint32 + RefCnt uint32 + type GactProb struct + PAction uint32 + PType uint16 + PVal uint16 + type Gate struct + BaseTime *uint64 + ClockID *int32 + CycleTime *uint64 + CycleTimeExt *uint64 + Flags *uint32 + Parms *GateParms + Priority *int32 + Tm *Tcft + type GateParms struct + Action uint32 + BindCnt uint32 + Capab uint32 + Index uint32 + RefCnt uint32 + type GenBasic struct + Bytes uint64 + Packets uint32 + type GenQueue struct + Backlog uint32 + Drops uint32 + Overlimits uint32 + QueueLen uint32 + Requeues uint32 + type GenRateEst struct + BytePerSecond uint32 + PacketPerSecond uint32 + type GenRateEst64 struct + BytePerSecond uint64 + PacketPerSecond uint64 + type GenStats struct + Basic *GenBasic + BasicHw *GenBasic + Queue *GenQueue + RateEst *GenRateEst + RateEst64 *GenRateEst64 + type Hfsc struct + Fsc *ServiceCurve + Rsc *ServiceCurve + Usc *ServiceCurve + type HfscQOpt struct + DefCls uint16 + type HfscXStats struct + Level uint32 + Period uint32 + RtWork uint64 + Work uint64 + type Hhf struct + AdmitBytes *uint32 + BacklogLimit *uint32 + EVICTTimeout *uint32 + HHFlowsLimit *uint32 + NonHHWeight *uint32 + Quantum *uint32 + ResetTimeout *uint32 + type HhfXStats struct + DropOverlimit uint32 + HhCurCount uint32 + HhOverlimit uint32 + HhTotCount uint32 + type HookFunc func(action uint16, m Object) int + type Htb struct + Ceil64 *uint64 + Ctab *[]byte + DirectQlen *uint32 + Init *HtbGlob + Parms *HtbOpt + Rate64 *uint64 + Rtab *[]byte + type HtbGlob struct + Debug uint32 + Defcls uint32 + DirectPkts uint32 + Rate2Quantum uint32 + Version uint32 + type HtbOpt struct + Buffer uint32 + Cbuffer uint32 + Ceil RateSpec + Level uint32 + Prio uint32 + Quantum uint32 + Rate RateSpec + type HtbXStats struct + Borrows uint32 + CTokens uint32 + Giants uint32 + Lends uint32 + Tokens uint32 + type IPSetDir uint8 + type IPSetMatch struct + Dir []IPSetDir + IPSetID uint16 + type Ife struct + DMac *[]byte + Parms *IfeParms + SMac *[]byte + Tm *Tcft + Type *uint16 + type IfeParms struct + Action uint32 + BindCnt uint32 + Capab uint32 + Flags uint16 + Index uint32 + RefCnt uint32 + type Ipt struct + Cnt *IptCnt + Hook *uint32 + Index *uint32 + Table *string + Tm *Tcft + type IptCnt struct + BindCnt uint32 + RefCnt uint32 + type Matchall struct + Actions *[]*Action + ClassID *uint32 + Flags *uint32 + type Mirred struct + Parms *MirredParam + Tm *Tcft + type MirredParam struct + Action uint32 + BindCnt uint32 + Capab uint32 + Eaction uint32 + IfIndex uint32 + Index uint32 + RefCnt uint32 + type MqPrio struct + MaxRate64 *uint64 + MinRate64 *uint64 + Mode *uint16 + Opt *MqPrioQopt + Shaper *uint16 + type MqPrioQopt struct + Count [16]uint16 + Hw uint8 + NumTc uint8 + Offset [16]uint16 + PrioTcMap [16]uint8 + type Msg struct + Family uint32 + Handle uint32 + Ifindex uint32 + Info uint32 + Parent uint32 + type Nat struct + Parms *NatParms + Tm *Tcft + type NatParms struct + Action uint32 + BindCnt uint32 + Capab uint32 + Flags uint32 + Index uint32 + Mask uint32 + NewAddr uint32 + OldAddr uint32 + RefCnt uint32 + type Netem struct + Corr *NetemCorr + Corrupt *NetemCorrupt + Ecn *uint32 + Jitter64 *int64 + Latency64 *int64 + Qopt NetemQopt + Rate *NetemRate + Rate64 *uint64 + Reorder *NetemReorder + Slot *NetemSlot + type NetemCorr struct + Delay uint32 + Dup uint32 + Loss uint32 + type NetemCorrupt struct + Correlation uint32 + Probability uint32 + type NetemQopt struct + Duplicate uint32 + Gap uint32 + Jitter uint32 + Latency uint32 + Limit uint32 + Loss uint32 + type NetemRate struct + CellOverhead int32 + CellSize int32 + PacketOverhead int32 + Rate uint32 + type NetemReorder struct + Correlation uint32 + Probability uint32 + type NetemSlot struct + DistDelay int64 + DistJitter int64 + MaxBytes int32 + MaxDelay int64 + MaxPackets int32 + MinDelay int64 + type Object struct + type Pie struct + Alpha *uint32 + Beta *uint32 + Bytemode *uint32 + ECN *uint32 + Limit *uint32 + TUpdate *uint32 + Target *uint32 + type PieXStats struct + AvgDqRate uint32 + Delay uint32 + Dropped uint32 + EcnMark uint32 + Maxq uint32 + Overlimit uint32 + PacketsIn uint32 + Prob uint64 + type Plug struct + Action PlugAction + Limit uint32 + type PlugAction int32 + const PlugBuffer + const PlugLimit + const PlugReleaseIndefinite + const PlugReleaseOne + type Police struct + AvRate *uint32 + PeakRate *RateSpec + PeakRate64 *uint64 + Rate *RateSpec + Rate64 *uint64 + Result *uint32 + Tbf *Policy + Tm *Tcft + type Policy struct + Action PolicyAction + BindCnt uint32 + Burst uint32 + Capab uint32 + Index uint32 + Limit uint32 + Mtu uint32 + PeakRate RateSpec + Rate RateSpec + RefCnt uint32 + type PolicyAction uint32 + const PolicyOk + const PolicyPipe + const PolicyReclassify + const PolicyShot + type Prio struct + Bands uint32 + PrioMap [16]uint8 + type Qdisc struct + func (qd *Qdisc) Add(info *Object) error + func (qd *Qdisc) Change(info *Object) error + func (qd *Qdisc) Delete(info *Object) error + func (qd *Qdisc) Get() ([]Object, error) + func (qd *Qdisc) Link(info *Object) error + func (qd *Qdisc) Replace(info *Object) error + type Qfq struct + Lmax *uint32 + Weight *uint32 + type RateSpec struct + CellAlign uint16 + CellLog uint8 + Linklayer uint8 + Mpu uint16 + Overhead uint16 + Rate uint32 + type Red struct + MaxP *uint32 + Parms *RedQOpt + type RedQOpt struct + Flags byte + Limit uint32 + Plog byte + QthMax uint32 + QthMin uint32 + ScellLog byte + Wlog byte + type RedXStats struct + Early uint32 + Marked uint32 + Other uint32 + PDrop uint32 + type Route4 struct + ClassID *uint32 + From *uint32 + IIf *uint32 + To *uint32 + type Rsvp struct + ClassID *uint32 + Dst *[]byte + PInfo *RsvpPInfo + Police *Police + Src *[]byte + type RsvpGpi struct + Key uint32 + Mask uint32 + Offset uint32 + type RsvpPInfo struct + Dpi RsvpGpi + Pad uint8 + Protocol uint8 + Spi RsvpGpi + TunnelHdr uint8 + TunnelID uint8 + type Sample struct + Parms *SampleParms + Rate *uint32 + SampleGroup *uint32 + Tm *Tcft + TruncSize *uint32 + type SampleParms struct + Action uint32 + BindCnt uint32 + Capab uint32 + Index uint32 + RefCnt uint32 + type ServiceCurve struct + D uint32 + M1 uint32 + M2 uint32 + type Sfb struct + Parms *SfbQopt + type SfbQopt struct + BinSize uint32 + Decrement uint32 + Increment uint32 + Limit uint32 + Max uint32 + PenaltyBurst uint32 + PenaltyRate uint32 + RehashInterval uint32 + WarmupTime uint32 + type SfbXStats struct + AvgProb uint32 + BucketDrop uint32 + ChildDrop uint32 + EarlyDrop uint32 + Marked uint32 + MaxProb uint32 + MaxQlen uint32 + PenaltyDrop uint32 + QueueDrop uint32 + type Sfq struct + Depth uint32 + Flags uint8 + Headdrop uint32 + Limit uint32 + MaxP uint32 + Plog uint8 + QthMax uint32 + QthMin uint32 + ScellLog uint8 + V0 SfqQopt + Wlog uint8 + type SfqQopt struct + Divisor uint32 + Flows uint32 + Limit uint32 + PerturbPeriod int32 + Quantum uint32 + type SfqXStats struct + Allot int32 + type SizeSpec struct + CellAlign int16 + CellLog uint8 + LinkLayer uint32 + MPU uint32 + MTU uint32 + Overhead int32 + SizeLog uint8 + TSize uint32 + type Stab struct + Base *SizeSpec + Data *[]byte + type Stats struct + Backlog uint32 + Bps uint32 + Bytes uint64 + Drops uint32 + Overlimits uint32 + Packets uint32 + Pps uint32 + Qlen uint32 + type Stats2 struct + Backlog uint32 + Bytes uint64 + Drops uint32 + Overlimits uint32 + Packets uint32 + Qlen uint32 + Requeues uint32 + type Tbf struct + Burst *uint32 + Parms *TbfQopt + Pburst *uint32 + type TbfQopt struct + Buffer uint32 + Limit uint32 + Mtu uint32 + PeakRate RateSpec + Rate RateSpec + type Tc struct + func Open(config *Config) (*Tc, error) + func (tc *Tc) Chain() *Chain + func (tc *Tc) Class() *Class + func (tc *Tc) Close() error + func (tc *Tc) Filter() *Filter + func (tc *Tc) Monitor(ctx context.Context, deadline time.Duration, fn HookFunc) error + func (tc *Tc) MonitorWithErrorFunc(ctx context.Context, deadline time.Duration, fn HookFunc, errfn ErrorFunc) error + func (tc *Tc) Qdisc() *Qdisc + type TcIndex struct + ClassID *uint32 + FallThrough *uint32 + Hash *uint32 + Mask *uint16 + Shift *uint32 + type Tcft struct + Expires uint64 + FirstUse uint64 + Install uint64 + LastUse uint64 + type TunnelKey struct + KeyEncDst *net.IP + KeyEncDstPort *uint16 + KeyEncKeyID *uint32 + KeyEncSrc *net.IP + KeyEncTOS *uint8 + KeyEncTTL *uint8 + KeyNoCSUM *uint8 + Parms *TunnelParms + Tm *Tcft + type TunnelParms struct + Action uint32 + BindCnt uint32 + Capab uint32 + Index uint32 + RefCnt uint32 + TunnelKeyAction uint32 + type U32 struct + Actions *[]*Action + ClassID *uint32 + Divisor *uint32 + Flags *uint32 + Hash *uint32 + InDev *string + Link *uint32 + Mark *U32Mark + Pcnt *uint64 + Police *Police + Sel *U32Sel + type U32Key struct + Mask uint32 + Off uint32 + OffMask uint32 + Val uint32 + type U32Mark struct + Mask uint32 + Success uint32 + Val uint32 + type U32Match struct + Mask uint32 + Off int32 + OffMask uint32 + Value uint32 + type U32Sel struct + Flags uint8 + Hmask uint32 + Hoff uint16 + Keys []U32Key + NKeys uint8 + Off uint16 + OffMask uint16 + Offoff uint16 + Offshift uint8 + type VLan struct + Parms *VLanParms + PushID *uint16 + PushPriority *uint32 + PushProtocol *uint16 + Tm *Tcft + type VLanParms struct + Action uint32 + BindCnt uint32 + Capab uint32 + Index uint32 + RefCnt uint32 + VLanAction uint32 + type XStats struct + Cbq *CbqXStats + Choke *ChokeXStats + Codel *CodelXStats + FqCodel *FqCodelXStats + Hfsc *HfscXStats + Hhf *HhfXStats + Htb *HtbXStats + Pie *PieXStats + Red *RedXStats + Sfb *SfbXStats + Sfq *SfqXStats