Documentation ¶
Index ¶
- Constants
- func LockFileExistsForConfiguredInterfaces(dirProvider boshdirs.Provider) bool
- func LockFileExistsForDNS(fs boshsys.FileSystem, dirProvider boshdirs.Provider) bool
- func LockFileExistsForRandomizedPasswords(fs boshsys.FileSystem, dirProvider boshdirs.Provider) bool
- func NewDefaultNetworkResolver(routesSearcher RoutesSearcher, ipResolver boship.Resolver) boshsettings.DefaultNetworkResolver
- func SetupIptables(host, port string, addr_array []net.IP) error
- func SetupNatsFirewall(mbus string) error
- func WriteLockFileForDNS(fs boshsys.FileSystem, dirProvider boshdirs.Provider) error
- func WriteLockFileForRandomizedPasswords(fs boshsys.FileSystem, dirProvider boshdirs.Provider) error
- type DHCPInterfaceConfiguration
- type DHCPInterfaceConfigurations
- type Interface
- type InterfaceConfigurationCreator
- type InterfaceManager
- type KernelIPv6
- type KernelIPv6Impl
- type MACAddressDetector
- type Manager
- func NewCentosNetManager(fs boshsys.FileSystem, cmdRunner boshsys.CmdRunner, ipResolver boship.Resolver, ...) Manager
- func NewUbuntuNetManager(fs boshsys.FileSystem, cmdRunner boshsys.CmdRunner, ipResolver boship.Resolver, ...) Manager
- func NewWindowsNetManager(runner boshsys.CmdRunner, ...) Manager
- type Route
- type RoutesSearcher
- type StaticInterfaceConfiguration
- type StaticInterfaceConfigurations
- type UbuntuNetManager
- func (net UbuntuNetManager) ComputeNetworkConfig(networks boshsettings.Networks) ([]StaticInterfaceConfiguration, []DHCPInterfaceConfiguration, []string, error)
- func (net UbuntuNetManager) GetConfiguredNetworkInterfaces() ([]string, error)
- func (net UbuntuNetManager) SetupIPv6(config boshsettings.IPv6, stopCh <-chan struct{}) error
- func (net UbuntuNetManager) SetupNetworking(networks boshsettings.Networks, mbus string, errCh chan error) error
- type VirtualInterface
- type WindowsNetManager
- func (net WindowsNetManager) ComputeNetworkConfig(networks boshsettings.Networks) ([]StaticInterfaceConfiguration, []DHCPInterfaceConfiguration, []string, error)
- func (net WindowsNetManager) GetConfiguredNetworkInterfaces() ([]string, error)
- func (net WindowsNetManager) SetupIPv6(_ boshsettings.IPv6, _ <-chan struct{}) error
- func (net WindowsNetManager) SetupNetworking(networks boshsettings.Networks, mbus string, errCh chan error) error
Constants ¶
const ( SetDNSTemplate = `` /* 207-byte string literal not displayed */ ResetDNSTemplate = `` /* 180-byte string literal not displayed */ NicSettingsTemplate = ` netsh interface ip set address %q static %s %s %s ` )
const DefaultAddress = `0.0.0.0`
const (
UbuntuNetManagerLogTag = "UbuntuNetManager"
)
Variables ¶
This section is empty.
Functions ¶
func LockFileExistsForDNS ¶
func LockFileExistsForDNS(fs boshsys.FileSystem, dirProvider boshdirs.Provider) bool
func LockFileExistsForRandomizedPasswords ¶
func LockFileExistsForRandomizedPasswords(fs boshsys.FileSystem, dirProvider boshdirs.Provider) bool
func NewDefaultNetworkResolver ¶
func NewDefaultNetworkResolver( routesSearcher RoutesSearcher, ipResolver boship.Resolver, ) boshsettings.DefaultNetworkResolver
func SetupNatsFirewall ¶
SetupNatsFirewall will setup the outgoing cgroup based rule that prevents everything except the agent to open connections to the nats api
func WriteLockFileForDNS ¶
func WriteLockFileForDNS(fs boshsys.FileSystem, dirProvider boshdirs.Provider) error
func WriteLockFileForRandomizedPasswords ¶
func WriteLockFileForRandomizedPasswords(fs boshsys.FileSystem, dirProvider boshdirs.Provider) error
Types ¶
type DHCPInterfaceConfiguration ¶
type DHCPInterfaceConfiguration struct { Name string PostUpRoutes boshsettings.Routes Address string }
func (DHCPInterfaceConfiguration) IsVersion6 ¶
func (c DHCPInterfaceConfiguration) IsVersion6() bool
func (DHCPInterfaceConfiguration) Version6 ¶
func (c DHCPInterfaceConfiguration) Version6() string
type DHCPInterfaceConfigurations ¶
type DHCPInterfaceConfigurations []DHCPInterfaceConfiguration
func (DHCPInterfaceConfigurations) HasVersion6 ¶
func (configs DHCPInterfaceConfigurations) HasVersion6() bool
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 InterfaceManager ¶
func NewInterfaceManager ¶
func NewInterfaceManager() InterfaceManager
type KernelIPv6 ¶
type KernelIPv6 interface {
Enable(stopCh <-chan struct{}) error
}
type KernelIPv6Impl ¶
type KernelIPv6Impl struct {
// contains filtered or unexported fields
}
func NewKernelIPv6Impl ¶
func NewKernelIPv6Impl(fs boshsys.FileSystem, cmdRunner boshsys.CmdRunner, logger boshlog.Logger) KernelIPv6Impl
func (KernelIPv6Impl) Enable ¶
func (net KernelIPv6Impl) Enable(stopCh <-chan struct{}) error
type MACAddressDetector ¶
func NewLinuxMacAddressDetector ¶
func NewLinuxMacAddressDetector(fs boshsys.FileSystem) 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, mbus string, 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, macAddressDetector MACAddressDetector, interfaceConfigurationCreator InterfaceConfigurationCreator, interfaceAddrsProvider boship.InterfaceAddressesProvider, dnsResolver boshdnsresolver.DNSResolver, addressBroadcaster bosharp.AddressBroadcaster, logger boshlog.Logger, ) Manager
func NewUbuntuNetManager ¶
func NewUbuntuNetManager( fs boshsys.FileSystem, cmdRunner boshsys.CmdRunner, ipResolver boship.Resolver, macAddressDetector MACAddressDetector, interfaceConfigurationCreator InterfaceConfigurationCreator, interfaceAddrsProvider boship.InterfaceAddressesProvider, dnsResolver boshdnsresolver.DNSResolver, addressBroadcaster bosharp.AddressBroadcaster, kernelIPv6 KernelIPv6, 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 RoutesSearcher ¶
func NewRoutesSearcher ¶
func NewRoutesSearcher(logger boshlog.Logger, runner boshsys.CmdRunner, _ InterfaceManager) RoutesSearcher
type StaticInterfaceConfiguration ¶
type StaticInterfaceConfiguration struct { Name string Address string Netmask string Network string Broadcast string IsDefaultForGateway bool Mac string Gateway string PostUpRoutes boshsettings.Routes VirtualInterfaces []VirtualInterface }
func (StaticInterfaceConfiguration) CIDR ¶
func (c StaticInterfaceConfiguration) CIDR() (string, error)
func (StaticInterfaceConfiguration) IsVersion6 ¶
func (c StaticInterfaceConfiguration) IsVersion6() bool
func (StaticInterfaceConfiguration) Version6 ¶
func (c StaticInterfaceConfiguration) Version6() string
type StaticInterfaceConfigurations ¶
type StaticInterfaceConfigurations []StaticInterfaceConfiguration
func (StaticInterfaceConfigurations) HasVersion6 ¶
func (configs StaticInterfaceConfigurations) HasVersion6() bool
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 (net UbuntuNetManager) ComputeNetworkConfig(networks boshsettings.Networks) ([]StaticInterfaceConfiguration, []DHCPInterfaceConfiguration, []string, error)
func (UbuntuNetManager) GetConfiguredNetworkInterfaces ¶
func (net UbuntuNetManager) GetConfiguredNetworkInterfaces() ([]string, error)
func (UbuntuNetManager) SetupIPv6 ¶
func (net UbuntuNetManager) SetupIPv6(config boshsettings.IPv6, stopCh <-chan struct{}) error
func (UbuntuNetManager) SetupNetworking ¶
func (net UbuntuNetManager) SetupNetworking(networks boshsettings.Networks, mbus string, errCh chan error) error
type VirtualInterface ¶
type WindowsNetManager ¶
type WindowsNetManager struct {
// contains filtered or unexported fields
}
func (WindowsNetManager) ComputeNetworkConfig ¶
func (net WindowsNetManager) ComputeNetworkConfig(networks boshsettings.Networks) ( []StaticInterfaceConfiguration, []DHCPInterfaceConfiguration, []string, error, )
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 ¶
func (net WindowsNetManager) SetupIPv6(_ boshsettings.IPv6, _ <-chan struct{}) error
func (WindowsNetManager) SetupNetworking ¶
func (net WindowsNetManager) SetupNetworking(networks boshsettings.Networks, mbus string, errCh chan error) error
Source Files ¶
- centos_net_manager.go
- default_network_resolver.go
- firewall_provider_linux.go
- interface_configuration_creator.go
- interface_manager_interface.go
- interface_manager_unix.go
- kernel_ipv6.go
- lock_file.go
- mac_address_detector.go
- net_manager_interface.go
- routes_searcher_interface.go
- routes_searcher_unix.go
- ubuntu_net_manager.go
- windows_net_manager.go