Documentation ¶
Index ¶
- func CreateDefaultBridge(name string) (*netlink.Bridge, error)
- func DefaultBridgeValid() error
- func NotAttachedFilter(link netlink.Link) (bool, error)
- func PhysicalFilter(link netlink.Link) (bool, error)
- func PluggedFilter(link netlink.Link) (bool, error)
- func SelectZOS(cfgs []IfaceConfig) (string, error)
- type Filter
- type IfaceConfig
- type Requires
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultBridge ¶
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
NotAttachedFilter filters out network cards that area attached to bridges
func PhysicalFilter ¶ added in v0.4.9
PhysicalFilter returns true if physical link
func PluggedFilter ¶ added in v0.4.9
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 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 ¶ added in v0.4.9
func AnalyseLink(ctx context.Context, requires Requires, link netlink.Link) (cfg IfaceConfig, err error)
AnalyseLink gets information about link
func AnalyseLinks ¶ added in v0.4.9
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