network

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2017 License: Apache-2.0 Imports: 11 Imported by: 12 modules, 26 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultBridgeIface = "hyper0"
	DefaultBridgeIP    = "192.168.123.0/24"
)

Variables

View Source
var (
	IpAllocator   = ipallocator.New()
	BridgeIPv4Net *net.IPNet
	BridgeIface   string
	BridgeIP      string
)

Functions

func DeleteBridge

func DeleteBridge(name string) error

func InitNetwork

func InitNetwork(bIface, bIP string, disable bool) error

func IpParser added in v1.0.0

func IpParser(ipstr string) (net.IP, net.IPMask, error)

func NicName added in v1.0.0

func NicName(id string, index int) string

func ReleaseAddr added in v0.8.0

func ReleaseAddr(releasedIP string) error

func UpAndAddToBridge

func UpAndAddToBridge(name, bridge, options string) error

Types

type Settings

type Settings struct {
	Mac       string
	IPAddress string
	Gateway   string
	Bridge    string
	Device    string
	Automatic bool
}

func AllocateAddr added in v0.8.0

func AllocateAddr(requestedIP string) (*Settings, error)

func Configure

func Configure(inf *api.InterfaceDescription) (*Settings, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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