feat(Device): add GetIp4Connectivity
See https://developer-old.gnome.org/NetworkManager/1.16/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Ip4Connectivity
This commit is contained in:
parent
4b20a2d51a
commit
24266a326a
1 changed files with 8 additions and 0 deletions
|
@ -150,6 +150,9 @@ type Device interface {
|
||||||
// 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.
|
// 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)
|
||||||
|
|
||||||
|
// The result of the last IPv4 connectivity check.
|
||||||
|
GetPropertyIp4Connectivity() (NmConnectivity, error)
|
||||||
|
|
||||||
MarshalJSON() ([]byte, error)
|
MarshalJSON() ([]byte, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,6 +312,11 @@ func (d *device) GetPropertyReal() (bool, error) {
|
||||||
return d.getBoolProperty(DevicePropertyReal)
|
return d.getBoolProperty(DevicePropertyReal)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *device) GetPropertyIp4Connectivity() (NmConnectivity, error) {
|
||||||
|
u, err := d.getUint32Property(DevicePropertyIp4Connectivity)
|
||||||
|
return NmConnectivity(u), err
|
||||||
|
}
|
||||||
|
|
||||||
func (d *device) marshalMap() (map[string]interface{}, error) {
|
func (d *device) marshalMap() (map[string]interface{}, error) {
|
||||||
Interface, err := d.GetPropertyInterface()
|
Interface, err := d.GetPropertyInterface()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Reference in a new issue