Documentation ¶
Index ¶
- func DetectDefaultRouteInterface() (netlink.Link, error)
- func DetectDefaultRouteInterfaceName() (string, error)
- func DisableRpFilter(ifName string) error
- func EnsureLinkAddr(addr *netlink.Addr, dev netlink.Link) error
- func FindENILinkByMac(macAddress string) (netlink.Link, error)
- func IsExistsError(err error) bool
- func IsLinkNotFound(err error) bool
- func IsNoRouteToHostError(err error) bool
- func IsNotExistError(err error) bool
- func MoveAndRenameLink(dev netlink.Link, targetNs ns.NetNS, devName string) (err error)
- func ReplaceRoute(routes []netlink.Route) error
- type ContainerContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableRpFilter ¶
DisableRpFilter tries to disable rpfilter on specified interface
func FindENILinkByMac ¶
FindENILinkByMac the MAC address inputted will return the corresponding netlink.Link network equipment.
func IsExistsError ¶
IsExistsError returns true if the error type is syscall.EEXIST
func IsLinkNotFound ¶
IsLinkNotFound returns true if error is LinkNotFoundError
func IsNoRouteToHostError ¶
func IsNotExistError ¶
IsNotExistError returns true if the error type is syscall.ENOENT or syscall.ESRCH
func MoveAndRenameLink ¶
MoveAndRenameLink Reename the network equipment after moving to target namespace
func ReplaceRoute ¶
Types ¶
type ContainerContext ¶
type ContainerContext struct { ID string NetnsPath string Driver string ContainerDev netlink.Link HostDev netlink.Link ContainerNetns ns.NetNS }
func NewContainerContext ¶
func NewContainerContext(id string, netnsPath string) (*ContainerContext, error)
func (*ContainerContext) Close ¶
func (ctx *ContainerContext) Close()
func (*ContainerContext) GetContainerDev ¶
func (ctx *ContainerContext) GetContainerDev(devName string) ([]netlink.Link, error)
Click to show internal directories.
Click to hide internal directories.