mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-21 00:30:07 +01:00
nm-device: expose via D-Bus the 'hw-address' property
Drop device-specific 'hw-address' GObject properties which are now redundant. https://bugzilla.redhat.com/show_bug.cgi?id=1786937
This commit is contained in:
parent
cbb45aaf90
commit
067a3d6c08
57 changed files with 292 additions and 681 deletions
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Bluetooth hardware address of the device.
|
Bluetooth hardware address of the device.
|
||||||
|
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Hardware address of the device.
|
Hardware address of the device.
|
||||||
|
n
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Hardware address of the device.
|
Hardware address of the device.
|
||||||
|
n
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Hardware address of the device.
|
Hardware address of the device.
|
||||||
|
n
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Hardware address of the device.
|
Hardware address of the device.
|
||||||
|
n
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Hardware address of the device.
|
Hardware address of the device.
|
||||||
|
n
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
The active hardware address of the device.
|
The active hardware address of the device.
|
||||||
|
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
The hardware address of the device.
|
The hardware address of the device.
|
||||||
|
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Hardware address of the device.
|
Hardware address of the device.
|
||||||
|
n
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Hardware address of the device.
|
Hardware address of the device.
|
||||||
|
n
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Hardware address of the device.
|
Hardware address of the device.
|
||||||
|
n
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Hardware address of the device.
|
Hardware address of the device.
|
||||||
|
n
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
The active hardware address of the device.
|
The active hardware address of the device.
|
||||||
|
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
|
|
||||||
Since: 1.16
|
Since: 1.16
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
Active hardware address of the device.
|
Active hardware address of the device.
|
||||||
|
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
The active hardware address of the device.
|
The active hardware address of the device.
|
||||||
|
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
HwAddress:
|
HwAddress:
|
||||||
|
|
||||||
The active hardware address of the device.
|
The active hardware address of the device.
|
||||||
|
|
||||||
|
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||||
-->
|
-->
|
||||||
<property name="HwAddress" type="s" access="read"/>
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -289,6 +289,17 @@
|
||||||
-->
|
-->
|
||||||
<property name="InterfaceFlags" type="u" access="read"/>
|
<property name="InterfaceFlags" type="u" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
HwAddress:
|
||||||
|
|
||||||
|
The hardware address of the device.
|
||||||
|
|
||||||
|
This replaces the other 'HwAddress' properties on the device-specific D-Bus interfaces.
|
||||||
|
|
||||||
|
Since: 1.24
|
||||||
|
-->
|
||||||
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Reapply:
|
Reapply:
|
||||||
@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.
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,10 @@
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMLDBusPropertyO parent;
|
NMLDBusPropertyO parent;
|
||||||
char *hw_address;
|
|
||||||
} NMDevice6LowpanPrivate;
|
} NMDevice6LowpanPrivate;
|
||||||
|
|
||||||
struct _NMDevice6Lowpan {
|
struct _NMDevice6Lowpan {
|
||||||
|
|
@ -62,19 +60,15 @@ nm_device_6lowpan_get_parent (NMDevice6Lowpan *device)
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
*
|
*
|
||||||
* Since: 1.14
|
* Since: 1.14
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_6lowpan_get_hw_address (NMDevice6Lowpan *device)
|
nm_device_6lowpan_get_hw_address (NMDevice6Lowpan *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_6LOWPAN (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_6LOWPAN (device), NULL);
|
||||||
|
|
||||||
return NM_DEVICE_6LOWPAN_GET_PRIVATE (device)->hw_address;
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_6lowpan_get_hw_address (NM_DEVICE_6LOWPAN (device));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
@ -84,16 +78,6 @@ nm_device_6lowpan_init (NMDevice6Lowpan *device)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
dispose (GObject *object)
|
|
||||||
{
|
|
||||||
NMDevice6LowpanPrivate *priv = NM_DEVICE_6LOWPAN_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_6lowpan_parent_class)->dispose (object);
|
|
||||||
|
|
||||||
nm_clear_g_free (&priv->hw_address);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object,
|
get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
|
|
@ -106,9 +90,6 @@ get_property (GObject *object,
|
||||||
case PROP_PARENT:
|
case PROP_PARENT:
|
||||||
g_value_set_object (value, nm_device_6lowpan_get_parent (device));
|
g_value_set_object (value, nm_device_6lowpan_get_parent (device));
|
||||||
break;
|
break;
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_6lowpan_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
@ -120,7 +101,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_lowpan = NML_DBUS_META_IFA
|
||||||
nm_device_6lowpan_get_type,
|
nm_device_6lowpan_get_type,
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDevice6Lowpan, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_O_PROP ("Parent", PROP_PARENT, NMDevice6Lowpan, _priv.parent, nm_device_get_type ),
|
NML_DBUS_META_PROPERTY_INIT_O_PROP ("Parent", PROP_PARENT, NMDevice6Lowpan, _priv.parent, nm_device_get_type ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -130,17 +111,13 @@ nm_device_6lowpan_class_init (NMDevice6LowpanClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (klass);
|
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (klass);
|
||||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->dispose = dispose;
|
|
||||||
|
|
||||||
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT (nm_object_class, NMDevice6Lowpan);
|
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT (nm_object_class, NMDevice6Lowpan);
|
||||||
|
|
||||||
_NM_OBJECT_CLASS_INIT_PROPERTY_O_FIELDS_1 (nm_object_class, NMDevice6LowpanPrivate, parent);
|
_NM_OBJECT_CLASS_INIT_PROPERTY_O_FIELDS_1 (nm_object_class, NMDevice6LowpanPrivate, parent);
|
||||||
|
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDevice6Lowpan:parent:
|
* NMDevice6Lowpan:parent:
|
||||||
*
|
*
|
||||||
|
|
@ -154,18 +131,5 @@ nm_device_6lowpan_class_init (NMDevice6LowpanClass *klass)
|
||||||
G_PARAM_READABLE |
|
G_PARAM_READABLE |
|
||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDevice6Lowpan:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
*
|
|
||||||
* Since: 1.14
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_6LOWPAN_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
_nml_dbus_meta_class_init_with_properties (object_class, &_nml_dbus_meta_iface_nm_device_lowpan);
|
_nml_dbus_meta_class_init_with_properties (object_class, &_nml_dbus_meta_iface_nm_device_lowpan);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,11 @@ GType nm_device_6lowpan_get_type (void);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_14
|
NM_AVAILABLE_IN_1_14
|
||||||
NMDevice * nm_device_6lowpan_get_parent (NMDevice6Lowpan *device);
|
NMDevice * nm_device_6lowpan_get_parent (NMDevice6Lowpan *device);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_14
|
NM_AVAILABLE_IN_1_14
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char * nm_device_6lowpan_get_hw_address (NMDevice6Lowpan *device);
|
const char * nm_device_6lowpan_get_hw_address (NMDevice6Lowpan *device);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __NM_DEVICE_6LOWPAN_H__ */
|
#endif /* __NM_DEVICE_6LOWPAN_H__ */
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_CARRIER,
|
PROP_CARRIER,
|
||||||
PROP_SLAVES,
|
PROP_SLAVES,
|
||||||
);
|
);
|
||||||
|
|
@ -50,13 +49,15 @@ G_DEFINE_TYPE (NMDeviceBond, nm_device_bond, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the hardware address. This is the internal string used by the
|
* Returns: the hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_bond_get_hw_address (NMDeviceBond *device)
|
nm_device_bond_get_hw_address (NMDeviceBond *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_BOND (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_BOND (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_BOND_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -116,12 +117,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_BOND;
|
return NM_TYPE_SETTING_BOND;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_bond_get_hw_address (NM_DEVICE_BOND (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -148,9 +143,6 @@ get_property (GObject *object,
|
||||||
NMDeviceBond *device = NM_DEVICE_BOND (object);
|
NMDeviceBond *device = NM_DEVICE_BOND (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_bond_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_CARRIER:
|
case PROP_CARRIER:
|
||||||
g_value_set_boolean (value, nm_device_bond_get_carrier (device));
|
g_value_set_boolean (value, nm_device_bond_get_carrier (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -169,7 +161,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_bond = NML_DBUS_META_IFACE
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceBond, _priv.carrier ),
|
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceBond, _priv.carrier ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceBond, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_AO_PROP ("Slaves", PROP_SLAVES, NMDeviceBond, _priv.slaves, nm_device_get_type ),
|
NML_DBUS_META_PROPERTY_INIT_AO_PROP ("Slaves", PROP_SLAVES, NMDeviceBond, _priv.slaves, nm_device_get_type ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -190,18 +182,6 @@ nm_device_bond_class_init (NMDeviceBondClass *klass)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceBond:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_BOND_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceBond:carrier:
|
* NMDeviceBond:carrier:
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,9 @@ typedef struct _NMDeviceBondClass NMDeviceBondClass;
|
||||||
|
|
||||||
GType nm_device_bond_get_type (void);
|
GType nm_device_bond_get_type (void);
|
||||||
|
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char *nm_device_bond_get_hw_address (NMDeviceBond *device);
|
const char *nm_device_bond_get_hw_address (NMDeviceBond *device);
|
||||||
|
|
||||||
gboolean nm_device_bond_get_carrier (NMDeviceBond *device);
|
gboolean nm_device_bond_get_carrier (NMDeviceBond *device);
|
||||||
const GPtrArray *nm_device_bond_get_slaves (NMDeviceBond *device);
|
const GPtrArray *nm_device_bond_get_slaves (NMDeviceBond *device);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,12 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_CARRIER,
|
PROP_CARRIER,
|
||||||
PROP_SLAVES,
|
PROP_SLAVES,
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMLDBusPropertyAO slaves;
|
NMLDBusPropertyAO slaves;
|
||||||
char *hw_address;
|
|
||||||
bool carrier;
|
bool carrier;
|
||||||
} NMDeviceBridgePrivate;
|
} NMDeviceBridgePrivate;
|
||||||
|
|
||||||
|
|
@ -50,13 +48,15 @@ G_DEFINE_TYPE (NMDeviceBridge, nm_device_bridge, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the hardware address. This is the internal string used by the
|
* Returns: the hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_bridge_get_hw_address (NMDeviceBridge *device)
|
nm_device_bridge_get_hw_address (NMDeviceBridge *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_BRIDGE (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_BRIDGE (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_BRIDGE_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -121,12 +121,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_BRIDGE;
|
return NM_TYPE_SETTING_BRIDGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_bridge_get_hw_address (NM_DEVICE_BRIDGE (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -134,16 +128,6 @@ nm_device_bridge_init (NMDeviceBridge *device)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMDeviceBridgePrivate *priv = NM_DEVICE_BRIDGE_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_bridge_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object,
|
get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
|
|
@ -153,9 +137,6 @@ get_property (GObject *object,
|
||||||
NMDeviceBridge *device = NM_DEVICE_BRIDGE (object);
|
NMDeviceBridge *device = NM_DEVICE_BRIDGE (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_bridge_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_CARRIER:
|
case PROP_CARRIER:
|
||||||
g_value_set_boolean (value, nm_device_bridge_get_carrier (device));
|
g_value_set_boolean (value, nm_device_bridge_get_carrier (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -174,7 +155,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_bridge = NML_DBUS_META_IFA
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceBridge, _priv.carrier ),
|
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceBridge, _priv.carrier ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceBridge, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_AO_PROP ("Slaves", PROP_SLAVES, NMDeviceBridge, _priv.slaves, nm_device_get_type ),
|
NML_DBUS_META_PROPERTY_INIT_AO_PROP ("Slaves", PROP_SLAVES, NMDeviceBridge, _priv.slaves, nm_device_get_type ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -186,7 +167,6 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *klass)
|
||||||
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (klass);
|
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (klass);
|
||||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
||||||
|
|
||||||
object_class->finalize = finalize;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
|
||||||
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT (nm_object_class, NMDeviceBridge);
|
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT (nm_object_class, NMDeviceBridge);
|
||||||
|
|
@ -195,18 +175,6 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *klass)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceBridge:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_BRIDGE_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceBridge:carrier:
|
* NMDeviceBridge:carrier:
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,9 @@ typedef struct _NMDeviceBridgeClass NMDeviceBridgeClass;
|
||||||
|
|
||||||
GType nm_device_bridge_get_type (void);
|
GType nm_device_bridge_get_type (void);
|
||||||
|
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char *nm_device_bridge_get_hw_address (NMDeviceBridge *device);
|
const char *nm_device_bridge_get_hw_address (NMDeviceBridge *device);
|
||||||
|
|
||||||
gboolean nm_device_bridge_get_carrier (NMDeviceBridge *device);
|
gboolean nm_device_bridge_get_carrier (NMDeviceBridge *device);
|
||||||
const GPtrArray *nm_device_bridge_get_slaves (NMDeviceBridge *device);
|
const GPtrArray *nm_device_bridge_get_slaves (NMDeviceBridge *device);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,11 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_NAME,
|
PROP_NAME,
|
||||||
PROP_BT_CAPABILITIES,
|
PROP_BT_CAPABILITIES,
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *hw_address;
|
|
||||||
char *name;
|
char *name;
|
||||||
guint32 bt_capabilities;
|
guint32 bt_capabilities;
|
||||||
} NMDeviceBtPrivate;
|
} NMDeviceBtPrivate;
|
||||||
|
|
@ -51,13 +49,15 @@ G_DEFINE_TYPE (NMDeviceBt, nm_device_bt, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the hardware address. This is the internal string used by the
|
* Returns: the hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_bt_get_hw_address (NMDeviceBt *device)
|
nm_device_bt_get_hw_address (NMDeviceBt *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_BT (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_BT (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_BT_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -138,7 +138,7 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check BT address */
|
/* Check BT address */
|
||||||
hw_addr = nm_device_bt_get_hw_address (NM_DEVICE_BT (device));
|
hw_addr = nm_device_get_hw_address (device);
|
||||||
if (hw_addr) {
|
if (hw_addr) {
|
||||||
if (!nm_utils_hwaddr_valid (hw_addr, ETH_ALEN)) {
|
if (!nm_utils_hwaddr_valid (hw_addr, ETH_ALEN)) {
|
||||||
g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
||||||
|
|
@ -170,12 +170,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_BLUETOOTH;
|
return NM_TYPE_SETTING_BLUETOOTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_bt_get_hw_address (NM_DEVICE_BT (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -188,7 +182,6 @@ finalize (GObject *object)
|
||||||
{
|
{
|
||||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);
|
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
g_free (priv->name);
|
g_free (priv->name);
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_bt_parent_class)->finalize (object);
|
G_OBJECT_CLASS (nm_device_bt_parent_class)->finalize (object);
|
||||||
|
|
@ -203,9 +196,6 @@ get_property (GObject *object,
|
||||||
NMDeviceBt *device = NM_DEVICE_BT (object);
|
NMDeviceBt *device = NM_DEVICE_BT (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_bt_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_NAME:
|
case PROP_NAME:
|
||||||
g_value_set_string (value, nm_device_bt_get_name (device));
|
g_value_set_string (value, nm_device_bt_get_name (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -224,7 +214,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_bluetooth = NML_DBUS_META_
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_U ("BtCapabilities", PROP_BT_CAPABILITIES, NMDeviceBt, _priv.bt_capabilities ),
|
NML_DBUS_META_PROPERTY_INIT_U ("BtCapabilities", PROP_BT_CAPABILITIES, NMDeviceBt, _priv.bt_capabilities ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceBt, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("Name", PROP_NAME, NMDeviceBt, _priv.name ),
|
NML_DBUS_META_PROPERTY_INIT_S ("Name", PROP_NAME, NMDeviceBt, _priv.name ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -240,18 +230,6 @@ nm_device_bt_class_init (NMDeviceBtClass *bt_class)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceBt:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_BT_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceBt:name:
|
* NMDeviceBt:name:
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ typedef struct _NMDeviceBtClass NMDeviceBtClass;
|
||||||
|
|
||||||
GType nm_device_bt_get_type (void);
|
GType nm_device_bt_get_type (void);
|
||||||
|
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char *nm_device_bt_get_hw_address (NMDeviceBt *device);
|
const char *nm_device_bt_get_hw_address (NMDeviceBt *device);
|
||||||
|
|
||||||
const char *nm_device_bt_get_name (NMDeviceBt *device);
|
const char *nm_device_bt_get_name (NMDeviceBt *device);
|
||||||
|
|
|
||||||
|
|
@ -13,17 +13,8 @@
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *hw_address;
|
|
||||||
} NMDeviceDummyPrivate;
|
|
||||||
|
|
||||||
struct _NMDeviceDummy {
|
struct _NMDeviceDummy {
|
||||||
NMDevice parent;
|
NMDevice parent;
|
||||||
NMDeviceDummyPrivate _priv;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _NMDeviceDummyClass {
|
struct _NMDeviceDummyClass {
|
||||||
|
|
@ -46,13 +37,15 @@ G_DEFINE_TYPE (NMDeviceDummy, nm_device_dummy, NM_TYPE_DEVICE)
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_dummy_get_hw_address (NMDeviceDummy *device)
|
nm_device_dummy_get_hw_address (NMDeviceDummy *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_DUMMY (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_DUMMY (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_DUMMY_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
@ -85,12 +78,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_DUMMY;
|
return NM_TYPE_SETTING_DUMMY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_dummy_get_hw_address (NM_DEVICE_DUMMY (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -98,68 +85,20 @@ nm_device_dummy_init (NMDeviceDummy *device)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_dummy = NML_DBUS_META_IFACE_INIT (
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMDeviceDummyPrivate *priv = NM_DEVICE_DUMMY_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_dummy_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMDeviceDummy *device = NM_DEVICE_DUMMY (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_dummy_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_dummy = NML_DBUS_META_IFACE_INIT_PROP (
|
|
||||||
NM_DBUS_INTERFACE_DEVICE_DUMMY,
|
NM_DBUS_INTERFACE_DEVICE_DUMMY,
|
||||||
nm_device_dummy_get_type,
|
nm_device_dummy_get_type,
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceDummy, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_device_dummy_class_init (NMDeviceDummyClass *dummy_class)
|
nm_device_dummy_class_init (NMDeviceDummyClass *dummy_class)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (dummy_class);
|
|
||||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (dummy_class);
|
NMDeviceClass *device_class = NM_DEVICE_CLASS (dummy_class);
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceDummy:hw-address:
|
|
||||||
*
|
|
||||||
* The active hardware (MAC) address of the device.
|
|
||||||
*
|
|
||||||
* Since: 1.10
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_DUMMY_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
_nml_dbus_meta_class_init_with_properties (object_class, &_nml_dbus_meta_iface_nm_device_dummy);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,9 @@ G_BEGIN_DECLS
|
||||||
typedef struct _NMDeviceDummyClass NMDeviceDummyClass;
|
typedef struct _NMDeviceDummyClass NMDeviceDummyClass;
|
||||||
|
|
||||||
GType nm_device_dummy_get_type (void);
|
GType nm_device_dummy_get_type (void);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_10
|
NM_AVAILABLE_IN_1_10
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char *nm_device_dummy_get_hw_address (NMDeviceDummy *device);
|
const char *nm_device_dummy_get_hw_address (NMDeviceDummy *device);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_PERM_HW_ADDRESS,
|
PROP_PERM_HW_ADDRESS,
|
||||||
PROP_SPEED,
|
PROP_SPEED,
|
||||||
PROP_CARRIER,
|
PROP_CARRIER,
|
||||||
|
|
@ -26,7 +25,6 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char **s390_subchannels;
|
char **s390_subchannels;
|
||||||
char *hw_address;
|
|
||||||
char *perm_hw_address;
|
char *perm_hw_address;
|
||||||
guint32 speed;
|
guint32 speed;
|
||||||
bool carrier;
|
bool carrier;
|
||||||
|
|
@ -55,13 +53,15 @@ G_DEFINE_TYPE (NMDeviceEthernet, nm_device_ethernet, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the active hardware address. This is the internal string used by the
|
* Returns: the active hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_ethernet_get_hw_address (NMDeviceEthernet *device)
|
nm_device_ethernet_get_hw_address (NMDeviceEthernet *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_ETHERNET_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -210,7 +210,7 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
|
||||||
/* Virtual devices will have empty permanent addr but they should not be excluded
|
/* Virtual devices will have empty permanent addr but they should not be excluded
|
||||||
* from the MAC address check specified in the connection */
|
* from the MAC address check specified in the connection */
|
||||||
if (*perm_addr == 0)
|
if (*perm_addr == 0)
|
||||||
perm_addr = nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device));
|
perm_addr = nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
|
|
||||||
if (!nm_utils_hwaddr_valid (perm_addr, ETH_ALEN)) {
|
if (!nm_utils_hwaddr_valid (perm_addr, ETH_ALEN)) {
|
||||||
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
||||||
|
|
@ -251,12 +251,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_WIRED;
|
return NM_TYPE_SETTING_WIRED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -269,7 +263,6 @@ finalize (GObject *object)
|
||||||
{
|
{
|
||||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object);
|
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object);
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
g_free (priv->perm_hw_address);
|
g_free (priv->perm_hw_address);
|
||||||
g_strfreev (priv->s390_subchannels);
|
g_strfreev (priv->s390_subchannels);
|
||||||
|
|
||||||
|
|
@ -286,9 +279,6 @@ get_property (GObject *object,
|
||||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device);
|
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_ethernet_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_PERM_HW_ADDRESS:
|
case PROP_PERM_HW_ADDRESS:
|
||||||
g_value_set_string (value, nm_device_ethernet_get_permanent_hw_address (device));
|
g_value_set_string (value, nm_device_ethernet_get_permanent_hw_address (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -320,7 +310,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_wired = NML_DBUS_META_IFAC
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceEthernet, _priv.carrier ),
|
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceEthernet, _priv.carrier ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceEthernet, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("PermHwAddress", PROP_PERM_HW_ADDRESS, NMDeviceEthernet, _priv.perm_hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_S ("PermHwAddress", PROP_PERM_HW_ADDRESS, NMDeviceEthernet, _priv.perm_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_AS ("S390Subchannels", PROP_S390_SUBCHANNELS, NMDeviceEthernet, _priv.s390_subchannels ),
|
NML_DBUS_META_PROPERTY_INIT_AS ("S390Subchannels", PROP_S390_SUBCHANNELS, NMDeviceEthernet, _priv.s390_subchannels ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_U ("Speed", PROP_SPEED, NMDeviceEthernet, _priv.speed ),
|
NML_DBUS_META_PROPERTY_INIT_U ("Speed", PROP_SPEED, NMDeviceEthernet, _priv.speed ),
|
||||||
|
|
@ -338,18 +328,6 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *eth_class)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceEthernet:hw-address:
|
|
||||||
*
|
|
||||||
* The active hardware (MAC) address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_ETHERNET_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceEthernet:perm-hw-address:
|
* NMDeviceEthernet:perm-hw-address:
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,9 @@ typedef struct _NMDeviceEthernetClass NMDeviceEthernetClass;
|
||||||
|
|
||||||
GType nm_device_ethernet_get_type (void);
|
GType nm_device_ethernet_get_type (void);
|
||||||
|
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char * nm_device_ethernet_get_hw_address (NMDeviceEthernet *device);
|
const char * nm_device_ethernet_get_hw_address (NMDeviceEthernet *device);
|
||||||
|
|
||||||
const char * nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device);
|
const char * nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device);
|
||||||
guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *device);
|
guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *device);
|
||||||
gboolean nm_device_ethernet_get_carrier (NMDeviceEthernet *device);
|
gboolean nm_device_ethernet_get_carrier (NMDeviceEthernet *device);
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,10 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_TYPE_DESCRIPTION,
|
PROP_TYPE_DESCRIPTION,
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *hw_address;
|
|
||||||
char *type_description;
|
char *type_description;
|
||||||
} NMDeviceGenericPrivate;
|
} NMDeviceGenericPrivate;
|
||||||
|
|
||||||
|
|
@ -46,13 +44,15 @@ G_DEFINE_TYPE (NMDeviceGeneric, nm_device_generic, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the hardware address. This is the internal string used by the
|
* Returns: the hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_generic_get_hw_address (NMDeviceGeneric *device)
|
nm_device_generic_get_hw_address (NMDeviceGeneric *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_GENERIC (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_GENERIC (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_GENERIC_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
@ -65,12 +65,6 @@ get_type_description (NMDevice *device)
|
||||||
return _nml_coerce_property_str_not_empty (priv->type_description);
|
return _nml_coerce_property_str_not_empty (priv->type_description);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_generic_get_hw_address (NM_DEVICE_GENERIC (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
|
|
@ -113,7 +107,6 @@ finalize (GObject *object)
|
||||||
{
|
{
|
||||||
NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (object);
|
NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (object);
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
g_free (priv->type_description);
|
g_free (priv->type_description);
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_generic_parent_class)->finalize (object);
|
G_OBJECT_CLASS (nm_device_generic_parent_class)->finalize (object);
|
||||||
|
|
@ -126,12 +119,8 @@ get_property (GObject *object,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMDeviceGeneric *self = NM_DEVICE_GENERIC (object);
|
NMDeviceGeneric *self = NM_DEVICE_GENERIC (object);
|
||||||
NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (self);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, priv->hw_address);
|
|
||||||
break;
|
|
||||||
case PROP_TYPE_DESCRIPTION:
|
case PROP_TYPE_DESCRIPTION:
|
||||||
g_value_set_string (value, get_type_description ((NMDevice *) self));
|
g_value_set_string (value, get_type_description ((NMDevice *) self));
|
||||||
break;
|
break;
|
||||||
|
|
@ -146,7 +135,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_generic = NML_DBUS_META_IF
|
||||||
nm_device_generic_get_type,
|
nm_device_generic_get_type,
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceGeneric, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("TypeDescription", PROP_TYPE_DESCRIPTION, NMDeviceGeneric, _priv.type_description ),
|
NML_DBUS_META_PROPERTY_INIT_S ("TypeDescription", PROP_TYPE_DESCRIPTION, NMDeviceGeneric, _priv.type_description ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -161,20 +150,9 @@ nm_device_generic_class_init (NMDeviceGenericClass *klass)
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
device_class->get_type_description = get_type_description;
|
device_class->get_type_description = get_type_description;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceGeneric:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_GENERIC_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceGeneric:type-description:
|
* NMDeviceGeneric:type-description:
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ typedef struct _NMDeviceGenericClass NMDeviceGenericClass;
|
||||||
|
|
||||||
GType nm_device_generic_get_type (void);
|
GType nm_device_generic_get_type (void);
|
||||||
|
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char *nm_device_generic_get_hw_address (NMDeviceGeneric *device);
|
const char *nm_device_generic_get_hw_address (NMDeviceGeneric *device);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,10 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_CARRIER,
|
PROP_CARRIER,
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *hw_address;
|
|
||||||
bool carrier;
|
bool carrier;
|
||||||
} NMDeviceInfinibandPrivate;
|
} NMDeviceInfinibandPrivate;
|
||||||
|
|
||||||
|
|
@ -47,13 +45,15 @@ G_DEFINE_TYPE (NMDeviceInfiniband, nm_device_infiniband, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the hardware address. This is the internal string used by the
|
* Returns: the hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_infiniband_get_hw_address (NMDeviceInfiniband *device)
|
nm_device_infiniband_get_hw_address (NMDeviceInfiniband *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_INFINIBAND (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_INFINIBAND (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_INFINIBAND_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -87,7 +87,7 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
hwaddr = nm_device_infiniband_get_hw_address (NM_DEVICE_INFINIBAND (device));
|
hwaddr = nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
if (hwaddr) {
|
if (hwaddr) {
|
||||||
if (!nm_utils_hwaddr_valid (hwaddr, INFINIBAND_ALEN)) {
|
if (!nm_utils_hwaddr_valid (hwaddr, INFINIBAND_ALEN)) {
|
||||||
g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
||||||
|
|
@ -113,12 +113,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_INFINIBAND;
|
return NM_TYPE_SETTING_INFINIBAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_infiniband_get_hw_address (NM_DEVICE_INFINIBAND (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -126,16 +120,6 @@ nm_device_infiniband_init (NMDeviceInfiniband *device)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMDeviceInfinibandPrivate *priv = NM_DEVICE_INFINIBAND_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_infiniband_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object,
|
get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
|
|
@ -145,9 +129,6 @@ get_property (GObject *object,
|
||||||
NMDeviceInfiniband *device = NM_DEVICE_INFINIBAND (object);
|
NMDeviceInfiniband *device = NM_DEVICE_INFINIBAND (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_infiniband_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_CARRIER:
|
case PROP_CARRIER:
|
||||||
g_value_set_boolean (value, nm_device_infiniband_get_carrier (device));
|
g_value_set_boolean (value, nm_device_infiniband_get_carrier (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -163,7 +144,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_infiniband = NML_DBUS_META
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceInfiniband, _priv.carrier ),
|
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceInfiniband, _priv.carrier ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceInfiniband, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -174,22 +155,9 @@ nm_device_infiniband_class_init (NMDeviceInfinibandClass *ib_class)
|
||||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (ib_class);
|
NMDeviceClass *device_class = NM_DEVICE_CLASS (ib_class);
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceInfiniband:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_INFINIBAND_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceInfiniband:carrier:
|
* NMDeviceInfiniband:carrier:
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ typedef struct _NMDeviceInfinibandClass NMDeviceInfinibandClass;
|
||||||
|
|
||||||
GType nm_device_infiniband_get_type (void);
|
GType nm_device_infiniband_get_type (void);
|
||||||
|
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char * nm_device_infiniband_get_hw_address (NMDeviceInfiniband *device);
|
const char * nm_device_infiniband_get_hw_address (NMDeviceInfiniband *device);
|
||||||
|
|
||||||
gboolean nm_device_infiniband_get_carrier (NMDeviceInfiniband *device);
|
gboolean nm_device_infiniband_get_carrier (NMDeviceInfiniband *device);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_SCI,
|
PROP_SCI,
|
||||||
PROP_CIPHER_SUITE,
|
PROP_CIPHER_SUITE,
|
||||||
PROP_ICV_LENGTH,
|
PROP_ICV_LENGTH,
|
||||||
|
|
@ -32,7 +31,6 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMLDBusPropertyO parent;
|
NMLDBusPropertyO parent;
|
||||||
char *hw_address;
|
|
||||||
char *validation;
|
char *validation;
|
||||||
guint64 sci;
|
guint64 sci;
|
||||||
guint64 cipher_suite;
|
guint64 cipher_suite;
|
||||||
|
|
@ -88,13 +86,15 @@ nm_device_macsec_get_parent (NMDeviceMacsec *device)
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
*
|
*
|
||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_macsec_get_hw_address (NMDeviceMacsec *device)
|
nm_device_macsec_get_hw_address (NMDeviceMacsec *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_MACSEC (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_MACSEC (device), NULL);
|
||||||
|
|
||||||
return NM_DEVICE_MACSEC_GET_PRIVATE (device)->hw_address;
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -318,12 +318,6 @@ nm_device_macsec_get_replay_protect (NMDeviceMacsec *device)
|
||||||
return NM_DEVICE_MACSEC_GET_PRIVATE (device)->replay_protect;
|
return NM_DEVICE_MACSEC_GET_PRIVATE (device)->replay_protect;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_macsec_get_hw_address (NM_DEVICE_MACSEC (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -337,7 +331,6 @@ finalize (GObject *object)
|
||||||
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE (object);
|
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE (object);
|
||||||
|
|
||||||
g_free (priv->validation);
|
g_free (priv->validation);
|
||||||
g_free (priv->hw_address);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_macsec_parent_class)->finalize (object);
|
G_OBJECT_CLASS (nm_device_macsec_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
@ -354,9 +347,6 @@ get_property (GObject *object,
|
||||||
case PROP_PARENT:
|
case PROP_PARENT:
|
||||||
g_value_set_object (value, nm_device_macsec_get_parent (device));
|
g_value_set_object (value, nm_device_macsec_get_parent (device));
|
||||||
break;
|
break;
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_macsec_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_SCI:
|
case PROP_SCI:
|
||||||
g_value_set_uint64 (value, nm_device_macsec_get_sci (device));
|
g_value_set_uint64 (value, nm_device_macsec_get_sci (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -425,7 +415,6 @@ nm_device_macsec_class_init (NMDeviceMacsecClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (klass);
|
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (klass);
|
||||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
@ -434,8 +423,6 @@ nm_device_macsec_class_init (NMDeviceMacsecClass *klass)
|
||||||
|
|
||||||
_NM_OBJECT_CLASS_INIT_PROPERTY_O_FIELDS_1 (nm_object_class, NMDeviceMacsecPrivate, parent);
|
_NM_OBJECT_CLASS_INIT_PROPERTY_O_FIELDS_1 (nm_object_class, NMDeviceMacsecPrivate, parent);
|
||||||
|
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceMacsec:parent:
|
* NMDeviceMacsec:parent:
|
||||||
*
|
*
|
||||||
|
|
@ -449,19 +436,6 @@ nm_device_macsec_class_init (NMDeviceMacsecClass *klass)
|
||||||
G_PARAM_READABLE |
|
G_PARAM_READABLE |
|
||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceMacsec:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
*
|
|
||||||
* Since: 1.6
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_MACSEC_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceMacsec:sci:
|
* NMDeviceMacsec:sci:
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,11 @@ GType nm_device_macsec_get_type (void);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_6
|
NM_AVAILABLE_IN_1_6
|
||||||
NMDevice * nm_device_macsec_get_parent (NMDeviceMacsec *device);
|
NMDevice * nm_device_macsec_get_parent (NMDeviceMacsec *device);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_6
|
NM_AVAILABLE_IN_1_6
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char * nm_device_macsec_get_hw_address (NMDeviceMacsec *device);
|
const char * nm_device_macsec_get_hw_address (NMDeviceMacsec *device);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_6
|
NM_AVAILABLE_IN_1_6
|
||||||
guint64 nm_device_macsec_get_sci (NMDeviceMacsec *device);
|
guint64 nm_device_macsec_get_sci (NMDeviceMacsec *device);
|
||||||
NM_AVAILABLE_IN_1_6
|
NM_AVAILABLE_IN_1_6
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_MODE,
|
PROP_MODE,
|
||||||
PROP_NO_PROMISC,
|
PROP_NO_PROMISC,
|
||||||
PROP_TAP,
|
PROP_TAP,
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -128,13 +127,15 @@ nm_device_macvlan_get_tap (NMDeviceMacvlan *device)
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
*
|
*
|
||||||
* This property is not implemented yet, and the function always return NULL.
|
* This property is not implemented yet, and the function always return NULL.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_macvlan_get_hw_address (NMDeviceMacvlan *device)
|
nm_device_macvlan_get_hw_address (NMDeviceMacvlan *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_MACVLAN (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_MACVLAN (device), NULL);
|
||||||
|
|
||||||
return NULL;
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
@ -161,12 +162,6 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_macvlan_get_hw_address (NM_DEVICE_MACVLAN (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
static GType
|
static GType
|
||||||
get_setting_type (NMDevice *device)
|
get_setting_type (NMDevice *device)
|
||||||
{
|
{
|
||||||
|
|
@ -211,9 +206,6 @@ get_property (GObject *object,
|
||||||
case PROP_TAP:
|
case PROP_TAP:
|
||||||
g_value_set_boolean (value, nm_device_macvlan_get_tap (device));
|
g_value_set_boolean (value, nm_device_macvlan_get_tap (device));
|
||||||
break;
|
break;
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_macvlan_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
@ -248,7 +240,6 @@ nm_device_macvlan_class_init (NMDeviceMacvlanClass *klass)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceMacvlan:parent:
|
* NMDeviceMacvlan:parent:
|
||||||
|
|
@ -302,20 +293,5 @@ nm_device_macvlan_class_init (NMDeviceMacvlanClass *klass)
|
||||||
G_PARAM_READABLE |
|
G_PARAM_READABLE |
|
||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceMacvlan:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* This property is not implemented yet, and the function always return NULL.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_MACVLAN_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
_nml_dbus_meta_class_init_with_properties (object_class, &_nml_dbus_meta_iface_nm_device_macvlan);
|
_nml_dbus_meta_class_init_with_properties (object_class, &_nml_dbus_meta_iface_nm_device_macvlan);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,9 @@ NM_AVAILABLE_IN_1_2
|
||||||
gboolean nm_device_macvlan_get_no_promisc (NMDeviceMacvlan *device);
|
gboolean nm_device_macvlan_get_no_promisc (NMDeviceMacvlan *device);
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
gboolean nm_device_macvlan_get_tap (NMDeviceMacvlan *device);
|
gboolean nm_device_macvlan_get_tap (NMDeviceMacvlan *device);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char * nm_device_macvlan_get_hw_address (NMDeviceMacvlan *device);
|
const char * nm_device_macvlan_get_hw_address (NMDeviceMacvlan *device);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,12 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_COMPANION,
|
PROP_COMPANION,
|
||||||
PROP_ACTIVE_CHANNEL,
|
PROP_ACTIVE_CHANNEL,
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMLDBusPropertyO companion;
|
NMLDBusPropertyO companion;
|
||||||
char *hw_address;
|
|
||||||
guint32 active_channel;
|
guint32 active_channel;
|
||||||
} NMDeviceOlpcMeshPrivate;
|
} NMDeviceOlpcMeshPrivate;
|
||||||
|
|
||||||
|
|
@ -49,13 +47,15 @@ G_DEFINE_TYPE (NMDeviceOlpcMesh, nm_device_olpc_mesh, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the hardware address. This is the internal string used by the
|
* Returns: the hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_olpc_mesh_get_hw_address (NMDeviceOlpcMesh *device)
|
nm_device_olpc_mesh_get_hw_address (NMDeviceOlpcMesh *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_OLPC_MESH (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_OLPC_MESH (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_OLPC_MESH_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -90,12 +90,6 @@ nm_device_olpc_mesh_get_active_channel (NMDeviceOlpcMesh *device)
|
||||||
return NM_DEVICE_OLPC_MESH_GET_PRIVATE (device)->active_channel;
|
return NM_DEVICE_OLPC_MESH_GET_PRIVATE (device)->active_channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_olpc_mesh_get_hw_address (NM_DEVICE_OLPC_MESH (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
|
|
@ -124,16 +118,6 @@ nm_device_olpc_mesh_init (NMDeviceOlpcMesh *device)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object,
|
get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
|
|
@ -143,9 +127,6 @@ get_property (GObject *object,
|
||||||
NMDeviceOlpcMesh *device = NM_DEVICE_OLPC_MESH (object);
|
NMDeviceOlpcMesh *device = NM_DEVICE_OLPC_MESH (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_olpc_mesh_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_COMPANION:
|
case PROP_COMPANION:
|
||||||
g_value_set_object (value, nm_device_olpc_mesh_get_companion (device));
|
g_value_set_object (value, nm_device_olpc_mesh_get_companion (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -165,7 +146,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_olpcmesh = NML_DBUS_META_I
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_U ("ActiveChannel", PROP_ACTIVE_CHANNEL, NMDeviceOlpcMesh, _priv.active_channel ),
|
NML_DBUS_META_PROPERTY_INIT_U ("ActiveChannel", PROP_ACTIVE_CHANNEL, NMDeviceOlpcMesh, _priv.active_channel ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_O_PROP ("Companion", PROP_COMPANION, NMDeviceOlpcMesh, _priv.companion, nm_device_wifi_get_type ),
|
NML_DBUS_META_PROPERTY_INIT_O_PROP ("Companion", PROP_COMPANION, NMDeviceOlpcMesh, _priv.companion, nm_device_wifi_get_type ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceOlpcMesh, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -177,7 +158,6 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass)
|
||||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT (nm_object_class, NMDeviceOlpcMesh);
|
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT (nm_object_class, NMDeviceOlpcMesh);
|
||||||
|
|
||||||
|
|
@ -185,18 +165,6 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceOlpcMesh:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_OLPC_MESH_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceOlpcMesh:companion:
|
* NMDeviceOlpcMesh:companion:
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,9 @@ typedef struct _NMDeviceOlpcMeshClass NMDeviceOlpcMeshClass;
|
||||||
|
|
||||||
GType nm_device_olpc_mesh_get_type (void);
|
GType nm_device_olpc_mesh_get_type (void);
|
||||||
|
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char *nm_device_olpc_mesh_get_hw_address (NMDeviceOlpcMesh *device);
|
const char *nm_device_olpc_mesh_get_hw_address (NMDeviceOlpcMesh *device);
|
||||||
|
|
||||||
NMDeviceWifi *nm_device_olpc_mesh_get_companion (NMDeviceOlpcMesh *device);
|
NMDeviceWifi *nm_device_olpc_mesh_get_companion (NMDeviceOlpcMesh *device);
|
||||||
guint32 nm_device_olpc_mesh_get_active_channel (NMDeviceOlpcMesh *device);
|
guint32 nm_device_olpc_mesh_get_active_channel (NMDeviceOlpcMesh *device);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_CARRIER,
|
PROP_CARRIER,
|
||||||
PROP_SLAVES,
|
PROP_SLAVES,
|
||||||
PROP_CONFIG,
|
PROP_CONFIG,
|
||||||
|
|
@ -24,7 +23,6 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMLDBusPropertyAO slaves;
|
NMLDBusPropertyAO slaves;
|
||||||
char *hw_address;
|
|
||||||
char *config;
|
char *config;
|
||||||
bool carrier;
|
bool carrier;
|
||||||
} NMDeviceTeamPrivate;
|
} NMDeviceTeamPrivate;
|
||||||
|
|
@ -52,13 +50,15 @@ G_DEFINE_TYPE (NMDeviceTeam, nm_device_team, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the hardware address. This is the internal string used by the
|
* Returns: the hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_team_get_hw_address (NMDeviceTeam *device)
|
nm_device_team_get_hw_address (NMDeviceTeam *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_TEAM (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_TEAM (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_TEAM_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -114,12 +114,6 @@ nm_device_team_get_config (NMDeviceTeam *device)
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_TEAM_GET_PRIVATE (device)->config);
|
return _nml_coerce_property_str_not_empty (NM_DEVICE_TEAM_GET_PRIVATE (device)->config);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_team_get_hw_address (NM_DEVICE_TEAM (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
|
|
@ -155,7 +149,6 @@ finalize (GObject *object)
|
||||||
{
|
{
|
||||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (object);
|
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (object);
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
g_free (priv->config);
|
g_free (priv->config);
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_team_parent_class)->finalize (object);
|
G_OBJECT_CLASS (nm_device_team_parent_class)->finalize (object);
|
||||||
|
|
@ -170,9 +163,6 @@ get_property (GObject *object,
|
||||||
NMDeviceTeam *device = NM_DEVICE_TEAM (object);
|
NMDeviceTeam *device = NM_DEVICE_TEAM (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_team_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_CARRIER:
|
case PROP_CARRIER:
|
||||||
g_value_set_boolean (value, nm_device_team_get_carrier (device));
|
g_value_set_boolean (value, nm_device_team_get_carrier (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -195,7 +185,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_team = NML_DBUS_META_IFACE
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceTeam, _priv.carrier ),
|
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceTeam, _priv.carrier ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("Config", PROP_CONFIG, NMDeviceTeam, _priv.config ),
|
NML_DBUS_META_PROPERTY_INIT_S ("Config", PROP_CONFIG, NMDeviceTeam, _priv.config ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceTeam, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_AO_PROP ("Slaves", PROP_SLAVES, NMDeviceTeam, _priv.slaves, nm_device_get_type ),
|
NML_DBUS_META_PROPERTY_INIT_AO_PROP ("Slaves", PROP_SLAVES, NMDeviceTeam, _priv.slaves, nm_device_get_type ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -216,18 +206,6 @@ nm_device_team_class_init (NMDeviceTeamClass *klass)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceTeam:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_TEAM_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceTeam:carrier:
|
* NMDeviceTeam:carrier:
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,9 @@ typedef struct _NMDeviceTeamClass NMDeviceTeamClass;
|
||||||
|
|
||||||
GType nm_device_team_get_type (void);
|
GType nm_device_team_get_type (void);
|
||||||
|
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char *nm_device_team_get_hw_address (NMDeviceTeam *device);
|
const char *nm_device_team_get_hw_address (NMDeviceTeam *device);
|
||||||
|
|
||||||
gboolean nm_device_team_get_carrier (NMDeviceTeam *device);
|
gboolean nm_device_team_get_carrier (NMDeviceTeam *device);
|
||||||
const GPtrArray *nm_device_team_get_slaves (NMDeviceTeam *device);
|
const GPtrArray *nm_device_team_get_slaves (NMDeviceTeam *device);
|
||||||
NM_AVAILABLE_IN_1_4
|
NM_AVAILABLE_IN_1_4
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_MODE,
|
PROP_MODE,
|
||||||
PROP_OWNER,
|
PROP_OWNER,
|
||||||
PROP_GROUP,
|
PROP_GROUP,
|
||||||
|
|
@ -27,7 +26,6 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *hw_address;
|
|
||||||
char *mode;
|
char *mode;
|
||||||
gint64 owner;
|
gint64 owner;
|
||||||
gint64 group;
|
gint64 group;
|
||||||
|
|
@ -61,13 +59,15 @@ G_DEFINE_TYPE (NMDeviceTun, nm_device_tun, NM_TYPE_DEVICE)
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_tun_get_hw_address (NMDeviceTun *device)
|
nm_device_tun_get_hw_address (NMDeviceTun *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_TUN (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_TUN (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_TUN_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -221,12 +221,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_TUN;
|
return NM_TYPE_SETTING_TUN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_tun_get_hw_address (NM_DEVICE_TUN (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -240,7 +234,6 @@ finalize (GObject *object)
|
||||||
NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE (object);
|
NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE (object);
|
||||||
|
|
||||||
g_free (priv->mode);
|
g_free (priv->mode);
|
||||||
g_free (priv->hw_address);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_tun_parent_class)->finalize (object);
|
G_OBJECT_CLASS (nm_device_tun_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
@ -254,9 +247,6 @@ get_property (GObject *object,
|
||||||
NMDeviceTun *device = NM_DEVICE_TUN (object);
|
NMDeviceTun *device = NM_DEVICE_TUN (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_tun_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_MODE:
|
case PROP_MODE:
|
||||||
g_value_set_string (value, nm_device_tun_get_mode (device));
|
g_value_set_string (value, nm_device_tun_get_mode (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -288,7 +278,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_tun = NML_DBUS_META_IFACE_
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_X ("Group", PROP_GROUP, NMDeviceTun, _priv.group ),
|
NML_DBUS_META_PROPERTY_INIT_X ("Group", PROP_GROUP, NMDeviceTun, _priv.group ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceTun, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("Mode", PROP_MODE, NMDeviceTun, _priv.mode ),
|
NML_DBUS_META_PROPERTY_INIT_S ("Mode", PROP_MODE, NMDeviceTun, _priv.mode ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("MultiQueue", PROP_MULTI_QUEUE, NMDeviceTun, _priv.multi_queue ),
|
NML_DBUS_META_PROPERTY_INIT_B ("MultiQueue", PROP_MULTI_QUEUE, NMDeviceTun, _priv.multi_queue ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("NoPi", PROP_NO_PI, NMDeviceTun, _priv.no_pi ),
|
NML_DBUS_META_PROPERTY_INIT_B ("NoPi", PROP_NO_PI, NMDeviceTun, _priv.no_pi ),
|
||||||
|
|
@ -308,20 +298,6 @@ nm_device_tun_class_init (NMDeviceTunClass *gre_class)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceTun:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_TUN_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceTun:mode:
|
* NMDeviceTun:mode:
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,9 @@ NM_AVAILABLE_IN_1_2
|
||||||
GType nm_device_tun_get_type (void);
|
GType nm_device_tun_get_type (void);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char * nm_device_tun_get_hw_address (NMDeviceTun *device);
|
const char * nm_device_tun_get_hw_address (NMDeviceTun *device);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
const char * nm_device_tun_get_mode (NMDeviceTun *device);
|
const char * nm_device_tun_get_mode (NMDeviceTun *device);
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_CARRIER,
|
PROP_CARRIER,
|
||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
PROP_VLAN_ID,
|
PROP_VLAN_ID,
|
||||||
|
|
@ -24,7 +23,6 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMLDBusPropertyO parent;
|
NMLDBusPropertyO parent;
|
||||||
char *hw_address;
|
|
||||||
guint32 vlan_id;
|
guint32 vlan_id;
|
||||||
bool carrier;
|
bool carrier;
|
||||||
} NMDeviceVlanPrivate;
|
} NMDeviceVlanPrivate;
|
||||||
|
|
@ -52,13 +50,15 @@ G_DEFINE_TYPE (NMDeviceVlan, nm_device_vlan, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the hardware address. This is the internal string used by the
|
* Returns: the hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_vlan_get_hw_address (NMDeviceVlan *device)
|
nm_device_vlan_get_hw_address (NMDeviceVlan *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_VLAN_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -108,10 +108,10 @@ nm_device_vlan_get_vlan_id (NMDeviceVlan *device)
|
||||||
static gboolean
|
static gboolean
|
||||||
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
NMDeviceVlanPrivate *priv;
|
|
||||||
NMSettingVlan *s_vlan;
|
NMSettingVlan *s_vlan;
|
||||||
NMSettingWired *s_wired;
|
NMSettingWired *s_wired;
|
||||||
const char *setting_hwaddr;
|
const char *setting_hwaddr;
|
||||||
|
const char *hw_address;
|
||||||
|
|
||||||
if (!NM_DEVICE_CLASS (nm_device_vlan_parent_class)->connection_compatible (device, connection, error))
|
if (!NM_DEVICE_CLASS (nm_device_vlan_parent_class)->connection_compatible (device, connection, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
@ -135,10 +135,11 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
|
||||||
else
|
else
|
||||||
setting_hwaddr = NULL;
|
setting_hwaddr = NULL;
|
||||||
if (setting_hwaddr) {
|
if (setting_hwaddr) {
|
||||||
priv = NM_DEVICE_VLAN_GET_PRIVATE (device);
|
hw_address = nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
if ( !priv->hw_address
|
|
||||||
|
if ( !hw_address
|
||||||
|| !nm_utils_hwaddr_matches (setting_hwaddr, -1,
|
|| !nm_utils_hwaddr_matches (setting_hwaddr, -1,
|
||||||
priv->hw_address, -1)) {
|
hw_address, -1)) {
|
||||||
g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
|
g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
|
||||||
_("The hardware address of the device and the connection didn't match."));
|
_("The hardware address of the device and the connection didn't match."));
|
||||||
}
|
}
|
||||||
|
|
@ -153,12 +154,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_VLAN;
|
return NM_TYPE_SETTING_VLAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_vlan_get_hw_address (NM_DEVICE_VLAN (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -166,16 +161,6 @@ nm_device_vlan_init (NMDeviceVlan *device)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_vlan_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object,
|
get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
|
|
@ -185,9 +170,6 @@ get_property (GObject *object,
|
||||||
NMDeviceVlan *device = NM_DEVICE_VLAN (object);
|
NMDeviceVlan *device = NM_DEVICE_VLAN (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_vlan_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_CARRIER:
|
case PROP_CARRIER:
|
||||||
g_value_set_boolean (value, nm_device_vlan_get_carrier (device));
|
g_value_set_boolean (value, nm_device_vlan_get_carrier (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -209,7 +191,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_vlan = NML_DBUS_META_IFACE
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceVlan, _priv.carrier ),
|
NML_DBUS_META_PROPERTY_INIT_B ("Carrier", PROP_CARRIER, NMDeviceVlan, _priv.carrier ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceVlan, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_O_PROP ("Parent", PROP_PARENT, NMDeviceVlan, _priv.parent, nm_device_get_type ),
|
NML_DBUS_META_PROPERTY_INIT_O_PROP ("Parent", PROP_PARENT, NMDeviceVlan, _priv.parent, nm_device_get_type ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_U ("VlanId", PROP_VLAN_ID, NMDeviceVlan, _priv.vlan_id ),
|
NML_DBUS_META_PROPERTY_INIT_U ("VlanId", PROP_VLAN_ID, NMDeviceVlan, _priv.vlan_id ),
|
||||||
),
|
),
|
||||||
|
|
@ -223,7 +205,6 @@ nm_device_vlan_class_init (NMDeviceVlanClass *klass)
|
||||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT (nm_object_class, NMDeviceVlan);
|
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT (nm_object_class, NMDeviceVlan);
|
||||||
|
|
||||||
|
|
@ -231,18 +212,6 @@ nm_device_vlan_class_init (NMDeviceVlanClass *klass)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceVlan:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_VLAN_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceVlan:carrier:
|
* NMDeviceVlan:carrier:
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,9 @@ typedef struct _NMDeviceVlanClass NMDeviceVlanClass;
|
||||||
|
|
||||||
GType nm_device_vlan_get_type (void);
|
GType nm_device_vlan_get_type (void);
|
||||||
|
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char * nm_device_vlan_get_hw_address (NMDeviceVlan *device);
|
const char * nm_device_vlan_get_hw_address (NMDeviceVlan *device);
|
||||||
|
|
||||||
gboolean nm_device_vlan_get_carrier (NMDeviceVlan *device);
|
gboolean nm_device_vlan_get_carrier (NMDeviceVlan *device);
|
||||||
NMDevice * nm_device_vlan_get_parent (NMDeviceVlan *device);
|
NMDevice * nm_device_vlan_get_parent (NMDeviceVlan *device);
|
||||||
guint nm_device_vlan_get_vlan_id (NMDeviceVlan *device);
|
guint nm_device_vlan_get_vlan_id (NMDeviceVlan *device);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_CARRIER,
|
PROP_CARRIER,
|
||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
PROP_ID,
|
PROP_ID,
|
||||||
|
|
@ -37,7 +36,6 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMLDBusPropertyO parent;
|
NMLDBusPropertyO parent;
|
||||||
char *hw_address;
|
|
||||||
char *group;
|
char *group;
|
||||||
char *local;
|
char *local;
|
||||||
guint32 id;
|
guint32 id;
|
||||||
|
|
@ -80,13 +78,15 @@ G_DEFINE_TYPE (NMDeviceVxlan, nm_device_vxlan, NM_TYPE_DEVICE)
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_vxlan_get_hw_address (NMDeviceVxlan *device)
|
nm_device_vxlan_get_hw_address (NMDeviceVxlan *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_VXLAN_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -398,12 +398,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_VXLAN;
|
return NM_TYPE_SETTING_VXLAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_vxlan_get_hw_address (NM_DEVICE_VXLAN (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -416,7 +410,6 @@ finalize (GObject *object)
|
||||||
{
|
{
|
||||||
NMDeviceVxlanPrivate *priv = NM_DEVICE_VXLAN_GET_PRIVATE (object);
|
NMDeviceVxlanPrivate *priv = NM_DEVICE_VXLAN_GET_PRIVATE (object);
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
g_free (priv->group);
|
g_free (priv->group);
|
||||||
g_free (priv->local);
|
g_free (priv->local);
|
||||||
|
|
||||||
|
|
@ -432,9 +425,6 @@ get_property (GObject *object,
|
||||||
NMDeviceVxlan *device = NM_DEVICE_VXLAN (object);
|
NMDeviceVxlan *device = NM_DEVICE_VXLAN (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_vxlan_get_hw_address (device));
|
|
||||||
break;
|
|
||||||
case PROP_CARRIER:
|
case PROP_CARRIER:
|
||||||
g_value_set_boolean (value, nm_device_vxlan_get_carrier (device));
|
g_value_set_boolean (value, nm_device_vxlan_get_carrier (device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -500,7 +490,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_vxlan = NML_DBUS_META_IFAC
|
||||||
NML_DBUS_META_PROPERTY_INIT_U ("Ageing", PROP_AGEING, NMDeviceVxlan, _priv.ageing ),
|
NML_DBUS_META_PROPERTY_INIT_U ("Ageing", PROP_AGEING, NMDeviceVxlan, _priv.ageing ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_Q ("DstPort", PROP_DST_PORT, NMDeviceVxlan, _priv.dst_port ),
|
NML_DBUS_META_PROPERTY_INIT_Q ("DstPort", PROP_DST_PORT, NMDeviceVxlan, _priv.dst_port ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("Group", PROP_GROUP, NMDeviceVxlan, _priv.group ),
|
NML_DBUS_META_PROPERTY_INIT_S ("Group", PROP_GROUP, NMDeviceVxlan, _priv.group ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceVxlan, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_U ("Id", PROP_ID, NMDeviceVxlan, _priv.id ),
|
NML_DBUS_META_PROPERTY_INIT_U ("Id", PROP_ID, NMDeviceVxlan, _priv.id ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("L2miss", PROP_L2MISS, NMDeviceVxlan, _priv.l2miss ),
|
NML_DBUS_META_PROPERTY_INIT_B ("L2miss", PROP_L2MISS, NMDeviceVxlan, _priv.l2miss ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("L3miss", PROP_L3MISS, NMDeviceVxlan, _priv.l3miss ),
|
NML_DBUS_META_PROPERTY_INIT_B ("L3miss", PROP_L3MISS, NMDeviceVxlan, _priv.l3miss ),
|
||||||
|
|
@ -533,20 +523,6 @@ nm_device_vxlan_class_init (NMDeviceVxlanClass *klass)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceVxlan:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_VXLAN_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceVxlan:carrier:
|
* NMDeviceVxlan:carrier:
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,11 @@ typedef struct _NMDeviceVxlanClass NMDeviceVxlanClass;
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
GType nm_device_vxlan_get_type (void);
|
GType nm_device_vxlan_get_type (void);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char * nm_device_vxlan_get_hw_address (NMDeviceVxlan *device);
|
const char * nm_device_vxlan_get_hw_address (NMDeviceVxlan *device);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
gboolean nm_device_vxlan_get_carrier (NMDeviceVxlan *device);
|
gboolean nm_device_vxlan_get_carrier (NMDeviceVxlan *device);
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_PEERS,
|
PROP_PEERS,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -34,7 +33,6 @@ static guint signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMLDBusPropertyAO peers;
|
NMLDBusPropertyAO peers;
|
||||||
char *hw_address;
|
|
||||||
} NMDeviceWifiP2PPrivate;
|
} NMDeviceWifiP2PPrivate;
|
||||||
|
|
||||||
struct _NMDeviceWifiP2P {
|
struct _NMDeviceWifiP2P {
|
||||||
|
|
@ -62,13 +60,15 @@ G_DEFINE_TYPE (NMDeviceWifiP2P, nm_device_wifi_p2p, NM_TYPE_DEVICE)
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
*
|
*
|
||||||
* Since: 1.16
|
* Since: 1.16
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_wifi_p2p_get_hw_address (NMDeviceWifiP2P *device)
|
nm_device_wifi_p2p_get_hw_address (NMDeviceWifiP2P *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_WIFI_P2P (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_WIFI_P2P (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_WIFI_P2P_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -278,12 +278,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_WIRELESS;
|
return NM_TYPE_SETTING_WIRELESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_wifi_p2p_get_hw_address (NM_DEVICE_WIFI_P2P (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_type_description (NMDevice *device)
|
get_type_description (NMDevice *device)
|
||||||
{
|
{
|
||||||
|
|
@ -319,9 +313,6 @@ get_property (GObject *object,
|
||||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P (object);
|
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_wifi_p2p_get_hw_address (self));
|
|
||||||
break;
|
|
||||||
case PROP_PEERS:
|
case PROP_PEERS:
|
||||||
g_value_take_boxed (value, _nm_utils_copy_object_array (nm_device_wifi_p2p_get_peers (self)));
|
g_value_take_boxed (value, _nm_utils_copy_object_array (nm_device_wifi_p2p_get_peers (self)));
|
||||||
break;
|
break;
|
||||||
|
|
@ -338,22 +329,12 @@ nm_device_wifi_p2p_init (NMDeviceWifiP2P *device)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_wifi_p2p_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_wifip2p = NML_DBUS_META_IFACE_INIT_PROP (
|
const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_wifip2p = NML_DBUS_META_IFACE_INIT_PROP (
|
||||||
NM_DBUS_INTERFACE_DEVICE_WIFI_P2P,
|
NM_DBUS_INTERFACE_DEVICE_WIFI_P2P,
|
||||||
nm_device_wifi_p2p_get_type,
|
nm_device_wifi_p2p_get_type,
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceWifiP2P, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_AO_PROP ("Peers", PROP_PEERS, NMDeviceWifiP2P, _priv.peers, nm_wifi_p2p_peer_get_type, .notify_changed_ao = _property_ao_notify_changed_peers_cb ),
|
NML_DBUS_META_PROPERTY_INIT_AO_PROP ("Peers", PROP_PEERS, NMDeviceWifiP2P, _priv.peers, nm_wifi_p2p_peer_get_type, .notify_changed_ao = _property_ao_notify_changed_peers_cb ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -366,7 +347,6 @@ nm_device_wifi_p2p_class_init (NMDeviceWifiP2PClass *klass)
|
||||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT (nm_object_class, NMDeviceWifiP2P);
|
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT (nm_object_class, NMDeviceWifiP2P);
|
||||||
|
|
||||||
|
|
@ -374,22 +354,8 @@ nm_device_wifi_p2p_class_init (NMDeviceWifiP2PClass *klass)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
device_class->get_type_description = get_type_description;
|
device_class->get_type_description = get_type_description;
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceWifiP2P:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
*
|
|
||||||
* Since: 1.16
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_WIFI_P2P_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceWifiP2P:peers: (type GPtrArray(NMWifiP2PPeer))
|
* NMDeviceWifiP2P:peers: (type GPtrArray(NMWifiP2PPeer))
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ NM_AVAILABLE_IN_1_16
|
||||||
GType nm_device_wifi_p2p_get_type (void);
|
GType nm_device_wifi_p2p_get_type (void);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_16
|
NM_AVAILABLE_IN_1_16
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char * nm_device_wifi_p2p_get_hw_address (NMDeviceWifiP2P *device);
|
const char * nm_device_wifi_p2p_get_hw_address (NMDeviceWifiP2P *device);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_16
|
NM_AVAILABLE_IN_1_16
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
PROP_PERM_HW_ADDRESS,
|
PROP_PERM_HW_ADDRESS,
|
||||||
PROP_MODE,
|
PROP_MODE,
|
||||||
PROP_BITRATE,
|
PROP_BITRATE,
|
||||||
|
|
@ -34,7 +33,6 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMLDBusPropertyAO access_points;
|
NMLDBusPropertyAO access_points;
|
||||||
NMLDBusPropertyO active_access_point;
|
NMLDBusPropertyO active_access_point;
|
||||||
char *hw_address;
|
|
||||||
char *perm_hw_address;
|
char *perm_hw_address;
|
||||||
gint64 last_scan;
|
gint64 last_scan;
|
||||||
guint32 mode;
|
guint32 mode;
|
||||||
|
|
@ -74,13 +72,15 @@ G_DEFINE_TYPE (NMDeviceWifi, nm_device_wifi, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the actual hardware address. This is the internal string used by the
|
* Returns: the actual hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_wifi_get_hw_address (NMDeviceWifi *device)
|
nm_device_wifi_get_hw_address (NMDeviceWifi *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_WIFI_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -515,12 +515,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_WIRELESS;
|
return NM_TYPE_SETTING_WIRELESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -558,9 +552,6 @@ get_property (GObject *object,
|
||||||
NMDeviceWifi *self = NM_DEVICE_WIFI (object);
|
NMDeviceWifi *self = NM_DEVICE_WIFI (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_wifi_get_hw_address (self));
|
|
||||||
break;
|
|
||||||
case PROP_PERM_HW_ADDRESS:
|
case PROP_PERM_HW_ADDRESS:
|
||||||
g_value_set_string (value, nm_device_wifi_get_permanent_hw_address (self));
|
g_value_set_string (value, nm_device_wifi_get_permanent_hw_address (self));
|
||||||
break;
|
break;
|
||||||
|
|
@ -593,7 +584,6 @@ finalize (GObject *object)
|
||||||
{
|
{
|
||||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
|
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
g_free (priv->perm_hw_address);
|
g_free (priv->perm_hw_address);
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_wifi_parent_class)->finalize (object);
|
G_OBJECT_CLASS (nm_device_wifi_parent_class)->finalize (object);
|
||||||
|
|
@ -607,7 +597,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_wireless = NML_DBUS_META_I
|
||||||
NML_DBUS_META_PROPERTY_INIT_AO_PROP ("AccessPoints", PROP_ACCESS_POINTS, NMDeviceWifi, _priv.access_points, nm_access_point_get_type, .notify_changed_ao = _property_ao_notify_changed_access_points_cb ),
|
NML_DBUS_META_PROPERTY_INIT_AO_PROP ("AccessPoints", PROP_ACCESS_POINTS, NMDeviceWifi, _priv.access_points, nm_access_point_get_type, .notify_changed_ao = _property_ao_notify_changed_access_points_cb ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_O_PROP ("ActiveAccessPoint", PROP_ACTIVE_ACCESS_POINT, NMDeviceWifi, _priv.active_access_point, nm_access_point_get_type ),
|
NML_DBUS_META_PROPERTY_INIT_O_PROP ("ActiveAccessPoint", PROP_ACTIVE_ACCESS_POINT, NMDeviceWifi, _priv.active_access_point, nm_access_point_get_type ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_U ("Bitrate", PROP_BITRATE, NMDeviceWifi, _priv.bitrate ),
|
NML_DBUS_META_PROPERTY_INIT_U ("Bitrate", PROP_BITRATE, NMDeviceWifi, _priv.bitrate ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceWifi, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_X ("LastScan", PROP_LAST_SCAN, NMDeviceWifi, _priv.last_scan ),
|
NML_DBUS_META_PROPERTY_INIT_X ("LastScan", PROP_LAST_SCAN, NMDeviceWifi, _priv.last_scan ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_U ("Mode", PROP_MODE, NMDeviceWifi, _priv.mode ),
|
NML_DBUS_META_PROPERTY_INIT_U ("Mode", PROP_MODE, NMDeviceWifi, _priv.mode ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("PermHwAddress", PROP_PERM_HW_ADDRESS, NMDeviceWifi, _priv.perm_hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_S ("PermHwAddress", PROP_PERM_HW_ADDRESS, NMDeviceWifi, _priv.perm_hw_address ),
|
||||||
|
|
@ -632,18 +622,6 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceWifi:hw-address:
|
|
||||||
*
|
|
||||||
* The hardware (MAC) address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceWifi:perm-hw-address:
|
* NMDeviceWifi:perm-hw-address:
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,9 @@ typedef struct _NMDeviceWifiClass NMDeviceWifiClass;
|
||||||
|
|
||||||
GType nm_device_wifi_get_type (void);
|
GType nm_device_wifi_get_type (void);
|
||||||
|
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char * nm_device_wifi_get_hw_address (NMDeviceWifi *device);
|
const char * nm_device_wifi_get_hw_address (NMDeviceWifi *device);
|
||||||
|
|
||||||
const char * nm_device_wifi_get_permanent_hw_address (NMDeviceWifi *device);
|
const char * nm_device_wifi_get_permanent_hw_address (NMDeviceWifi *device);
|
||||||
NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *device);
|
NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *device);
|
||||||
guint32 nm_device_wifi_get_bitrate (NMDeviceWifi *device);
|
guint32 nm_device_wifi_get_bitrate (NMDeviceWifi *device);
|
||||||
|
|
|
||||||
|
|
@ -13,17 +13,8 @@
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|
||||||
PROP_HW_ADDRESS,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *hw_address;
|
|
||||||
} NMDeviceWpanPrivate;
|
|
||||||
|
|
||||||
struct _NMDeviceWpan {
|
struct _NMDeviceWpan {
|
||||||
NMDevice parent;
|
NMDevice parent;
|
||||||
NMDeviceWpanPrivate _priv;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _NMDeviceWpanClass {
|
struct _NMDeviceWpanClass {
|
||||||
|
|
@ -31,9 +22,6 @@ struct _NMDeviceWpanClass {
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMDeviceWpan, nm_device_wpan, NM_TYPE_DEVICE)
|
G_DEFINE_TYPE (NMDeviceWpan, nm_device_wpan, NM_TYPE_DEVICE)
|
||||||
|
|
||||||
#define NM_DEVICE_WPAN_GET_PRIVATE(self) _NM_GET_PRIVATE(self, NMDeviceWpan, NM_IS_DEVICE_WPAN, NMObject, NMDevice)
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,13 +32,15 @@ G_DEFINE_TYPE (NMDeviceWpan, nm_device_wpan, NM_TYPE_DEVICE)
|
||||||
*
|
*
|
||||||
* Returns: the active hardware address. This is the internal string used by the
|
* Returns: the active hardware address. This is the internal string used by the
|
||||||
* device, and must not be modified.
|
* device, and must not be modified.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.24 use nm_device_get_hw_address() instead.
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
nm_device_wpan_get_hw_address (NMDeviceWpan *device)
|
nm_device_wpan_get_hw_address (NMDeviceWpan *device)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_WPAN (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_WPAN (device), NULL);
|
||||||
|
|
||||||
return _nml_coerce_property_str_not_empty (NM_DEVICE_WPAN_GET_PRIVATE (device)->hw_address);
|
return nm_device_get_hw_address (NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
@ -74,27 +64,6 @@ get_setting_type (NMDevice *device)
|
||||||
return NM_TYPE_SETTING_WPAN;
|
return NM_TYPE_SETTING_WPAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
get_hw_address (NMDevice *device)
|
|
||||||
{
|
|
||||||
return nm_device_wpan_get_hw_address (NM_DEVICE_WPAN (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_HW_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_device_wpan_get_hw_address (NM_DEVICE_WPAN (object)));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -102,48 +71,20 @@ nm_device_wpan_init (NMDeviceWpan *device)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_wpan = NML_DBUS_META_IFACE_INIT (
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMDeviceWpanPrivate *priv = NM_DEVICE_WPAN_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_wpan_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_wpan = NML_DBUS_META_IFACE_INIT_PROP (
|
|
||||||
NM_DBUS_INTERFACE_DEVICE_WPAN,
|
NM_DBUS_INTERFACE_DEVICE_WPAN,
|
||||||
nm_device_wpan_get_type,
|
nm_device_wpan_get_type,
|
||||||
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
|
||||||
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
NML_DBUS_META_IFACE_DBUS_PROPERTIES (
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("HwAddress", PROP_HW_ADDRESS, NMDeviceWpan, _priv.hw_address ),
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_device_wpan_class_init (NMDeviceWpanClass *wpan_class)
|
nm_device_wpan_class_init (NMDeviceWpanClass *wpan_class)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (wpan_class);
|
|
||||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (wpan_class);
|
NMDeviceClass *device_class = NM_DEVICE_CLASS (wpan_class);
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
device_class->connection_compatible = connection_compatible;
|
device_class->connection_compatible = connection_compatible;
|
||||||
device_class->get_setting_type = get_setting_type;
|
device_class->get_setting_type = get_setting_type;
|
||||||
device_class->get_hw_address = get_hw_address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NMDeviceWpan:hw-address:
|
|
||||||
*
|
|
||||||
* The active hardware (MAC) address of the device.
|
|
||||||
**/
|
|
||||||
obj_properties[PROP_HW_ADDRESS] =
|
|
||||||
g_param_spec_string (NM_DEVICE_WPAN_HW_ADDRESS, "", "",
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READABLE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
_nml_dbus_meta_class_init_with_properties (object_class, &_nml_dbus_meta_iface_nm_device_wpan);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ NM_AVAILABLE_IN_1_14
|
||||||
GType nm_device_wpan_get_type (void);
|
GType nm_device_wpan_get_type (void);
|
||||||
|
|
||||||
NM_AVAILABLE_IN_1_14
|
NM_AVAILABLE_IN_1_14
|
||||||
|
NM_DEPRECATED_IN_1_24_FOR (nm_device_get_hw_address)
|
||||||
const char *nm_device_wpan_get_hw_address (NMDeviceWpan *device);
|
const char *nm_device_wpan_get_hw_address (NMDeviceWpan *device);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMDevice,
|
||||||
PROP_IP4_CONNECTIVITY,
|
PROP_IP4_CONNECTIVITY,
|
||||||
PROP_IP6_CONNECTIVITY,
|
PROP_IP6_CONNECTIVITY,
|
||||||
PROP_INTERFACE_FLAGS,
|
PROP_INTERFACE_FLAGS,
|
||||||
|
PROP_HW_ADDRESS,
|
||||||
);
|
);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
@ -85,6 +86,7 @@ typedef struct _NMDevicePrivate {
|
||||||
GPtrArray *lldp_neighbors;
|
GPtrArray *lldp_neighbors;
|
||||||
char *driver;
|
char *driver;
|
||||||
char *driver_version;
|
char *driver_version;
|
||||||
|
char *hw_address;
|
||||||
char *interface;
|
char *interface;
|
||||||
char *ip_interface;
|
char *ip_interface;
|
||||||
char *firmware_version;
|
char *firmware_version;
|
||||||
|
|
@ -105,6 +107,8 @@ typedef struct _NMDevicePrivate {
|
||||||
bool managed;
|
bool managed;
|
||||||
bool real;
|
bool real;
|
||||||
|
|
||||||
|
bool hw_address_is_new:1;
|
||||||
|
|
||||||
guint32 old_state;
|
guint32 old_state;
|
||||||
|
|
||||||
struct udev *udev;
|
struct udev *udev;
|
||||||
|
|
@ -340,6 +344,7 @@ finalize (GObject *object)
|
||||||
g_free (priv->bus_name);
|
g_free (priv->bus_name);
|
||||||
g_free (priv->type_description);
|
g_free (priv->type_description);
|
||||||
g_free (priv->physical_port_id);
|
g_free (priv->physical_port_id);
|
||||||
|
g_free (priv->hw_address);
|
||||||
|
|
||||||
nm_clear_pointer (&priv->udev, udev_unref);
|
nm_clear_pointer (&priv->udev, udev_unref);
|
||||||
|
|
||||||
|
|
@ -445,6 +450,9 @@ get_property (GObject *object,
|
||||||
case PROP_INTERFACE_FLAGS:
|
case PROP_INTERFACE_FLAGS:
|
||||||
g_value_set_uint (value, nm_device_get_interface_flags (device));
|
g_value_set_uint (value, nm_device_get_interface_flags (device));
|
||||||
break;
|
break;
|
||||||
|
case PROP_HW_ADDRESS:
|
||||||
|
g_value_set_string (value, nm_device_get_hw_address (device));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
@ -501,6 +509,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device = NML_DBUS_META_IFACE_INIT
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("DriverVersion", PROP_DRIVER_VERSION, NMDevicePrivate, driver_version ),
|
NML_DBUS_META_PROPERTY_INIT_S ("DriverVersion", PROP_DRIVER_VERSION, NMDevicePrivate, driver_version ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_B ("FirmwareMissing", PROP_FIRMWARE_MISSING, NMDevicePrivate, firmware_missing ),
|
NML_DBUS_META_PROPERTY_INIT_B ("FirmwareMissing", PROP_FIRMWARE_MISSING, NMDevicePrivate, firmware_missing ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("FirmwareVersion", PROP_FIRMWARE_VERSION, NMDevicePrivate, firmware_version ),
|
NML_DBUS_META_PROPERTY_INIT_S ("FirmwareVersion", PROP_FIRMWARE_VERSION, NMDevicePrivate, firmware_version ),
|
||||||
|
NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S ("Interface", PROP_INTERFACE, NMDevicePrivate, interface ),
|
NML_DBUS_META_PROPERTY_INIT_S ("Interface", PROP_INTERFACE, NMDevicePrivate, interface ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_U ("InterfaceFlags", PROP_INTERFACE_FLAGS, NMDevicePrivate, interface_flags ),
|
NML_DBUS_META_PROPERTY_INIT_U ("InterfaceFlags", PROP_INTERFACE_FLAGS, NMDevicePrivate, interface_flags ),
|
||||||
NML_DBUS_META_PROPERTY_INIT_IGNORE ("Ip4Address", "u" ),
|
NML_DBUS_META_PROPERTY_INIT_IGNORE ("Ip4Address", "u" ),
|
||||||
|
|
@ -903,6 +912,19 @@ nm_device_class_init (NMDeviceClass *klass)
|
||||||
G_PARAM_READABLE |
|
G_PARAM_READABLE |
|
||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NMDevice:hw-address:
|
||||||
|
*
|
||||||
|
* The hardware address of the device.
|
||||||
|
*
|
||||||
|
* Since: 1.24
|
||||||
|
**/
|
||||||
|
obj_properties[PROP_HW_ADDRESS] =
|
||||||
|
g_param_spec_string (NM_DEVICE_HW_ADDRESS, "", "",
|
||||||
|
NULL,
|
||||||
|
G_PARAM_READABLE |
|
||||||
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
_nml_dbus_meta_class_init_with_properties (object_class, &_nml_dbus_meta_iface_nm_device);
|
_nml_dbus_meta_class_init_with_properties (object_class, &_nml_dbus_meta_iface_nm_device);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1081,6 +1103,50 @@ nm_device_get_type_description (NMDevice *device)
|
||||||
return _nml_coerce_property_str_not_empty (priv->type_description);
|
return _nml_coerce_property_str_not_empty (priv->type_description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NMLDBusNotifyUpdatePropFlags
|
||||||
|
_nm_device_notify_update_prop_hw_address (NMClient *client,
|
||||||
|
NMLDBusObject *dbobj,
|
||||||
|
const NMLDBusMetaIface *meta_iface,
|
||||||
|
guint dbus_property_idx,
|
||||||
|
GVariant *value)
|
||||||
|
{
|
||||||
|
NMDevice *self = NM_DEVICE (dbobj->nmobj);
|
||||||
|
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||||
|
gboolean is_new = (meta_iface == &_nml_dbus_meta_iface_nm_device);
|
||||||
|
gboolean changed = FALSE;
|
||||||
|
|
||||||
|
if ( !is_new
|
||||||
|
&& priv->hw_address_is_new) {
|
||||||
|
/* once the instance is marked to honor the new property, the
|
||||||
|
* changed signal for the old variant gets ignored. */
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
if (nm_clear_g_free (&priv->hw_address))
|
||||||
|
changed = TRUE;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
priv->hw_address_is_new = is_new;
|
||||||
|
|
||||||
|
nm_utils_strdup_reset (&priv->hw_address,
|
||||||
|
_nml_coerce_property_str_not_empty (g_variant_get_string (value, NULL)));
|
||||||
|
|
||||||
|
/* always emit a changed signal here, even if "priv->hw_address" might be unchanged.
|
||||||
|
* We want to emit the signal because we received a PropertiesChanged signal on D-Bus,
|
||||||
|
* even if nothing actually changed. */
|
||||||
|
changed = TRUE;
|
||||||
|
|
||||||
|
out:
|
||||||
|
if (changed) {
|
||||||
|
_nm_client_queue_notify_object (client,
|
||||||
|
self,
|
||||||
|
obj_properties[PROP_HW_ADDRESS]);
|
||||||
|
}
|
||||||
|
return NML_DBUS_NOTIFY_UPDATE_PROP_FLAGS_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_device_get_hw_address:
|
* nm_device_get_hw_address:
|
||||||
* @device: a #NMDevice
|
* @device: a #NMDevice
|
||||||
|
|
@ -1093,12 +1159,15 @@ nm_device_get_type_description (NMDevice *device)
|
||||||
const char *
|
const char *
|
||||||
nm_device_get_hw_address (NMDevice *device)
|
nm_device_get_hw_address (NMDevice *device)
|
||||||
{
|
{
|
||||||
|
NMDevicePrivate *priv;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
|
||||||
|
|
||||||
if (NM_DEVICE_GET_CLASS (device)->get_hw_address)
|
priv = NM_DEVICE_GET_PRIVATE (device);
|
||||||
return NM_DEVICE_GET_CLASS (device)->get_hw_address (device);
|
|
||||||
|
|
||||||
return NULL;
|
nm_assert (!nm_streq0 (priv->hw_address, ""));
|
||||||
|
|
||||||
|
return priv->hw_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ _NM_DEPRECATED_SYNC_WRITABLE_PROPERTY
|
||||||
#define NM_DEVICE_IP4_CONNECTIVITY "ip4-connectivity"
|
#define NM_DEVICE_IP4_CONNECTIVITY "ip4-connectivity"
|
||||||
#define NM_DEVICE_IP6_CONNECTIVITY "ip6-connectivity"
|
#define NM_DEVICE_IP6_CONNECTIVITY "ip6-connectivity"
|
||||||
#define NM_DEVICE_INTERFACE_FLAGS "interface-flags"
|
#define NM_DEVICE_INTERFACE_FLAGS "interface-flags"
|
||||||
|
#define NM_DEVICE_HW_ADDRESS "hw-address"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDevice:
|
* NMDevice:
|
||||||
|
|
|
||||||
|
|
@ -822,8 +822,6 @@ struct _NMDeviceClass {
|
||||||
|
|
||||||
const char *(*get_type_description) (NMDevice *device);
|
const char *(*get_type_description) (NMDevice *device);
|
||||||
|
|
||||||
const char *(*get_hw_address) (NMDevice *device);
|
|
||||||
|
|
||||||
GType (*get_setting_type) (NMDevice *device);
|
GType (*get_setting_type) (NMDevice *device);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1018,4 +1016,13 @@ void _nm_vpn_connection_state_changed_commit (NMVpnConnection *self,
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
NMLDBusNotifyUpdatePropFlags
|
||||||
|
_nm_device_notify_update_prop_hw_address (NMClient *client,
|
||||||
|
NMLDBusObject *dbobj,
|
||||||
|
const NMLDBusMetaIface *meta_iface,
|
||||||
|
guint dbus_property_idx,
|
||||||
|
GVariant *value);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
#endif /* __NM_LIBNM_UTILS_H__ */
|
#endif /* __NM_LIBNM_UTILS_H__ */
|
||||||
|
|
|
||||||
|
|
@ -17636,6 +17636,7 @@ static const NMDBusInterfaceInfoExtended interface_info_device = {
|
||||||
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Ip4Connectivity", "u", NM_DEVICE_IP4_CONNECTIVITY),
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Ip4Connectivity", "u", NM_DEVICE_IP4_CONNECTIVITY),
|
||||||
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Ip6Connectivity", "u", NM_DEVICE_IP6_CONNECTIVITY),
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Ip6Connectivity", "u", NM_DEVICE_IP6_CONNECTIVITY),
|
||||||
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("InterfaceFlags", "u", NM_DEVICE_INTERFACE_FLAGS),
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("InterfaceFlags", "u", NM_DEVICE_INTERFACE_FLAGS),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("HwAddress", "s", NM_DEVICE_HW_ADDRESS),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue