public

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// PublicBridge public bridge name, exists only after a call to EnsurePublicSetup
	PublicBridge    = types.PublicBridge
	DefaultBridge   = types.DefaultBridge
	PublicNamespace = types.PublicNamespace
)

Variables

View Source
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() (netlink.Link, error)

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() (netlink.Link, error)

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 IPs

func IPs() ([]net.IPNet, error)

IPs gets the public ips of the nodes

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(link netlink.Link) error

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.

Jump to

Keyboard shortcuts

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