ip

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// link
	RandomVethName() (string, error)
	RenameLink(curName, newName string) error
	SetupVethWithName(contVethName, hostVethName string, mtu int, hostNS ns.NetNS) (net.Interface, net.Interface, error)
	SetupVeth(contVethName string, mtu int, hostNS ns.NetNS) (net.Interface, net.Interface, error)
	DelLinkByName(ifName string) error
	DelLinkByNameAddr(ifName string) ([]*net.IPNet, error)
	GetVethPeerIfindex(ifName string) (netlink.Link, int, error)

	// forward
	EnableIP4Forward() error
	EnableIP6Forward() error
	EnableForward(ips []*current.IPConfig) error

	// masq
	SetupIPMasq(ipn *net.IPNet, chain string, comment string) error
	TeardownIPMasq(ipn *net.IPNet, chain string, comment string) error

	// route
	AddRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error
	AddHostRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error
	AddDefaultRoute(gw net.IP, dev netlink.Link) error
}

Interface is the wrapper interface for the containernetworking ip

func New

func New() Interface

New returns a new IP

Directories

Path Synopsis
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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