Documentation
¶
Index ¶
- Variables
- func CreateDefaultBridge(name string, vlan *uint16) (*netlink.Bridge, error)
- func DefaultBridgeValid() error
- func NotAttachedFilter(link netlink.Link) (bool, error)
- func NotIpsAssignedFilter(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)
- func VEthFilter(link netlink.Link) (bool, error)
- type Filter
- type IfaceConfig
- type Requires
Constants ¶
This section is empty.
Variables ¶
var ( // RequiresIPv4 requires ipv4 RequiresIPv4 = Requires{/* contains filtered or unexported fields */} // RequiresIPv6 requires ipv6 RequiresIPv6 = Requires{/* contains filtered or unexported fields */} )
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 ¶
NotAttachedFilter filters out network cards that area attached to bridges
func PhysicalFilter ¶
PhysicalFilter returns true if physical link
func PluggedFilter ¶
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 DefaultGW net.IP }
IfaceConfig contains all the IP address and routes of an interface
func AnalyzeLinks ¶
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