Georg Reinke 2022-08-04 14:53:57 +02:00
parent 4b20a2d51a
commit 24266a326a

View file

@ -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 {