networkutils

package
v1.0.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IpsetHandler ipsetHandler

Functions

func GetConfigForDebug

func GetConfigForDebug() map[string]interface{}

not use GetConfigForDebug returns the active values of the configuration env vars (for debugging purposes).

func GetVPNNet

func GetVPNNet(ip string) string

GetVPNNet return the ip from the vpn tunnel, which in most time is the x.x.255.254

func InitIpset

func InitIpset()

Types

type NetworkAPIs

type NetworkAPIs interface {
	// SetupNodeNetwork performs node level network configuration
	SetupHostNetwork(primaryMAC string, primaryAddr *net.IP) error
	// SetupNICNetwork performs nic level network configuration
	SetupNICNetwork(nicIP string, mac string, table int, subnetCIDR string) error
}

NetworkAPIs defines the host level and the nic level network related operations

func New

func New() NetworkAPIs

New creates a linuxNetwork object

func NewFakeNetworkAPI

func NewFakeNetworkAPI(netlink netlinkwrapper.NetLink, iptableIface iptables.IptablesIface, setProcSys func(string, string) error) NetworkAPIs

NewFakeNetworkAPI is used by unit test

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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