netmgr

package module
v0.0.0-...-f6f69dc Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 4 Imported by: 3

README ΒΆ

Welcome to go-netmgr πŸ‘‹

Documentation

Go bindings for NetworkManager D-Bus API

Install

go get -u github.com/nlepage/go-netmgr

Usage

🚧 Coming soon...

Author

πŸ‘€ Nicolas Lepage

🀝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

πŸ“ License

Copyright Β© 2020 Nicolas Lepage.
This project is Apache 2.0 licensed.


This README was generated with ❀️ by readme-md-generator

Documentation ΒΆ

Overview ΒΆ

Package netmgr offers bindings for NetworkManager D-Bus API (https://developer.gnome.org/NetworkManager/stable/spec.html).

Index ΒΆ

Constants ΒΆ

View Source
const (
	// CheckpointCreateFlagNone means no flags.
	CheckpointCreateFlagNone CheckpointCreateFlags = 0

	// CheckpointCreateFlagDestroyAll means when creating a new checkpoint, destroy all existing ones.
	CheckpointCreateFlagDestroyAll = 1 << (iota - 1)

	// CheckpointCreateFlagDeleteNewConnections means upon rollback, delete any new connection added after the checkpoint.
	CheckpointCreateFlagDeleteNewConnections

	// CheckpointCreateFlagDisconnectNewDevices means upon rollback, disconnect any new device appeared after the checkpoint.
	CheckpointCreateFlagDisconnectNewDevices

	// CheckpointCreateFlagAllowOverlapping means creating a checkpoint doesn't fail if there are already existing checkoints that reference the same devices.
	CheckpointCreateFlagAllowOverlapping
)
View Source
const BusName = "org.freedesktop.NetworkManager"

BusName of NetworkManager.

View Source
const CheckpointIface = "org.freedesktop.NetworkManager.Checkpoint"

CheckpointIface is the Checkpoint interface.

View Source
const ConnectionActiveIface = "org.freedesktop.NetworkManager.Connection.Active"

ConnectionActiveIface is the Active Connection interface.

View Source
const DeviceIface = "org.freedesktop.NetworkManager.Device"

DeviceIface is the base Device interface.

View Source
const NetworkManagerInterface = "org.freedesktop.NetworkManager"

NetworkManagerInterface is the Connection Manager interface.

View Source
const NetworkManagerPath = "/org/freedesktop/NetworkManager"

NetworkManagerPath is the Connection Manager path.

View Source
const VPNConnectionIface = "org.freedesktop.NetworkManager.VPN.Connection"

VPNConnectionIface is the VPN connection interface.

Variables ΒΆ

This section is empty.

Functions ΒΆ

func AddAndActivateConnection ΒΆ

func AddAndActivateConnection(connection SettingsConnectionInput, device interface{}, specificObject interface{}) (SettingsConnection, ConnectionActive, error)

AddAndActivateConnection adds a new connection using the given details (if any) as a template (automatically filling in missing settings with the capabilities of the given device and specific object), then activate the new connection.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.AddAndActivateConnection for more information.

func AddAndActivateConnection2 ΒΆ

func AddAndActivateConnection2(connection SettingsConnectionInput, device interface{}, specificObject interface{}, options map[string]interface{}) (SettingsConnection, ConnectionActive, error)

AddAndActivateConnection2 adds a new connection using the given details (if any) as a template (automatically filling in missing settings with the capabilities of the given device and specific object), then activate the new connection.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.AddAndActivateConnection2 for more information.

func CheckpointAdjustRollbackTimeout ΒΆ

func CheckpointAdjustRollbackTimeout(checkpoint interface{}, rollbackTimeout uint) error

CheckpointAdjustRollbackTimeout resets the timeout for rollback for the checkpoint.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.CheckpointAdjustRollbackTimeout for more information.

func CheckpointDestroy ΒΆ

func CheckpointDestroy(checkpoint interface{}) error

CheckpointDestroy destroys a previously created checkpoint.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.CheckpointDestroy for more information.

func CheckpointRollback ΒΆ

func CheckpointRollback(checkpoint interface{}) (map[dbus.ObjectPath]RollbackResult, error)

CheckpointRollback rollback a checkpoint before the timeout is reached.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.CheckpointRollback for more information.

func ConnectivityCheckAvailable ΒΆ

func ConnectivityCheckAvailable() (bool, error)

ConnectivityCheckAvailable indicates whether connectivity checking service has been configured.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ConnectivityCheckAvailable for more information.

func ConnectivityCheckEnabled ΒΆ

func ConnectivityCheckEnabled() (bool, error)

ConnectivityCheckEnabled indicates whether connectivity checking is enabled.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ConnectivityCheckEnabled for more information.

func ConnectivityCheckURI ΒΆ

func ConnectivityCheckURI() (string, error)

ConnectivityCheckURI is the URI that NetworkManager will hit to check if there is internet connectivity.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ConnectivityCheckURI for more information.

func DeactivateConnection ΒΆ

func DeactivateConnection(activeConnection interface{}) error

DeactivateConnection deactivates an active connection.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.DeactivateConnection for more information.

func Enable ΒΆ

func Enable(enable bool) error

Enable control whether overall networking is enabled or disabled.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.Enable for more information.

func GetLogging ΒΆ

func GetLogging() (string, string, error)

GetLogging gets current logging verbosity level and operations domains.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.GetLogging for more information.

func GetPermissions ΒΆ

func GetPermissions() (map[string]string, error)

GetPermissions returns the permissions a caller has for various authenticated operations that NetworkManager provides, like Enable/Disable networking, changing Wi-Fi, WWAN, and WiMAX state, etc.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.GetPermissions for more information.

func GlobalDNSConfiguration ΒΆ

func GlobalDNSConfiguration() (map[string]interface{}, error)

GlobalDNSConfiguration is the dictionary of global DNS settings where the key is one of "searches", "options" and "domains".

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.GlobalDnsConfiguration for more information.

func NetworkingEnabled ΒΆ

func NetworkingEnabled() (bool, error)

NetworkingEnabled indicates if overall networking is currently enabled or not.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.NetworkingEnabled for more information.

func PrimaryConnectionType ΒΆ

func PrimaryConnectionType() (string, error)

PrimaryConnectionType is the connection type of the "primary" active connection being used to access the network.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.PrimaryConnectionType for more information.

func Reload ΒΆ

func Reload(flags uint) error

Reload NetworkManager's configuration and perform certain updates, like flushing a cache or rewriting external state to disk.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.Reload for more information.

func SetConnectivityCheckEnabled ΒΆ

func SetConnectivityCheckEnabled(value bool) error

SetConnectivityCheckEnabled enables or disables connectivity checking.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ConnectivityCheckEnabled for more information.

func SetGlobalDNSConfiguration ΒΆ

func SetGlobalDNSConfiguration(value map[string]interface{}) error

SetGlobalDNSConfiguration sets the dictionary of global DNS settings where the key is one of "searches", "options" and "domains".

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.GlobalDnsConfiguration for more information.

func SetLogging ΒΆ

func SetLogging(level string, domains string) error

SetLogging sets logging verbosity and which operations are logged.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.SetLogging for more information.

func SetWwanEnabled ΒΆ

func SetWwanEnabled(value bool) error

SetWwanEnabled enables or disables mobile broadband devices.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WwanEnabled for more information.

func Sleep ΒΆ

func Sleep(sleep bool) error

Sleep controls the NetworkManager daemon's sleep state.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.Sleep for more information.

func StateChanged ΒΆ

func StateChanged(state chan<- StateEnum) error

func WirelessEnabled ΒΆ

func WirelessEnabled() (bool, error)

WirelessEnabled indicates if wireless is currently enabled or not.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WirelessEnabled for more information.

func WirelessHardwareEnabled ΒΆ

func WirelessHardwareEnabled() (bool, error)

WirelessHardwareEnabled indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WirelessHardwareEnabled for more information.

func WwanEnabled ΒΆ

func WwanEnabled() (bool, error)

WwanEnabled indicates if mobile broadband devices are currently enabled or not.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WwanEnabled for more information.

func WwanHardwareEnabled ΒΆ

func WwanHardwareEnabled() (bool, error)

WwanHardwareEnabled indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WwanHardwareEnabled for more information.

Types ΒΆ

type Capability ΒΆ

type Capability uint

Capability names the numbers in the Capabilities property.

See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMCapability for more information.

const (
	// CapabilityTeam indicates teams can be managed. This means the team device plugin is loaded.
	CapabilityTeam Capability = iota + 1

	// CapabilityOVS indicates OpenVSwitch can be managed. This means the OVS device plugin is loaded. Since: 1.24, 1.22.2
	CapabilityOVS
)

type Checkpoint ΒΆ

type Checkpoint interface {
	dbus.BusObject

	// FIXME documentation
	Devices() ([]Device, error)
}

Checkpoint is a snapshot of NetworkManager state for a given device list.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Checkpoint.html for more information.

func CheckpointCreate ΒΆ

func CheckpointCreate(devices []interface{}, rollbackTimeout uint, flags CheckpointCreateFlags) (Checkpoint, error)

CheckpointCreate creates a checkpoint of the current networking configuration for given interfaces.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.CheckpointCreate for more information.

func NewCheckpoint ΒΆ

func NewCheckpoint(conn *dbus.Conn, path dbus.ObjectPath) Checkpoint

NewCheckpoint returns the Checkpoint from conn corresponding to path.

func NewCheckpoints ΒΆ

func NewCheckpoints(conn *dbus.Conn, paths []dbus.ObjectPath) []Checkpoint

NewCheckpoints returns the slice of Checkpoint from conn corresponding to paths.

type CheckpointCreateFlags ΒΆ

type CheckpointCreateFlags uint

CheckpointCreateFlags are the flags for CheckpointCreate call.

See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMCheckpointCreateFlags for more information.

type ConnectionActive ΒΆ

type ConnectionActive interface {
	dbus.BusObject

	// Vpn indicates whether this active connection is also a VPN connection.
	//
	// See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Connection.Active.html#gdbus-property-org-freedesktop-NetworkManager-Connection-Active.Vpn for more information.
	Vpn() (bool, error)
}

ConnectionActive represents an attempt to connect to a network using the details provided by a Connection object.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Connection.Active.html for more information.

func ActivateConnection ΒΆ

func ActivateConnection(connection interface{}, device interface{}, specificObject interface{}) (ConnectionActive, error)

ActivateConnection activates a connection using the supplied device.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.ActivateConnection for more information.

func ActivatingConnection ΒΆ

func ActivatingConnection() (ConnectionActive, error)

ActivatingConnection is an active connection that is currently being activated and which is expected to become the new PrimaryConnection when it finishes activating.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ActivatingConnection for more information.

func NewConnectionActive ΒΆ

func NewConnectionActive(conn *dbus.Conn, path dbus.ObjectPath) (ConnectionActive, error)

NewConnectionActive returns the ConnectionActive from conn corresponding to path.

func NewConnectionActives ΒΆ

func NewConnectionActives(conn *dbus.Conn, paths []dbus.ObjectPath) ([]ConnectionActive, error)

NewConnectionActives returns the slice of ConnectionActive from conn corresponding to paths.

func PrimaryConnection ΒΆ

func PrimaryConnection() (ConnectionActive, error)

PrimaryConnection is the "primary" active connection being used to access the network.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.PrimaryConnection for more information.

type ConnectivityState ΒΆ

type ConnectivityState uint

ConnectivityState values indicate the connectivity state.

See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMConnectivityState for more information.

const (
	// ConnectivityUnknown means network connectivity is unknown.
	ConnectivityUnknown ConnectivityState = iota

	// ConnectivityNone means the host is not connected to any network.
	ConnectivityNone

	// ConnectivityPortal means the Internet connection is hijacked by a captive portal gateway.
	ConnectivityPortal

	// ConnectivityLimited means the host is connected to a network, does not appear to be able to reach the full Internet, but a captive portal has not been detected.
	ConnectivityLimited

	// ConnectivityFull means the host is connected to a network, and appears to be able to reach the full Internet.
	ConnectivityFull
)

func (ConnectivityState) String ΒΆ

func (cs ConnectivityState) String() string

type Device ΒΆ

type Device interface {
	dbus.BusObject

	// Udi is the operating-system specific transient device hardware identifier.
	//
	// See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Udi for more information.
	Udi() (string, error)

	// Interface is the name of the device's control (and often data) interface.
	//
	// See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Interface for more information.
	Interface() (string, error)

	// IPInterface is the name of the device's data interface when available.
	//
	// See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.IpInterface for more information.
	IPInterface() (string, error)

	// Driver is the driver handling the device.
	//
	// See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Driver for more information.
	Driver() (string, error)

	// DriverVersion is the version of the driver handling the device.
	//
	// See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.DriverVersion for more information.
	DriverVersion() (string, error)

	// FirmwareVersion is the firmware version for the device.
	//
	// See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.FirmwareVersion for more information.
	FirmwareVersion() (string, error)
}

Device represents a device.

func AllDevices ΒΆ

func AllDevices() ([]Device, error)

AllDevices is the list of both realized and un-realized network devices.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.AllDevices for more information.

func GetDeviceByIPIface ΒΆ

func GetDeviceByIPIface(iface string) (Device, error)

GetDeviceByIPIface returns the network device referenced by its IP interface name.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.GetDeviceByIpIface for more information.

func GetDevices ΒΆ

func GetDevices() ([]Device, error)

GetDevices gets the list of realized network devices.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.GetDevices for more information.

func NewDevice ΒΆ

func NewDevice(conn *dbus.Conn, path dbus.ObjectPath) Device

NewDevice returns the Device from conn corresponding to path.

func NewDevices ΒΆ

func NewDevices(conn *dbus.Conn, paths []dbus.ObjectPath) []Device

NewDevices returns the slice of Device from conn corresponding paths.

type MeteredEnum ΒΆ

type MeteredEnum uint

MeteredEnum has two different purposes: one is to configure "connection.metered" setting of a connection profile in NMSettingConnection, and the other is to express the actual metered state of the NMDevice at a given moment.

See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMMetered for more information.

const (
	// MeteredUnknown is unknown.
	MeteredUnknown MeteredEnum = iota

	// MeteredYes is metered, the value was explicitly configured.
	MeteredYes

	// MeteredNo is not metered, the value was explicitly configured.
	MeteredNo

	// MeteredGuessYes is metered, the value was guessed.
	MeteredGuessYes

	// MeteredGuessNo is not metered, the value was guessed.
	MeteredGuessNo
)

type NetworkManager ΒΆ

type NetworkManager interface {
	dbus.BusObject

	Reload(flags uint) error
	GetDevices() ([]Device, error)
	GetAllDevices() ([]Device, error)
	GetDeviceByIPIface(iface string) (Device, error)
	ActivateConnection(connection interface{}, device interface{}, specificObject interface{}) (ConnectionActive, error)
	AddAndActivateConnection(connection SettingsConnectionInput, device interface{}, specificObject interface{}) (SettingsConnection, ConnectionActive, error)
	AddAndActivateConnection2(connection SettingsConnectionInput, device interface{}, specificObject interface{}, options map[string]interface{}) (SettingsConnection, ConnectionActive, error)
	DeactivateConnection(activeConnection interface{}) error
	Sleep(sleep bool) error
	Enable(enable bool) error
	GetPermissions() (map[string]string, error)
	SetLogging(level string, domains string) error
	GetLogging() (string, string, error)
	CheckConnectivity() (ConnectivityState, error)
	GetState() (StateEnum, error)
	CheckpointCreate(devices []interface{}, rollbackTimeout uint, flags CheckpointCreateFlags) (Checkpoint, error)
	CheckpointDestroy(checkpoint interface{}) error
	CheckpointRollback(checkpoint interface{}) (map[dbus.ObjectPath]RollbackResult, error)
	CheckpointAdjustRollbackTimeout(checkpoint interface{}, rollbackTimeout uint) error

	// FIXME Signals
	StateChanged(ch chan<- StateEnum) error

	Devices() ([]Device, error)
	AllDevices() ([]Device, error)
	Checkpoints() ([]Checkpoint, error)
	NetworkingEnabled() (bool, error)
	WirelessEnabled() (bool, error)
	SetWirelessEnabled(bool) error
	WirelessHardwareEnabled() (bool, error)
	WwanEnabled() (bool, error)
	SetWwanEnabled(bool) error
	WwanHardwareEnabled() (bool, error)
	ActiveConnections() ([]ConnectionActive, error)
	PrimaryConnection() (ConnectionActive, error)
	PrimaryConnectionType() (string, error)
	Metered() (MeteredEnum, error)
	ActivatingConnection() (ConnectionActive, error)
	Startup() (bool, error)
	Version() (string, error)
	Capabilities() ([]Capability, error)
	State() (StateEnum, error)
	Connectivity() (ConnectivityState, error)
	ConnectivityCheckAvailable() (bool, error)
	ConnectivityCheckEnabled() (bool, error)
	SetConnectivityCheckEnabled(bool) error
	ConnectivityCheckURI() (string, error)
	GlobalDNSConfiguration() (map[string]interface{}, error)
	SetGlobalDNSConfiguration(map[string]interface{}) error
}

NetworkManager is the Connection Manager.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html for more information.

func New ΒΆ

func New(conn *dbus.Conn) NetworkManager

New returns the Connection Manager from conn.

func System ΒΆ

func System() (NetworkManager, error)

System returns the Connection Manager from the system bus.

It is equivalent to:

conn, err := netmgrutil.SystemBus()
if err != nil {
    // Manager error
}
nm := netmgr.New(conn)

type RollbackResult ΒΆ

type RollbackResult uint

RollbackResult is the result of a checkpoint Rollback() operation for a specific device.

See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMRollbackResult for more information.

const (
	// RollbackResultOK means the rollback succeeded.
	RollbackResultOK RollbackResult = iota

	// RollbackResultErrNoDevice means the device no longer exists.
	RollbackResultErrNoDevice

	// RollbackResultErrDeviceUnmanaged means the device is now unmanaged.
	RollbackResultErrDeviceUnmanaged

	// RollbackResultErrFailed means other errors during rollback.
	RollbackResultErrFailed
)

type SettingsConnection ΒΆ

type SettingsConnection interface {
	dbus.BusObject
}

SettingsConnection represents a single network connection configuration.

func NewSettingsConnection ΒΆ

func NewSettingsConnection(conn *dbus.Conn, path dbus.ObjectPath) SettingsConnection

NewSettingsConnection returns the SettingsConnection from conn corresponding to path.

type SettingsConnectionInput ΒΆ

type SettingsConnectionInput struct {
}

SettingsConnectionInput represents connection settings and properties.

type StateEnum ΒΆ

type StateEnum uint

StateEnum values indicate the current overall networking state.

See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMState for more information.

const (
	// StateUnknown means networking state is unknown.
	StateUnknown StateEnum = iota * 10

	// StateAsleep means networking is not enabled, the system is being suspended or resumed from suspend.
	StateAsleep

	// StateDisconnected means there is no active network connection.
	StateDisconnected

	// StateDisconnecting means network connections are being cleaned up.
	StateDisconnecting

	// StateConnecting means a network connection is being started.
	StateConnecting

	// StateConnectedLocal means there is only local IPv4 and/or IPv6 connectivity, but no default route to access the Internet.
	StateConnectedLocal

	// StateConnectedSite means there is only site-wide IPv4 and/or IPv6 connectivity.
	StateConnectedSite

	// StateConnectedGlobal means there is global IPv4 and/or IPv6 Internet connectivity.
	StateConnectedGlobal
)

func GetState ΒΆ

func GetState() (StateEnum, error)

GetState gets the overall networking state as determined by the NetworkManager daemon, based on the state of network devices under its management.

See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.state for more information.

type VPNConnection ΒΆ

type VPNConnection interface {
	ConnectionActive
}

VPNConnection represents an active connection to a Virtual Private Network.

Directories ΒΆ

Path Synopsis
Package agtmgr offers bindings for the AgentManager of NetworkManager D-Bus API (https://developer.gnome.org/NetworkManager/stable/spec.html).
Package agtmgr offers bindings for the AgentManager of NetworkManager D-Bus API (https://developer.gnome.org/NetworkManager/stable/spec.html).
Package dnsmgr offers bindings for the DnsManager of NetworkManager D-Bus API (https://developer.gnome.org/NetworkManager/stable/spec.html).
Package dnsmgr offers bindings for the DnsManager of NetworkManager D-Bus API (https://developer.gnome.org/NetworkManager/stable/spec.html).
gql module
internal

Jump to

Keyboard shortcuts

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