diff --git a/Device.go b/Device.go index 9b1e1e1..a78e0ee 100644 --- a/Device.go +++ b/Device.go @@ -10,6 +10,7 @@ const ( DeviceInterface = NetworkManagerInterface + ".Device" DevicePropertyInterface = DeviceInterface + ".Interface" + DevicePropertyIpInterface = DeviceInterface + ".IpInterface" DevicePropertyState = DeviceInterface + ".State" DevicePropertyIP4Config = DeviceInterface + ".Ip4Config" DevicePropertyDeviceType = DeviceInterface + ".DeviceType" @@ -36,6 +37,9 @@ type Device interface { // interface. GetInterface() string + // GetIpInterface gets the IP interface name of the device. + GetIpInterface() string + // GetState gets the current state of the device. GetState() NmDeviceState @@ -73,6 +77,10 @@ func (d *device) GetInterface() string { return d.getStringProperty(DevicePropertyInterface) } +func (d *device) GetIpInterface() string { + return d.getStringProperty(DevicePropertyIpInterface) +} + func (d *device) GetState() NmDeviceState { return NmDeviceState(d.getUint32Property(DevicePropertyState)) } @@ -127,6 +135,7 @@ func (d *device) GetAvailableConnections() []Connection { func (d *device) marshalMap() map[string]interface{} { return map[string]interface{}{ "Interface": d.GetInterface(), + "IP interface": d.GetIpInterface(), "State": d.GetState().String(), "IP4Config": d.GetIP4Config(), "DHCP4Config": d.GetDHCP4Config(),