Documentation ¶
Index ¶
- Variables
- func AddrDel(ctx context.Context, link netlink.Link, addr *netlink.Addr) error
- func AddrReplace(ctx context.Context, link netlink.Link, addr *netlink.Addr) error
- func CleanIPRules(ctx context.Context) (err error)
- func DelEgressPriority(ctx context.Context, link netlink.Link, ipNetSet *terwayTypes.IPNetSet) error
- func DelFilter(ctx context.Context, link netlink.Link, parentID uint32, ...) error
- func DelLinkByName(ctx context.Context, ifName string) error
- func EnsureAddr(ctx context.Context, link netlink.Link, expect *netlink.Addr) (bool, error)
- func EnsureClsActQdsic(ctx context.Context, link netlink.Link) error
- func EnsureHostNsConfig(ipv4, ipv6 bool) error
- func EnsureIPRule(ctx context.Context, expected *netlink.Rule) (bool, error)
- func EnsureLinkMTU(ctx context.Context, link netlink.Link, mtu int) (bool, error)
- func EnsureLinkName(ctx context.Context, link netlink.Link, name string) (bool, error)
- func EnsureLinkUp(ctx context.Context, link netlink.Link) (bool, error)
- func EnsureMQQdisc(ctx context.Context, link netlink.Link) error
- func EnsureNeigh(ctx context.Context, neigh *netlink.Neigh) (bool, error)
- func EnsureNetConfSet(ipv4, ipv6 bool) error
- func EnsurePrioQdiscAt10(ctx context.Context, link netlink.Link) error
- func EnsureRoute(ctx context.Context, expected *netlink.Route) (bool, error)
- func EnsureVlanTag(ctx context.Context, link netlink.Link, ipNetSet *terwayTypes.IPNetSet, ...) error
- func EnsureVlanUntagger(ctx context.Context, link netlink.Link) error
- func FilterAdd(ctx context.Context, filter *netlink.U32) error
- func FilterDel(ctx context.Context, filter netlink.Filter) error
- func FindIPRule(rule *netlink.Rule) ([]netlink.Rule, error)
- func FoundRoutes(expected *netlink.Route) ([]netlink.Route, error)
- func GenerateIPv6Sysctl(ifName string, disableRA, enableForward bool) map[string][]string
- func GenericTearDown(ctx context.Context, netNS ns.NetNS) error
- func GetERdmaFromLink(link netlink.Link) (*netlink.RdmaLink, error)
- func GetHostIP(ipv4, ipv6 bool) (*terwayTypes.IPNetSet, error)
- func GetRouteTableID(linkIndex int) int
- func InitLog(debug bool) logr.Logger
- func JSONStr(v interface{}) string
- func LinkAdd(ctx context.Context, link netlink.Link) error
- func LinkDel(ctx context.Context, link netlink.Link) error
- func LinkSetDown(ctx context.Context, link netlink.Link) error
- func LinkSetMTU(ctx context.Context, link netlink.Link, mtu int) error
- func LinkSetName(ctx context.Context, link netlink.Link, name string) error
- func LinkSetNsFd(ctx context.Context, link netlink.Link, netNS ns.NetNS) error
- func LinkSetUp(ctx context.Context, link netlink.Link) error
- func NeighSet(ctx context.Context, neigh *netlink.Neigh) error
- func NetlinkFamily(ip net.IP) int
- func NewIPNet(ipNet *terwayTypes.IPNetSet) *terwayTypes.IPNetSet
- func NewIPNet1(ipNet *terwayTypes.IPNetSet) []*netlink.Addr
- func NewIPNetToMaxMask(ipNet *terwayTypes.IPNetSet) []*netlink.Addr
- func NewIPNetWithMaxMask(ipNet *net.IPNet) *net.IPNet
- func QdiscDel(ctx context.Context, qdisc netlink.Qdisc) error
- func QdiscReplace(ctx context.Context, qdisc netlink.Qdisc) error
- func RouteDel(ctx context.Context, route *netlink.Route) error
- func RouteReplace(ctx context.Context, route *netlink.Route) error
- func RuleAdd(ctx context.Context, rule *netlink.Rule) error
- func RuleDel(ctx context.Context, rule *netlink.Rule) error
- func SetEgressPriority(ctx context.Context, link netlink.Link, classID uint32, ...) error
- func SetFilter(ctx context.Context, link netlink.Link, parentID, classID uint32, ...) error
- func SetupTC(link netlink.Link, bandwidthInBytes uint64) error
- type Locker
Constants ¶
This section is empty.
Variables ¶
var Log = logr.Discard()
Functions ¶
func AddrReplace ¶
func CleanIPRules ¶
CleanIPRules del ip rule for detached devs
func DelEgressPriority ¶ added in v1.3.0
func DelFilter ¶ added in v1.3.0
func DelFilter(ctx context.Context, link netlink.Link, parentID uint32, ipNetSet *terwayTypes.IPNetSet) error
DelFilter del u32 filter by pod ip
func DelLinkByName ¶
DelLinkByName del by name and ignore if link not present
func EnsureAddr ¶
EnsureAddr ensure only one IP for each family is present on link
func EnsureHostNsConfig ¶
EnsureHostNsConfig setup host namespace configs
func EnsureLinkMTU ¶
EnsureLinkMTU set link mtu,return changed and err
func EnsureLinkName ¶
func EnsureLinkUp ¶
EnsureLinkUp set link up,return changed and err
func EnsureMQQdisc ¶ added in v1.3.0
EnsureMQQdisc write qdisc
func EnsureNetConfSet ¶
EnsureNetConfSet will set net config to all link
func EnsurePrioQdiscAt10 ¶ added in v1.3.0
EnsurePrioQdiscAt10 write qdisc attach under mq
func EnsureRoute ¶
EnsureRoute will call ip route replace if route is not found
func EnsureVlanTag ¶ added in v1.4.0
func EnsureVlanTag(ctx context.Context, link netlink.Link, ipNetSet *terwayTypes.IPNetSet, vid uint16) error
EnsureVlanTag use tc-vlan set vlan tag
func FindIPRule ¶
FindIPRule look up ip rules in config
func FoundRoutes ¶
FoundRoutes look up routes
func GenerateIPv6Sysctl ¶
func GenericTearDown ¶
GenericTearDown target to clean all related resource as much as possible
func GetERdmaFromLink ¶ added in v1.9.8
func GetRouteTableID ¶
GetRouteTableID add 1000 to link index to avoid route table conflict
func NetlinkFamily ¶
func NewIPNet ¶
func NewIPNet(ipNet *terwayTypes.IPNetSet) *terwayTypes.IPNetSet
func NewIPNetToMaxMask ¶
func NewIPNetToMaxMask(ipNet *terwayTypes.IPNetSet) []*netlink.Addr
func SetEgressPriority ¶ added in v1.3.0
func SetEgressPriority(ctx context.Context, link netlink.Link, classID uint32, ipNetSet *terwayTypes.IPNetSet) error
SetEgressPriority write egress priority rule for pod