netconf

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONF = "/var/lib/rancher/conf"
	MODE = "mode"
)

Variables

This section is empty.

Functions

func ApplyNetworkConfigs

func ApplyNetworkConfigs(netCfg *NetworkConfig, userSetHostname, userSetDNS bool) (bool, error)

func AssignLinkLocalIP

func AssignLinkLocalIP(link netlink.Link) error

func GetDhcpLease

func GetDhcpLease(iface string) (lease map[string]string)
func GetValidLinkList() ([]netlink.Link, error)

func RemoveLinkLocalIP

func RemoveLinkLocalIP(link netlink.Link) error

func StopDhcpcd

func StopDhcpcd()

func StopWpaSupplicant

func StopWpaSupplicant()

Types

type Bonding

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

func Bond

func Bond(name string) (*Bonding, error)

func (*Bonding) AddSlave

func (b *Bonding) AddSlave(slave string) error

func (*Bonding) ListSlaves

func (b *Bonding) ListSlaves() ([]string, error)

func (*Bonding) Opt

func (b *Bonding) Opt(key, value string) error

func (*Bonding) RemoveSlave

func (b *Bonding) RemoveSlave(slave string) error

type Bridge

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

func NewBridge

func NewBridge(name string) (*Bridge, error)
func (b *Bridge) AddLink(link netlink.Link) error

type DNSConfig

type DNSConfig struct {
	Nameservers []string `yaml:"nameservers,flow,omitempty"`
	Search      []string `yaml:"search,flow,omitempty"`
}

type InterfaceConfig

type InterfaceConfig struct {
	Match       string            `yaml:"match,omitempty"`
	DHCP        bool              `yaml:"dhcp,omitempty"`
	DHCPArgs    string            `yaml:"dhcp_args,omitempty"`
	Address     string            `yaml:"address,omitempty"`
	Addresses   []string          `yaml:"addresses,omitempty"`
	IPV4LL      bool              `yaml:"ipv4ll,omitempty"`
	Gateway     string            `yaml:"gateway,omitempty"`
	GatewayIpv6 string            `yaml:"gateway_ipv6,omitempty"`
	MTU         int               `yaml:"mtu,omitempty"`
	Bridge      string            `yaml:"bridge,omitempty"`
	Bond        string            `yaml:"bond,omitempty"`
	BondOpts    map[string]string `yaml:"bond_opts,omitempty"`
	PostUp      []string          `yaml:"post_up,omitempty"`
	PreUp       []string          `yaml:"pre_up,omitempty"`
	Vlans       string            `yaml:"vlans,omitempty"`
	WifiNetwork string            `yaml:"wifi_network,omitempty"`
}

type ModemNetworkConfig

type ModemNetworkConfig struct {
	Apn       string `yaml:"apn"`
	ExtraArgs string `yaml:"extra_args,omitempty"`
}

type NetworkConfig

type NetworkConfig struct {
	PreCmds       []string                      `yaml:"pre_cmds,omitempty"`
	DHCPTimeout   int                           `yaml:"dhcp_timeout,omitempty"`
	DNS           DNSConfig                     `yaml:"dns,omitempty"`
	Interfaces    map[string]InterfaceConfig    `yaml:"interfaces,omitempty"`
	PostCmds      []string                      `yaml:"post_cmds,omitempty"`
	HTTPProxy     string                        `yaml:"http_proxy,omitempty"`
	HTTPSProxy    string                        `yaml:"https_proxy,omitempty"`
	NoProxy       string                        `yaml:"no_proxy,omitempty"`
	WifiNetworks  map[string]WifiNetworkConfig  `yaml:"wifi_networks,omitempty"`
	ModemNetworks map[string]ModemNetworkConfig `yaml:"modem_networks,omitempty"`
}

type Vlan

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

func NewVlan

func NewVlan(link netlink.Link, name string, id int) (*Vlan, error)

type VlanDefinition

type VlanDefinition struct {
	ID   int
	Name string
}

func ParseVlanDefinitions

func ParseVlanDefinitions(vlans string) ([]VlanDefinition, error)

type WifiNetworkConfig

type WifiNetworkConfig struct {
	Address           string   `yaml:"address,omitempty"`
	Gateway           string   `yaml:"gateway,omitempty"`
	ScanSSID          int      `yaml:"scan_ssid,omitempty"`
	SSID              string   `yaml:"ssid,omitempty"`
	PSK               string   `yaml:"psk,omitempty"`
	Priority          int      `yaml:"priority,omitempty"`
	Pairwise          string   `yaml:"pairwise,omitempty"`
	Group             string   `yaml:"group,omitempty"`
	Eap               string   `yaml:"eap,omitempty"`
	Identity          string   `yaml:"identity,omitempty"`
	AnonymousIdentity string   `yaml:"anonymous_identity,omitempty"`
	CaCerts           []string `yaml:"ca_certs,omitempty"`
	ClientCerts       []string `yaml:"client_certs,omitempty"`
	PrivateKeys       []string `yaml:"private_keys,omitempty"`
	PrivateKeyPasswds []string `yaml:"private_key_passwds,omitempty"`
	Phases            []string `yaml:"phases,omitempty"`
	EapolFlags        int      `yaml:"eapol_flags,omitempty"`
	KeyMgmt           string   `yaml:"key_mgmt,omitempty"`
	Password          string   `yaml:"password,omitempty"`
}

Jump to

Keyboard shortcuts

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