mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-02 11:10:16 +01:00
device: use NM_DEVICE_CLASS_DECLARE_TYPES() to set connection_type_supported of device class
the macro already does it just fine. Use it.
This commit is contained in:
parent
0cbf2c8c2a
commit
87a60c4596
9 changed files with 9 additions and 17 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue