bootstrap

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RequiresIPv4 requires ipv4
	RequiresIPv4 = Requires{/* contains filtered or unexported fields */}
	// RequiresIPv6 requires ipv6
	RequiresIPv6 = Requires{/* contains filtered or unexported fields */}
)

Functions

func CreateDefaultBridge

func CreateDefaultBridge(name string, vlan *uint16) (*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

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

NotAttachedFilter filters out network cards that area attached to bridges

func NotIpsAssignedFilter

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

func PhysicalFilter

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

PhysicalFilter returns true if physical link

func PluggedFilter

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

func VEthFilter

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

Types

type Filter

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
	DefaultGW net.IP
}

IfaceConfig contains all the IP address and routes of an interface

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

AnalyzeLinks 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

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

Requires tells the analyzer to wait for ip type

func (Requires) WithIPv4

func (r Requires) WithIPv4(b bool) Requires

func (Requires) WithIPv6

func (r Requires) WithIPv6(b bool) Requires

func (Requires) WithVlan

func (r Requires) WithVlan(b *uint16) Requires

Jump to

Keyboard shortcuts

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