bootstrap

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultBridge

func CreateDefaultBridge(name string) (*netlink.Bridge, error)

CreateDefaultBridge creates the default bridge of the node that will received the management interface

func DefaultBridgeValid

func DefaultBridgeValid() error

DefaultBridgeValid validates default bridge exists and of correct type

func NotAttachedFilter added in v0.4.9

func NotAttachedFilter(link netlink.Link) (bool, error)

NotAttachedFilter filters out network cards that area attached to bridges

func PhysicalFilter added in v0.4.9

func PhysicalFilter(link netlink.Link) (bool, error)

PhysicalFilter returns true if physical link

func PluggedFilter added in v0.4.9

func PluggedFilter(link netlink.Link) (bool, error)

PluggedFilter returns true if link is plugged in

func SelectZOS

func SelectZOS(cfgs []IfaceConfig) (string, error)

SelectZOS decide which interface should be assigned to the ZOS bridge if multiple interfaces receives an IP from DHCP we prefer a interfaces that has the smallest IP and private IP gateway if none is found, then we pick the interface that has the smallest IP and any IP gateway

Types

type Filter added in v0.4.9

type Filter func(link netlink.Link) (bool, error)

Filter interface to filter out links

type IfaceConfig

type IfaceConfig struct {
	Name    string
	Addrs4  []netlink.Addr
	Addrs6  []netlink.Addr
	Routes4 []netlink.Route
	Routes6 []netlink.Route
}

IfaceConfig contains all the IP address and routes of an interface

func AnalyseLink(ctx context.Context, requires Requires, link netlink.Link) (cfg IfaceConfig, err error)

AnalyseLink gets information about link

func AnalyseLinks(requires Requires, filters ...Filter) ([]IfaceConfig, error)

AnalyseLinks is used to gather the IP that each interfaces would be from DHCP and SLAAC it returns the IPs and routes for each interfaces for both IPv4 and IPv6

It will list all the physical interfaces that have a cable plugged in it create a network namespace per interfaces start a DHCP probe on each interfaces and gather the IPs and routes received

type Requires added in v0.4.9

type Requires int

Requires tesll the analyser to wait for ip type

const (
	// RequiresIPv4 requires ipv4
	RequiresIPv4 Requires = 1 << iota
	// RequiresIPv6 requires ipv6
	RequiresIPv6
)

Jump to

Keyboard shortcuts

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