[RFC PATCH 2/8] wifi: Move KnownNetworkData to nm-iwd-manger.h



---
 src/devices/wifi/nm-iwd-manager.c | 17 ++++++-----------
 src/devices/wifi/nm-iwd-manager.h |  5 +++++
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/devices/wifi/nm-iwd-manager.c b/src/devices/wifi/nm-iwd-manager.c
index 39db3a04c..2da6db0e4 100644
--- a/src/devices/wifi/nm-iwd-manager.c
+++ b/src/devices/wifi/nm-iwd-manager.c
@@ -33,11 +33,6 @@
 
 /*****************************************************************************/
 
-typedef struct {
-       gchar *name;
-       NMIwdNetworkSecurity security;
-} KnownNetworkData;
-
 typedef struct {
        NMManager *manager;
        GCancellable *cancellable;
@@ -351,7 +346,7 @@ object_added (NMIwdManager *self, GDBusObject *object)
 }
 
 static void
-known_network_free (KnownNetworkData *network)
+known_network_free (NMIwdKnownNetworkData *network)
 {
        g_free (network->name);
        g_free (network);
@@ -384,7 +379,7 @@ list_known_networks_cb (GObject *source, GAsyncResult *res, gpointer user_data)
                const gchar *name = NULL;
                const gchar *type = NULL;
                GVariant *val;
-               KnownNetworkData *network_data;
+               NMIwdKnownNetworkData *network_data;
 
                while (g_variant_iter_next (props, "{&sv}", &key, &val)) {
                        if (!strcmp (key, "Name"))
@@ -399,7 +394,7 @@ list_known_networks_cb (GObject *source, GAsyncResult *res, gpointer user_data)
                if (!name || !type)
                        goto next;
 
-               network_data = g_new (KnownNetworkData, 1);
+               network_data = g_new (NMIwdKnownNetworkData, 1);
                network_data->name = g_strdup (name);
                if (!strcmp (type, "open"))
                        network_data->security = NM_IWD_NETWORK_SECURITY_NONE;
@@ -601,7 +596,7 @@ nm_iwd_manager_is_known_network (NMIwdManager *self, const gchar *name,
        const GSList *iter;
 
        for (iter = priv->known_networks; iter; iter = g_slist_next (iter)) {
-               const KnownNetworkData *network = iter->data;
+               const NMIwdKnownNetworkData *network = iter->data;
 
                if (!strcmp (network->name, name) && network->security == security)
                        return true;
@@ -615,12 +610,12 @@ nm_iwd_manager_network_connected (NMIwdManager *self, const gchar *name,
                                   NMIwdNetworkSecurity security)
 {
        NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE (self);
-       KnownNetworkData *network_data;
+       NMIwdKnownNetworkData *network_data;
 
        if (nm_iwd_manager_is_known_network (self, name, security))
                return;
 
-       network_data = g_new (KnownNetworkData, 1);
+       network_data = g_new (NMIwdKnownNetworkData, 1);
        network_data->name = g_strdup (name);
        network_data->security = security;
        priv->known_networks = g_slist_append (priv->known_networks, network_data);
diff --git a/src/devices/wifi/nm-iwd-manager.h b/src/devices/wifi/nm-iwd-manager.h
index 8e6b66ff2..80b430f0f 100644
--- a/src/devices/wifi/nm-iwd-manager.h
+++ b/src/devices/wifi/nm-iwd-manager.h
@@ -43,6 +43,11 @@ typedef enum {
        NM_IWD_NETWORK_SECURITY_8021X,
 } NMIwdNetworkSecurity;
 
+typedef struct {
+       gchar *name;
+       NMIwdNetworkSecurity security;
+} NMIwdKnownNetworkData;
+
 #define NM_TYPE_IWD_MANAGER              (nm_iwd_manager_get_type ())
 #define NM_IWD_MANAGER(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IWD_MANAGER, 
NMIwdManager))
 #define NM_IWD_MANAGER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass),  NM_TYPE_IWD_MANAGER, 
NMIwdManagerClass))
-- 
2.14.1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]