bsp

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DNS1Offset = 0
	DNS2Offset = 1
)

Variables

View Source
var DefaultNetwork = Network{
	NetworkManager: &impl.NetworkManager{},
	Exec:           &impl.Exec{},
}

Functions

This section is empty.

Types

type Network

type Network struct {
	NetworkManager interfaces.NetworkManager
	Exec           interfaces.Exec
	Settings       gonetworkmanager.Settings
	Device         gonetworkmanager.Device
	State          NetworkState
	// contains filtered or unexported fields
}

func NewNetwork

func NewNetwork() *Network

func (*Network) CheckInterfacePrivateRange

func (network *Network) CheckInterfacePrivateRange(networkAdapter string) (bool, error)

func (*Network) CleanupNetworkAdapter added in v0.0.2

func (network *Network) CleanupNetworkAdapter(networkAdapter string) error

func (*Network) InitializeNetworkState

func (network *Network) InitializeNetworkState(networkAdapter, connectionID string)

func (*Network) PropagateNetworkSettings

func (network *Network) PropagateNetworkSettings(networkAdapter string) error

func (*Network) RetrieveDNS1

func (network *Network) RetrieveDNS1(networkAdapter string) (string, error)

func (*Network) RetrieveDNS2

func (network *Network) RetrieveDNS2(networkAdapter string) (string, error)

func (*Network) RetrieveDefaultGateway

func (network *Network) RetrieveDefaultGateway(networkAdapter string) (string, error)

func (*Network) RetrieveDeviceState

func (network *Network) RetrieveDeviceState(networkAdapter string) gonetworkmanager.NmDeviceState

func (*Network) RetrieveHostname

func (network *Network) RetrieveHostname() (string, error)

func (*Network) RetrieveIPAddress

func (network *Network) RetrieveIPAddress(networkAdapter string) (string, error)

func (*Network) RetrieveInternalMode

func (network *Network) RetrieveInternalMode() string

func (*Network) RetrieveMACAddress

func (network *Network) RetrieveMACAddress(networkAdapter string) (string, error)

func (*Network) RetrieveMode

func (network *Network) RetrieveMode(networkAdapter string) (string, error)

func (*Network) RetrieveSubnetMask

func (network *Network) RetrieveSubnetMask(networkAdapter string) (string, error)

func (*Network) SetDNS1

func (network *Network) SetDNS1(networkAdapter string, dns1 string) error

func (*Network) SetDNS2

func (network *Network) SetDNS2(networkAdapter string, dns2 string) error

func (*Network) SetDefaultGateway

func (network *Network) SetDefaultGateway(networkAdapter string, gateway string) error

func (*Network) SetIPAddress

func (network *Network) SetIPAddress(networkAdapter string, ip string) error

func (*Network) SetIPs

func (network *Network) SetIPs(networkAdapter string, mode string, ip string, subnet string, gateway string, dns1 string, dns2 string) error

func (*Network) SetMode

func (network *Network) SetMode(networkAdapter string, mode string) error

func (*Network) SetSubnetMask

func (network *Network) SetSubnetMask(networkAdapter string, subnet string) error

type NetworkState

type NetworkState struct {
	Mode           string
	IPAddress      string
	SubnetMask     string
	DefaultGateway string
	DNS1           string
	DNS2           string
}

Jump to

Keyboard shortcuts

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