summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-07-10 08:27:04 +0200
committerThomas Haller <thaller@redhat.com>2018-07-24 09:39:09 +0200
commit87a60c4596d097913977f14ceca2c76fda517092 (patch)
tree12c14fc5a7b65e81b71ae9bc204fb56ee01fcea2
parent0cbf2c8c2ae3311bae688449dea4cfa21f4293e6 (diff)
downloadNetworkManager-87a60c4596d097913977f14ceca2c76fda517092.tar.gz
device: use NM_DEVICE_CLASS_DECLARE_TYPES() to set connection_type_supported of device class
the macro already does it just fine. Use it.
-rw-r--r--src/devices/nm-device-6lowpan.c3
-rw-r--r--src/devices/nm-device-dummy.c3
-rw-r--r--src/devices/nm-device-macsec.c4
-rw-r--r--src/devices/nm-device-macvlan.c3
-rw-r--r--src/devices/nm-device-tun.c3
-rw-r--r--src/devices/nm-device-vxlan.c3
-rw-r--r--src/devices/nm-device-wpan.c3
-rw-r--r--src/devices/nm-device.c1
-rw-r--r--src/devices/ovs/nm-device-ovs-interface.c3
9 files changed, 9 insertions, 17 deletions
diff --git a/src/devices/nm-device-6lowpan.c b/src/devices/nm-device-6lowpan.c
index 63622b49e9..526a171972 100644
--- a/src/devices/nm-device-6lowpan.c
+++ b/src/devices/nm-device-6lowpan.c
@@ -296,14 +296,13 @@ nm_device_6lowpan_class_init (NMDevice6LowpanClass *klass)
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
- NM_DEVICE_CLASS_DECLARE_TYPES (klass, NULL, NM_LINK_TYPE_6LOWPAN);
+ NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_6LOWPAN_SETTING_NAME, NM_LINK_TYPE_6LOWPAN);
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_6lowpan);
device_class->act_stage1_prepare = act_stage1_prepare;
device_class->check_connection_compatible = check_connection_compatible;
device_class->complete_connection = complete_connection;
- device_class->connection_type_supported = NM_SETTING_6LOWPAN_SETTING_NAME;
device_class->create_and_realize = create_and_realize;
device_class->get_generic_capabilities = get_generic_capabilities;
device_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired;
diff --git a/src/devices/nm-device-dummy.c b/src/devices/nm-device-dummy.c
index fe805cf9c5..a85efa590d 100644
--- a/src/devices/nm-device-dummy.c
+++ b/src/devices/nm-device-dummy.c
@@ -173,11 +173,10 @@ nm_device_dummy_class_init (NMDeviceDummyClass *klass)
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
- NM_DEVICE_CLASS_DECLARE_TYPES (klass, NULL, NM_LINK_TYPE_DUMMY);
+ NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_DUMMY_SETTING_NAME, NM_LINK_TYPE_DUMMY);
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_dummy);
- device_class->connection_type_supported = NM_SETTING_DUMMY_SETTING_NAME;
device_class->complete_connection = complete_connection;
device_class->check_connection_compatible = check_connection_compatible;
device_class->create_and_realize = create_and_realize;
diff --git a/src/devices/nm-device-macsec.c b/src/devices/nm-device-macsec.c
index 9b691b8dc1..f8977e5e8f 100644
--- a/src/devices/nm-device-macsec.c
+++ b/src/devices/nm-device-macsec.c
@@ -843,7 +843,7 @@ nm_device_macsec_class_init (NMDeviceMacsecClass *klass)
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
- NM_DEVICE_CLASS_DECLARE_TYPES (klass, NULL, NM_LINK_TYPE_MACSEC);
+ NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_MACSEC_SETTING_NAME, NM_LINK_TYPE_MACSEC);
object_class->get_property = get_property;
object_class->dispose = dispose;
@@ -861,8 +861,6 @@ nm_device_macsec_class_init (NMDeviceMacsecClass *klass)
device_class->state_changed = device_state_changed;
device_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired;
- device_class->connection_type_supported = NM_SETTING_MACSEC_SETTING_NAME;
-
obj_properties[PROP_SCI] =
g_param_spec_uint64 (NM_DEVICE_MACSEC_SCI, "", "",
0, G_MAXUINT64, 0,
diff --git a/src/devices/nm-device-macvlan.c b/src/devices/nm-device-macvlan.c
index f1f185c8a7..51ac225ef4 100644
--- a/src/devices/nm-device-macvlan.c
+++ b/src/devices/nm-device-macvlan.c
@@ -495,7 +495,7 @@ nm_device_macvlan_class_init (NMDeviceMacvlanClass *klass)
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
- NM_DEVICE_CLASS_DECLARE_TYPES (klass, NULL, NM_LINK_TYPE_MACVLAN, NM_LINK_TYPE_MACVTAP);
+ NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_MACVLAN_SETTING_NAME, NM_LINK_TYPE_MACVLAN, NM_LINK_TYPE_MACVTAP);
object_class->get_property = get_property;
object_class->set_property = set_property;
@@ -505,7 +505,6 @@ nm_device_macvlan_class_init (NMDeviceMacvlanClass *klass)
device_class->act_stage1_prepare = act_stage1_prepare;
device_class->check_connection_compatible = check_connection_compatible;
device_class->complete_connection = complete_connection;
- device_class->connection_type_supported = NM_SETTING_MACVLAN_SETTING_NAME;
device_class->create_and_realize = create_and_realize;
device_class->get_generic_capabilities = get_generic_capabilities;
device_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired;
diff --git a/src/devices/nm-device-tun.c b/src/devices/nm-device-tun.c
index 1c95b84518..d09d2e8af7 100644
--- a/src/devices/nm-device-tun.c
+++ b/src/devices/nm-device-tun.c
@@ -430,13 +430,12 @@ nm_device_tun_class_init (NMDeviceTunClass *klass)
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
- NM_DEVICE_CLASS_DECLARE_TYPES (klass, NULL, NM_LINK_TYPE_TUN);
+ NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_TUN_SETTING_NAME, NM_LINK_TYPE_TUN);
object_class->get_property = get_property;
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_tun);
- device_class->connection_type_supported = NM_SETTING_TUN_SETTING_NAME;
device_class->link_changed = link_changed;
device_class->complete_connection = complete_connection;
device_class->check_connection_compatible = check_connection_compatible;
diff --git a/src/devices/nm-device-vxlan.c b/src/devices/nm-device-vxlan.c
index 30436ed2bc..fd9c80f91c 100644
--- a/src/devices/nm-device-vxlan.c
+++ b/src/devices/nm-device-vxlan.c
@@ -577,7 +577,7 @@ nm_device_vxlan_class_init (NMDeviceVxlanClass *klass)
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
- NM_DEVICE_CLASS_DECLARE_TYPES (klass, NULL, NM_LINK_TYPE_VXLAN);
+ NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_VXLAN_SETTING_NAME, NM_LINK_TYPE_VXLAN);
object_class->get_property = get_property;
@@ -585,7 +585,6 @@ nm_device_vxlan_class_init (NMDeviceVxlanClass *klass)
device_class->link_changed = link_changed;
device_class->unrealize_notify = unrealize_notify;
- device_class->connection_type_supported = NM_SETTING_VXLAN_SETTING_NAME;
device_class->create_and_realize = create_and_realize;
device_class->check_connection_compatible = check_connection_compatible;
device_class->complete_connection = complete_connection;
diff --git a/src/devices/nm-device-wpan.c b/src/devices/nm-device-wpan.c
index 59e9efbfc4..e444d64afa 100644
--- a/src/devices/nm-device-wpan.c
+++ b/src/devices/nm-device-wpan.c
@@ -213,11 +213,10 @@ nm_device_wpan_class_init (NMDeviceWpanClass *klass)
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
- NM_DEVICE_CLASS_DECLARE_TYPES (klass, NULL, NM_LINK_TYPE_WPAN);
+ NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_WPAN_SETTING_NAME, NM_LINK_TYPE_WPAN);
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_wpan);
- device_class->connection_type_supported = NM_SETTING_WPAN_SETTING_NAME;
device_class->complete_connection = complete_connection;
device_class->check_connection_compatible = check_connection_compatible;
device_class->update_connection = update_connection;
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index ea3649014a..d816e64136 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -5239,6 +5239,7 @@ nm_device_generate_connection (NMDevice *self,
NM_SETTING_CONNECTION_INTERFACE_NAME, ifname,
NM_SETTING_CONNECTION_TIMESTAMP, (guint64) time (NULL),
NULL);
+
if (klass->connection_type_supported)
g_object_set (s_con, NM_SETTING_CONNECTION_TYPE, klass->connection_type_supported, NULL);
diff --git a/src/devices/ovs/nm-device-ovs-interface.c b/src/devices/ovs/nm-device-ovs-interface.c
index d8217330cf..95d8a86a5c 100644
--- a/src/devices/ovs/nm-device-ovs-interface.c
+++ b/src/devices/ovs/nm-device-ovs-interface.c
@@ -199,11 +199,10 @@ nm_device_ovs_interface_class_init (NMDeviceOvsInterfaceClass *klass)
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
- NM_DEVICE_CLASS_DECLARE_TYPES (klass, NULL, NM_LINK_TYPE_OPENVSWITCH);
+ NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_OVS_INTERFACE_SETTING_NAME, NM_LINK_TYPE_OPENVSWITCH);
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_ovs_interface);
- device_class->connection_type_supported = NM_SETTING_OVS_INTERFACE_SETTING_NAME;
device_class->get_type_description = get_type_description;
device_class->create_and_realize = create_and_realize;
device_class->get_generic_capabilities = get_generic_capabilities;