net

package
v0.0.28 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const UbuntuNetManagerLogTag = "UbuntuNetManager"

Variables

This section is empty.

Functions

func NewDefaultNetworkResolver

func NewDefaultNetworkResolver(
	routesSearcher RoutesSearcher,
	ipResolver boship.Resolver,
) boshsettings.DefaultNetworkResolver

Types

type DHCPInterfaceConfiguration

type DHCPInterfaceConfiguration struct {
	Name string
}

type DHCPInterfaceConfigurations

type DHCPInterfaceConfigurations []DHCPInterfaceConfiguration

func (DHCPInterfaceConfigurations) Len

func (configs DHCPInterfaceConfigurations) Len() int

func (DHCPInterfaceConfigurations) Less

func (configs DHCPInterfaceConfigurations) Less(i, j int) bool

func (DHCPInterfaceConfigurations) Swap

func (configs DHCPInterfaceConfigurations) Swap(i, j int)

type InterfaceConfigurationCreator

type InterfaceConfigurationCreator interface {
	CreateInterfaceConfigurations(boshsettings.Networks, map[string]string) ([]StaticInterfaceConfiguration, []DHCPInterfaceConfiguration, error)
}

func NewInterfaceConfigurationCreator

func NewInterfaceConfigurationCreator(logger boshlog.Logger) InterfaceConfigurationCreator

type Manager

type Manager interface {
	// SetupNetworking configures network interfaces with either a static ip or dhcp.
	// If errCh is provided, nil or an error will be sent
	// upon completion of background network reconfiguration (e.g. arping).
	SetupNetworking(networks boshsettings.Networks, errCh chan error) error

	// Returns the list of interfaces that have configurations for them present
	GetConfiguredNetworkInterfaces() ([]string, error)
}

func NewCentosNetManager

func NewCentosNetManager(
	fs boshsys.FileSystem,
	cmdRunner boshsys.CmdRunner,
	ipResolver boship.Resolver,
	interfaceConfigurationCreator InterfaceConfigurationCreator,
	addressBroadcaster bosharp.AddressBroadcaster,
	logger boshlog.Logger,
) Manager

func NewUbuntuNetManager

func NewUbuntuNetManager(
	fs boshsys.FileSystem,
	cmdRunner boshsys.CmdRunner,
	ipResolver boship.Resolver,
	interfaceConfigurationCreator InterfaceConfigurationCreator,
	addressBroadcaster bosharp.AddressBroadcaster,
	logger boshlog.Logger,
) Manager

type Route

type Route struct {
	Destination   string
	Gateway       string
	InterfaceName string
}

func (Route) IsDefault

func (r Route) IsDefault() bool

type RoutesSearcher

type RoutesSearcher interface {
	SearchRoutes() ([]Route, error)
}

func NewCmdRoutesSearcher

func NewCmdRoutesSearcher(runner boshsys.CmdRunner) RoutesSearcher

type StaticInterfaceConfiguration

type StaticInterfaceConfiguration struct {
	Name      string
	Address   string
	Netmask   string
	Network   string
	Broadcast string
	Mac       string
	Gateway   string
}

type StaticInterfaceConfigurations

type StaticInterfaceConfigurations []StaticInterfaceConfiguration

func (StaticInterfaceConfigurations) Len

func (configs StaticInterfaceConfigurations) Len() int

func (StaticInterfaceConfigurations) Less

func (configs StaticInterfaceConfigurations) Less(i, j int) bool

func (StaticInterfaceConfigurations) Swap

func (configs StaticInterfaceConfigurations) Swap(i, j int)

type UbuntuNetManager

type UbuntuNetManager struct {
	// contains filtered or unexported fields
}

func (UbuntuNetManager) ComputeNetworkConfig

func (UbuntuNetManager) GetConfiguredNetworkInterfaces

func (net UbuntuNetManager) GetConfiguredNetworkInterfaces() ([]string, error)

func (UbuntuNetManager) SetupNetworking

func (net UbuntuNetManager) SetupNetworking(networks boshsettings.Networks, errCh chan error) error

Directories

Path Synopsis
arp
ip

Jump to

Keyboard shortcuts

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