net

package
v2.18.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SetDNSTemplate = `` /* 207-byte string literal not displayed */

	ResetDNSTemplate = `` /* 180-byte string literal not displayed */

	NicSettingsTemplate = `` /* 173-byte string literal not displayed */

)
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 DNSValidator

type DNSValidator interface {
	Validate([]string) error
}

func NewDNSValidator

func NewDNSValidator(fs boshsys.FileSystem) DNSValidator

type InterfaceConfigurationCreator

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

func NewInterfaceConfigurationCreator

func NewInterfaceConfigurationCreator(logger boshlog.Logger) InterfaceConfigurationCreator

type MACAddressDetector

type MACAddressDetector interface {
	MACAddresses() (map[string]string, error)
}

func NewMACAddressDetector

func NewMACAddressDetector() MACAddressDetector

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)

	SetupIPv6(boshsettings.IPv6, <-chan struct{}) error
}

func NewCentosNetManager

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

func NewUbuntuNetManager

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

func NewWindowsNetManager

func NewWindowsNetManager(
	runner boshsys.CmdRunner,
	interfaceConfigurationCreator InterfaceConfigurationCreator,
	macAddressDetector MACAddressDetector,
	logger boshlog.Logger,
	clock clock.Clock,
	fs boshsys.FileSystem,
	dirProvider boshdirs.Provider,
) 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 NewRoutesSearcher

func NewRoutesSearcher(runner boshsys.CmdRunner) RoutesSearcher

type StaticInterfaceConfiguration

type StaticInterfaceConfiguration struct {
	Name                string
	Address             string
	Netmask             string
	Network             string
	Broadcast           string
	IsDefaultForGateway bool
	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) SetupIPv6 added in v0.0.34

func (net UbuntuNetManager) SetupIPv6(config boshsettings.IPv6, stopCh <-chan struct{}) error

func (UbuntuNetManager) SetupNetworking

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

type WindowsNetManager

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

func (WindowsNetManager) ComputeNetworkConfig

func (WindowsNetManager) GetConfiguredNetworkInterfaces

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

GetConfiguredNetworkInterfaces returns all of the network interfaces if a previous call to SetupNetworking succeeded as indicated by the presence of a file ("configured_interfaces.txt").

A file is used because there is no good way to determine if network interfaces are configured on Windows and SetupNetworking may be called during bootstrap so it is possible the agent will have restarted since it the last call.

We return all of the network interfaces as we configure DNS for all of the network interfaces. Apart from DNS, the returned network interfaces may not have been configured.

func (WindowsNetManager) SetupIPv6 added in v0.0.34

func (net WindowsNetManager) SetupIPv6(_ boshsettings.IPv6, _ <-chan struct{}) error

func (WindowsNetManager) SetupNetworking

func (net WindowsNetManager) 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