summary refs log tree commit diff
path: root/libnm/nm-device-wpan.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-10-05 22:27:18 +0200
committerMichael Biebl <biebl@debian.org>2020-10-05 22:27:18 +0200
commitaafc1dbe4712c86189bbc1d4d54ad8cb4c69be7e (patch)
treea2a9bb4d007339a0b1304540388230ccedac32bd /libnm/nm-device-wpan.c
parente7b44ef4c80907346ec7492a09c45277459924fc (diff)
New upstream version 1.27.90 upstream/1.27.90
Diffstat (limited to 'libnm/nm-device-wpan.c')
-rw-r--r--libnm/nm-device-wpan.c75
1 files changed, 39 insertions, 36 deletions
diff --git a/libnm/nm-device-wpan.c b/libnm/nm-device-wpan.c
index 8a52e031..83597c62 100644
--- a/libnm/nm-device-wpan.c
+++ b/libnm/nm-device-wpan.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: LGPL-2.1+
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /*
  * Copyright (C) 2018 Lubomir Rintel <lkundrak@v3.sk>
  */
@@ -14,14 +14,14 @@
 /*****************************************************************************/
 
 struct _NMDeviceWpan {
-	NMDevice parent;
+    NMDevice parent;
 };
 
 struct _NMDeviceWpanClass {
-	NMDeviceClass parent;
+    NMDeviceClass parent;
 };
 
-G_DEFINE_TYPE (NMDeviceWpan, nm_device_wpan, NM_TYPE_DEVICE)
+G_DEFINE_TYPE(NMDeviceWpan, nm_device_wpan, NM_TYPE_DEVICE)
 /*****************************************************************************/
 
 /**
@@ -36,55 +36,58 @@ G_DEFINE_TYPE (NMDeviceWpan, nm_device_wpan, NM_TYPE_DEVICE)
  * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
  **/
 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 nm_device_get_hw_address (NM_DEVICE (device));
+    return nm_device_get_hw_address(NM_DEVICE(device));
 }
 
 static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
+connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
 {
-	if (!NM_DEVICE_CLASS (nm_device_wpan_parent_class)->connection_compatible (device, connection, error))
-		return FALSE;
-
-	if (!nm_connection_is_type (connection, NM_SETTING_WPAN_SETTING_NAME)) {
-		g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
-		                     _("The connection was not a wpan connection."));
-		return FALSE;
-	}
-
-	return TRUE;
+    if (!NM_DEVICE_CLASS(nm_device_wpan_parent_class)
+             ->connection_compatible(device, connection, error))
+        return FALSE;
+
+    if (!nm_connection_is_type(connection, NM_SETTING_WPAN_SETTING_NAME)) {
+        g_set_error_literal(error,
+                            NM_DEVICE_ERROR,
+                            NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
+                            _("The connection was not a wpan connection."));
+        return FALSE;
+    }
+
+    return TRUE;
 }
 
 static GType
-get_setting_type (NMDevice *device)
+get_setting_type(NMDevice *device)
 {
-	return NM_TYPE_SETTING_WPAN;
+    return NM_TYPE_SETTING_WPAN;
 }
 
 /*****************************************************************************/
 
 static void
-nm_device_wpan_init (NMDeviceWpan *device)
-{
-}
-
-const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_wpan = NML_DBUS_META_IFACE_INIT (
-	NM_DBUS_INTERFACE_DEVICE_WPAN,
-	nm_device_wpan_get_type,
-	NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
-	NML_DBUS_META_IFACE_DBUS_PROPERTIES (
-		NML_DBUS_META_PROPERTY_INIT_FCN ("HwAddress", 0, "s", _nm_device_notify_update_prop_hw_address ),
-	),
-);
+nm_device_wpan_init(NMDeviceWpan *device)
+{}
+
+const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_wpan = NML_DBUS_META_IFACE_INIT(
+    NM_DBUS_INTERFACE_DEVICE_WPAN,
+    nm_device_wpan_get_type,
+    NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_HIGH,
+    NML_DBUS_META_IFACE_DBUS_PROPERTIES(
+        NML_DBUS_META_PROPERTY_INIT_FCN("HwAddress",
+                                        0,
+                                        "s",
+                                        _nm_device_notify_update_prop_hw_address), ), );
 
 static void
-nm_device_wpan_class_init (NMDeviceWpanClass *wpan_class)
+nm_device_wpan_class_init(NMDeviceWpanClass *wpan_class)
 {
-	NMDeviceClass *device_class = NM_DEVICE_CLASS (wpan_class);
+    NMDeviceClass *device_class = NM_DEVICE_CLASS(wpan_class);
 
-	device_class->connection_compatible = connection_compatible;
-	device_class->get_setting_type      = get_setting_type;
+    device_class->connection_compatible = connection_compatible;
+    device_class->get_setting_type      = get_setting_type;
 }