Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNetworkUnreachableError ¶ added in v1.4.0
IsNetworkUnreachableError returns true if the error type is syscall.ENETUNREACH This helps us determine if we should ignore this error as the route the call depends on is not plumbed ready yet
func IsNotExistsError ¶ added in v1.4.0
IsNotExistsError returns true if the error type is syscall.ESRCH This helps us determine if we should ignore this error as the route that we want to cleanup has been deleted already routing table
func IsRouteExistsError ¶ added in v1.4.0
IsRouteExistsError returns true if the error type is syscall.EEXIST This helps us determine if we should ignore this error as the route we want to add has been added already in routing table
Types ¶
type NetLink ¶
type NetLink interface { // LinkByName gets a link object given the device name LinkByName(name string) (netlink.Link, error) // LinkSetNsFd is equivalent to `ip link set $link netns $ns` LinkSetNsFd(link netlink.Link, fd int) error // ParseAddr parses an address string ParseAddr(s string) (*netlink.Addr, error) // AddrAdd is equivalent to `ip addr add $addr dev $link` AddrAdd(link netlink.Link, addr *netlink.Addr) error // AddrDel is equivalent to `ip addr del $addr dev $link` AddrDel(link netlink.Link, addr *netlink.Addr) error // AddrList is equivalent to `ip addr show ` AddrList(link netlink.Link, family int) ([]netlink.Addr, error) // LinkAdd is equivalent to `ip link add` LinkAdd(link netlink.Link) error // LinkSetUp is equivalent to `ip link set $link up` LinkSetUp(link netlink.Link) error // LinkList is equivalent to: `ip link show` LinkList() ([]netlink.Link, error) // LinkSetDown is equivalent to: `ip link set $link down` LinkSetDown(link netlink.Link) error // RouteList gets a list of routes in the system. RouteList(link netlink.Link, family int) ([]netlink.Route, error) // RouteAdd will add a route to the route table RouteAdd(route *netlink.Route) error // RouteReplace will replace the route in the route table RouteReplace(route *netlink.Route) error // RouteDel is equivalent to `ip route del` RouteDel(route *netlink.Route) error // NeighAdd equivalent to: `ip neigh add ....` NeighAdd(neigh *netlink.Neigh) error // LinkDel equivalent to: `ip link del $link` LinkDel(link netlink.Link) error // NewRule creates a new empty rule NewRule() *netlink.Rule // RuleAdd is equivalent to: ip rule add RuleAdd(rule *netlink.Rule) error // RuleDel is equivalent to: ip rule del RuleDel(rule *netlink.Rule) error // RuleList is equivalent to: ip rule list RuleList(family int) ([]netlink.Rule, error) // LinkSetMTU is equivalent to `ip link set dev $link mtu $mtu` LinkSetMTU(link netlink.Link, mtu int) error }
NetLink wraps methods used from the vishvananda/netlink package
Directories ¶
Path | Synopsis |
---|---|
Package mock_netlink is a generated GoMock package.
|
Package mock_netlink is a generated GoMock package. |
Package mock_netlinkwrapper is a generated GoMock package.
|
Package mock_netlinkwrapper is a generated GoMock package. |
Package mock_netlink is a generated GoMock package.
|
Package mock_netlink is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.