Add godoc standard comment prefix
This commit is contained in:
parent
4b20a2d51a
commit
ec47b1991d
17 changed files with 159 additions and 163 deletions
|
@ -25,40 +25,36 @@ const (
|
||||||
type AccessPoint interface {
|
type AccessPoint interface {
|
||||||
GetPath() dbus.ObjectPath
|
GetPath() dbus.ObjectPath
|
||||||
|
|
||||||
// GetFlags gets flags describing the capabilities of the access point.
|
// GetPropertyFlags gets flags describing the capabilities of the access point.
|
||||||
GetPropertyFlags() (uint32, error)
|
GetPropertyFlags() (uint32, error)
|
||||||
|
|
||||||
// GetWPAFlags gets flags describing the access point's capabilities
|
// GetPropertyWPAFlags gets flags describing the access point's capabilities
|
||||||
// according to WPA (Wifi Protected Access).
|
// according to WPA (Wi-Fi Protected Access).
|
||||||
GetPropertyWPAFlags() (uint32, error)
|
GetPropertyWPAFlags() (uint32, error)
|
||||||
|
|
||||||
// GetRSNFlags gets flags describing the access point's capabilities
|
// GetPropertyRSNFlags gets flags describing the access point's capabilities
|
||||||
// according to the RSN (Robust Secure Network) protocol.
|
// according to the RSN (Robust Secure Network) protocol.
|
||||||
GetPropertyRSNFlags() (uint32, error)
|
GetPropertyRSNFlags() (uint32, error)
|
||||||
|
|
||||||
// GetSSID returns the Service Set Identifier identifying the access point.
|
// GetPropertySSID returns the Service Set Identifier identifying the access point.
|
||||||
GetPropertySSID() (string, error)
|
GetPropertySSID() (string, error)
|
||||||
|
|
||||||
// GetFrequency gets the radio channel frequency in use by the access point,
|
// GetPropertyFrequency gets the radio channel frequency in use by the access point, in MHz.
|
||||||
// in MHz.
|
|
||||||
GetPropertyFrequency() (uint32, error)
|
GetPropertyFrequency() (uint32, error)
|
||||||
|
|
||||||
// GetHWAddress gets the hardware address (BSSID) of the access point.
|
// GetPropertyHWAddress gets the hardware address (BSSID) of the access point.
|
||||||
GetPropertyHWAddress() (string, error)
|
GetPropertyHWAddress() (string, error)
|
||||||
|
|
||||||
// GetMode describes the operating mode of the access point.
|
// GetPropertyMode describes the operating mode of the access point.
|
||||||
GetPropertyMode() (Nm80211Mode, error)
|
GetPropertyMode() (Nm80211Mode, error)
|
||||||
|
|
||||||
// GetMaxBitrate gets the maximum bitrate this access point is capable of, in
|
// GetPropertyMaxBitrate gets the maximum bitrate this access point is capable of, in kilobits/second (Kb/s).
|
||||||
// kilobits/second (Kb/s).
|
|
||||||
GetPropertyMaxBitrate() (uint32, error)
|
GetPropertyMaxBitrate() (uint32, error)
|
||||||
|
|
||||||
// GetStrength gets the current signal quality of the access point, in
|
// GetPropertyStrength gets the current signal quality of the access point, in percent.
|
||||||
// percent.
|
|
||||||
GetPropertyStrength() (uint8, error)
|
GetPropertyStrength() (uint8, error)
|
||||||
|
|
||||||
// GetPropertyLastSeen
|
// GetPropertyLastSeen The timestamp (in CLOCK_BOOTTIME seconds) for the last time the access point was found in scan results.
|
||||||
// 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.
|
// A value of -1 means the access point has never been found in scan results.
|
||||||
GetPropertyLastSeen() (int32, error)
|
GetPropertyLastSeen() (int32, error)
|
||||||
|
|
||||||
|
|
|
@ -35,52 +35,52 @@ const (
|
||||||
type ActiveConnection interface {
|
type ActiveConnection interface {
|
||||||
GetPath() dbus.ObjectPath
|
GetPath() dbus.ObjectPath
|
||||||
|
|
||||||
// GetConnectionSettings gets connection object of the connection.
|
// GetPropertyConnection gets connection object of the connection.
|
||||||
GetPropertyConnection() (Connection, error)
|
GetPropertyConnection() (Connection, error)
|
||||||
|
|
||||||
// GetSpecificObject gets a specific object associated with the active connection.
|
// GetPropertySpecificObject gets a specific object associated with the active connection.
|
||||||
GetPropertySpecificObject() (AccessPoint, error)
|
GetPropertySpecificObject() (AccessPoint, error)
|
||||||
|
|
||||||
// GetID gets the ID of the connection.
|
// GetPropertyID gets the ID of the connection.
|
||||||
GetPropertyID() (string, error)
|
GetPropertyID() (string, error)
|
||||||
|
|
||||||
// GetUUID gets the UUID of the connection.
|
// GetPropertyUUID gets the UUID of the connection.
|
||||||
GetPropertyUUID() (string, error)
|
GetPropertyUUID() (string, error)
|
||||||
|
|
||||||
// GetType gets the type of the connection.
|
// GetPropertyType gets the type of the connection.
|
||||||
GetPropertyType() (string, error)
|
GetPropertyType() (string, error)
|
||||||
|
|
||||||
// GetDevices gets array of device objects which are part of this active connection.
|
// GetPropertyDevices gets array of device objects which are part of this active connection.
|
||||||
GetPropertyDevices() ([]Device, error)
|
GetPropertyDevices() ([]Device, error)
|
||||||
|
|
||||||
// GetState gets the state of the connection.
|
// GetPropertyState gets the state of the connection.
|
||||||
GetPropertyState() (NmActiveConnectionState, error)
|
GetPropertyState() (NmActiveConnectionState, error)
|
||||||
|
|
||||||
// GetStateFlags gets the state flags of the connection.
|
// GetPropertyStateFlags gets the state flags of the connection.
|
||||||
GetPropertyStateFlags() (uint32, error)
|
GetPropertyStateFlags() (uint32, error)
|
||||||
|
|
||||||
// GetDefault gets the default IPv4 flag of the connection.
|
// GetPropertyDefault gets the default IPv4 flag of the connection.
|
||||||
GetPropertyDefault() (bool, error)
|
GetPropertyDefault() (bool, error)
|
||||||
|
|
||||||
// GetIP4Config gets the IP4Config of the connection.
|
// GetPropertyIP4Config gets the IP4Config of the connection.
|
||||||
GetPropertyIP4Config() (IP4Config, error)
|
GetPropertyIP4Config() (IP4Config, error)
|
||||||
|
|
||||||
// GetDHCP4Config gets the DHCP6Config of the connection.
|
// GetPropertyDHCP4Config gets the DHCP6Config of the connection.
|
||||||
GetPropertyDHCP4Config() (DHCP4Config, error)
|
GetPropertyDHCP4Config() (DHCP4Config, error)
|
||||||
|
|
||||||
// GetDefault gets the default IPv6 flag of the connection.
|
// GetPropertyDefault6 gets the default IPv6 flag of the connection.
|
||||||
GetPropertyDefault6() (bool, error)
|
GetPropertyDefault6() (bool, error)
|
||||||
|
|
||||||
// GetIP6Config gets the IP6Config of the connection.
|
// GetPropertyIP6Config gets the IP6Config of the connection.
|
||||||
GetPropertyIP6Config() (IP6Config, error)
|
GetPropertyIP6Config() (IP6Config, error)
|
||||||
|
|
||||||
// GetDHCP6Config gets the DHCP4Config of the connection.
|
// GetPropertyDHCP6Config gets the DHCP4Config of the connection.
|
||||||
GetPropertyDHCP6Config() (DHCP6Config, error)
|
GetPropertyDHCP6Config() (DHCP6Config, error)
|
||||||
|
|
||||||
// GetVPN gets the VPN flag of the connection.
|
// GetPropertyVPN gets the VPN flag of the connection.
|
||||||
GetPropertyVPN() (bool, error)
|
GetPropertyVPN() (bool, error)
|
||||||
|
|
||||||
// GetMaster gets the master device of the connection.
|
// GetPropertyMaster gets the master device of the connection.
|
||||||
GetPropertyMaster() (Device, error)
|
GetPropertyMaster() (Device, error)
|
||||||
|
|
||||||
SubscribeState(receiver chan StateChange, exit chan struct{}) (err error)
|
SubscribeState(receiver chan StateChange, exit chan struct{}) (err error)
|
||||||
|
|
|
@ -18,13 +18,13 @@ const (
|
||||||
type Checkpoint interface {
|
type Checkpoint interface {
|
||||||
GetPath() dbus.ObjectPath
|
GetPath() dbus.ObjectPath
|
||||||
|
|
||||||
// Array of object paths for devices which are part of this checkpoint.
|
// GetPropertyDevices Array of object paths for devices which are part of this checkpoint.
|
||||||
GetPropertyDevices() ([]Device, error)
|
GetPropertyDevices() ([]Device, error)
|
||||||
|
|
||||||
// The timestamp (in CLOCK_BOOTTIME milliseconds) of checkpoint creation.
|
// GetPropertyCreated The timestamp (in CLOCK_BOOTTIME milliseconds) of checkpoint creation.
|
||||||
GetPropertyCreated() (int64, error)
|
GetPropertyCreated() (int64, error)
|
||||||
|
|
||||||
// Timeout in seconds for automatic rollback, or zero.
|
// GetPropertyRollbackTimeout Timeout in seconds for automatic rollback, or zero.
|
||||||
GetPropertyRollbackTimeout() (uint32, error)
|
GetPropertyRollbackTimeout() (uint32, error)
|
||||||
|
|
||||||
MarshalJSON() ([]byte, error)
|
MarshalJSON() ([]byte, error)
|
||||||
|
|
|
@ -34,7 +34,7 @@ type Connection interface {
|
||||||
// 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 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
|
Update(settings ConnectionSettings) error
|
||||||
|
|
||||||
// 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 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
|
UpdateUnsaved(settings ConnectionSettings) error
|
||||||
|
|
||||||
// Delete the connection.
|
// Delete the connection.
|
||||||
|
@ -46,25 +46,25 @@ type Connection interface {
|
||||||
// separately using the GetSecrets() method.
|
// separately using the GetSecrets() method.
|
||||||
GetSettings() (ConnectionSettings, error)
|
GetSettings() (ConnectionSettings, error)
|
||||||
|
|
||||||
// Get the secrets belonging to this network configuration. Only secrets from
|
// GetSecrets Get the secrets belonging to this network configuration. Only secrets from
|
||||||
// persistent storage or a Secret Agent running in the requestor's session
|
// 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
|
// will be returned. The user will never be prompted for secrets as a result
|
||||||
// of this request.
|
// of this request.
|
||||||
GetSecrets(settingName string) (ConnectionSettings, error)
|
GetSecrets(settingName string) (ConnectionSettings, error)
|
||||||
|
|
||||||
// Clear the secrets belonging to this network connection profile.
|
// ClearSecrets Clear the secrets belonging to this network connection profile.
|
||||||
ClearSecrets() error
|
ClearSecrets() error
|
||||||
|
|
||||||
// Saves a "dirty" connection (that had previously been updated with UpdateUnsaved) to persistent storage.
|
// Save a "dirty" connection (that had previously been updated with UpdateUnsaved) to persistent storage.
|
||||||
Save() error
|
Save() error
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyUnsaved() (bool, error)
|
||||||
|
|
||||||
// Additional flags of the connection profile.
|
// GetPropertyFlags Additional flags of the connection profile.
|
||||||
GetPropertyFlags() (uint32, error)
|
GetPropertyFlags() (uint32, error)
|
||||||
|
|
||||||
// File that stores the connection in case the connection is file-backed.
|
// GetPropertyFilename File that stores the connection in case the connection is file-backed.
|
||||||
GetPropertyFilename() (string, error)
|
GetPropertyFilename() (string, error)
|
||||||
|
|
||||||
MarshalJSON() ([]byte, error)
|
MarshalJSON() ([]byte, error)
|
||||||
|
|
|
@ -16,7 +16,7 @@ const (
|
||||||
type DHCP4Options map[string]interface{}
|
type DHCP4Options map[string]interface{}
|
||||||
|
|
||||||
type DHCP4Config interface {
|
type DHCP4Config interface {
|
||||||
// GetOptions gets options map of configuration returned by the IPv4 DHCP server.
|
// GetPropertyOptions GetOptions gets options map of configuration returned by the IPv4 DHCP server.
|
||||||
GetPropertyOptions() (DHCP4Options, error)
|
GetPropertyOptions() (DHCP4Options, error)
|
||||||
|
|
||||||
MarshalJSON() ([]byte, error)
|
MarshalJSON() ([]byte, error)
|
||||||
|
|
|
@ -16,7 +16,7 @@ const (
|
||||||
type DHCP6Options map[string]interface{}
|
type DHCP6Options map[string]interface{}
|
||||||
|
|
||||||
type DHCP6Config interface {
|
type DHCP6Config interface {
|
||||||
// GetOptions gets options map of configuration returned by the IPv4 DHCP server.
|
// GetPropertyOptions GetOptions gets options map of configuration returned by the IPv4 DHCP server.
|
||||||
GetPropertyOptions() (DHCP6Options, error)
|
GetPropertyOptions() (DHCP6Options, error)
|
||||||
|
|
||||||
MarshalJSON() ([]byte, error)
|
MarshalJSON() ([]byte, error)
|
||||||
|
|
48
Device.go
48
Device.go
|
@ -74,80 +74,80 @@ func DeviceFactory(objectPath dbus.ObjectPath) (Device, error) {
|
||||||
type Device interface {
|
type Device interface {
|
||||||
GetPath() dbus.ObjectPath
|
GetPath() dbus.ObjectPath
|
||||||
|
|
||||||
// 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.
|
// 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.
|
// 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.
|
// 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.
|
// 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
|
Reapply(connection Connection, versionId uint64, flags uint32) error
|
||||||
|
|
||||||
// Disconnects a device and prevents the device from automatically activating further connections without user intervention.
|
// Disconnect a device and prevents the device from automatically activating further connections without user intervention.
|
||||||
Disconnect() error
|
Disconnect() error
|
||||||
|
|
||||||
// Deletes a software device from NetworkManager and removes the interface from the system. The method returns an error when called for a hardware device.
|
// 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
|
Delete() error
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyUdi() (string, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyInterface() (string, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyIpInterface() (string, error)
|
||||||
|
|
||||||
// The driver handling the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
|
// GetPropertyDriver The driver handling the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
|
||||||
GetPropertyDriver() (string, error)
|
GetPropertyDriver() (string, error)
|
||||||
|
|
||||||
// The version of the driver handling the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
|
// GetPropertyDriverVersion The version of the driver handling the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
|
||||||
GetPropertyDriverVersion() (string, error)
|
GetPropertyDriverVersion() (string, error)
|
||||||
|
|
||||||
// The firmware version for the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
|
// GetPropertyFirmwareVersion The firmware version for the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
|
||||||
GetPropertyFirmwareVersion() (string, error)
|
GetPropertyFirmwareVersion() (string, error)
|
||||||
|
|
||||||
// The current state of the device.
|
// GetPropertyState The current state of the device.
|
||||||
GetPropertyState() (NmDeviceState, error)
|
GetPropertyState() (NmDeviceState, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyActiveConnection() (ActiveConnection, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyIP4Config() (IP4Config, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyDHCP4Config() (DHCP4Config, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyIP6Config() (IP6Config, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyDHCP6Config() (DHCP6Config, error)
|
||||||
|
|
||||||
// Whether or not 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 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)
|
GetPropertyManaged() (bool, error)
|
||||||
SetPropertyManaged(bool) error
|
SetPropertyManaged(bool) error
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyAutoConnect() (bool, error)
|
||||||
|
|
||||||
// If TRUE, indicates the device is likely missing firmware necessary for its operation.
|
// GetPropertyFirmwareMissing If TRUE, indicates the device is likely missing firmware necessary for its operation.
|
||||||
GetPropertyFirmwareMissing() (bool, error)
|
GetPropertyFirmwareMissing() (bool, error)
|
||||||
|
|
||||||
// If TRUE, indicates the NetworkManager plugin for the device is likely missing or misconfigured.
|
// GetPropertyNmPluginMissing If TRUE, indicates the NetworkManager plugin for the device is likely missing or misconfigured.
|
||||||
GetPropertyNmPluginMissing() (bool, error)
|
GetPropertyNmPluginMissing() (bool, error)
|
||||||
|
|
||||||
// The general type of the network device; ie Ethernet, Wi-Fi, etc.
|
// GetPropertyDeviceType The general type of the network device; ie Ethernet, Wi-Fi, etc.
|
||||||
GetPropertyDeviceType() (NmDeviceType, error)
|
GetPropertyDeviceType() (NmDeviceType, error)
|
||||||
|
|
||||||
// An array of object paths of every configured connection that is currently 'available' through this device.
|
// GetPropertyAvailableConnections An array of object paths of every configured connection that is currently 'available' through this device.
|
||||||
GetPropertyAvailableConnections() ([]Connection, error)
|
GetPropertyAvailableConnections() ([]Connection, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyPhysicalPortId() (string, error)
|
||||||
|
|
||||||
// The device MTU (maximum transmission unit).
|
// GetPropertyMtu The device MTU (maximum transmission unit).
|
||||||
GetPropertyMtu() (uint32, error)
|
GetPropertyMtu() (uint32, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyReal() (bool, error)
|
||||||
|
|
||||||
MarshalJSON() ([]byte, error)
|
MarshalJSON() ([]byte, error)
|
||||||
|
|
|
@ -17,10 +17,10 @@ const (
|
||||||
type DeviceGeneric interface {
|
type DeviceGeneric interface {
|
||||||
Device
|
Device
|
||||||
|
|
||||||
// Active hardware address of the device.
|
// GetPropertyHwAddress Active hardware address of the device.
|
||||||
GetPropertyHwAddress() (string, error)
|
GetPropertyHwAddress() (string, error)
|
||||||
|
|
||||||
// A (non-localized) description of the interface type, if known.
|
// GetPropertyTypeDescription A (non-localized) description of the interface type, if known.
|
||||||
GetPropertyTypeDescription() (string, error)
|
GetPropertyTypeDescription() (string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,40 +29,40 @@ const (
|
||||||
type DeviceIpTunnel interface {
|
type DeviceIpTunnel interface {
|
||||||
Device
|
Device
|
||||||
|
|
||||||
// The tunneling mode
|
// GetPropertyMode The tunneling mode
|
||||||
GetPropertyMode() (uint32, error)
|
GetPropertyMode() (uint32, error)
|
||||||
|
|
||||||
// The object path of the parent device.
|
// GetPropertyParent The object path of the parent device.
|
||||||
GetPropertyParent() (Device, error)
|
GetPropertyParent() (Device, error)
|
||||||
|
|
||||||
// The local endpoint of the tunnel.
|
// GetPropertyLocal The local endpoint of the tunnel.
|
||||||
GetPropertyLocal() (string, error)
|
GetPropertyLocal() (string, error)
|
||||||
|
|
||||||
// The remote endpoint of the tunnel.
|
// GetPropertyRemote The remote endpoint of the tunnel.
|
||||||
GetPropertyRemote() (string, error)
|
GetPropertyRemote() (string, error)
|
||||||
|
|
||||||
// The TTL assigned to tunneled packets. 0 is a special value meaning that packets inherit the TTL value
|
// GetPropertyTtl The TTL assigned to tunneled packets. 0 is a special value meaning that packets inherit the TTL value
|
||||||
GetPropertyTtl() (uint8, error)
|
GetPropertyTtl() (uint8, error)
|
||||||
|
|
||||||
// The type of service (IPv4) or traffic class (IPv6) assigned to tunneled packets.
|
// GetPropertyTos The type of service (IPv4) or traffic class (IPv6) assigned to tunneled packets.
|
||||||
GetPropertyTos() (uint8, error)
|
GetPropertyTos() (uint8, error)
|
||||||
|
|
||||||
// Whether path MTU discovery is enabled on this tunnel.
|
// GetPropertyPathMtuDiscovery Whether path MTU discovery is enabled on this tunnel.
|
||||||
GetPropertyPathMtuDiscovery() (bool, error)
|
GetPropertyPathMtuDiscovery() (bool, error)
|
||||||
|
|
||||||
// The key used for incoming packets.
|
// GetPropertyInputKey The key used for incoming packets.
|
||||||
GetPropertyInputKey() (string, error)
|
GetPropertyInputKey() (string, error)
|
||||||
|
|
||||||
// The key used for outgoing packets.
|
// GetPropertyOutputKey The key used for outgoing packets.
|
||||||
GetPropertyOutputKey() (string, error)
|
GetPropertyOutputKey() (string, error)
|
||||||
|
|
||||||
// How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels.
|
// GetPropertyEncapsulationLimit How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels.
|
||||||
GetPropertyEncapsulationLimit() (uint8, error)
|
GetPropertyEncapsulationLimit() (uint8, error)
|
||||||
|
|
||||||
// The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels.
|
// GetPropertyFlowLabel The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels.
|
||||||
GetPropertyFlowLabel() (uint32, error)
|
GetPropertyFlowLabel() (uint32, error)
|
||||||
|
|
||||||
// Tunnel flags.
|
// GetPropertyFlags Tunnel flags.
|
||||||
GetPropertyFlags() (uint32, error)
|
GetPropertyFlags() (uint32, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,15 +18,15 @@ const (
|
||||||
type DeviceStatistics interface {
|
type DeviceStatistics interface {
|
||||||
GetPath() dbus.ObjectPath
|
GetPath() dbus.ObjectPath
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyRefreshRateMs() (uint32, error)
|
||||||
|
|
||||||
SetPropertyRefreshRateMs(uint32) (error)
|
SetPropertyRefreshRateMs(uint32) error
|
||||||
|
|
||||||
// Number of transmitted bytes
|
// GetPropertyTxBytes Number of transmitted bytes
|
||||||
GetPropertyTxBytes() (uint64, error)
|
GetPropertyTxBytes() (uint64, error)
|
||||||
|
|
||||||
// Number of received bytes
|
// GetPropertyRxBytes Number of received bytes
|
||||||
GetPropertyRxBytes() (uint64, error)
|
GetPropertyRxBytes() (uint64, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ func (d *deviceStatistics) GetPropertyRefreshRateMs() (uint32, error) {
|
||||||
return d.getUint32Property(DeviceStatisticsPropertyRefreshRateMs)
|
return d.getUint32Property(DeviceStatisticsPropertyRefreshRateMs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *deviceStatistics) SetPropertyRefreshRateMs(rate uint32) (error) {
|
func (d *deviceStatistics) SetPropertyRefreshRateMs(rate uint32) error {
|
||||||
return d.setProperty(DeviceStatisticsPropertyRefreshRateMs, rate)
|
return d.setProperty(DeviceStatisticsPropertyRefreshRateMs, rate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,19 +20,19 @@ const (
|
||||||
type DeviceWired interface {
|
type DeviceWired interface {
|
||||||
Device
|
Device
|
||||||
|
|
||||||
// Active hardware address of the device.
|
// GetPropertyHwAddress Active hardware address of the device.
|
||||||
GetPropertyHwAddress() (string, error)
|
GetPropertyHwAddress() (string, error)
|
||||||
|
|
||||||
// Permanent hardware address of the device.
|
// GetPropertyPermHwAddress Permanent hardware address of the device.
|
||||||
GetPropertyPermHwAddress() (string, error)
|
GetPropertyPermHwAddress() (string, error)
|
||||||
|
|
||||||
// Design speed of the device, in megabits/second (Mb/s).
|
// GetPropertySpeed Design speed of the device, in megabits/second (Mb/s).
|
||||||
GetPropertySpeed() (uint32, error)
|
GetPropertySpeed() (uint32, error)
|
||||||
|
|
||||||
// Array of S/390 subchannels for S/390 or z/Architecture devices.
|
// GetPropertyS390Subchannels Array of S/390 subchannels for S/390 or z/Architecture devices.
|
||||||
GetPropertyS390Subchannels() ([]string, error)
|
GetPropertyS390Subchannels() ([]string, error)
|
||||||
|
|
||||||
// Indicates whether the physical carrier is found (e.g. whether a cable is plugged in or not).
|
// GetPropertyCarrier Indicates whether the physical carrier is found (e.g. whether a cable is plugged in or not).
|
||||||
GetPropertyCarrier() (bool, error)
|
GetPropertyCarrier() (bool, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,33 +38,33 @@ type DeviceWireless interface {
|
||||||
// device, including hidden ones for which the SSID is not yet known.
|
// device, including hidden ones for which the SSID is not yet known.
|
||||||
GetAllAccessPoints() ([]AccessPoint, error)
|
GetAllAccessPoints() ([]AccessPoint, error)
|
||||||
|
|
||||||
// Request the device to scan. To know when the scan is finished, use the
|
// RequestScan Request the device to scan. To know when the scan is finished, use the
|
||||||
// "PropertiesChanged" signal from "org.freedesktop.DBus.Properties" to listen
|
// "PropertiesChanged" signal from "org.freedesktop.DBus.Properties" to listen
|
||||||
// to changes to the "LastScan" property.
|
// to changes to the "LastScan" property.
|
||||||
RequestScan() error
|
RequestScan() error
|
||||||
|
|
||||||
// The active hardware address of the device.
|
// GetPropertyHwAddress The active hardware address of the device.
|
||||||
GetPropertyHwAddress() (string, error)
|
GetPropertyHwAddress() (string, error)
|
||||||
|
|
||||||
// The permanent hardware address of the device.
|
// GetPropertyPermHwAddress The permanent hardware address of the device.
|
||||||
GetPropertyPermHwAddress() (string, error)
|
GetPropertyPermHwAddress() (string, error)
|
||||||
|
|
||||||
// The operating mode of the wireless device.
|
// GetPropertyMode The operating mode of the wireless device.
|
||||||
GetPropertyMode() (Nm80211Mode, error)
|
GetPropertyMode() (Nm80211Mode, error)
|
||||||
|
|
||||||
// The bit rate currently used by the wireless device, in kilobits/second (Kb/s).
|
// GetPropertyBitrate The bit rate currently used by the wireless device, in kilobits/second (Kb/s).
|
||||||
GetPropertyBitrate() (uint32, error)
|
GetPropertyBitrate() (uint32, error)
|
||||||
|
|
||||||
// List of object paths of access point visible to this wireless device.
|
// GetPropertyAccessPoints List of object paths of access point visible to this wireless device.
|
||||||
GetPropertyAccessPoints() ([]AccessPoint, error)
|
GetPropertyAccessPoints() ([]AccessPoint, error)
|
||||||
|
|
||||||
// Object path of the access point currently used by the wireless device.
|
// GetPropertyActiveAccessPoint Object path of the access point currently used by the wireless device.
|
||||||
GetPropertyActiveAccessPoint() (AccessPoint, error)
|
GetPropertyActiveAccessPoint() (AccessPoint, error)
|
||||||
|
|
||||||
// The capabilities of the wireless device.
|
// GetPropertyWirelessCapabilities The capabilities of the wireless device.
|
||||||
GetPropertyWirelessCapabilities() (uint32, error)
|
GetPropertyWirelessCapabilities() (uint32, error)
|
||||||
|
|
||||||
// The timestamp (in CLOCK_BOOTTIME milliseconds) for the last finished
|
// GetPropertyLastScan The timestamp (in CLOCK_BOOTTIME milliseconds) for the last finished
|
||||||
// network scan. A value of -1 means the device never scanned for access
|
// network scan. A value of -1 means the device never scanned for access
|
||||||
// points.
|
// points.
|
||||||
GetPropertyLastScan() (int64, error)
|
GetPropertyLastScan() (int64, error)
|
||||||
|
|
24
IP4Config.go
24
IP4Config.go
|
@ -59,43 +59,43 @@ type IP4NameserverData struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type IP4Config interface {
|
type IP4Config interface {
|
||||||
// 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), ...]
|
// 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
|
// Deprecated: use AddressData and Gateway
|
||||||
GetPropertyAddresses() ([]IP4Address, error)
|
GetPropertyAddresses() ([]IP4Address, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyAddressData() ([]IP4AddressData, error)
|
||||||
|
|
||||||
// The gateway in use.
|
// GetPropertyGateway The gateway in use.
|
||||||
GetPropertyGateway() (string, error)
|
GetPropertyGateway() (string, error)
|
||||||
|
|
||||||
// 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), ...]
|
// 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
|
// Deprecated: use RouteData
|
||||||
GetPropertyRoutes() ([]IP4Route, error)
|
GetPropertyRoutes() ([]IP4Route, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyRouteData() ([]IP4RouteData, error)
|
||||||
|
|
||||||
// The nameservers in use.
|
// GetPropertyNameservers The nameservers in use.
|
||||||
// Deprecated: use NameserverData
|
// Deprecated: use NameserverData
|
||||||
GetPropertyNameservers() ([]string, error)
|
GetPropertyNameservers() ([]string, error)
|
||||||
|
|
||||||
// The nameservers in use. Currently only the value "address" is recognized (with an IP address string).
|
// GetPropertyNameserverData The nameservers in use. Currently only the value "address" is recognized (with an IP address string).
|
||||||
GetPropertyNameserverData() ([]IP4NameserverData, error)
|
GetPropertyNameserverData() ([]IP4NameserverData, error)
|
||||||
|
|
||||||
// A list of domains this address belongs to.
|
// GetPropertyDomains A list of domains this address belongs to.
|
||||||
GetPropertyDomains() ([]string, error)
|
GetPropertyDomains() ([]string, error)
|
||||||
|
|
||||||
// A list of dns searches.
|
// GetPropertySearches A list of dns searches.
|
||||||
GetPropertySearches() ([]string, error)
|
GetPropertySearches() ([]string, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyDnsOptions() ([]string, error)
|
||||||
|
|
||||||
// The relative priority of DNS servers.
|
// GetPropertyDnsPriority The relative priority of DNS servers.
|
||||||
GetPropertyDnsPriority() (uint32, error)
|
GetPropertyDnsPriority() (uint32, error)
|
||||||
|
|
||||||
// The Windows Internet Name Service servers associated with the connection.
|
// GetPropertyWinsServerData The Windows Internet Name Service servers associated with the connection.
|
||||||
GetPropertyWinsServerData() ([]string, error)
|
GetPropertyWinsServerData() ([]string, error)
|
||||||
|
|
||||||
MarshalJSON() ([]byte, error)
|
MarshalJSON() ([]byte, error)
|
||||||
|
|
16
IP6Config.go
16
IP6Config.go
|
@ -53,28 +53,28 @@ type IP6RouteData struct {
|
||||||
|
|
||||||
type IP6Config interface {
|
type IP6Config interface {
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyAddressData() ([]IP6AddressData, error)
|
||||||
|
|
||||||
// The gateway in use.
|
// GetPropertyGateway The gateway in use.
|
||||||
GetPropertyGateway() (string, error)
|
GetPropertyGateway() (string, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyRouteData() ([]IP6RouteData, error)
|
||||||
|
|
||||||
// GetNameservers gets the nameservers in use.
|
// GetPropertyNameservers GetNameservers gets the nameservers in use.
|
||||||
GetPropertyNameservers() ([][]byte, error)
|
GetPropertyNameservers() ([][]byte, error)
|
||||||
|
|
||||||
// A list of domains this address belongs to.
|
// GetPropertyDomains A list of domains this address belongs to.
|
||||||
GetPropertyDomains() ([]string, error)
|
GetPropertyDomains() ([]string, error)
|
||||||
|
|
||||||
// A list of dns searches.
|
// GetPropertySearches A list of dns searches.
|
||||||
GetPropertySearches() ([]string, error)
|
GetPropertySearches() ([]string, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyDnsOptions() ([]string, error)
|
||||||
|
|
||||||
// The relative priority of DNS servers.
|
// GetPropertyDnsPriority The relative priority of DNS servers.
|
||||||
GetPropertyDnsPriority() (uint32, error)
|
GetPropertyDnsPriority() (uint32, error)
|
||||||
|
|
||||||
MarshalJSON() ([]byte, error)
|
MarshalJSON() ([]byte, error)
|
||||||
|
|
|
@ -67,19 +67,19 @@ type NetworkManager interface {
|
||||||
// (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.
|
// (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
|
Reload(flags uint32) error
|
||||||
|
|
||||||
// Get the list of realized network devices.
|
// GetDevices Get the list of realized network devices.
|
||||||
GetDevices() ([]Device, error)
|
GetDevices() ([]Device, error)
|
||||||
|
|
||||||
// Get the list of all network devices.
|
// GetAllDevices Get the list of all network devices.
|
||||||
GetAllDevices() ([]Device, error)
|
GetAllDevices() ([]Device, error)
|
||||||
|
|
||||||
// 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 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)
|
GetDeviceByIpIface(interfaceId string) (Device, error)
|
||||||
|
|
||||||
// Activate a connection using the supplied device.
|
// ActivateConnection Activate a connection using the supplied device.
|
||||||
ActivateConnection(connection Connection, device Device, specificObject *dbus.Object) (ActiveConnection, error)
|
ActivateConnection(connection Connection, device Device, specificObject *dbus.Object) (ActiveConnection, error)
|
||||||
|
|
||||||
// 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 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)
|
AddAndActivateConnection(connection map[string]map[string]interface{}, device Device) (ActiveConnection, error)
|
||||||
|
|
||||||
// ActivateWirelessConnection requests activating access point to network device
|
// ActivateWirelessConnection requests activating access point to network device
|
||||||
|
@ -97,116 +97,116 @@ type NetworkManager interface {
|
||||||
// connection["802-11-wireless-security"]["psk"] = password
|
// connection["802-11-wireless-security"]["psk"] = password
|
||||||
AddAndActivateWirelessConnection(connection map[string]map[string]interface{}, device Device, accessPoint AccessPoint) (ActiveConnection, error)
|
AddAndActivateWirelessConnection(connection map[string]map[string]interface{}, device Device, accessPoint AccessPoint) (ActiveConnection, error)
|
||||||
|
|
||||||
// Deactivate an active connection.
|
// DeactivateConnection Deactivate an active connection.
|
||||||
DeactivateConnection(connection ActiveConnection) error
|
DeactivateConnection(connection ActiveConnection) error
|
||||||
|
|
||||||
// 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.
|
// 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.
|
// sleepnWake: Indicates whether the NetworkManager daemon should sleep or wake.
|
||||||
Sleep(sleepNWake bool) error
|
Sleep(sleepNWake bool) error
|
||||||
|
|
||||||
// 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.
|
// 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.
|
// enableNDisable: If FALSE, indicates that all networking should be disabled. If TRUE, indicates that NetworkManager should begin managing network devices.
|
||||||
Enable(enableNDisable bool) error
|
Enable(enableNDisable bool) error
|
||||||
|
|
||||||
// Re-check the network connectivity state.
|
// CheckConnectivity Re-check the network connectivity state.
|
||||||
CheckConnectivity() error
|
CheckConnectivity() error
|
||||||
|
|
||||||
// The overall networking state as determined by the NetworkManager daemon, based on the state of network devices under its management.
|
// State The overall networking state as determined by the NetworkManager daemon, based on the state of network devices under its management.
|
||||||
State() (NmState, error)
|
State() (NmState, error)
|
||||||
|
|
||||||
// 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.
|
// 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.
|
// 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.
|
// rollbackTimeout: The time in seconds until NetworkManager will automatically rollback to the checkpoint. Set to zero for infinite.
|
||||||
// flags: Flags for the creation.
|
// flags: Flags for the creation.
|
||||||
// returns: On success, the new checkpoint.
|
// returns: On success, the new checkpoint.
|
||||||
CheckpointCreate(devices []Device, rollbackTimeout uint32, flags uint32) (Checkpoint, error)
|
CheckpointCreate(devices []Device, rollbackTimeout uint32, flags uint32) (Checkpoint, error)
|
||||||
|
|
||||||
// Destroy a previously created checkpoint.
|
// CheckpointDestroy Destroy a previously created checkpoint.
|
||||||
// checkpoint: The checkpoint to be destroyed. Set to empty to cancel all pending checkpoints.
|
// checkpoint: The checkpoint to be destroyed. Set to empty to cancel all pending checkpoints.
|
||||||
CheckpointDestroy(checkpoint Checkpoint) error
|
CheckpointDestroy(checkpoint Checkpoint) error
|
||||||
|
|
||||||
// Rollback a checkpoint before the timeout is reached.
|
// CheckpointRollback Rollback a checkpoint before the timeout is reached.
|
||||||
// checkpoint: The checkpoint to be rolled back.
|
// 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.
|
// 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)
|
CheckpointRollback(checkpoint Checkpoint) (result map[dbus.ObjectPath]NmRollbackResult, err error)
|
||||||
|
|
||||||
// Reset the timeout for rollback for the checkpoint.
|
// CheckpointAdjustRollbackTimeout Reset the timeout for rollback for the checkpoint.
|
||||||
// Since: 1.12
|
// 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.
|
// 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
|
CheckpointAdjustRollbackTimeout(checkpoint Checkpoint, addTimeout uint32) error
|
||||||
|
|
||||||
/* PROPERTIES */
|
/* PROPERTIES */
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyDevices() ([]Device, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyAllDevices() ([]Device, error)
|
||||||
|
|
||||||
// The list of active checkpoints.
|
// GetPropertyCheckpoints The list of active checkpoints.
|
||||||
GetPropertyCheckpoints() ([]Checkpoint, error)
|
GetPropertyCheckpoints() ([]Checkpoint, error)
|
||||||
|
|
||||||
// Indicates if overall networking is currently enabled or not. See the Enable() method.
|
// GetPropertyNetworkingEnabled Indicates if overall networking is currently enabled or not. See the Enable() method.
|
||||||
GetPropertyNetworkingEnabled() (bool, error)
|
GetPropertyNetworkingEnabled() (bool, error)
|
||||||
|
|
||||||
// Indicates if wireless is currently enabled or not.
|
// GetPropertyWirelessEnabled Indicates if wireless is currently enabled or not.
|
||||||
GetPropertyWirelessEnabled() (bool, error)
|
GetPropertyWirelessEnabled() (bool, error)
|
||||||
SetPropertyWirelessEnabled(bool) error
|
SetPropertyWirelessEnabled(bool) error
|
||||||
|
|
||||||
// Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch.
|
// GetPropertyWirelessHardwareEnabled Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch.
|
||||||
GetPropertyWirelessHardwareEnabled() (bool, error)
|
GetPropertyWirelessHardwareEnabled() (bool, error)
|
||||||
|
|
||||||
// Indicates if mobile broadband devices are currently enabled or not.
|
// GetPropertyWwanEnabled Indicates if mobile broadband devices are currently enabled or not.
|
||||||
GetPropertyWwanEnabled() (bool, error)
|
GetPropertyWwanEnabled() (bool, error)
|
||||||
|
|
||||||
// Indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch.
|
// GetPropertyWwanHardwareEnabled Indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch.
|
||||||
GetPropertyWwanHardwareEnabled() (bool, error)
|
GetPropertyWwanHardwareEnabled() (bool, error)
|
||||||
|
|
||||||
// Indicates if WiMAX devices are currently enabled or not.
|
// GetPropertyWimaxEnabled Indicates if WiMAX devices are currently enabled or not.
|
||||||
GetPropertyWimaxEnabled() (bool, error)
|
GetPropertyWimaxEnabled() (bool, error)
|
||||||
|
|
||||||
// Indicates if the WiMAX hardware is currently enabled, i.e. the state of the RF kill switch.
|
// GetPropertyWimaxHardwareEnabled Indicates if the WiMAX hardware is currently enabled, i.e. the state of the RF kill switch.
|
||||||
GetPropertyWimaxHardwareEnabled() (bool, error)
|
GetPropertyWimaxHardwareEnabled() (bool, error)
|
||||||
|
|
||||||
// List of active connection object paths.
|
// GetPropertyActiveConnections List of active connection object paths.
|
||||||
GetPropertyActiveConnections() ([]ActiveConnection, error)
|
GetPropertyActiveConnections() ([]ActiveConnection, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyPrimaryConnection() (ActiveConnection, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyPrimaryConnectionType() (string, error)
|
||||||
|
|
||||||
// Indicates whether the connectivity is metered. This is equivalent to the metered property of the device associated with the primary connection.
|
// 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)
|
GetPropertyMetered() (NmMetered, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyActivatingConnection() (ActiveConnection, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyStartup() (bool, error)
|
||||||
|
|
||||||
// NetworkManager version.
|
// GetPropertyVersion NetworkManager version.
|
||||||
GetPropertyVersion() (string, error)
|
GetPropertyVersion() (string, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyCapabilities() ([]NmCapability, error)
|
||||||
|
|
||||||
// The overall state of the NetworkManager daemon.
|
// 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.
|
// 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.
|
// 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)
|
GetPropertyState() (NmState, error)
|
||||||
|
|
||||||
// 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.
|
// 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.
|
// 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.
|
// 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)
|
GetPropertyConnectivity() (NmConnectivity, error)
|
||||||
|
|
||||||
// Indicates whether connectivity checking service has been configured. This may return true even if the service is not currently enabled.
|
// 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.
|
// 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)
|
GetPropertyConnectivityCheckAvailable() (bool, error)
|
||||||
|
|
||||||
// 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 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)
|
GetPropertyConnectivityCheckEnabled() (bool, error)
|
||||||
|
|
||||||
// Dictionary of global DNS settings where the key is one of "searches", "options" and "domains". The values for the "searches" and "options" keys are string arrays describing the list of search domains and resolver options, respectively. The value of the "domains" key is a second-level dictionary, where each key is a domain name, and each key's value is a third-level dictionary with the keys "servers" and "options". "servers" is a string array of DNS servers, "options" is a string array of domain-specific options.
|
// Dictionary of global DNS settings where the key is one of "searches", "options" and "domains". The values for the "searches" and "options" keys are string arrays describing the list of search domains and resolver options, respectively. The value of the "domains" key is a second-level dictionary, where each key is a domain name, and each key's value is a third-level dictionary with the keys "servers" and "options". "servers" is a string array of DNS servers, "options" is a string array of domain-specific options.
|
||||||
|
|
|
@ -36,16 +36,16 @@ type Settings interface {
|
||||||
// AddConnection adds new connection and save it to disk.
|
// AddConnection adds new connection and save it to disk.
|
||||||
AddConnection(settings ConnectionSettings) (Connection, error)
|
AddConnection(settings ConnectionSettings) (Connection, error)
|
||||||
|
|
||||||
// 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 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)
|
AddConnectionUnsaved(settings ConnectionSettings) (Connection, error)
|
||||||
|
|
||||||
// Save the hostname to persistent configuration.
|
// SaveHostname Save the hostname to persistent configuration.
|
||||||
SaveHostname(hostname string) error
|
SaveHostname(hostname string) error
|
||||||
|
|
||||||
// If true, adding and modifying connections is supported.
|
// GetPropertyCanModify If true, adding and modifying connections is supported.
|
||||||
GetPropertyCanModify() (bool, error)
|
GetPropertyCanModify() (bool, error)
|
||||||
|
|
||||||
// The machine hostname stored in persistent configuration.
|
// GetPropertyHostname The machine hostname stored in persistent configuration.
|
||||||
GetPropertyHostname() (string, error)
|
GetPropertyHostname() (string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,10 @@ const (
|
||||||
type VpnConnection interface {
|
type VpnConnection interface {
|
||||||
GetPath() dbus.ObjectPath
|
GetPath() dbus.ObjectPath
|
||||||
|
|
||||||
// The VPN-specific state of the connection.
|
// GetPropertyVpnState The VPN-specific state of the connection.
|
||||||
GetPropertyVpnState() (NmVpnConnectionState, error)
|
GetPropertyVpnState() (NmVpnConnectionState, error)
|
||||||
|
|
||||||
// The banner string of the VPN connection.
|
// GetPropertyBanner The banner string of the VPN connection.
|
||||||
GetPropertyBanner() (string, error)
|
GetPropertyBanner() (string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue