networkutils

package
v1.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupNetworkFakeHelper

func SetupNetworkFakeHelper()

func SetupNetworkHelper

func SetupNetworkHelper()

Types

type NetworkUtils

type NetworkUtils struct {
}

func (NetworkUtils) CleanupNicNetwork

func (n NetworkUtils) CleanupNicNetwork(nic *rpc.HostNic) error

After the Response is uninstalled, the relevant routes are cleared, so you only need to delete the rule.

func (NetworkUtils) IsNSorErr

func (n NetworkUtils) IsNSorErr(nspath string) error

func (NetworkUtils) LinkByMacAddr

func (n NetworkUtils) LinkByMacAddr(macAddr string) (netlink.Link, error)

should check result, maybe empty

func (NetworkUtils) SetupNicNetwork

func (n NetworkUtils) SetupNicNetwork(nic *rpc.HostNic) error

Note: setup NetworkManager to disable dhcp on nic SetupNicNetwork adds default route to route table (nic-<nic_table>)

type NetworkUtilsFake

type NetworkUtilsFake struct {
	Links  map[string]netlink.Link
	Rules  map[string]netlink.Rule
	Routes map[int][]netlink.Route
}

func (NetworkUtilsFake) CleanupNicNetwork

func (n NetworkUtilsFake) CleanupNicNetwork(nic *rpc.HostNic) error

func (NetworkUtilsFake) IsNSorErr

func (n NetworkUtilsFake) IsNSorErr(nspath string) error

func (NetworkUtilsFake) LinkByMacAddr

func (n NetworkUtilsFake) LinkByMacAddr(macAddr string) (netlink.Link, error)

func (NetworkUtilsFake) SetupNicNetwork

func (n NetworkUtilsFake) SetupNicNetwork(nic *rpc.HostNic) error

type NetworkUtilsWrap

type NetworkUtilsWrap interface {
	CleanupNicNetwork(nic *rpc.HostNic) error
	SetupNicNetwork(nic *rpc.HostNic) error
	LinkByMacAddr(macAddr string) (netlink.Link, error)
	IsNSorErr(nspath string) error
}
var (
	NetworkHelper NetworkUtilsWrap
)

Jump to

Keyboard shortcuts

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