tc

package
v1.17.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contain added in v1.4.0

func Contain(keys []netlink.TcU32Key, subKeys []netlink.TcU32Key) bool

func FilterBySrcIP added in v1.3.0

func FilterBySrcIP(link netlink.Link, parent uint32, ipNet *net.IPNet) (*netlink.U32, error)

FilterBySrcIP found u32 filter by pod ip used for prio only.

Note: match keys are family-specific (IPv4 → 1 key at off=12; IPv6 → 4 keys at off=8/12/16/20), so the key set alone disambiguates address family. We intentionally do not compare u32.Protocol here so this lookup tolerates existing filters created with either ETH_P_IP or ETH_P_IPV6 (older builds always used ETH_P_IP for both families).

func MatchSrc added in v1.3.0

func MatchSrc(u32 *netlink.U32, ipNet *net.IPNet)

MatchSrc add match for source ip

func SetRule

func SetRule(dev netlink.Link, rule *TrafficShapingRule) error

SetRule set the traffic rule on interface

func U32IPv4Src added in v1.3.0

func U32IPv4Src(ipNet *net.IPNet) netlink.TcU32Key

func U32IPv6Src added in v1.3.0

func U32IPv6Src(ipNet *net.IPNet) []netlink.TcU32Key

func U32MatchSrc added in v1.3.0

func U32MatchSrc(ipNet *net.IPNet) []netlink.TcU32Key

U32MatchSrc return u32 match key by src ip

Types

type TrafficShapingRule added in v1.1.0

type TrafficShapingRule struct {
	// rate in bytes
	Rate uint64
}

TrafficShapingRule the interface traffic shaping rule

Jump to

Keyboard shortcuts

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