Documentation
¶
Index ¶
- Constants
- Variables
- func DeletePublicConfig() error
- func EnsurePublicSetup(nodeID pkg.Identifier, vlan *uint16, inf *pkg.PublicConfig) (*netlink.Bridge, error)
- func GetCurrentPublicExitLink() (netlink.Link, error)
- func GetPrivateExitLink() (netlink.Link, error)
- func GetPublicSetup() (pkg.PublicConfig, error)
- func HasPublicSetup() bool
- func IPs() ([]net.IPNet, error)
- func LoadPublicConfig() (*pkg.PublicConfig, error)
- func SavePublicConfig(cfg pkg.PublicConfig) error
- func SetPersistence(path string)
- func SetPublicExitLink(link netlink.Link) error
Constants ¶
const ( // PublicBridge public bridge name, exists only after a call to EnsurePublicSetup PublicBridge = types.PublicBridge DefaultBridge = types.DefaultBridge PublicNamespace = types.PublicNamespace )
Variables ¶
var ErrNoPublicConfig = errors.New("no public configuration")
ErrNoPublicConfig is the error returns by ReadPubIface when no public interface is configured
Functions ¶
func DeletePublicConfig ¶
func DeletePublicConfig() error
func EnsurePublicSetup ¶
func EnsurePublicSetup(nodeID pkg.Identifier, vlan *uint16, inf *pkg.PublicConfig) (*netlink.Bridge, error)
EnsurePublicSetup create the public setup, it's okay to have inf == nil. this method need to be called at least once in the life of the node. to make bridges are created and wired correctly, and initialize public name space if `inf` is found. Public bridge wiring (to exit nic) is remembered from last boot. If no exit nic is set the node tries to detect the exit br-pub nic based on the following criteria - physical nic - wired and has a signal - can get public slaac IPv6
if no nic is found zos is selected. changes to the br-pub exit nic can then be done later with SetPublicExitLink
func GetCurrentPublicExitLink ¶
GetCurrentPublicExitLink basically find how the public bridge (br-pub) is wired to the outside world. This can be either directly to a physical nic device or over zos bridge via a veth pair. in either way, that link is returned if a veth link is returned this means that the node is running in a single nic setup, if a physical device is returned then it means the node is running in a multi-mode setup
func GetPrivateExitLink ¶
GetPrivateExitLink returns the physical link zos is wired to
func GetPublicSetup ¶
func GetPublicSetup() (pkg.PublicConfig, error)
GetPublicSetup gets the public setup from reality or error if node has no public setup
func HasPublicSetup ¶
func HasPublicSetup() bool
func LoadPublicConfig ¶
func LoadPublicConfig() (*pkg.PublicConfig, error)
LoadPublicConfig loads public config from file
func SavePublicConfig ¶
func SavePublicConfig(cfg pkg.PublicConfig) error
SavePublicConfig stores public config in a file
func SetPersistence ¶
func SetPersistence(path string)
func SetPublicExitLink ¶
SetPublicExitLink rewires the br-pub to a different exit (upstream) device. this upstream device can either be a physical free device, or zos bridge. the method is idempotent.
Types ¶
This section is empty.