Add Device ActiveConnection
This commit is contained in:
parent
27de9ee243
commit
dcb4492d52
1 changed files with 12 additions and 0 deletions
12
Device.go
12
Device.go
|
@ -101,6 +101,9 @@ type Device interface {
|
||||||
// The current state of the device.
|
// 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() (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.
|
// 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)
|
||||||
|
|
||||||
|
@ -193,6 +196,15 @@ func (d *device) GetPropertyState() (NmDeviceState, error) {
|
||||||
return NmDeviceState(v), err
|
return NmDeviceState(v), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *device) GetPropertyActiveConnection() (ActiveConnection, error) {
|
||||||
|
path, err := d.getObjectProperty(DevicePropertyActiveConnection)
|
||||||
|
if err != nil || path == "/" {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewActiveConnection(path)
|
||||||
|
}
|
||||||
|
|
||||||
func (d *device) GetPropertyIP4Config() (IP4Config, error) {
|
func (d *device) GetPropertyIP4Config() (IP4Config, error) {
|
||||||
path, err := d.getObjectProperty(DevicePropertyIp4Config)
|
path, err := d.getObjectProperty(DevicePropertyIp4Config)
|
||||||
if err != nil || path == "/" {
|
if err != nil || path == "/" {
|
||||||
|
|
Reference in a new issue