[network-manager-applet/danw/libnm-bgo736911: 6/9] wireless-security: build separate libnm-based and libnm-glib-based versions



commit 333167810af50bcbe1f6c7532b147f63acda8af1
Author: Dan Winship <danw redhat com>
Date:   Tue Nov 25 10:00:33 2014 -0500

    wireless-security: build separate libnm-based and libnm-glib-based versions
    
    Also, drop the "ssid" parameter from wireless_security_validate(),
    since it would need to be different between the two versions, but it
    turns out it's not actually used anyway.

 src/Makefile.am                             |    2 +-
 src/connection-editor/Makefile.am           |    2 +-
 src/connection-editor/page-8021x-security.c |    2 +-
 src/connection-editor/page-wifi-security.c  |    2 +-
 src/ethernet-dialog.c                       |    2 +-
 src/libnm-gtk/Makefile.am                   |    2 +-
 src/libnm-gtk/nm-wifi-dialog.c              |    4 +-
 src/wireless-security/Makefile.am           |   28 +++++++++++++++++++++++---
 src/wireless-security/eap-method-fast.c     |    5 +---
 src/wireless-security/eap-method-leap.c     |    3 +-
 src/wireless-security/eap-method-peap.c     |    5 +---
 src/wireless-security/eap-method-simple.c   |    4 +--
 src/wireless-security/eap-method-tls.c      |    5 +---
 src/wireless-security/eap-method-ttls.c     |    5 +---
 src/wireless-security/eap-method.c          |   24 ++++++++++++++++++++--
 src/wireless-security/eap-method.h          |    8 ++++++-
 src/wireless-security/helpers.c             |    2 +-
 src/wireless-security/helpers.h             |    9 +++++++-
 src/wireless-security/wireless-security.c   |   12 ++--------
 src/wireless-security/wireless-security.h   |   12 ++++++++--
 src/wireless-security/ws-dynamic-wep.c      |    5 +--
 src/wireless-security/ws-dynamic-wep.h      |    8 ++++++-
 src/wireless-security/ws-leap.c             |    5 +--
 src/wireless-security/ws-leap.h             |    8 ++++++-
 src/wireless-security/ws-wep-key.c          |    7 +----
 src/wireless-security/ws-wep-key.h          |    8 ++++++-
 src/wireless-security/ws-wpa-eap.c          |    5 +--
 src/wireless-security/ws-wpa-eap.h          |    8 ++++++-
 src/wireless-security/ws-wpa-psk.c          |    5 +--
 src/wireless-security/ws-wpa-psk.h          |   10 ++++++++-
 30 files changed, 134 insertions(+), 73 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 1d899fc..ee2e7f2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -78,7 +78,7 @@ nm_applet_LDADD = \
        $(LIBSECRET_LIBS) \
        $(NOTIFY_LIBS) \
        ${top_builddir}/src/utils/libutils-libnm-glib.la \
-       ${top_builddir}/src/wireless-security/libwireless-security.la \
+       ${top_builddir}/src/wireless-security/libwireless-security-libnm-glib.la \
        ${top_builddir}/src/libnm-gtk/libnm-gtk.la
 
 if WITH_MODEM_MANAGER_1
diff --git a/src/connection-editor/Makefile.am b/src/connection-editor/Makefile.am
index ccff613..cd5507b 100644
--- a/src/connection-editor/Makefile.am
+++ b/src/connection-editor/Makefile.am
@@ -87,7 +87,7 @@ nm-connection-editor-service-glue.h: $(top_srcdir)/src/connection-editor/nm-conn
        $(AM_V_GEN) dbus-binding-tool --prefix=nm_connection_editor_service --mode=glib-server --output=$@ $<
 
 nm_connection_editor_LDADD = \
-       ${top_builddir}/src/wireless-security/libwireless-security.la \
+       ${top_builddir}/src/wireless-security/libwireless-security-libnm-glib.la \
        ${top_builddir}/src/utils/libutils-libnm-glib.la \
        ${top_builddir}/src/libnm-gtk/libnm-gtk.la \
        $(GTK_LIBS) \
diff --git a/src/connection-editor/page-8021x-security.c b/src/connection-editor/page-8021x-security.c
index 5aca1e3..69968aa 100644
--- a/src/connection-editor/page-8021x-security.c
+++ b/src/connection-editor/page-8021x-security.c
@@ -153,7 +153,7 @@ validate (CEPage *page, NMConnection *connection, GError **error)
                NMSetting *s_8021x;
 
                /* FIXME: get failed property and error out of wireless security objects */
-               valid = wireless_security_validate (priv->security, NULL);
+               valid = wireless_security_validate (priv->security);
                if (valid) {
                        NMSetting *s_con;
 
diff --git a/src/connection-editor/page-wifi-security.c b/src/connection-editor/page-wifi-security.c
index e0d00b8..d2d09c6 100644
--- a/src/connection-editor/page-wifi-security.c
+++ b/src/connection-editor/page-wifi-security.c
@@ -485,7 +485,7 @@ validate (CEPage *page, NMConnection *connection, GError **error)
 
                if (ssid) {
                        /* FIXME: get failed property and error out of wifi security objects */
-                       valid = wireless_security_validate (sec, ssid);
+                       valid = wireless_security_validate (sec);
                        if (valid)
                                wireless_security_fill_connection (sec, connection);
                        else
diff --git a/src/ethernet-dialog.c b/src/ethernet-dialog.c
index 26d0053..9fd7c1a 100644
--- a/src/ethernet-dialog.c
+++ b/src/ethernet-dialog.c
@@ -40,7 +40,7 @@ stuff_changed_cb (WirelessSecurity *sec, gpointer user_data)
 {
        GtkWidget *button = GTK_WIDGET (user_data);
        
-       gtk_widget_set_sensitive (button, wireless_security_validate (sec, NULL));
+       gtk_widget_set_sensitive (button, wireless_security_validate (sec));
 }
 
 static void
diff --git a/src/libnm-gtk/Makefile.am b/src/libnm-gtk/Makefile.am
index b63c67c..f2f44c9 100644
--- a/src/libnm-gtk/Makefile.am
+++ b/src/libnm-gtk/Makefile.am
@@ -46,7 +46,7 @@ libnm_gtk_la_LIBADD = \
        $(GTK_LIBS) \
        $(NMA_LIBS) \
        $(GUDEV_LIBS) \
-       $(top_builddir)/src/wireless-security/libwireless-security.la
+       $(top_builddir)/src/wireless-security/libwireless-security-libnm-glib.la
 
 libnm_gtk_la_LDFLAGS = -Wl,-no-undefined \
        -export-symbols-regex '^nma_.*'
diff --git a/src/libnm-gtk/nm-wifi-dialog.c b/src/libnm-gtk/nm-wifi-dialog.c
index ace323b..712e208 100644
--- a/src/libnm-gtk/nm-wifi-dialog.c
+++ b/src/libnm-gtk/nm-wifi-dialog.c
@@ -261,7 +261,7 @@ stuff_changed_cb (WirelessSecurity *sec, gpointer user_data)
        }
 
        if (ssid) {
-               valid = wireless_security_validate (sec, ssid);
+               valid = wireless_security_validate (sec);
                if (free_ssid)
                        g_byte_array_free (ssid, TRUE);
        }
@@ -301,7 +301,7 @@ ssid_entry_changed (GtkWidget *entry, gpointer user_data)
                gtk_tree_model_get (model, &iter, S_SEC_COLUMN, &sec, -1);
 
        if (sec) {
-               valid = wireless_security_validate (sec, ssid);
+               valid = wireless_security_validate (sec);
                wireless_security_unref (sec);
        } else {
                valid = TRUE;
diff --git a/src/wireless-security/Makefile.am b/src/wireless-security/Makefile.am
index 78d5263..cb91106 100644
--- a/src/wireless-security/Makefile.am
+++ b/src/wireless-security/Makefile.am
@@ -1,6 +1,8 @@
-noinst_LTLIBRARIES = libwireless-security.la
+noinst_LTLIBRARIES = \
+       libwireless-security-libnm-glib.la \
+       libwireless-security-libnm.la
 
-libwireless_security_la_SOURCES = \
+wireless_security_sources = \
        wireless-security.h \
        wireless-security.c \
        ws-wep-key.h \
@@ -30,18 +32,36 @@ libwireless_security_la_SOURCES = \
        helpers.h \
        helpers.c
 
-libwireless_security_la_CPPFLAGS = \
+libwireless_security_libnm_glib_la_SOURCES = \
+       $(wireless_security_sources)
+
+libwireless_security_libnm_glib_la_CPPFLAGS = \
        $(GTK_CFLAGS) \
        -DUIDIR=\""$(uidir)"\" \
        -DLIBNM_GLIB_BUILD \
        $(NMA_CFLAGS) \
        -I${top_srcdir}/src/utils
 
-libwireless_security_la_LIBADD = \
+libwireless_security_libnm_glib_la_LIBADD = \
        $(GTK_LIBS) \
        $(NMA_LIBS) \
        ${top_builddir}/src/utils/libutils-libnm-glib.la
 
+libwireless_security_libnm_la_SOURCES = \
+       $(wireless_security_sources)
+
+libwireless_security_libnm_la_CPPFLAGS = \
+       $(GTK_CFLAGS) \
+       -DUIDIR=\""$(uidir)"\" \
+       -DLIBNM_BUILD \
+       $(LIBNM_CFLAGS) \
+       -I${top_srcdir}/src/utils
+
+libwireless_security_libnm_la_LIBADD = \
+       $(GTK_LIBS) \
+       $(LIBNM_LIBS) \
+       ${top_builddir}/src/utils/libutils-libnm.la
+
 uidir = $(datadir)/nm-applet
 ui_DATA = \
        eap-method-leap.ui \
diff --git a/src/wireless-security/eap-method-fast.c b/src/wireless-security/eap-method-fast.c
index 47f3d70..1071e76 100644
--- a/src/wireless-security/eap-method-fast.c
+++ b/src/wireless-security/eap-method-fast.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2012 Red Hat, Inc.
+ * Copyright 2012 - 2014 Red Hat, Inc.
  */
 
 #include "config.h"
@@ -26,9 +26,6 @@
 #include <ctype.h>
 #include <string.h>
 
-#include <nm-setting-connection.h>
-#include <nm-setting-8021x.h>
-
 #include "eap-method.h"
 #include "wireless-security.h"
 
diff --git a/src/wireless-security/eap-method-leap.c b/src/wireless-security/eap-method-leap.c
index 3f0b446..e446409 100644
--- a/src/wireless-security/eap-method-leap.c
+++ b/src/wireless-security/eap-method-leap.c
@@ -17,12 +17,11 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include <ctype.h>
 #include <string.h>
-#include <nm-setting-8021x.h>
 
 #include "eap-method.h"
 #include "wireless-security.h"
diff --git a/src/wireless-security/eap-method-peap.c b/src/wireless-security/eap-method-peap.c
index d4fa7db..623f854 100644
--- a/src/wireless-security/eap-method-peap.c
+++ b/src/wireless-security/eap-method-peap.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include "config.h"
@@ -26,9 +26,6 @@
 #include <ctype.h>
 #include <string.h>
 
-#include <nm-setting-connection.h>
-#include <nm-setting-8021x.h>
-
 #include "eap-method.h"
 #include "wireless-security.h"
 
diff --git a/src/wireless-security/eap-method-simple.c b/src/wireless-security/eap-method-simple.c
index 427bb9f..6cd3765 100644
--- a/src/wireless-security/eap-method-simple.c
+++ b/src/wireless-security/eap-method-simple.c
@@ -17,13 +17,11 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2011 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include <ctype.h>
 #include <string.h>
-#include <nm-setting-8021x.h>
-#include <nm-setting-connection.h>
 
 #include "eap-method.h"
 #include "wireless-security.h"
diff --git a/src/wireless-security/eap-method-tls.c b/src/wireless-security/eap-method-tls.c
index 6daa8f8..5e84358 100644
--- a/src/wireless-security/eap-method-tls.c
+++ b/src/wireless-security/eap-method-tls.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include "config.h"
@@ -26,9 +26,6 @@
 #include <ctype.h>
 #include <string.h>
 
-#include <nm-setting-connection.h>
-#include <nm-setting-8021x.h>
-
 #include "eap-method.h"
 #include "wireless-security.h"
 #include "helpers.h"
diff --git a/src/wireless-security/eap-method-ttls.c b/src/wireless-security/eap-method-ttls.c
index 294734d..d004373 100644
--- a/src/wireless-security/eap-method-ttls.c
+++ b/src/wireless-security/eap-method-ttls.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include "config.h"
@@ -26,9 +26,6 @@
 #include <ctype.h>
 #include <string.h>
 
-#include <nm-setting-connection.h>
-#include <nm-setting-8021x.h>
-
 #include "eap-method.h"
 #include "wireless-security.h"
 
diff --git a/src/wireless-security/eap-method.c b/src/wireless-security/eap-method.c
index 1adc2b5..2218353 100644
--- a/src/wireless-security/eap-method.c
+++ b/src/wireless-security/eap-method.c
@@ -18,7 +18,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2012 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include "config.h"
@@ -32,8 +32,6 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include <nm-setting-connection.h>
-#include <nm-setting-8021x.h>
 #include "eap-method.h"
 #include "nm-utils.h"
 
@@ -264,6 +262,7 @@ out:
        return success;
 }
 
+#ifdef LIBNM_GLIB_BUILD
 static const char *
 find_tag (const char *tag, const char *buf, gsize len)
 {
@@ -391,23 +390,33 @@ out:
        close (fd);
        return success;
 }
+#endif
 
 static gboolean
 default_filter_privkey (const GtkFileFilterInfo *filter_info, gpointer user_data)
 {
+#ifdef LIBNM_GLIB_BUILD
        const char *extensions[] = { ".der", ".pem", ".p12", ".key", NULL };
+#endif
        gboolean require_encrypted = !!user_data;
        gboolean is_encrypted = TRUE;
 
        if (!filter_info->filename)
                return FALSE;
 
+#if defined (LIBNM_GLIB_BUILD)
        if (!file_has_extension (filter_info->filename, extensions))
                return FALSE;
 
        if (   !file_is_der_or_pem (filter_info->filename, TRUE, &is_encrypted)
            && !nm_utils_file_is_pkcs12 (filter_info->filename))
                return FALSE;
+#elif defined (LIBNM_BUILD)
+       if (!nm_utils_file_is_private_key (filter_info->filename, &is_encrypted))
+               return FALSE;
+#else
+#error neither LIBNM_BUILD nor LIBNM_GLIB_BUILD defined
+#endif
 
        return require_encrypted ? is_encrypted : TRUE;
 }
@@ -415,16 +424,25 @@ default_filter_privkey (const GtkFileFilterInfo *filter_info, gpointer user_data
 static gboolean
 default_filter_cert (const GtkFileFilterInfo *filter_info, gpointer user_data)
 {
+#ifdef LIBNM_GLIB_BUILD
        const char *extensions[] = { ".der", ".pem", ".crt", ".cer", NULL };
+#endif
 
        if (!filter_info->filename)
                return FALSE;
 
+#if defined (LIBNM_GLIB_BUILD)
        if (!file_has_extension (filter_info->filename, extensions))
                return FALSE;
 
        if (!file_is_der_or_pem (filter_info->filename, FALSE, NULL))
                return FALSE;
+#elif defined (LIBNM_BUILD)
+       if (!nm_utils_file_is_certificate (filter_info->filename))
+               return FALSE;
+#else
+#error neither LIBNM_BUILD nor LIBNM_GLIB_BUILD defined
+#endif
 
        return TRUE;
 }
diff --git a/src/wireless-security/eap-method.h b/src/wireless-security/eap-method.h
index cf02081..e2ceb0a 100644
--- a/src/wireless-security/eap-method.h
+++ b/src/wireless-security/eap-method.h
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2012 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #ifndef EAP_METHOD_H
@@ -26,8 +26,14 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 
+#if defined (LIBNM_BUILD)
+#include <NetworkManager.h>
+#elif defined (LIBNM_GLIB_BUILD)
 #include <nm-connection.h>
 #include <nm-setting-8021x.h>
+#else
+#error neither LIBNM_BUILD nor LIBNM_GLIB_BUILD defined
+#endif
 
 typedef struct _EAPMethod EAPMethod;
 
diff --git a/src/wireless-security/helpers.c b/src/wireless-security/helpers.c
index 5d7941d..b972dc0 100644
--- a/src/wireless-security/helpers.c
+++ b/src/wireless-security/helpers.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2009 Red Hat, Inc.
+ * Copyright 2009 - 2014 Red Hat, Inc.
  */
 
 #include "helpers.h"
diff --git a/src/wireless-security/helpers.h b/src/wireless-security/helpers.h
index 75c01ea..bdd58b0 100644
--- a/src/wireless-security/helpers.h
+++ b/src/wireless-security/helpers.h
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2009 Red Hat, Inc.
+ * Copyright 2009 - 2014 Red Hat, Inc.
  */
 
 #ifndef _HELPERS_H_
@@ -25,8 +25,15 @@
 
 #include <glib.h>
 #include <gtk/gtk.h>
+
+#if defined (LIBNM_BUILD)
+#include <NetworkManager.h>
+#elif defined (LIBNM_GLIB_BUILD)
 #include <nm-connection.h>
 #include <nm-setting.h>
+#else
+#error neither LIBNM_BUILD nor LIBNM_GLIB_BUILD defined
+#endif
 
 typedef const char * (*HelperSecretFunc)(NMSetting *);
 
diff --git a/src/wireless-security/wireless-security.c b/src/wireless-security/wireless-security.c
index 7e009d5..12fee1e 100644
--- a/src/wireless-security/wireless-security.c
+++ b/src/wireless-security/wireless-security.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2012 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include "config.h"
@@ -28,12 +28,6 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
-#include <nm-setting-connection.h>
-#include <nm-setting-wired.h>
-#include <nm-setting-wireless.h>
-#include <nm-setting-wireless-security.h>
-#include <nm-setting-8021x.h>
-
 #include "wireless-security.h"
 #include "eap-method.h"
 
@@ -68,12 +62,12 @@ wireless_security_changed_cb (GtkWidget *ignored, gpointer user_data)
 }
 
 gboolean
-wireless_security_validate (WirelessSecurity *sec, const GByteArray *ssid)
+wireless_security_validate (WirelessSecurity *sec)
 {
        g_return_val_if_fail (sec != NULL, FALSE);
 
        g_assert (sec->validate);
-       return (*(sec->validate)) (sec, ssid);
+       return (*(sec->validate)) (sec);
 }
 
 void
diff --git a/src/wireless-security/wireless-security.h b/src/wireless-security/wireless-security.h
index 4a1a4fe..93a53a3 100644
--- a/src/wireless-security/wireless-security.h
+++ b/src/wireless-security/wireless-security.h
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #ifndef WIRELESS_SECURITY_H
@@ -26,7 +26,13 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 
+#if defined (LIBNM_BUILD)
+#include <NetworkManager.h>
+#elif defined (LIBNM_GLIB_BUILD)
 #include <nm-connection.h>
+#else
+#error neither LIBNM_BUILD nor LIBNM_GLIB_BUILD defined
+#endif
 
 typedef struct _WirelessSecurity WirelessSecurity;
 
@@ -36,7 +42,7 @@ typedef void (*WSAddToSizeGroupFunc) (WirelessSecurity *sec, GtkSizeGroup *group
 typedef void (*WSFillConnectionFunc) (WirelessSecurity *sec, NMConnection *connection);
 typedef void (*WSUpdateSecretsFunc)  (WirelessSecurity *sec, NMConnection *connection);
 typedef void (*WSDestroyFunc)        (WirelessSecurity *sec);
-typedef gboolean (*WSValidateFunc)   (WirelessSecurity *sec, const GByteArray *ssid);
+typedef gboolean (*WSValidateFunc)   (WirelessSecurity *sec);
 typedef GtkWidget * (*WSNagUserFunc) (WirelessSecurity *sec);
 
 struct _WirelessSecurity {
@@ -68,7 +74,7 @@ void wireless_security_set_changed_notify (WirelessSecurity *sec,
                                            WSChangedFunc func,
                                            gpointer user_data);
 
-gboolean wireless_security_validate (WirelessSecurity *sec, const GByteArray *ssid);
+gboolean wireless_security_validate (WirelessSecurity *sec);
 
 void wireless_security_add_to_size_group (WirelessSecurity *sec,
                                           GtkSizeGroup *group);
diff --git a/src/wireless-security/ws-dynamic-wep.c b/src/wireless-security/ws-dynamic-wep.c
index e7c85fa..a450edb 100644
--- a/src/wireless-security/ws-dynamic-wep.c
+++ b/src/wireless-security/ws-dynamic-wep.c
@@ -17,13 +17,12 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include <glib/gi18n.h>
 #include <ctype.h>
 #include <string.h>
-#include <nm-setting-wireless.h>
 
 #include "wireless-security.h"
 #include "eap-method.h"
@@ -44,7 +43,7 @@ destroy (WirelessSecurity *parent)
 }
 
 static gboolean
-validate (WirelessSecurity *parent, const GByteArray *ssid)
+validate (WirelessSecurity *parent)
 {
        return ws_802_1x_validate (parent, "dynamic_wep_auth_combo");
 }
diff --git a/src/wireless-security/ws-dynamic-wep.h b/src/wireless-security/ws-dynamic-wep.h
index 54979f4..e25a983 100644
--- a/src/wireless-security/ws-dynamic-wep.h
+++ b/src/wireless-security/ws-dynamic-wep.h
@@ -17,13 +17,19 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #ifndef WS_DYNAMIC_WEP_H
 #define WS_DYNAMIC_WEP_H
 
+#if defined (LIBNM_BUILD)
+#include <NetworkManager.h>
+#elif defined (LIBNM_GLIB_BUILD)
 #include <nm-connection.h>
+#else
+#error neither LIBNM_BUILD nor LIBNM_GLIB_BUILD defined
+#endif
 
 typedef struct _WirelessSecurityDynamicWEP WirelessSecurityDynamicWEP;
 
diff --git a/src/wireless-security/ws-leap.c b/src/wireless-security/ws-leap.c
index bfb913f..5a13a6f 100644
--- a/src/wireless-security/ws-leap.c
+++ b/src/wireless-security/ws-leap.c
@@ -17,11 +17,10 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include <string.h>
-#include <nm-setting-wireless.h>
 
 #include "wireless-security.h"
 #include "helpers.h"
@@ -47,7 +46,7 @@ show_toggled_cb (GtkCheckButton *button, WirelessSecurity *sec)
 }
 
 static gboolean
-validate (WirelessSecurity *parent, const GByteArray *ssid)
+validate (WirelessSecurity *parent)
 {
        GtkWidget *entry;
        const char *text;
diff --git a/src/wireless-security/ws-leap.h b/src/wireless-security/ws-leap.h
index 6f1d705..6b1fe56 100644
--- a/src/wireless-security/ws-leap.h
+++ b/src/wireless-security/ws-leap.h
@@ -17,13 +17,19 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #ifndef WS_LEAP_H
 #define WS_LEAP_H
 
+#if defined (LIBNM_BUILD)
+#include <NetworkManager.h>
+#elif defined (LIBNM_GLIB_BUILD)
 #include <nm-connection.h>
+#else
+#error neither LIBNM_BUILD nor LIBNM_GLIB_BUILD defined
+#endif
 
 typedef struct _WirelessSecurityLEAP WirelessSecurityLEAP;
 
diff --git a/src/wireless-security/ws-wep-key.c b/src/wireless-security/ws-wep-key.c
index f2ac042..4f386c8 100644
--- a/src/wireless-security/ws-wep-key.c
+++ b/src/wireless-security/ws-wep-key.c
@@ -17,15 +17,12 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include <string.h>
 #include <glib.h>
 
-#include <nm-setting-wireless.h>
-#include <nm-setting-wireless-security.h>
-
 #include "wireless-security.h"
 #include "utils.h"
 
@@ -91,7 +88,7 @@ destroy (WirelessSecurity *parent)
 }
 
 static gboolean
-validate (WirelessSecurity *parent, const GByteArray *ssid)
+validate (WirelessSecurity *parent)
 {
        WirelessSecurityWEPKey *sec = (WirelessSecurityWEPKey *) parent;
        GtkWidget *entry;
diff --git a/src/wireless-security/ws-wep-key.h b/src/wireless-security/ws-wep-key.h
index fdd70da..7ba5407 100644
--- a/src/wireless-security/ws-wep-key.h
+++ b/src/wireless-security/ws-wep-key.h
@@ -17,13 +17,19 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #ifndef WS_WEP_KEY_H
 #define WS_WEP_KEY_H
 
+#if defined (LIBNM_BUILD)
+#include <NetworkManager.h>
+#elif defined (LIBNM_GLIB_BUILD)
 #include <nm-setting-wireless-security.h>
+#else
+#error neither LIBNM_BUILD nor LIBNM_GLIB_BUILD defined
+#endif
 
 typedef struct _WirelessSecurityWEPKey WirelessSecurityWEPKey;
 
diff --git a/src/wireless-security/ws-wpa-eap.c b/src/wireless-security/ws-wpa-eap.c
index 6b911c1..3f88808 100644
--- a/src/wireless-security/ws-wpa-eap.c
+++ b/src/wireless-security/ws-wpa-eap.c
@@ -17,13 +17,12 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include <glib/gi18n.h>
 #include <ctype.h>
 #include <string.h>
-#include <nm-setting-wireless.h>
 
 #include "wireless-security.h"
 #include "eap-method.h"
@@ -45,7 +44,7 @@ destroy (WirelessSecurity *parent)
 }
 
 static gboolean
-validate (WirelessSecurity *parent, const GByteArray *ssid)
+validate (WirelessSecurity *parent)
 {
        return ws_802_1x_validate (parent, "wpa_eap_auth_combo");
 }
diff --git a/src/wireless-security/ws-wpa-eap.h b/src/wireless-security/ws-wpa-eap.h
index 5c8faea..b8f9ba8 100644
--- a/src/wireless-security/ws-wpa-eap.h
+++ b/src/wireless-security/ws-wpa-eap.h
@@ -17,13 +17,19 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #ifndef WS_WPA_EAP_H
 #define WS_WPA_EAP_H
 
+#if defined (LIBNM_BUILD)
+#include <NetworkManager.h>
+#elif defined (LIBNM_GLIB_BUILD)
 #include <nm-connection.h>
+#else
+#error neither LIBNM_BUILD nor LIBNM_GLIB_BUILD defined
+#endif
 
 typedef struct _WirelessSecurityWPAEAP WirelessSecurityWPAEAP;
 
diff --git a/src/wireless-security/ws-wpa-psk.c b/src/wireless-security/ws-wpa-psk.c
index aa50c9c..02aa0b5 100644
--- a/src/wireless-security/ws-wpa-psk.c
+++ b/src/wireless-security/ws-wpa-psk.c
@@ -17,12 +17,11 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #include <ctype.h>
 #include <string.h>
-#include <nm-setting-wireless.h>
 
 #include "wireless-security.h"
 #include "helpers.h"
@@ -51,7 +50,7 @@ show_toggled_cb (GtkCheckButton *button, WirelessSecurity *sec)
 }
 
 static gboolean
-validate (WirelessSecurity *parent, const GByteArray *ssid)
+validate (WirelessSecurity *parent)
 {
        GtkWidget *entry;
        const char *key;
diff --git a/src/wireless-security/ws-wpa-psk.h b/src/wireless-security/ws-wpa-psk.h
index a89552f..6bd1768 100644
--- a/src/wireless-security/ws-wpa-psk.h
+++ b/src/wireless-security/ws-wpa-psk.h
@@ -17,12 +17,20 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2010 Red Hat, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
  */
 
 #ifndef WS_WPA_PSK_H
 #define WS_WPA_PSK_H
 
+#if defined (LIBNM_BUILD)
+#include <NetworkManager.h>
+#elif defined (LIBNM_GLIB_BUILD)
+#include <nm-connection.h>
+#else
+#error neither LIBNM_BUILD nor LIBNM_GLIB_BUILD defined
+#endif
+
 typedef struct _WirelessSecurityWPAPSK WirelessSecurityWPAPSK;
 
 WirelessSecurityWPAPSK * ws_wpa_psk_new (NMConnection *connection, gboolean secrets_only);


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