nettool

package
v0.0.0-...-d3c8f0a Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDefaultRoute

func AddDefaultRoute(gw net.IP, dev netlink.Link) error

func AddHostRoute

func AddHostRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error

func AddRoute

func AddRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error

AddRoute adds a universally-scoped route to a device.

func CreateOrUpdateBridge

func CreateOrUpdateBridge(name, ip string, mtu int) (*netlink.Bridge, error)

func GetAllIPs

func GetAllIPs(cidr string) ([]string, error)

func GetVethIPInNS

func GetVethIPInNS(netns ns.NetNS, ifName string) (string, error)

GetVethIPInNS return the IP address for the ifName in container namespace

func SetupVeth

func SetupVeth(netns ns.NetNS, br *netlink.Bridge, ifname, ip, gwip string, mtu int) error

Types

type AllocatedIP

type AllocatedIP struct {
	Version string `json:"version"`
	Address string `json:"address"`
	Gateway string `json:"gateway"`
}

Jump to

Keyboard shortcuts

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