gonetworkmanager

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 7 Imported by: 23

README

GoDoc Go build

gonetworkmanager

Go D-Bus bindings for NetworkManager 1.16.

Tested with NetworkManager 1.16.0.

NetworkManager 1.16 D-Bus Spec

Backward compatibility

The library should also be compatible with NetworkManager 0.9.8.10.

Usage

You can find some examples in the examples directory.

Documentation

Index

Constants

View Source
const (
	AccessPointInterface = NetworkManagerInterface + ".AccessPoint"

	/* Properties */
	AccessPointPropertyFlags      = AccessPointInterface + ".Flags"      // readable   u
	AccessPointPropertyWpaFlags   = AccessPointInterface + ".WpaFlags"   // readable   u
	AccessPointPropertyRsnFlags   = AccessPointInterface + ".RsnFlags"   // readable   u
	AccessPointPropertySsid       = AccessPointInterface + ".Ssid"       // readable   ay
	AccessPointPropertyFrequency  = AccessPointInterface + ".Frequency"  // readable   u
	AccessPointPropertyHwAddress  = AccessPointInterface + ".HwAddress"  // readable   s
	AccessPointPropertyMode       = AccessPointInterface + ".Mode"       // readable   u
	AccessPointPropertyMaxBitrate = AccessPointInterface + ".MaxBitrate" // readable   u
	AccessPointPropertyStrength   = AccessPointInterface + ".Strength"   // readable   y
	AccessPointPropertyLastSeen   = AccessPointInterface + ".LastSeen"   // readable   i
)
View Source
const (
	ActiveConnectionInterface = NetworkManagerInterface + ".Connection.Active"

	/* Properties */
	ActiveConnectionPropertyConnection     = ActiveConnectionInterface + ".Connection"     // readable   o
	ActiveConnectionPropertySpecificObject = ActiveConnectionInterface + ".SpecificObject" // readable   o
	ActiveConnectionPropertyId             = ActiveConnectionInterface + ".Id"             // readable   s
	ActiveConnectionPropertyUuid           = ActiveConnectionInterface + ".Uuid"           // readable   s
	ActiveConnectionPropertyType           = ActiveConnectionInterface + ".Type"           // readable   s
	ActiveConnectionPropertyDevices        = ActiveConnectionInterface + ".Devices"        // readable   ao
	ActiveConnectionPropertyState          = ActiveConnectionInterface + ".State"          // readable   u
	ActiveConnectionPropertyStateFlags     = ActiveConnectionInterface + ".StateFlags"     // readable   u
	ActiveConnectionPropertyDefault        = ActiveConnectionInterface + ".Default"        // readable   b
	ActiveConnectionPropertyIp4Config      = ActiveConnectionInterface + ".Ip4Config"      // readable   o
	ActiveConnectionPropertyDhcp4Config    = ActiveConnectionInterface + ".Dhcp4Config"    // readable   o
	ActiveConnectionPropertyDefault6       = ActiveConnectionInterface + ".Default6"       // readable   b
	ActiveConnectionPropertyIp6Config      = ActiveConnectionInterface + ".Ip6Config"      // readable   o
	ActiveConnectionPropertyDhcp6Config    = ActiveConnectionInterface + ".Dhcp6Config"    // readable   o
	ActiveConnectionPropertyVpn            = ActiveConnectionInterface + ".Vpn"            // readable   b
	ActiveConnectionPropertyMaster         = ActiveConnectionInterface + ".Master"         // readable   o

	/* Signals */
	ActiveConnectionSignalStateChanged = "StateChanged" // u state, u reason

)
View Source
const (
	CheckpointInterface = NetworkManagerInterface + ".Checkpoint"

	/* Properties */
	CheckpointPropertyDevices         = CheckpointInterface + ".Devices"         // readable   ao
	CheckpointPropertyCreated         = CheckpointInterface + ".Created"         // readable   x
	CheckpointPropertyRollbackTimeout = CheckpointInterface + ".RollbackTimeout" // readable   u
)
View Source
const (
	ConnectionInterface = SettingsInterface + ".Connection"

	/* Methods */
	ConnectionUpdate        = ConnectionInterface + ".Update"
	ConnectionUpdateUnsaved = ConnectionInterface + ".UpdateUnsaved"
	ConnectionDelete        = ConnectionInterface + ".Delete"
	ConnectionGetSettings   = ConnectionInterface + ".GetSettings"
	ConnectionGetSecrets    = ConnectionInterface + ".GetSecrets"
	ConnectionClearSecrets  = ConnectionInterface + ".ClearSecrets"
	ConnectionSave          = ConnectionInterface + ".Save"
	ConnectionUpdate2       = ConnectionInterface + ".Update2"

	/* Properties */
	ConnectionPropertyUnsaved  = ConnectionInterface + ".Unsaved"  // readable   b
	ConnectionPropertyFlags    = ConnectionInterface + ".Flags"    // readable   u
	ConnectionPropertyFilename = ConnectionInterface + ".Filename" // readable   s
)
View Source
const (
	DHCP4ConfigInterface = NetworkManagerInterface + ".DHCP4Config"

	// Properties
	DHCP4ConfigPropertyOptions = DHCP4ConfigInterface + ".Options"
)
View Source
const (
	DHCP6ConfigInterface = NetworkManagerInterface + ".DHCP6Config"

	// Properties
	DHCP6ConfigPropertyOptions = DHCP6ConfigInterface + ".Options"
)
View Source
const (
	DeviceInterface = NetworkManagerInterface + ".Device"

	/* Methods */
	DeviceReapply              = DeviceInterface + ".Reapply"
	DeviceGetAppliedConnection = DeviceInterface + ".GetAppliedConnection"
	DeviceDisconnect           = DeviceInterface + ".Disconnect"
	DeviceDelete               = DeviceInterface + ".Delete"

	/* Properties */
	DevicePropertyUdi                  = DeviceInterface + ".Udi"                  // readable   s
	DevicePropertyInterface            = DeviceInterface + ".Interface"            // readable   s
	DevicePropertyIpInterface          = DeviceInterface + ".IpInterface"          // readable   s
	DevicePropertyDriver               = DeviceInterface + ".Driver"               // readable   s
	DevicePropertyDriverVersion        = DeviceInterface + ".DriverVersion"        // readable   s
	DevicePropertyFirmwareVersion      = DeviceInterface + ".FirmwareVersion"      // readable   s
	DevicePropertyCapabilities         = DeviceInterface + ".Capabilities"         // readable   u
	DevicePropertyState                = DeviceInterface + ".State"                // readable   u
	DevicePropertyStateReason          = DeviceInterface + ".StateReason"          // readable   (uu)
	DevicePropertyActiveConnection     = DeviceInterface + ".ActiveConnection"     // readable   o
	DevicePropertyIp4Config            = DeviceInterface + ".Ip4Config"            // readable   o
	DevicePropertyDhcp4Config          = DeviceInterface + ".Dhcp4Config"          // readable   o
	DevicePropertyIp6Config            = DeviceInterface + ".Ip6Config"            // readable   o
	DevicePropertyDhcp6Config          = DeviceInterface + ".Dhcp6Config"          // readable   o
	DevicePropertyManaged              = DeviceInterface + ".Managed"              // readwrite  b
	DevicePropertyAutoconnect          = DeviceInterface + ".Autoconnect"          // readwrite  b
	DevicePropertyFirmwareMissing      = DeviceInterface + ".FirmwareMissing"      // readable   b
	DevicePropertyNmPluginMissing      = DeviceInterface + ".NmPluginMissing"      // readable   b
	DevicePropertyDeviceType           = DeviceInterface + ".DeviceType"           // readable   u
	DevicePropertyAvailableConnections = DeviceInterface + ".AvailableConnections" // readable   ao
	DevicePropertyPhysicalPortId       = DeviceInterface + ".PhysicalPortId"       // readable   s
	DevicePropertyMtu                  = DeviceInterface + ".Mtu"                  // readable   u
	DevicePropertyMetered              = DeviceInterface + ".Metered"              // readable   u
	DevicePropertyLldpNeighbors        = DeviceInterface + ".LldpNeighbors"        // readable   aa{sv}
	DevicePropertyReal                 = DeviceInterface + ".Real"                 // readable   b
	DevicePropertyIp4Connectivity      = DeviceInterface + ".Ip4Connectivity"      // readable   u
)
View Source
const (
	DeviceDummyInterface = DeviceInterface + ".Dummy"

	/* Properties */
	DeviceDummyPropertyHwAddress = DeviceDummyInterface + ".HwAddress" // readable   s
)
View Source
const (
	DeviceGenericInterface = DeviceInterface + ".Generic"

	// Properties
	DeviceGenericPropertyHwAddress       = DeviceGenericInterface + ".HwAddress"       // readable   s
	DeviceGenericPropertyTypeDescription = DeviceGenericInterface + ".TypeDescription" // readable   s
)
View Source
const (
	DeviceIpTunnelInterface = DeviceInterface + ".IPTunnel"

	// Properties
	DeviceIpTunnelPropertyHwAddress          = DeviceIpTunnelInterface + "HwAddress"           // readable   s
	DeviceIpTunnelPropertyMode               = DeviceIpTunnelInterface + ".Mode"               // readable   u
	DeviceIpTunnelPropertyParent             = DeviceIpTunnelInterface + ".Parent"             // readable   o
	DeviceIpTunnelPropertyLocal              = DeviceIpTunnelInterface + ".Local"              // readable   s
	DeviceIpTunnelPropertyRemote             = DeviceIpTunnelInterface + ".Remote"             // readable   s
	DeviceIpTunnelPropertyTtl                = DeviceIpTunnelInterface + ".Ttl"                // readable   y
	DeviceIpTunnelPropertyTos                = DeviceIpTunnelInterface + ".Tos"                // readable   y
	DeviceIpTunnelPropertyPathMtuDiscovery   = DeviceIpTunnelInterface + ".PathMtuDiscovery"   // readable   b
	DeviceIpTunnelPropertyInputKey           = DeviceIpTunnelInterface + ".InputKey"           // readable   s
	DeviceIpTunnelPropertyOutputKey          = DeviceIpTunnelInterface + ".OutputKey"          // readable   s
	DeviceIpTunnelPropertyEncapsulationLimit = DeviceIpTunnelInterface + ".EncapsulationLimit" // readable   y
	DeviceIpTunnelPropertyFlowLabel          = DeviceIpTunnelInterface + ".FlowLabel"          // readable   u
	DeviceIpTunnelPropertyFlags              = DeviceIpTunnelInterface + ".Flags"              // readable   u

)
View Source
const (
	DeviceStatisticsInterface = DeviceInterface + ".Statistics"

	// Properties
	DeviceStatisticsPropertyRefreshRateMs = DeviceStatisticsInterface + ".RefreshRateMs" // readwrite  u
	DeviceStatisticsPropertyTxBytes       = DeviceStatisticsInterface + ".TxBytes"       // readable   t
	DeviceStatisticsPropertyRxBytes       = DeviceStatisticsInterface + ".RxBytes"       // readable   t
)
View Source
const (
	DeviceWiredInterface = DeviceInterface + ".Wired"

	// Properties
	DeviceWiredPropertyHwAddress       = DeviceWiredInterface + ".HwAddress"       // readable   s
	DeviceWiredPropertyPermHwAddress   = DeviceWiredInterface + ".PermHwAddress"   // readable   s
	DeviceWiredPropertySpeed           = DeviceWiredInterface + ".Speed"           // readable   u
	DeviceWiredPropertyS390Subchannels = DeviceWiredInterface + ".S390Subchannels" // readable   as
	DeviceWiredPropertyCarrier         = DeviceWiredInterface + ".Carrier"         // readable   b
)
View Source
const (
	DeviceWirelessInterface = DeviceInterface + ".Wireless"

	// Methods
	DeviceWirelessGetAccessPoints    = DeviceWirelessInterface + ".GetAccessPoints"
	DeviceWirelessGetAllAccessPoints = DeviceWirelessInterface + ".GetAllAccessPoints"
	DeviceWirelessRequestScan        = DeviceWirelessInterface + ".RequestScan"

	// Properties
	DeviceWirelessPropertyHwAddress            = DeviceWirelessInterface + ".HwAddress"            // readable   s
	DeviceWirelessPropertyPermHwAddress        = DeviceWirelessInterface + ".PermHwAddress"        // readable   s
	DeviceWirelessPropertyMode                 = DeviceWirelessInterface + ".Mode"                 // readable   u
	DeviceWirelessPropertyBitrate              = DeviceWirelessInterface + ".Bitrate"              // readable   u
	DeviceWirelessPropertyAccessPoints         = DeviceWirelessInterface + ".AccessPoints"         // readable   ao
	DeviceWirelessPropertyActiveAccessPoint    = DeviceWirelessInterface + ".ActiveAccessPoint"    // readable   o
	DeviceWirelessPropertyWirelessCapabilities = DeviceWirelessInterface + ".WirelessCapabilities" // readable   u
	DeviceWirelessPropertyLastScan             = DeviceWirelessInterface + ".LastScan"             // readable   x
)
View Source
const (
	DnsManagerInterface  = NetworkManagerInterface + ".DnsManager"
	DnsManagerObjectPath = "/org/freedesktop/NetworkManager/DnsManager"

	/* Property */
	DnsManagerPropertyMode          = DnsManagerInterface + ".Mode"          // readable s
	DnsManagerPropertyRcManager     = DnsManagerInterface + ".RcManager"     // readable s
	DnsManagerPropertyConfiguration = DnsManagerInterface + ".Configuration" // readable aa{sv}
)
View Source
const (
	IP4ConfigInterface = NetworkManagerInterface + ".IP4Config"

	/* Properties */
	IP4ConfigPropertyAddresses      = IP4ConfigInterface + ".Addresses"      // readable   aau
	IP4ConfigPropertyAddressData    = IP4ConfigInterface + ".AddressData"    // readable   aa{sv}
	IP4ConfigPropertyGateway        = IP4ConfigInterface + ".Gateway"        // readable   s
	IP4ConfigPropertyRoutes         = IP4ConfigInterface + ".Routes"         // readable   aau
	IP4ConfigPropertyRouteData      = IP4ConfigInterface + ".RouteData"      // readable   aa{sv}
	IP4ConfigPropertyNameservers    = IP4ConfigInterface + ".Nameservers"    // readable   au
	IP4ConfigPropertyNameserverData = IP4ConfigInterface + ".NameserverData" // readable   aa{sv}
	IP4ConfigPropertyDomains        = IP4ConfigInterface + ".Domains"        // readable   as
	IP4ConfigPropertySearches       = IP4ConfigInterface + ".Searches"       // readable   as
	IP4ConfigPropertyDnsOptions     = IP4ConfigInterface + ".DnsOptions"     // readable   as
	IP4ConfigPropertyDnsPriority    = IP4ConfigInterface + ".DnsPriority"    // readable   i
	IP4ConfigPropertyWinsServers    = IP4ConfigInterface + ".WinsServers"    // readable   au
	IP4ConfigPropertyWinsServerData = IP4ConfigInterface + ".WinsServerData" // readable   as
)
View Source
const (
	IP6ConfigInterface = NetworkManagerInterface + ".IP6Config"

	/* Properties */
	IP6ConfigPropertyAddresses   = IP6ConfigInterface + ".Addresses"   // readable   a(ayuay)
	IP6ConfigPropertyAddressData = IP6ConfigInterface + ".AddressData" // readable   aa{sv}
	IP6ConfigPropertyGateway     = IP6ConfigInterface + ".Gateway"     // readable   s
	IP6ConfigPropertyRoutes      = IP6ConfigInterface + ".Routes"      // readable   a(ayuayu)
	IP6ConfigPropertyRouteData   = IP6ConfigInterface + ".RouteData"   // readable   aa{sv}
	IP6ConfigPropertyNameservers = IP6ConfigInterface + ".Nameservers" // readable   aay
	IP6ConfigPropertyDomains     = IP6ConfigInterface + ".Domains"     // readable   as
	IP6ConfigPropertySearches    = IP6ConfigInterface + ".Searches"    // readable   as
	IP6ConfigPropertyDnsOptions  = IP6ConfigInterface + ".DnsOptions"  // readable   as
	IP6ConfigPropertyDnsPriority = IP6ConfigInterface + ".DnsPriority" // readable   i
)
View Source
const (
	NetworkManagerInterface  = "org.freedesktop.NetworkManager"
	NetworkManagerObjectPath = "/org/freedesktop/NetworkManager"

	/* Methods */
	NetworkManagerReload                          = NetworkManagerInterface + ".Reload"
	NetworkManagerGetDevices                      = NetworkManagerInterface + ".GetDevices"
	NetworkManagerGetAllDevices                   = NetworkManagerInterface + ".GetAllDevices"
	NetworkManagerGetDeviceByIpIface              = NetworkManagerInterface + ".GetDeviceByIpIface"
	NetworkManagerActivateConnection              = NetworkManagerInterface + ".ActivateConnection"
	NetworkManagerAddAndActivateConnection        = NetworkManagerInterface + ".AddAndActivateConnection"
	NetworkManagerAddAndActivateConnection2       = NetworkManagerInterface + ".AddAndActivateConnection2"
	NetworkManagerDeactivateConnection            = NetworkManagerInterface + ".DeactivateConnection"
	NetworkManagerSleep                           = NetworkManagerInterface + ".Sleep"
	NetworkManagerEnable                          = NetworkManagerInterface + ".Enable"
	NetworkManagerGetPermissions                  = NetworkManagerInterface + ".GetPermissions"
	NetworkManagerSetLogging                      = NetworkManagerInterface + ".SetLogging"
	NetworkManagerGetLogging                      = NetworkManagerInterface + ".GetLogging"
	NetworkManagerCheckConnectivity               = NetworkManagerInterface + ".CheckConnectivity"
	NetworkManagerState                           = NetworkManagerInterface + ".state"
	NetworkManagerCheckpointCreate                = NetworkManagerInterface + ".CheckpointCreate"
	NetworkManagerCheckpointDestroy               = NetworkManagerInterface + ".CheckpointDestroy"
	NetworkManagerCheckpointRollback              = NetworkManagerInterface + ".CheckpointRollback"
	NetworkManagerCheckpointAdjustRollbackTimeout = NetworkManagerInterface + ".CheckpointAdjustRollbackTimeout"

	/* Property */
	NetworkManagerPropertyDevices                    = NetworkManagerInterface + ".Devices"                    // readable   ao
	NetworkManagerPropertyAllDevices                 = NetworkManagerInterface + ".AllDevices"                 // readable   ao
	NetworkManagerPropertyCheckpoints                = NetworkManagerInterface + ".Checkpoints"                // readable   ao
	NetworkManagerPropertyNetworkingEnabled          = NetworkManagerInterface + ".NetworkingEnabled"          // readable   b
	NetworkManagerPropertyWirelessEnabled            = NetworkManagerInterface + ".WirelessEnabled"            // readwrite  b
	NetworkManagerPropertyWirelessHardwareEnabled    = NetworkManagerInterface + ".WirelessHardwareEnabled"    // readable   b
	NetworkManagerPropertyWwanEnabled                = NetworkManagerInterface + ".WwanEnabled"                // readwrite  b
	NetworkManagerPropertyWwanHardwareEnabled        = NetworkManagerInterface + ".WwanHardwareEnabled"        // readable   b
	NetworkManagerPropertyWimaxEnabled               = NetworkManagerInterface + ".WimaxEnabled"               // readwrite  b
	NetworkManagerPropertyWimaxHardwareEnabled       = NetworkManagerInterface + ".WimaxHardwareEnabled"       // readable   b
	NetworkManagerPropertyActiveConnections          = NetworkManagerInterface + ".ActiveConnections"          // readable   ao
	NetworkManagerPropertyPrimaryConnection          = NetworkManagerInterface + ".PrimaryConnection"          // readable   o
	NetworkManagerPropertyPrimaryConnectionType      = NetworkManagerInterface + ".PrimaryConnectionType"      // readable   s
	NetworkManagerPropertyMetered                    = NetworkManagerInterface + ".Metered"                    // readable   u
	NetworkManagerPropertyActivatingConnection       = NetworkManagerInterface + ".ActivatingConnection"       // readable   o
	NetworkManagerPropertyStartup                    = NetworkManagerInterface + ".Startup"                    // readable   b
	NetworkManagerPropertyVersion                    = NetworkManagerInterface + ".Version"                    // readable   s
	NetworkManagerPropertyCapabilities               = NetworkManagerInterface + ".Capabilities"               // readable   au
	NetworkManagerPropertyState                      = NetworkManagerInterface + ".State"                      // readable   u
	NetworkManagerPropertyConnectivity               = NetworkManagerInterface + ".Connectivity"               // readable   u
	NetworkManagerPropertyConnectivityCheckAvailable = NetworkManagerInterface + ".ConnectivityCheckAvailable" // readable   b
	NetworkManagerPropertyConnectivityCheckEnabled   = NetworkManagerInterface + ".ConnectivityCheckEnabled"   // readwrite  b
	NetworkManagerPropertyGlobalDnsConfiguration     = NetworkManagerInterface + ".GlobalDnsConfiguration"     // readwrite  a{sv}
)
View Source
const (
	SettingsInterface  = NetworkManagerInterface + ".Settings"
	SettingsObjectPath = NetworkManagerObjectPath + "/Settings"

	/* Methods */
	SettingsListConnections      = SettingsInterface + ".ListConnections"
	SettingsGetConnectionByUUID  = SettingsInterface + ".GetConnectionByUuid"
	SettingsAddConnection        = SettingsInterface + ".AddConnection"
	SettingsAddConnectionUnsaved = SettingsInterface + ".AddConnectionUnsaved"
	SettingsLoadConnections      = SettingsInterface + ".LoadConnections"
	SettingsReloadConnections    = SettingsInterface + ".ReloadConnections"
	SettingsSaveHostname         = SettingsInterface + ".SaveHostname"

	/* Properties */
	SettingsPropertyConnections = SettingsInterface + ".Connections" // readable   ao
	SettingsPropertyHostname    = SettingsInterface + ".Hostname"    // readable   s
	SettingsPropertyCanModify   = SettingsInterface + ".CanModify"   // readable   b
)
View Source
const (
	VpnConnectionInterface = NetworkManagerInterface + ".VPN.Connection"

	/* Properties */
	VpnConnectionPropertyVpnState = VpnConnectionInterface + ".VpnState" // readable   u
	VpnConnectionPropertyBanner   = VpnConnectionInterface + ".Banner"   // readable   s
)
View Source
const (
	NmVpnConnectionUnknown      = 0 //The state of the VPN connection is unknown.
	NmVpnConnectionPrepare      = 1 //The VPN connection is preparing to connect.
	NmVpnConnectionNeedAuth     = 2 //The VPN connection needs authorization credentials.
	NmVpnConnectionConnect      = 3 //The VPN connection is being established.
	NmVpnConnectionIpConfigGet  = 4 //The VPN connection is getting an IP address.
	NmVpnConnectionActivated    = 5 //The VPN connection is active.
	NmVpnConnectionFailed       = 6 //The VPN connection failed.
	NmVpnConnectionDisconnected = 7 //The VPN connection is disconnected.
)
View Source
const (
	NmDeviceStateReasonNone                        = 0  // No reason given
	NmDeviceStateReasonUnknown                     = 1  // Unknown error
	NmDeviceStateReasonNowManaged                  = 2  // Device is now managed
	NmDeviceStateReasonNowUnmanaged                = 3  // Device is now unmanaged
	NmDeviceStateReasonConfigFailed                = 4  // The device could not be readied for configuration
	NmDeviceStateReasonIpConfigUnavailable         = 5  // IP configuration could not be reserved (no available address, timeout, etc)
	NmDeviceStateReasonIpConfigExpired             = 6  // The IP config is no longer valid
	NmDeviceStateReasonNoSecrets                   = 7  // Secrets were required, but not provided
	NmDeviceStateReasonSupplicantDisconnect        = 8  // 802.1x supplicant disconnected
	NmDeviceStateReasonSupplicantConfigFailed      = 9  // 802.1x supplicant configuration failed
	NmDeviceStateReasonSupplicantFailed            = 10 // 802.1x supplicant failed
	NmDeviceStateReasonSupplicantTimeout           = 11 // 802.1x supplicant took too long to authenticate
	NmDeviceStateReasonPppStartFailed              = 12 // PPP service failed to start
	NmDeviceStateReasonPppDisconnect               = 13 // PPP service disconnected
	NmDeviceStateReasonPppFailed                   = 14 // PPP failed
	NmDeviceStateReasonDhcpStartFailed             = 15 // DHCP client failed to start
	NmDeviceStateReasonDhcpError                   = 16 // DHCP client error
	NmDeviceStateReasonDhcpFailed                  = 17 // DHCP client failed
	NmDeviceStateReasonSharedStartFailed           = 18 // Shared connection service failed to start
	NmDeviceStateReasonSharedFailed                = 19 // Shared connection service failed
	NmDeviceStateReasonAutoipStartFailed           = 20 // AutoIP service failed to start
	NmDeviceStateReasonAutoipError                 = 21 // AutoIP service error
	NmDeviceStateReasonAutoipFailed                = 22 // AutoIP service failed
	NmDeviceStateReasonModemBusy                   = 23 // The line is busy
	NmDeviceStateReasonModemNoDialTone             = 24 // No dial tone
	NmDeviceStateReasonModemNoCarrier              = 25 // No carrier could be established
	NmDeviceStateReasonModemDialTimeout            = 26 // The dialing request timed out
	NmDeviceStateReasonModemDialFailed             = 27 // The dialing attempt failed
	NmDeviceStateReasonModemInitFailed             = 28 // Modem initialization failed
	NmDeviceStateReasonGsmApnFailed                = 29 // Failed to select the specified APN
	NmDeviceStateReasonGsmRegistrationNotSearching = 30 // Not searching for networks
	NmDeviceStateReasonGsmRegistrationDenied       = 31 // Network registration denied
	NmDeviceStateReasonGsmRegistrationTimeout      = 32 // Network registration timed out
	NmDeviceStateReasonGsmRegistrationFailed       = 33 // Failed to register with the requested network
	NmDeviceStateReasonGsmPinCheckFailed           = 34 // PIN check failed
	NmDeviceStateReasonFirmwareMissing             = 35 // Necessary firmware for the device may be missing
	NmDeviceStateReasonRemoved                     = 36 // The device was removed
	NmDeviceStateReasonSleeping                    = 37 // NetworkManager went to sleep
	NmDeviceStateReasonConnectionRemoved           = 38 // The device's active connection disappeared
	NmDeviceStateReasonUserRequested               = 39 // Device disconnected by user or client
	NmDeviceStateReasonCarrier                     = 40 // Carrier/link changed
	NmDeviceStateReasonConnectionAssumed           = 41 // The device's existing connection was assumed
	NmDeviceStateReasonSupplicantAvailable         = 42 // The supplicant is now available
	NmDeviceStateReasonModemNotFound               = 43 // The modem could not be found
	NmDeviceStateReasonBtFailed                    = 44 // The Bluetooth connection failed or timed out
	NmDeviceStateReasonGsmSimNotInserted           = 45 // GSM Modem's SIM Card not inserted
	NmDeviceStateReasonGsmSimPinRequired           = 46 // GSM Modem's SIM Pin required
	NmDeviceStateReasonGsmSimPukRequired           = 47 // GSM Modem's SIM Puk required
	NmDeviceStateReasonGsmSimWrong                 = 48 // GSM Modem's SIM wrong
	NmDeviceStateReasonInfinibandMode              = 49 // InfiniBand device does not support connected mode
	NmDeviceStateReasonDependencyFailed            = 50 // A dependency of the connection failed
	NmDeviceStateReasonBr2684Failed                = 51 // Problem with the RFC 2684 Ethernet over ADSL bridge
	NmDeviceStateReasonModemManagerUnavailable     = 52 // ModemManager not running
	NmDeviceStateReasonSsidNotFound                = 53 // The Wi-Fi network could not be found
	NmDeviceStateReasonSecondaryConnectionFailed   = 54 // A secondary connection of the base connection failed
	NmDeviceStateReasonDcbFcoeFailed               = 55 // DCB or FCoE setup failed
	NmDeviceStateReasonTeamdControlFailed          = 56 // teamd control failed
	NmDeviceStateReasonModemFailed                 = 57 // Modem failed or no longer available
	NmDeviceStateReasonModemAvailable              = 58 // Modem now ready and available
	NmDeviceStateReasonSimPinIncorrect             = 59 // SIM PIN was incorrect
	NmDeviceStateReasonNewActivation               = 60 // New connection activation was enqueued
	NmDeviceStateReasonParentChanged               = 61 // the device's parent changed
	NmDeviceStateReasonParentManagedChanged        = 62 // the device parent's management changed
	NmDeviceStateReasonOvsdbFailed                 = 63 // problem communicating with Open vSwitch database
	NmDeviceStateReasonIpAddressDuplicate          = 64 // a duplicate IP address was detected
	NmDeviceStateReasonIpMethodUnsupported         = 65 // The selected IP method is not supported
	NmDeviceStateReasonSriovConfigurationFailed    = 66 // configuration of SR-IOV parameters failed
	NmDeviceStateReasonPeerNotFound                = 67 // The Wi-Fi P2P peer could not be found
)
View Source
const (
	NmActiveConnectionStateReasonUnknown             = 0  // The reason for the active connection state change is unknown.
	NmActiveConnectionStateReasonNone                = 1  // No reason was given for the active connection state change.
	NmActiveConnectionStateReasonUserDisconnected    = 2  // The active connection changed state because the user disconnected it.
	NmActiveConnectionStateReasonDeviceDisconnected  = 3  // The active connection changed state because the device it was using was disconnected.
	NmActiveConnectionStateReasonServiceStopped      = 4  // The service providing the VPN connection was stopped.
	NmActiveConnectionStateReasonIpConfigInvalid     = 5  // The IP config of the active connection was invalid.
	NmActiveConnectionStateReasonConnectTimeout      = 6  // The connection attempt to the VPN service timed out.
	NmActiveConnectionStateReasonServiceStartTimeout = 7  // A timeout occurred while starting the service providing the VPN connection.
	NmActiveConnectionStateReasonServiceStartFailed  = 8  // Starting the service providing the VPN connection failed.
	NmActiveConnectionStateReasonNoSecrets           = 9  // Necessary secrets for the connection were not provided.
	NmActiveConnectionStateReasonLoginFailed         = 10 // Authentication to the server failed.
	NmActiveConnectionStateReasonConnectionRemoved   = 11 // The connection was deleted from settings.
	NmActiveConnectionStateReasonDependencyFailed    = 12 // Master connection of this connection failed to activate.
	NmActiveConnectionStateReasonDeviceRealizeFailed = 13 // Could not create the software device link.
	NmActiveConnectionStateReasonDeviceRemoved       = 14 // The device this connection depended on disappeared.
)
View Source
const (
	NmRollbackResultOk                 = 0 // the rollback succeeded.
	NmRollbackResultErrNoDevice        = 1 // the device no longer exists.
	NmRollbackResultErrDeviceUnmanaged = 2 // the device is now unmanaged.
	NmRollbackResultErrFailed          = 3 // other errors during rollback.
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessPoint

type AccessPoint interface {
	GetPath() dbus.ObjectPath

	// GetPropertyFlags gets flags describing the capabilities of the access point.
	GetPropertyFlags() (uint32, error)

	// GetPropertyWPAFlags gets flags describing the access point's capabilities
	// according to WPA (Wi-Fi Protected Access).
	GetPropertyWPAFlags() (uint32, error)

	// GetPropertyRSNFlags gets flags describing the access point's capabilities
	// according to the RSN (Robust Secure Network) protocol.
	GetPropertyRSNFlags() (uint32, error)

	// GetPropertySSID returns the Service Set Identifier identifying the access point.
	GetPropertySSID() (string, error)

	// GetPropertyFrequency gets the radio channel frequency in use by the access point, in MHz.
	GetPropertyFrequency() (uint32, error)

	// GetPropertyHWAddress gets the hardware address (BSSID) of the access point.
	GetPropertyHWAddress() (string, error)

	// GetPropertyMode describes the operating mode of the access point.
	GetPropertyMode() (Nm80211Mode, error)

	// GetPropertyMaxBitrate gets the maximum bitrate this access point is capable of, in kilobits/second (Kb/s).
	GetPropertyMaxBitrate() (uint32, error)

	// GetPropertyStrength gets the current signal quality of the access point, in percent.
	GetPropertyStrength() (uint8, error)

	// GetPropertyLastSeen The timestamp (in CLOCK_BOOTTIME seconds) for the last  time the access point was found in scan results.
	// A value of -1 means the access point has never been found in scan results.
	GetPropertyLastSeen() (int32, error)

	MarshalJSON() ([]byte, error)
}

func NewAccessPoint

func NewAccessPoint(objectPath dbus.ObjectPath) (AccessPoint, error)

type ActiveConnection

type ActiveConnection interface {
	GetPath() dbus.ObjectPath

	// GetPropertyConnection gets connection object of the connection.
	GetPropertyConnection() (Connection, error)

	// GetPropertySpecificObject gets a specific object associated with the active connection.
	GetPropertySpecificObject() (AccessPoint, error)

	// GetPropertyID gets the ID of the connection.
	GetPropertyID() (string, error)

	// GetPropertyUUID gets the UUID of the connection.
	GetPropertyUUID() (string, error)

	// GetPropertyType gets the type of the connection.
	GetPropertyType() (string, error)

	// GetPropertyDevices gets array of device objects which are part of this active connection.
	GetPropertyDevices() ([]Device, error)

	// GetPropertyState gets the state of the connection.
	GetPropertyState() (NmActiveConnectionState, error)

	// GetPropertyStateFlags gets the state flags of the connection.
	GetPropertyStateFlags() (uint32, error)

	// GetPropertyDefault gets the default IPv4 flag of the connection.
	GetPropertyDefault() (bool, error)

	// GetPropertyIP4Config gets the IP4Config of the connection.
	GetPropertyIP4Config() (IP4Config, error)

	// GetPropertyDHCP4Config gets the DHCP6Config of the connection.
	GetPropertyDHCP4Config() (DHCP4Config, error)

	// GetPropertyDefault6 gets the default IPv6 flag of the connection.
	GetPropertyDefault6() (bool, error)

	// GetPropertyIP6Config gets the IP6Config of the connection.
	GetPropertyIP6Config() (IP6Config, error)

	// GetPropertyDHCP6Config gets the DHCP4Config of the connection.
	GetPropertyDHCP6Config() (DHCP6Config, error)

	// GetPropertyVPN gets the VPN flag of the connection.
	GetPropertyVPN() (bool, error)

	// GetPropertyMaster gets the master device of the connection.
	GetPropertyMaster() (Device, error)

	SubscribeState(receiver chan StateChange, exit chan struct{}) (err error)
}

func NewActiveConnection

func NewActiveConnection(objectPath dbus.ObjectPath) (ActiveConnection, error)

type Checkpoint

type Checkpoint interface {
	GetPath() dbus.ObjectPath

	// GetPropertyDevices Array of object paths for devices which are part of this checkpoint.
	GetPropertyDevices() ([]Device, error)

	// GetPropertyCreated The timestamp (in CLOCK_BOOTTIME milliseconds) of checkpoint creation.
	GetPropertyCreated() (int64, error)

	// GetPropertyRollbackTimeout Timeout in seconds for automatic rollback, or zero.
	GetPropertyRollbackTimeout() (uint32, error)

	MarshalJSON() ([]byte, error)
}

func NewCheckpoint

func NewCheckpoint(objectPath dbus.ObjectPath) (Checkpoint, error)

type Connection

type Connection interface {
	GetPath() dbus.ObjectPath

	// Update the connection with new settings and properties (replacing all previous settings and properties) and save the connection to disk. Secrets may be part of the update request, and will be either stored in persistent storage or sent to a Secret Agent for storage, depending on the flags associated with each secret.
	Update(settings ConnectionSettings) error

	// UpdateUnsaved Update the connection with new settings and properties (replacing all previous settings and properties) but do not immediately save the connection to disk. Secrets may be part of the update request and may sent to a Secret Agent for storage, depending on the flags associated with each secret. Use the 'Save' method to save these changes to disk. Note that unsaved changes will be lost if the connection is reloaded from disk (either automatically on file change or due to an explicit ReloadConnections call).
	UpdateUnsaved(settings ConnectionSettings) error

	// Delete the connection.
	Delete() error

	// GetSettings gets the settings maps describing this network configuration.
	// This will never include any secrets required for connection to the
	// network, as those are often protected. Secrets must be requested
	// separately using the GetSecrets() method.
	GetSettings() (ConnectionSettings, error)

	// GetSecrets Get the secrets belonging to this network configuration. Only secrets from
	// persistent storage or a Secret Agent running in the requestor's session
	// will be returned. The user will never be prompted for secrets as a result
	// of this request.
	GetSecrets(settingName string) (ConnectionSettings, error)

	// ClearSecrets Clear the secrets belonging to this network connection profile.
	ClearSecrets() error

	// Save a "dirty" connection (that had previously been updated with UpdateUnsaved) to persistent storage.
	Save() error

	// GetPropertyUnsaved If set, indicates that the in-memory state of the connection does not match the on-disk state. This flag will be set when UpdateUnsaved() is called or when any connection details change, and cleared when the connection is saved to disk via Save() or from internal operations.
	GetPropertyUnsaved() (bool, error)

	// GetPropertyFlags Additional flags of the connection profile.
	GetPropertyFlags() (uint32, error)

	// GetPropertyFilename File that stores the connection in case the connection is file-backed.
	GetPropertyFilename() (string, error)

	MarshalJSON() ([]byte, error)
}

func NewConnection

func NewConnection(objectPath dbus.ObjectPath) (Connection, error)

type ConnectionSettings

type ConnectionSettings map[string]map[string]interface{}

type ConnectionSettings map[string]map[string]interface{}

type DHCP4Config

type DHCP4Config interface {
	// GetPropertyOptions GetOptions gets options map of configuration returned by the IPv4 DHCP server.
	GetPropertyOptions() (DHCP4Options, error)

	MarshalJSON() ([]byte, error)
}

func NewDHCP4Config

func NewDHCP4Config(objectPath dbus.ObjectPath) (DHCP4Config, error)

type DHCP4Options

type DHCP4Options map[string]interface{}

type DHCP6Config

type DHCP6Config interface {
	// GetPropertyOptions GetOptions gets options map of configuration returned by the IPv4 DHCP server.
	GetPropertyOptions() (DHCP6Options, error)

	MarshalJSON() ([]byte, error)
}

func NewDHCP6Config

func NewDHCP6Config(objectPath dbus.ObjectPath) (DHCP6Config, error)

type DHCP6Options

type DHCP6Options map[string]interface{}

type Device

type Device interface {
	GetPath() dbus.ObjectPath

	// Reapply Attempts to update the configuration of a device without deactivating it. NetworkManager has the concept of connections, which are profiles that contain the configuration for a networking device. Those connections are exposed via D-Bus as individual objects that can be created, modified and deleted. When activating such a settings-connection on a device, the settings-connection is cloned to become an applied-connection and used to configure the device (see GetAppliedConnection). Subsequent modification of the settings-connection don't propagate automatically to the device's applied-connection (with exception of the firewall-zone and the metered property). For the changes to take effect, you can either re-activate the settings-connection, or call Reapply. The Reapply call allows you to directly update the applied-connection and reconfigure the device. Reapply can also be useful if the currently applied-connection is equal to the connection that is about to be reapplied. This allows to reconfigure the device and revert external changes like removing or adding an IP address (which NetworkManager doesn't revert automatically because it is assumed that the user made these changes intentionally outside of NetworkManager). Reapply can make the applied-connection different from the settings-connection, just like updating the settings-connection can make them different.
	// connection: The optional connection settings that will be reapplied on the device. If empty, the currently active settings-connection will be used. The connection cannot arbitrarly differ from the current applied-connection otherwise the call will fail. Only certain changes are supported, like adding or removing IP addresses.
	// versionId: If non-zero, the current version id of the applied-connection must match. The current version id can be retrieved via GetAppliedConnection. This optional argument allows to catch concurrent modifications between the GetAppliedConnection call and Reapply.
	// flags: Flags which would modify the behavior of the Reapply call. There are no flags defined currently and the users should use the value of 0.
	Reapply(connection Connection, versionId uint64, flags uint32) error

	// Disconnect a device and prevents the device from automatically activating further connections without user intervention.
	Disconnect() error

	// Delete a software device from NetworkManager and removes the interface from the system. The method returns an error when called for a hardware device.
	Delete() error

	// GetPropertyUdi Operating-system specific transient device hardware identifier. This is an opaque string representing the underlying hardware for the device, and shouldn't be used to keep track of individual devices. For some device types (Bluetooth, Modems) it is an identifier used by the hardware service (ie bluez or ModemManager) to refer to that device, and client programs use it get additional information from those services which NM does not provide. The Udi is not guaranteed to be consistent across reboots or hotplugs of the hardware. If you're looking for a way to uniquely track each device in your application, use the object path. If you're looking for a way to track a specific piece of hardware across reboot or hotplug, use a MAC address or USB serial number.
	GetPropertyUdi() (string, error)

	// GetPropertyInterface The name of the device's control (and often data) interface. Note that non UTF-8 characters are backslash escaped, so the resulting name may be longer then 15 characters. Use g_strcompress() to revert the escaping.
	GetPropertyInterface() (string, error)

	// GetPropertyIpInterface The name of the device's data interface when available. This property may not refer to the actual data interface until the device has successfully established a data connection, indicated by the device's State becoming ACTIVATED. Note that non UTF-8 characters are backslash escaped, so the resulting name may be longer then 15 characters. Use g_strcompress() to revert the escaping.
	GetPropertyIpInterface() (string, error)

	// GetPropertyDriver The driver handling the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
	GetPropertyDriver() (string, error)

	// GetPropertyDriverVersion The version of the driver handling the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
	GetPropertyDriverVersion() (string, error)

	// GetPropertyFirmwareVersion The firmware version for the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
	GetPropertyFirmwareVersion() (string, error)

	// GetPropertyState The current state of the device.
	GetPropertyState() (NmDeviceState, error)

	// GetPropertyActiveConnection Object path of an ActiveConnection object that "owns" this device during activation. The ActiveConnection object tracks the life-cycle of a connection to a specific network and implements the org.freedesktop.NetworkManager.Connection.Active D-Bus interface.
	GetPropertyActiveConnection() (ActiveConnection, error)

	// GetPropertyIP4Config Object path of the Ip4Config object describing the configuration of the device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state.
	GetPropertyIP4Config() (IP4Config, error)

	// GetPropertyDHCP4Config Object path of the Dhcp4Config object describing the DHCP options returned by the DHCP server. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state.
	GetPropertyDHCP4Config() (DHCP4Config, error)

	// GetPropertyIP6Config Object path of the Ip6Config object describing the configuration of the device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state.
	GetPropertyIP6Config() (IP6Config, error)

	// GetPropertyDHCP6Config Object path of the Dhcp6Config object describing the DHCP options returned by the DHCP server. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state.
	GetPropertyDHCP6Config() (DHCP6Config, error)

	// GetPropertyManaged Whether this device is managed by NetworkManager. Setting this property has a similar effect to configuring the device as unmanaged via the keyfile.unmanaged-devices setting in NetworkManager.conf. Changes to this value are not persistent and lost after NetworkManager restart.
	GetPropertyManaged() (bool, error)
	SetPropertyManaged(bool) error

	// GetPropertyAutoConnect If TRUE, indicates the device is allowed to autoconnect. If FALSE, manual intervention is required before the device will automatically connect to a known network, such as activating a connection using the device, or setting this property to TRUE. This property cannot be set to TRUE for default-unmanaged devices, since they never autoconnect.
	GetPropertyAutoConnect() (bool, error)

	// GetPropertyFirmwareMissing If TRUE, indicates the device is likely missing firmware necessary for its operation.
	GetPropertyFirmwareMissing() (bool, error)

	// GetPropertyNmPluginMissing If TRUE, indicates the NetworkManager plugin for the device is likely missing or misconfigured.
	GetPropertyNmPluginMissing() (bool, error)

	// GetPropertyDeviceType The general type of the network device; ie Ethernet, Wi-Fi, etc.
	GetPropertyDeviceType() (NmDeviceType, error)

	// GetPropertyAvailableConnections An array of object paths of every configured connection that is currently 'available' through this device.
	GetPropertyAvailableConnections() ([]Connection, error)

	// GetPropertyPhysicalPortId If non-empty, an (opaque) indicator of the physical network port associated with the device. This can be used to recognize when two seemingly-separate hardware devices are actually just different virtual interfaces to the same physical port.
	GetPropertyPhysicalPortId() (string, error)

	// GetPropertyMtu The device MTU (maximum transmission unit).
	GetPropertyMtu() (uint32, error)

	// GetPropertyReal True if the device exists, or False for placeholder devices that do not yet exist but could be automatically created by NetworkManager if one of their AvailableConnections was activated.
	GetPropertyReal() (bool, error)

	// The result of the last IPv4 connectivity check.
	GetPropertyIp4Connectivity() (NmConnectivity, error)

	MarshalJSON() ([]byte, error)
}

func DeviceFactory

func DeviceFactory(objectPath dbus.ObjectPath) (Device, error)

func NewDevice

func NewDevice(objectPath dbus.ObjectPath) (Device, error)

type DeviceDummy

type DeviceDummy interface {
	Device

	// Hardware address of the device.
	GetPropertyHwAddress() (string, error)
}

func NewDeviceDummy

func NewDeviceDummy(objectPath dbus.ObjectPath) (DeviceDummy, error)

type DeviceGeneric

type DeviceGeneric interface {
	Device

	// GetPropertyHwAddress Active hardware address of the device.
	GetPropertyHwAddress() (string, error)

	// GetPropertyTypeDescription A (non-localized) description of the interface type, if known.
	GetPropertyTypeDescription() (string, error)
}

func NewDeviceGeneric

func NewDeviceGeneric(objectPath dbus.ObjectPath) (DeviceGeneric, error)

type DeviceIpTunnel

type DeviceIpTunnel interface {
	Device

	// GetPropertyMode The tunneling mode
	GetPropertyMode() (uint32, error)

	// GetPropertyParent The object path of the parent device.
	GetPropertyParent() (Device, error)

	// GetPropertyLocal The local endpoint of the tunnel.
	GetPropertyLocal() (string, error)

	// GetPropertyRemote The remote endpoint of the tunnel.
	GetPropertyRemote() (string, error)

	// GetPropertyTtl The TTL assigned to tunneled packets. 0 is a special value meaning that packets inherit the TTL value
	GetPropertyTtl() (uint8, error)

	// GetPropertyTos The type of service (IPv4) or traffic class (IPv6) assigned to tunneled packets.
	GetPropertyTos() (uint8, error)

	// GetPropertyPathMtuDiscovery Whether path MTU discovery is enabled on this tunnel.
	GetPropertyPathMtuDiscovery() (bool, error)

	// GetPropertyInputKey The key used for incoming packets.
	GetPropertyInputKey() (string, error)

	// GetPropertyOutputKey The key used for outgoing packets.
	GetPropertyOutputKey() (string, error)

	// GetPropertyEncapsulationLimit How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels.
	GetPropertyEncapsulationLimit() (uint8, error)

	// GetPropertyFlowLabel The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels.
	GetPropertyFlowLabel() (uint32, error)

	// GetPropertyFlags Tunnel flags.
	GetPropertyFlags() (uint32, error)
}

func NewDeviceIpTunnel

func NewDeviceIpTunnel(objectPath dbus.ObjectPath) (DeviceIpTunnel, error)

type DeviceStatistics

type DeviceStatistics interface {
	GetPath() dbus.ObjectPath

	// GetPropertyRefreshRateMs Refresh rate of the rest of properties of this interface. The properties are guaranteed to be refreshed each RefreshRateMs milliseconds in case the underlying counter has changed too. If zero, there is no guaranteed refresh rate of the properties.
	GetPropertyRefreshRateMs() (uint32, error)

	SetPropertyRefreshRateMs(uint32) error

	// GetPropertyTxBytes Number of transmitted bytes
	GetPropertyTxBytes() (uint64, error)

	// GetPropertyRxBytes Number of received bytes
	GetPropertyRxBytes() (uint64, error)
}

func NewDeviceStatistics

func NewDeviceStatistics(objectPath dbus.ObjectPath) (DeviceStatistics, error)

type DeviceWired

type DeviceWired interface {
	Device

	// GetPropertyHwAddress Active hardware address of the device.
	GetPropertyHwAddress() (string, error)

	// GetPropertyPermHwAddress Permanent hardware address of the device.
	GetPropertyPermHwAddress() (string, error)

	// GetPropertySpeed Design speed of the device, in megabits/second (Mb/s).
	GetPropertySpeed() (uint32, error)

	// GetPropertyS390Subchannels Array of S/390 subchannels for S/390 or z/Architecture devices.
	GetPropertyS390Subchannels() ([]string, error)

	// GetPropertyCarrier Indicates whether the physical carrier is found (e.g. whether a cable is plugged in or not).
	GetPropertyCarrier() (bool, error)
}

func NewDeviceWired

func NewDeviceWired(objectPath dbus.ObjectPath) (DeviceWired, error)

type DeviceWireless

type DeviceWireless interface {
	Device

	// GetAccessPoints gets the list of access points visible to this device.
	// Note that this list does not include access points which hide their SSID.
	// To retrieve a list of all access points (including hidden ones) use the
	// GetAllAccessPoints() method.
	GetAccessPoints() ([]AccessPoint, error)

	// GetAllAccessPoints gets the list of all access points visible to this
	// device, including hidden ones for which the SSID is not yet known.
	GetAllAccessPoints() ([]AccessPoint, error)

	// RequestScan Request the device to scan. To know when the scan is finished, use the
	// "PropertiesChanged" signal from "org.freedesktop.DBus.Properties" to listen
	// to changes to the "LastScan" property.
	RequestScan() error

	// GetPropertyHwAddress The active hardware address of the device.
	GetPropertyHwAddress() (string, error)

	// GetPropertyPermHwAddress The permanent hardware address of the device.
	GetPropertyPermHwAddress() (string, error)

	// GetPropertyMode The operating mode of the wireless device.
	GetPropertyMode() (Nm80211Mode, error)

	// GetPropertyBitrate The bit rate currently used by the wireless device, in kilobits/second (Kb/s).
	GetPropertyBitrate() (uint32, error)

	// GetPropertyAccessPoints List of object paths of access point visible to this wireless device.
	GetPropertyAccessPoints() ([]AccessPoint, error)

	// GetPropertyActiveAccessPoint Object path of the access point currently used by the wireless device.
	GetPropertyActiveAccessPoint() (AccessPoint, error)

	// GetPropertyWirelessCapabilities The capabilities of the wireless device.
	GetPropertyWirelessCapabilities() (uint32, error)

	// GetPropertyLastScan The timestamp (in CLOCK_BOOTTIME milliseconds) for the last finished
	// network scan. A value of -1 means the device never scanned for access
	// points.
	GetPropertyLastScan() (int64, error)
}

func NewDeviceWireless

func NewDeviceWireless(objectPath dbus.ObjectPath) (DeviceWireless, error)

type DnsConfigurationData added in v0.5.0

type DnsConfigurationData struct {
	Nameservers []string
	Priority    int32
	Interface   string
	Vpn         bool
}

type DnsManager added in v0.5.0

type DnsManager interface {
	GetPath() dbus.ObjectPath
	GetPropertyMode() (string, error)
	GetPropertyRcManager() (string, error)
	GetPropertyConfiguration() ([]DnsConfigurationData, error)
}

func NewDnsManager added in v0.5.0

func NewDnsManager() (DnsManager, error)

type IP4Address deprecated

type IP4Address struct {
	Address string
	Prefix  uint8
	Gateway string
}

Deprecated: use IP4AddressData instead

type IP4AddressData

type IP4AddressData struct {
	Address string
	Prefix  uint8
}

type IP4Config

type IP4Config interface {
	// GetPropertyAddresses Array of arrays of IPv4 address/prefix/gateway. All 3 elements of each array are in network byte order. Essentially: [(addr, prefix, gateway), (addr, prefix, gateway), ...]
	// Deprecated: use AddressData and Gateway
	GetPropertyAddresses() ([]IP4Address, error)

	// GetPropertyAddressData Array of IP address data objects. All addresses will include "address" (an IP address string), and "prefix" (a uint). Some addresses may include additional attributes.
	GetPropertyAddressData() ([]IP4AddressData, error)

	// GetPropertyGateway The gateway in use.
	GetPropertyGateway() (string, error)

	// GetPropertyRoutes Arrays of IPv4 route/prefix/next-hop/metric. All 4 elements of each tuple are in network byte order. 'route' and 'next hop' are IPv4 addresses, while prefix and metric are simple unsigned integers. Essentially: [(route, prefix, next-hop, metric), (route, prefix, next-hop, metric), ...]
	// Deprecated: use RouteData
	GetPropertyRoutes() ([]IP4Route, error)

	// GetPropertyRouteData Array of IP route data objects. All routes will include "dest" (an IP address string) and "prefix" (a uint). Some routes may include "next-hop" (an IP address string), "metric" (a uint), and additional attributes.
	GetPropertyRouteData() ([]IP4RouteData, error)

	// GetPropertyNameservers The nameservers in use.
	// Deprecated: use NameserverData
	GetPropertyNameservers() ([]string, error)

	// GetPropertyNameserverData The nameservers in use. Currently only the value "address" is recognized (with an IP address string).
	GetPropertyNameserverData() ([]IP4NameserverData, error)

	// GetPropertyDomains A list of domains this address belongs to.
	GetPropertyDomains() ([]string, error)

	// GetPropertySearches A list of dns searches.
	GetPropertySearches() ([]string, error)

	// GetPropertyDnsOptions A list of DNS options that modify the behavior of the DNS resolver. See resolv.conf(5) manual page for the list of supported options.
	GetPropertyDnsOptions() ([]string, error)

	// GetPropertyDnsPriority The relative priority of DNS servers.
	GetPropertyDnsPriority() (uint32, error)

	// GetPropertyWinsServerData The Windows Internet Name Service servers associated with the connection.
	GetPropertyWinsServerData() ([]string, error)

	MarshalJSON() ([]byte, error)
}

func NewIP4Config

func NewIP4Config(objectPath dbus.ObjectPath) (IP4Config, error)

type IP4NameserverData

type IP4NameserverData struct {
	Address string
}

type IP4Route deprecated

type IP4Route struct {
	Route   string
	Prefix  uint8
	NextHop string
	Metric  uint8
}

Deprecated: use IP4RouteData instead

type IP4RouteData

type IP4RouteData struct {
	Destination          string
	Prefix               uint8
	NextHop              string
	Metric               uint8
	AdditionalAttributes map[string]string
}

type IP6Address deprecated

type IP6Address struct {
	Address string
	Prefix  uint8
	Gateway string
}

Deprecated: use IP6AddressData instead

type IP6AddressData

type IP6AddressData struct {
	Address string
	Prefix  uint8
}

type IP6Config

type IP6Config interface {

	// GetPropertyAddressData Array of IP address data objects. All addresses will include "address" (an IP address string), and "prefix" (a uint). Some addresses may include additional attributes.
	GetPropertyAddressData() ([]IP6AddressData, error)

	// GetPropertyGateway The gateway in use.
	GetPropertyGateway() (string, error)

	// GetPropertyRouteData Array of IP route data objects. All routes will include "dest" (an IP address string) and "prefix" (a uint). Some routes may include "next-hop" (an IP address string), "metric" (a uint), and additional attributes.
	GetPropertyRouteData() ([]IP6RouteData, error)

	// GetPropertyNameservers GetNameservers gets the nameservers in use.
	GetPropertyNameservers() ([][]byte, error)

	// GetPropertyDomains A list of domains this address belongs to.
	GetPropertyDomains() ([]string, error)

	// GetPropertySearches A list of dns searches.
	GetPropertySearches() ([]string, error)

	// GetPropertyDnsOptions A list of DNS options that modify the behavior of the DNS resolver. See resolv.conf(5) manual page for the list of supported options.
	GetPropertyDnsOptions() ([]string, error)

	// GetPropertyDnsPriority The relative priority of DNS servers.
	GetPropertyDnsPriority() (uint32, error)

	MarshalJSON() ([]byte, error)
}

func NewIP6Config

func NewIP6Config(objectPath dbus.ObjectPath) (IP6Config, error)

type IP6Route deprecated

type IP6Route struct {
	Route   string
	Prefix  uint8
	NextHop string
	Metric  uint8
}

Deprecated: use IP6RouteData instead

type IP6RouteData

type IP6RouteData struct {
	Destination          string
	Prefix               uint8
	NextHop              string
	Metric               uint8
	AdditionalAttributes map[string]string
}

type NetworkManager

type NetworkManager interface {

	// Reload NetworkManager's configuration and perform certain updates, like flushing a cache or rewriting external state to disk. This is similar to sending SIGHUP to NetworkManager but it allows for more fine-grained control over what to reload (see flags). It also allows non-root access via PolicyKit and contrary to signals it is synchronous.
	// No flags (0x00) means to reload everything that is supported which is identical to sending a SIGHUP.
	// (0x01) means to reload the NetworkManager.conf configuration from disk. Note that this does not include connections, which can be reloaded via Setting's ReloadConnections.
	// (0x02) means to update DNS configuration, which usually involves writing /etc/resolv.conf anew.
	// (0x04) means to restart the DNS plugin. This is for example useful when using dnsmasq plugin, which uses additional configuration in /etc/NetworkManager/dnsmasq.d. If you edit those files, you can restart the DNS plugin. This action shortly interrupts name resolution. Note that flags may affect each other. For example, restarting the DNS plugin (0x04) implicitly updates DNS too (0x02). Or when reloading the configuration (0x01), changes to DNS setting also cause a DNS update (0x02). However, (0x01) does not involve restarting the DNS plugin (0x04) or update resolv.conf (0x02), unless the DNS related configuration changes in NetworkManager.conf.
	Reload(flags uint32) error

	// GetDevices Get the list of realized network devices.
	GetDevices() ([]Device, error)

	// GetAllDevices Get the list of all network devices.
	GetAllDevices() ([]Device, error)

	// GetDeviceByIpIface Return the object path of the network device referenced by its IP interface name. Note that some devices (usually modems) only have an IP interface name when they are connected.
	GetDeviceByIpIface(interfaceId string) (Device, error)

	// ActivateConnection Activate a connection using the supplied device.
	ActivateConnection(connection Connection, device Device, specificObject *dbus.Object) (ActiveConnection, 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), then activate the new connection. Cannot be used for VPN connections at this time.
	AddAndActivateConnection(connection map[string]map[string]interface{}, device Device) (ActiveConnection, error)

	// ActivateWirelessConnection requests activating access point to network device
	ActivateWirelessConnection(connection Connection, device Device, accessPoint AccessPoint) (ActiveConnection, error)

	// AddAndActivateWirelessConnection adds a new connection profile to the network device it has been
	// passed. It then activates the connection to the passed access point. The first parameter contains
	// additional information for the connection (most probably the credentials).
	// Example contents for connection are:
	// connection := make(map[string]map[string]interface{})
	// connection["802-11-wireless"] = make(map[string]interface{})
	// connection["802-11-wireless"]["security"] = "802-11-wireless-security"
	// connection["802-11-wireless-security"] = make(map[string]interface{})
	// connection["802-11-wireless-security"]["key-mgmt"] = "wpa-psk"
	// connection["802-11-wireless-security"]["psk"] = password
	AddAndActivateWirelessConnection(connection map[string]map[string]interface{}, device Device, accessPoint AccessPoint) (ActiveConnection, error)

	// DeactivateConnection Deactivate an active connection.
	DeactivateConnection(connection ActiveConnection) error

	// Sleep Control the NetworkManager daemon's sleep state. When asleep, all interfaces that it manages are deactivated. When awake, devices are available to be activated. This command should not be called directly by users or clients; it is intended for system suspend/resume tracking.
	// sleepnWake: Indicates whether the NetworkManager daemon should sleep or wake.
	Sleep(sleepNWake bool) error

	// Enable Control whether overall networking is enabled or disabled. When disabled, all interfaces that NM manages are deactivated. When enabled, all managed interfaces are re-enabled and available to be activated. This command should be used by clients that provide to users the ability to enable/disable all networking.
	// enableNDisable: If FALSE, indicates that all networking should be disabled. If TRUE, indicates that NetworkManager should begin managing network devices.
	Enable(enableNDisable bool) error

	// CheckConnectivity Re-check the network connectivity state.
	CheckConnectivity() error

	// State The overall networking state as determined by the NetworkManager daemon, based on the state of network devices under its management.
	State() (NmState, error)

	// CheckpointCreate Create a checkpoint of the current networking configuration for given interfaces. If rollback_timeout is not zero, a rollback is automatically performed after the given timeout.
	// devices: A list of device paths for which a checkpoint should be created. An empty list means all devices.
	// rollbackTimeout: The time in seconds until NetworkManager will automatically rollback to the checkpoint. Set to zero for infinite.
	// flags: Flags for the creation.
	// returns: On success, the new checkpoint.
	CheckpointCreate(devices []Device, rollbackTimeout uint32, flags uint32) (Checkpoint, error)

	// CheckpointDestroy Destroy a previously created checkpoint.
	// checkpoint: The checkpoint to be destroyed. Set to empty to cancel all pending checkpoints.
	CheckpointDestroy(checkpoint Checkpoint) error

	// CheckpointRollback Rollback a checkpoint before the timeout is reached.
	// checkpoint: The checkpoint to be rolled back.
	// result: On return, a dictionary of devices and results. Devices are represented by their original D-Bus path; each result is a RollbackResult.
	CheckpointRollback(checkpoint Checkpoint) (result map[dbus.ObjectPath]NmRollbackResult, err error)

	// CheckpointAdjustRollbackTimeout Reset the timeout for rollback for the checkpoint.
	// Since: 1.12
	// addTimeout: number of seconds from ~now~ in which the timeout will expire. Set to 0 to disable the timeout. Note that the added seconds start counting from now, not "Created" timestamp or the previous expiration time. Note that the "Created" property of the checkpoint will stay unchanged by this call. However, the "RollbackTimeout" will be recalculated to give the approximate new expiration time. The new "RollbackTimeout" property will be approximate up to one second precision, which is the accuracy of the property.
	CheckpointAdjustRollbackTimeout(checkpoint Checkpoint, addTimeout uint32) error

	// GetPropertyDevices The list of realized network devices. Realized devices are those which have backing resources (eg from the kernel or a management daemon like ModemManager, teamd, etc).
	GetPropertyDevices() ([]Device, error)

	// GetPropertyAllDevices The list of both realized and un-realized network devices. Un-realized devices are software devices which do not yet have backing resources, but for which backing resources can be created if the device is activated.
	GetPropertyAllDevices() ([]Device, error)

	// GetPropertyCheckpoints The list of active checkpoints.
	GetPropertyCheckpoints() ([]Checkpoint, error)

	// GetPropertyNetworkingEnabled Indicates if overall networking is currently enabled or not. See the Enable() method.
	GetPropertyNetworkingEnabled() (bool, error)

	// GetPropertyWirelessEnabled Indicates if wireless is currently enabled or not.
	GetPropertyWirelessEnabled() (bool, error)
	SetPropertyWirelessEnabled(bool) error

	// GetPropertyWirelessHardwareEnabled Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch.
	GetPropertyWirelessHardwareEnabled() (bool, error)

	// GetPropertyWwanEnabled Indicates if mobile broadband devices are currently enabled or not.
	GetPropertyWwanEnabled() (bool, error)

	// GetPropertyWwanHardwareEnabled Indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch.
	GetPropertyWwanHardwareEnabled() (bool, error)

	// GetPropertyWimaxEnabled Indicates if WiMAX devices are currently enabled or not.
	GetPropertyWimaxEnabled() (bool, error)

	// GetPropertyWimaxHardwareEnabled Indicates if the WiMAX hardware is currently enabled, i.e. the state of the RF kill switch.
	GetPropertyWimaxHardwareEnabled() (bool, error)

	// GetPropertyActiveConnections List of active connection object paths.
	GetPropertyActiveConnections() ([]ActiveConnection, error)

	// GetPropertyPrimaryConnection The object path of the "primary" active connection being used to access the network. In particular, if there is no VPN active, or the VPN does not have the default route, then this indicates the connection that has the default route. If there is a VPN active with the default route, then this indicates the connection that contains the route to the VPN endpoint.
	GetPropertyPrimaryConnection() (ActiveConnection, error)

	// GetPropertyPrimaryConnectionType The connection type of the "primary" active connection being used to access the network. This is the same as the Type property on the object indicated by PrimaryConnection.
	GetPropertyPrimaryConnectionType() (string, error)

	// GetPropertyMetered Indicates whether the connectivity is metered. This is equivalent to the metered property of the device associated with the primary connection.
	GetPropertyMetered() (NmMetered, error)

	// GetPropertyActivatingConnection The object path of an active connection that is currently being activated and which is expected to become the new PrimaryConnection when it finishes activating.
	GetPropertyActivatingConnection() (ActiveConnection, error)

	// GetPropertyStartup Indicates whether NM is still starting up; this becomes FALSE when NM has finished attempting to activate every connection that it might be able to activate at startup.
	GetPropertyStartup() (bool, error)

	// GetPropertyVersion NetworkManager version.
	GetPropertyVersion() (string, error)

	// GetPropertyCapabilities The current set of capabilities. See NMCapability for currently defined capability numbers. The array is guaranteed to be sorted in ascending order without duplicates.
	GetPropertyCapabilities() ([]NmCapability, error)

	// GetPropertyState The overall state of the NetworkManager daemon.
	// This takes state of all active connections and the connectivity state into account to produce a single indicator of the network accessibility status.
	// The graphical shells may use this property to provide network connection status indication and applications may use this to check if Internet connection is accessible. Shell that is able to cope with captive portals should use the "Connectivity" property to decide whether to present a captive portal authentication dialog.
	GetPropertyState() (NmState, error)

	// GetPropertyConnectivity The result of the last connectivity check. The connectivity check is triggered automatically when a default connection becomes available, periodically and by calling a CheckConnectivity() method.
	// This property is in general useful for the graphical shell to determine whether the Internet access is being hijacked by an authentication gateway (a "captive portal"). In such case it would typically present a web browser window to give the user a chance to authenticate and call CheckConnectivity() when the user submits a form or dismisses the window.
	// To determine the whether the user is able to access the Internet without dealing with captive portals (e.g. to provide a network connection indicator or disable controls that require Internet access), the "State" property is more suitable.
	GetPropertyConnectivity() (NmConnectivity, error)

	// GetPropertyConnectivityCheckAvailable Indicates whether connectivity checking service has been configured. This may return true even if the service is not currently enabled.
	// This is primarily intended for use in a privacy control panel, as a way to determine whether to show an option to enable/disable the feature.
	GetPropertyConnectivityCheckAvailable() (bool, error)

	// GetPropertyConnectivityCheckEnabled Indicates whether connectivity checking is enabled. This property can also be written to to disable connectivity checking (as a privacy control panel might want to do).
	GetPropertyConnectivityCheckEnabled() (bool, error)

	Subscribe() <-chan *dbus.Signal
	Unsubscribe()

	MarshalJSON() ([]byte, error)
}

func NewNetworkManager

func NewNetworkManager() (NetworkManager, error)

type Nm80211APFlags

type Nm80211APFlags uint32
const (
	Nm80211APFlagsNone    Nm80211APFlags = 0x0
	Nm80211APFlagsPrivacy Nm80211APFlags = 0x1
)

func (Nm80211APFlags) String

func (i Nm80211APFlags) String() string

type Nm80211APSec

type Nm80211APSec uint32
const (
	Nm80211APSecNone         Nm80211APSec = 0x0
	Nm80211APSecPairWEP40    Nm80211APSec = 0x1
	Nm80211APSecPairWEP104   Nm80211APSec = 0x2
	Nm80211APSecPairTKIP     Nm80211APSec = 0x4
	Nm80211APSecPairCCMP     Nm80211APSec = 0x8
	Nm80211APSecGroupWEP40   Nm80211APSec = 0x10
	Nm80211APSecGroupWEP104  Nm80211APSec = 0x20
	Nm80211APSecGroupTKIP    Nm80211APSec = 0x40
	Nm80211APSecGroupCCMP    Nm80211APSec = 0x80
	Nm80211APSecKeyMgmtPSK   Nm80211APSec = 0x100
	Nm80211APSecKeyMgmt8021X Nm80211APSec = 0x200
	Nm80211APSecKeyMgmtSAE   Nm80211APSec = 0x400
	Nm80211APSecKeyMgmtOWE   Nm80211APSec = 0x800
	Nm80211APSecKeyMgmtOWETM Nm80211APSec = 0x1000
)

func (Nm80211APSec) String

func (i Nm80211APSec) String() string

type Nm80211Mode

type Nm80211Mode uint32
const (
	Nm80211ModeUnknown Nm80211Mode = 0
	Nm80211ModeAdhoc   Nm80211Mode = 1
	Nm80211ModeInfra   Nm80211Mode = 2
	Nm80211ModeAp      Nm80211Mode = 3
)

func (Nm80211Mode) String

func (i Nm80211Mode) String() string

type NmActivationStateFlag

type NmActivationStateFlag uint32
const (
	NmActivationStateFlagNone                             NmActivationStateFlag = 0x00 // an alias for numeric zero, no flags set.
	NmActivationStateFlagIsMaster                         NmActivationStateFlag = 0x01 // the device is a master.
	NmActivationStateFlagIsSlave                          NmActivationStateFlag = 0x02 // the device is a slave.
	NmActivationStateFlagLayer2Ready                      NmActivationStateFlag = 0x04 // layer2 is activated and ready.
	NmActivationStateFlagIp4Ready                         NmActivationStateFlag = 0x08 // IPv4 setting is completed.
	NmActivationStateFlagIp6Ready                         NmActivationStateFlag = 0x10 // IPv6 setting is completed.
	NmActivationStateFlagMasterHasSlaves                  NmActivationStateFlag = 0x20 // The master has any slave devices attached. This only makes sense if the device is a master.
	NmActivationStateFlagLifetimeBoundToProfileVisibility NmActivationStateFlag = 0x40 // the lifetime of the activation is bound to the visilibity of the connection profile, which in turn depends on "connection.permissions" and whether a session for the user exists. Since: 1.16
)

func (NmActivationStateFlag) String

func (i NmActivationStateFlag) String() string

type NmActiveConnectionState

type NmActiveConnectionState uint32
const (
	NmActiveConnectionStateUnknown      NmActiveConnectionState = 0 // The state of the connection is unknown
	NmActiveConnectionStateActivating   NmActiveConnectionState = 1 // A network connection is being prepared
	NmActiveConnectionStateActivated    NmActiveConnectionState = 2 // There is a connection to the network
	NmActiveConnectionStateDeactivating NmActiveConnectionState = 3 // The network connection is being torn down and cleaned up
	NmActiveConnectionStateDeactivated  NmActiveConnectionState = 4 // The network connection is disconnected and will be removed
)

func (NmActiveConnectionState) String

func (i NmActiveConnectionState) String() string

type NmActiveConnectionStateReason added in v0.3.0

type NmActiveConnectionStateReason uint32

type NmCapability

type NmCapability uint32
const (
	NmCapabilityTeam NmCapability = 1 // Teams can be managed
)

func (NmCapability) String

func (i NmCapability) String() string

type NmCheckpointCreateFlags

type NmCheckpointCreateFlags uint32
const (
	NmCheckpointCreateFlagsNone                 NmCheckpointCreateFlags = 0    // no flags
	NmCheckpointCreateFlagsDestroyAll           NmCheckpointCreateFlags = 0x01 // when creating a new checkpoint, destroy all existing ones.
	NmCheckpointCreateFlagsDeleteNewConnections NmCheckpointCreateFlags = 0x02 // upon rollback, delete any new connection added after the checkpoint (Since: 1.6)
	NmCheckpointCreateFlagsDisconnectNewDevices NmCheckpointCreateFlags = 0x04 // upon rollback, disconnect any new device appeared after the checkpoint (Since: 1.6)
	NmCheckpointCreateFlagsAllowOverlapping     NmCheckpointCreateFlags = 0x08 // by default, creating a checkpoint fails if there are already existing checkoints that reference the same devices. With this flag, creation of such checkpoints is allowed, however, if an older checkpoint that references overlapping devices gets rolled back, it will automatically destroy this checkpoint during rollback. This allows to create several overlapping checkpoints in parallel, and rollback to them at will. With the special case that rolling back to an older checkpoint will invalidate all overlapping younger checkpoints. This opts-in that the checkpoint can be automatically destroyed by the rollback of an older checkpoint. (Since: 1.12)
)

func (NmCheckpointCreateFlags) String

func (i NmCheckpointCreateFlags) String() string

type NmConnectivity

type NmConnectivity uint32
const (
	NmConnectivityUnknown NmConnectivity = 0 // Network connectivity is unknown. This means the connectivity checks are disabled (e.g. on server installations) or has not run yet. The graphical shell should assume the Internet connection might be available and not present a captive portal window.
	NmConnectivityNone    NmConnectivity = 1 // The host is not connected to any network. There's no active connection that contains a default route to the internet and thus it makes no sense to even attempt a connectivity check. The graphical shell should use this state to indicate the network connection is unavailable.
	NmConnectivityPortal  NmConnectivity = 2 // The Internet connection is hijacked by a captive portal gateway. The graphical shell may open a sandboxed web browser window (because the captive portals typically attempt a man-in-the-middle attacks against the https connections) for the purpose of authenticating to a gateway and retrigger the connectivity check with CheckConnectivity() when the browser window is dismissed.
	NmConnectivityLimited NmConnectivity = 3 // 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.
	NmConnectivityFull    NmConnectivity = 4 // The host is connected to a network, and appears to be able to reach the full Internet.
)

func (NmConnectivity) String

func (i NmConnectivity) String() string

type NmDeviceState

type NmDeviceState uint32
const (
	NmDeviceStateUnknown      NmDeviceState = 0   // the device's state is unknown
	NmDeviceStateUnmanaged    NmDeviceState = 10  // the device is recognized, but not managed by NetworkManager
	NmDeviceStateUnavailable  NmDeviceState = 20  // the device is managed by NetworkManager, but is not available for use. Reasons may include the wireless switched off, missing firmware, no ethernet carrier, missing supplicant or modem manager, etc.
	NmDeviceStateDisconnected NmDeviceState = 30  // the device can be activated, but is currently idle and not connected to a network.
	NmDeviceStatePrepare      NmDeviceState = 40  // the device is preparing the connection to the network. This may include operations like changing the MAC address, setting physical link properties, and anything else required to connect to the requested network.
	NmDeviceStateConfig       NmDeviceState = 50  // the device is connecting to the requested network. This may include operations like associating with the Wi-Fi AP, dialing the modem, connecting to the remote Bluetooth device, etc.
	NmDeviceStateNeedAuth     NmDeviceState = 60  // the device requires more information to continue connecting to the requested network. This includes secrets like WiFi passphrases, login passwords, PIN codes, etc.
	NmDeviceStateIpConfig     NmDeviceState = 70  // the device is requesting IPv4 and/or IPv6 addresses and routing information from the network.
	NmDeviceStateIpCheck      NmDeviceState = 80  // the device is checking whether further action is required for the requested network connection. This may include checking whether only local network access is available, whether a captive portal is blocking access to the Internet, etc.
	NmDeviceStateSecondaries  NmDeviceState = 90  // the device is waiting for a secondary connection (like a VPN) which must activated before the device can be activated
	NmDeviceStateActivated    NmDeviceState = 100 // the device has a network connection, either local or global.
	NmDeviceStateDeactivating NmDeviceState = 110 // a disconnection from the current network connection was requested, and the device is cleaning up resources used for that connection. The network connection may still be valid.
	NmDeviceStateFailed       NmDeviceState = 120 // the device failed to connect to the requested network and is cleaning up the connection request
)

func (NmDeviceState) String

func (i NmDeviceState) String() string

type NmDeviceStateReason added in v0.3.0

type NmDeviceStateReason uint32

type NmDeviceType

type NmDeviceType uint32
const (
	NmDeviceTypeUnknown      NmDeviceType = 0  // unknown device
	NmDeviceTypeGeneric      NmDeviceType = 14 // generic support for unrecognized device types
	NmDeviceTypeEthernet     NmDeviceType = 1  // a wired ethernet device
	NmDeviceTypeWifi         NmDeviceType = 2  // an 802.11 Wi-Fi device
	NmDeviceTypeUnused1      NmDeviceType = 3  // not used
	NmDeviceTypeUnused2      NmDeviceType = 4  // not used
	NmDeviceTypeBt           NmDeviceType = 5  // a Bluetooth device supporting PAN or DUN access protocols
	NmDeviceTypeOlpcMesh     NmDeviceType = 6  // an OLPC XO mesh networking device
	NmDeviceTypeWimax        NmDeviceType = 7  // an 802.16e Mobile WiMAX broadband device
	NmDeviceTypeModem        NmDeviceType = 8  // a modem supporting analog telephone, CDMA/EVDO, GSM/UMTS, or LTE network access protocols
	NmDeviceTypeInfiniband   NmDeviceType = 9  // an IP-over-InfiniBand device
	NmDeviceTypeBond         NmDeviceType = 10 // a bond master interface
	NmDeviceTypeVlan         NmDeviceType = 11 // an 802.1Q VLAN interface
	NmDeviceTypeAdsl         NmDeviceType = 12 // ADSL modem
	NmDeviceTypeBridge       NmDeviceType = 13 // a bridge master interface
	NmDeviceTypeTeam         NmDeviceType = 15 // a team master interface
	NmDeviceTypeTun          NmDeviceType = 16 // a TUN or TAP interface
	NmDeviceTypeIpTunnel     NmDeviceType = 17 // a IP tunnel interface
	NmDeviceTypeMacvlan      NmDeviceType = 18 // a MACVLAN interface
	NmDeviceTypeVxlan        NmDeviceType = 19 // a VXLAN interface
	NmDeviceTypeVeth         NmDeviceType = 20 // a VETH interface
	NmDeviceTypeMacsec       NmDeviceType = 21 // a MACsec interface
	NmDeviceTypeDummy        NmDeviceType = 22 // a dummy interface
	NmDeviceTypePpp          NmDeviceType = 23 // a PPP interface
	NmDeviceTypeOvsInterface NmDeviceType = 24 // a Open vSwitch interface
	NmDeviceTypeOvsPort      NmDeviceType = 25 // a Open vSwitch port
	NmDeviceTypeOvsBridge    NmDeviceType = 26 // a Open vSwitch bridge
	NmDeviceTypeWpan         NmDeviceType = 27 // a IEEE 802.15.4 (WPAN) MAC Layer Device
	NmDeviceType6lowpan      NmDeviceType = 28 // 6LoWPAN interface
	NmDeviceTypeWireguard    NmDeviceType = 29 // a WireGuard interface
	NmDeviceTypeWifiP2p      NmDeviceType = 30 // an 802.11 Wi-Fi P2P device (Since: 1.16)
)

func (NmDeviceType) String

func (i NmDeviceType) String() string

type NmMetered

type NmMetered uint32
const (
	NmMeteredUnknown  NmMetered = 0 // The metered status is unknown
	NmMeteredYes      NmMetered = 1 // Metered, the value was statically set
	NmMeteredNo       NmMetered = 2 // Not metered, the value was statically set
	NmMeteredGuessYes NmMetered = 3 // Metered, the value was guessed
	NmMeteredGuessNo  NmMetered = 4 // Not metered, the value was guessed
)

func (NmMetered) String

func (i NmMetered) String() string

type NmRollbackResult added in v0.3.0

type NmRollbackResult uint32

type NmState

type NmState uint32
const (
	NmStateUnknown         NmState = 0  // Networking state is unknown. This indicates a daemon error that makes it unable to reasonably assess the state. In such event the applications are expected to assume Internet connectivity might be present and not disable controls that require network access. The graphical shells may hide the network accessibility indicator altogether since no meaningful status indication can be provided.
	NmStateAsleep          NmState = 10 // Networking is not enabled, the system is being suspended or resumed from suspend.
	NmStateDisconnected    NmState = 20 // There is no active network connection. The graphical shell should indicate no network connectivity and the applications should not attempt to access the network.
	NmStateDisconnecting   NmState = 30 // Network connections are being cleaned up. The applications should tear down their network sessions.
	NmStateConnecting      NmState = 40 // A network connection is being started The graphical shell should indicate the network is being connected while the applications should still make no attempts to connect the network.
	NmStateConnectedLocal  NmState = 50 // There is only local IPv4 and/or IPv6 connectivity, but no default route to access the Internet. The graphical shell should indicate no network connectivity.
	NmStateConnectedSite   NmState = 60 // There is only site-wide IPv4 and/or IPv6 connectivity. This means a default route is available, but the Internet connectivity check (see "Connectivity" property) did not succeed. The graphical shell should indicate limited network connectivity.
	NmStateConnectedGlobal NmState = 70 // There is global IPv4 and/or IPv6 Internet connectivity This means the Internet connectivity check succeeded, the graphical shell should indicate full network connectivity.
)

func (NmState) String

func (i NmState) String() string

type NmVpnConnectionState added in v0.3.0

type NmVpnConnectionState uint32

type Settings

type Settings interface {
	// ListConnections gets list the saved network connections known to NetworkManager
	ListConnections() ([]Connection, error)

	// ReloadConnections tells NetworkManager to reload all connection files from disk, including noticing any added or deleted connection files.
	ReloadConnections() error

	// GetConnectionByUUID gets the connection, given that connection's UUID.
	GetConnectionByUUID(uuid string) (Connection, error)

	// AddConnection adds new connection and save it to disk.
	AddConnection(settings ConnectionSettings) (Connection, error)

	// AddConnectionUnsaved Add new connection but do not save it to disk immediately. This operation does not start the network connection unless (1) device is idle and able to connect to the network described by the new connection, and (2) the connection is allowed to be started automatically. Use the 'Save' method on the connection to save these changes to disk. Note that unsaved changes will be lost if the connection is reloaded from disk (either automatically on file change or due to an explicit ReloadConnections call).
	AddConnectionUnsaved(settings ConnectionSettings) (Connection, error)

	// SaveHostname Save the hostname to persistent configuration.
	SaveHostname(hostname string) error

	// GetPropertyCanModify If true, adding and modifying connections is supported.
	GetPropertyCanModify() (bool, error)

	// GetPropertyHostname The machine hostname stored in persistent configuration.
	GetPropertyHostname() (string, error)
}

func NewSettings

func NewSettings() (Settings, error)

type StateChange added in v0.3.0

type StateChange struct {
	Path   dbus.ObjectPath
	State  NmActiveConnectionState
	Reason NmActiveConnectionStateReason
}

type VpnConnection added in v0.3.0

type VpnConnection interface {
	GetPath() dbus.ObjectPath

	// GetPropertyVpnState The VPN-specific state of the connection.
	GetPropertyVpnState() (NmVpnConnectionState, error)

	// GetPropertyBanner The banner string of the VPN connection.
	GetPropertyBanner() (string, error)
}

func NewVpnConnection added in v0.3.0

func NewVpnConnection(objectPath dbus.ObjectPath) (VpnConnection, error)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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