iproute

package
v1.6.2-rc Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureIPRule

func EnsureIPRule(expected *netlink.Rule) error

EnsureIPRule add specified rule if it not exists.

func EnsureNeigh

func EnsureNeigh(neigh *netlink.Neigh) error

EnsureNeigh add specified neigh if it not exists.

func EnsureRoute

func EnsureRoute(expected *netlink.Route) error

EnsureRoute add specified route if it not exists.

func FindIPRule

func FindIPRule(rule *netlink.Rule) ([]netlink.Rule, error)

FindIPRule lookup expected rules.

func FoundRoutes

func FoundRoutes(expected *netlink.Route) ([]netlink.Route, error)

FoundRoutes lookup expected Routes.

func GetDefaultRoute

func GetDefaultRoute(family int) (*netlink.Route, error)

GetDefaultRoute get the default route of the corresponding family.

func GetHostIP

func GetHostIP() (*types.IPSet, error)

GetHostIP return types.IPSet of Host.

func GetHostLinkByDefaultRoute

func GetHostLinkByDefaultRoute(family int) (netlink.Link, error)

GetHostLinkByDefaultRoute get the link pointed to by the default route.

func GetLinkAddresses

func GetLinkAddresses(link netlink.Link) ([]netlink.Addr, error)

GetLinkAddresses return ips of specified link.

func LinkByMac

func LinkByMac(mac string) (netlink.Link, error)

LinkByMac get link by mac, it will ignore virtual nic type.

func NetlinkFamily

func NetlinkFamily(ip net.IP) int

NetlinkFamily return family of ip.

Types

This section is empty.

Jump to

Keyboard shortcuts

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