[RFC PATCH 1/8] wifi: Move get_connection_iwd_security to nm-wifi-utils.c

2018-06-12 Thread Andrew Zaborowski
Make this function public.  I'm not sure if at this point it makes
much sense to add a new file for iwd-specific utilities.
---
 src/devices/wifi/nm-device-iwd.c | 35 ++-
 src/devices/wifi/nm-wifi-utils.c | 23 +++
 src/devices/wifi/nm-wifi-utils.h |  3 +++
 3 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/src/devices/wifi/nm-device-iwd.c b/src/devices/wifi/nm-device-iwd.c
index d3c5ae9aa..c756f5d35 100644
--- a/src/devices/wifi/nm-device-iwd.c
+++ b/src/devices/wifi/nm-device-iwd.c
@@ -452,29 +452,6 @@ deactivate_async (NMDevice *device,
   G_DBUS_CALL_FLAGS_NONE, -1, cancellable, 
disconnect_cb, ctx);
 }
 
-static NMIwdNetworkSecurity
-get_connection_iwd_security (NMConnection *connection)
-{
-   NMSettingWirelessSecurity *s_wireless_sec;
-   const char *key_mgmt = NULL;
-
-   s_wireless_sec = nm_connection_get_setting_wireless_security 
(connection);
-   if (!s_wireless_sec)
-   return NM_IWD_NETWORK_SECURITY_NONE;
-
-   key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wireless_sec);
-   nm_assert (key_mgmt);
-
-   if (!strcmp (key_mgmt, "none") || !strcmp (key_mgmt, "ieee8021x"))
-   return NM_IWD_NETWORK_SECURITY_WEP;
-
-   if (!strcmp (key_mgmt, "wpa-psk"))
-   return NM_IWD_NETWORK_SECURITY_PSK;
-
-   nm_assert (!strcmp (key_mgmt, "wpa-eap"));
-   return NM_IWD_NETWORK_SECURITY_8021X;
-}
-
 static gboolean
 is_connection_known_network (NMConnection *connection)
 {
@@ -495,7 +472,7 @@ is_connection_known_network (NMConnection *connection)
 
return nm_iwd_manager_is_known_network (nm_iwd_manager_get (),
str_ssid,
-   get_connection_iwd_security 
(connection));
+   
nm_wifi_connection_get_iwd_security (connection));
 }
 
 static gboolean
@@ -549,7 +526,7 @@ check_connection_compatible (NMDevice *device, NMConnection 
*connection)
/* 8021x networks can only be used if they've been provisioned on the 
IWD side and
 * thus are Known Networks.
 */
-   if (get_connection_iwd_security (connection) == 
NM_IWD_NETWORK_SECURITY_8021X) {
+   if (nm_wifi_connection_get_iwd_security (connection) == 
NM_IWD_NETWORK_SECURITY_8021X) {
if (!is_connection_known_network (connection))
return FALSE;
}
@@ -583,7 +560,7 @@ check_connection_available (NMDevice *device,
/* 8021x networks can only be used if they've been provisioned on the 
IWD side and
 * thus are Known Networks.
 */
-   if (get_connection_iwd_security (connection) == 
NM_IWD_NETWORK_SECURITY_8021X) {
+   if (nm_wifi_connection_get_iwd_security (connection) == 
NM_IWD_NETWORK_SECURITY_8021X) {
if (!is_connection_known_network (connection))
return FALSE;
}
@@ -718,7 +695,7 @@ complete_connection (NMDevice *device,
/* 8021x networks can only be used if they've been provisioned on the 
IWD side and
 * thus are Known Networks.
 */
-   if (get_connection_iwd_security (connection) == 
NM_IWD_NETWORK_SECURITY_8021X) {
+   if (nm_wifi_connection_get_iwd_security (connection) == 
NM_IWD_NETWORK_SECURITY_8021X) {
if (!is_connection_known_network (connection)) {
g_set_error_literal (error,
 NM_CONNECTION_ERROR,
@@ -819,7 +796,7 @@ can_auto_connect (NMDevice *device,
/* 8021x networks can only be used if they've been provisioned on the 
IWD side and
 * thus are Known Networks.
 */
-   if (get_connection_iwd_security (connection) == 
NM_IWD_NETWORK_SECURITY_8021X) {
+   if (nm_wifi_connection_get_iwd_security (connection) == 
NM_IWD_NETWORK_SECURITY_8021X) {
if (!is_connection_known_network (connection))
return FALSE;
}
@@ -1160,7 +1137,7 @@ network_connect_cb (GObject *source, GAsyncResult *res, 
gpointer user_data)
nm_device_activate_schedule_stage3_ip_config_start (device);
 
nm_iwd_manager_network_connected (nm_iwd_manager_get (), str_ssid,
- get_connection_iwd_security 
(connection));
+ nm_wifi_connection_get_iwd_security 
(connection));
 
return;
 
diff --git a/src/devices/wifi/nm-wifi-utils.c b/src/devices/wifi/nm-wifi-utils.c
index 044bd392d..c7bb71963 100644
--- a/src/devices/wifi/nm-wifi-utils.c
+++ b/src/devices/wifi/nm-wifi-utils.c
@@ -814,3 +814,26 @@ nm_wifi_utils_is_manf_default_ssid (const GByteArray *ssid)
}
return FALSE;
 }
+
+NMIwdNetworkSecurity
+nm_wifi_connection_get_iwd_security (NMConnection *connection)
+{
+   NMSettingWirelessSecurity *s_wireless_sec;
+   

[RFC PATCH 3/8] iwd: Emit known-networks-changed signals from NMIwdManager

2018-06-12 Thread Andrew Zaborowski
Emit a signal when NMIwdManager learns that a KnownNetwork has been
added or removed and when the list has been initially loaded.
---
 src/devices/wifi/nm-iwd-manager.c | 26 ++
 src/devices/wifi/nm-iwd-manager.h |  3 +++
 2 files changed, 29 insertions(+)

diff --git a/src/devices/wifi/nm-iwd-manager.c 
b/src/devices/wifi/nm-iwd-manager.c
index 2da6db0e4..8897f43a4 100644
--- a/src/devices/wifi/nm-iwd-manager.c
+++ b/src/devices/wifi/nm-iwd-manager.c
@@ -33,6 +33,14 @@
 
 /*/
 
+enum {
+   KNOWN_NETWORKS_CHANGED,
+
+   LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
 typedef struct {
NMManager *manager;
GCancellable *cancellable;
@@ -412,6 +420,8 @@ next:
 
g_variant_iter_free (networks);
 
+   g_signal_emit (self, signals[KNOWN_NETWORKS_CHANGED], 0, 
priv->known_networks);
+
/* For completness we may want to call 
nm_device_emit_recheck_auto_activate
 * and nm_device_recheck_available_connections for all affected devices
 * now but the ListKnownNetworks call should have been really fast,
@@ -468,6 +478,12 @@ name_owner_changed (GObject *object, GParamSpec *pspec, 
gpointer user_data)
   NULL);
}
}
+
+   if (priv->known_networks) {
+   g_slist_free_full (priv->known_networks, 
(GDestroyNotify) known_network_free);
+   priv->known_networks = NULL;
+   g_signal_emit (self, signals[KNOWN_NETWORKS_CHANGED], 
0, NULL);
+   }
}
 }
 
@@ -619,6 +635,8 @@ nm_iwd_manager_network_connected (NMIwdManager *self, const 
gchar *name,
network_data->name = g_strdup (name);
network_data->security = security;
priv->known_networks = g_slist_append (priv->known_networks, 
network_data);
+
+   g_signal_emit (self, signals[KNOWN_NETWORKS_CHANGED], 0, 
priv->known_networks);
 }
 
 /*/
@@ -685,4 +703,12 @@ nm_iwd_manager_class_init (NMIwdManagerClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
object_class->dispose = dispose;
+
+   signals[KNOWN_NETWORKS_CHANGED] =
+   g_signal_new (NM_IWD_MANAGER_KNOWN_NETWORKS_CHANGED,
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0, NULL, NULL, NULL,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
 }
diff --git a/src/devices/wifi/nm-iwd-manager.h 
b/src/devices/wifi/nm-iwd-manager.h
index 80b430f0f..96b5e2c26 100644
--- a/src/devices/wifi/nm-iwd-manager.h
+++ b/src/devices/wifi/nm-iwd-manager.h
@@ -55,6 +55,9 @@ typedef struct {
 #define NM_IS_IWD_MANAGER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass),  
NM_TYPE_IWD_MANAGER))
 #define NM_IWD_MANAGER_GET_CLASS(obj)(G_TYPE_INSTANCE_GET_CLASS ((obj),  
NM_TYPE_IWD_MANAGER, NMIwdManagerClass))
 
+/* signals */
+#define NM_IWD_MANAGER_KNOWN_NETWORKS_CHANGED "known-networks-changed"
+
 typedef struct _NMIwdManager NMIwdManager;
 typedef struct _NMIwdManagerClass NMIwdManagerClass;
 
-- 
2.14.1

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[RFC PATCH 7/8] settings: Add an IWD plugin

2018-06-12 Thread Andrew Zaborowski
The plugin listens to NMIwdManager signals to add and remove connections
for IWD's KnownNetworks.  The connections are currently read-only and
contain the minimum settings to mirror the information provided by IWD:
the SSID and the security type.

If this approach is taken the connections will probably still need an
additional NM keyfile to save any settings related to proxies, dhcp,
autoconnect and more (autoconnect and dhcp may eventually end up being
managed by IWD)
---
 src/settings/plugins/iwd/nms-iwd-connection.c | 173 +
 src/settings/plugins/iwd/nms-iwd-connection.h |  43 +++
 src/settings/plugins/iwd/nms-iwd-plugin.c | 176 ++
 src/settings/plugins/iwd/nms-iwd-plugin.h |  37 ++
 4 files changed, 429 insertions(+)
 create mode 100644 src/settings/plugins/iwd/nms-iwd-connection.c
 create mode 100644 src/settings/plugins/iwd/nms-iwd-connection.h
 create mode 100644 src/settings/plugins/iwd/nms-iwd-plugin.c
 create mode 100644 src/settings/plugins/iwd/nms-iwd-plugin.h

diff --git a/src/settings/plugins/iwd/nms-iwd-connection.c 
b/src/settings/plugins/iwd/nms-iwd-connection.c
new file mode 100644
index 0..5f784de58
--- /dev/null
+++ b/src/settings/plugins/iwd/nms-iwd-connection.c
@@ -0,0 +1,173 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager system settings service - IWD plugin
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Copyright (C) 2018 Intel Corporation
+ */
+
+#include "nm-default.h"
+
+#include "nms-iwd-connection.h"
+
+#include "nm-setting-connection.h"
+#include "nm-core-internal.h"
+#include "nm-utils.h"
+#include "devices/wifi/nm-wifi-utils.h"
+
+#include "settings/nm-settings-plugin.h"
+
+/*/
+
+typedef struct {
+   NMIwdKnownNetworkData known_network_data;
+} NMSIwdConnectionPrivate;
+
+struct _NMSIwdConnection {
+   NMSettingsConnection parent;
+   NMSIwdConnectionPrivate _priv;
+};
+
+struct _NMSIwdConnectionClass {
+   NMSettingsConnectionClass parent;
+};
+
+G_DEFINE_TYPE (NMSIwdConnection, nms_iwd_connection, 
NM_TYPE_SETTINGS_CONNECTION)
+
+#define NMS_IWD_CONNECTION_GET_PRIVATE(self) _NM_GET_PRIVATE (self, 
NMSIwdConnection, NMS_IS_IWD_CONNECTION)
+
+/*/
+
+static gboolean
+delete (NMSettingsConnection *connection,
+GError **error)
+{
+   NMSettingWireless *s_wireless;
+   GBytes *ssid;
+   gs_free gchar *str_ssid = NULL;
+
+   s_wireless = nm_connection_get_setting_wireless (NM_CONNECTION 
(connection));
+   if (!s_wireless) {
+   g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
+"Connection has no Wireless setting");
+   return FALSE;
+   }
+
+   ssid = nm_setting_wireless_get_ssid (s_wireless);
+   if (!ssid) {
+   g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
+"Connection has no SSID in the Wireless setting");
+   return FALSE;
+   }
+
+   str_ssid = nm_utils_ssid_to_utf8 (g_bytes_get_data (ssid, NULL),
+ g_bytes_get_size (ssid));
+
+   nm_iwd_manager_forget_network (nm_iwd_manager_get (),
+  str_ssid,
+  nm_wifi_connection_get_iwd_security 
(NM_CONNECTION (connection)));
+
+   return TRUE;
+}
+
+/*/
+
+const NMIwdKnownNetworkData *
+nms_iwd_get_known_network_data (NMSIwdConnection *connection)
+{
+   NMSIwdConnectionPrivate *priv = NMS_IWD_CONNECTION_GET_PRIVATE 
(connection);
+
+   return >known_network_data;
+}
+
+/*/
+
+static void
+nms_iwd_connection_init (NMSIwdConnection *connection)
+{
+}
+
+NMSIwdConnection *
+nms_iwd_connection_new (const NMIwdKnownNetworkData *network)
+{
+   NMSIwdConnectionPrivate *priv;
+   GObject *object;
+   char uuid[37];
+   NMSetting *setting;
+   GBytes *ssid = g_bytes_new (network->name, strlen 

[RFC PATCH 8/8] iwd: Register the IWD settings plugin

2018-06-12 Thread Andrew Zaborowski
Add the IWD plugin to the build and use nm_settings_add_plugin to add
its instance.  The plugin is built into the wifi plugin's binary because
with an independent binary it's difficult to cleanly listen to
NMIwdManager's signals and call its methods.  The meson configuration is
not in this patch.

Note the plugin is added as just another plugin in the list in the
NMSettings object, which means that for any operation it's tried along
with the other plugins until one succeeds.  Instead it would be better
if the plugin gets some sort of exclusivity on wireless connections so
that no other plugin can create duplicate connections for the ones
already added by this plugin.

The plugin is effectively registered whenever the IWD backend is enabled
for at least one device.  NM still allows IWD-managed devices to coexist
with wpa_supplicant devices.  The plugin makes no sense in those
situations because the IWD connections (specifically WPA-Enterprise)
can't be activated on wpa_supplicant devices and normal NM
WPA-Enterprise connections can't be activated on IWD-managed devices.
We are considering eventually allowing the IWD plugin to access IWD's
WPA-Enterprise network config files directly so that they can be
read/written/edited through the NM clients, without going through the
IWD DBus interface.
---
 Makefile.am   |  6 +-
 src/devices/wifi/nm-iwd-manager.c | 11 +++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 79b046280..6fe8fb9a1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2757,7 +2757,11 @@ src_devices_wifi_libnm_device_plugin_wifi_la_SOURCES += \
src/devices/wifi/nm-device-iwd.c \
src/devices/wifi/nm-device-iwd.h \
src/devices/wifi/nm-iwd-manager.c \
-   src/devices/wifi/nm-iwd-manager.h
+   src/devices/wifi/nm-iwd-manager.h \
+   src/settings/plugins/iwd/nms-iwd-connection.c \
+   src/settings/plugins/iwd/nms-iwd-connection.h \
+   src/settings/plugins/iwd/nms-iwd-plugin.c \
+   src/settings/plugins/iwd/nms-iwd-plugin.h
 endif
 
 src_devices_wifi_libnm_device_plugin_wifi_la_CPPFLAGS = \
diff --git a/src/devices/wifi/nm-iwd-manager.c 
b/src/devices/wifi/nm-iwd-manager.c
index d785c1100..bd508f151 100644
--- a/src/devices/wifi/nm-iwd-manager.c
+++ b/src/devices/wifi/nm-iwd-manager.c
@@ -30,6 +30,8 @@
 #include "nm-manager.h"
 #include "nm-device-iwd.h"
 #include "nm-utils/nm-random-utils.h"
+#include "settings/nm-settings.h"
+#include "settings/plugins/iwd/nms-iwd-plugin.h"
 
 /*/
 
@@ -49,6 +51,7 @@ typedef struct {
guint agent_id;
gchar *agent_path;
GSList *known_networks;
+   gboolean settings_added;
 } NMIwdManagerPrivate;
 
 struct _NMIwdManager {
@@ -589,6 +592,14 @@ got_object_manager (GObject *object, GAsyncResult *result, 
gpointer user_data)
 
update_known_networks (self);
}
+
+   if (!priv->settings_added) {
+   NMSIwdPlugin *settings = nms_iwd_plugin_get ();
+
+   nm_settings_add_plugin (NM_SETTINGS_GET, NM_SETTINGS_PLUGIN 
(settings));
+
+   priv->settings_added = TRUE;
+   }
 }
 
 static void
-- 
2.14.1

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[RFC PATCH 6/8] libnm-core: 8021x: Allow a new eap value "extern"

2018-06-12 Thread Andrew Zaborowski
To allow connections that mirror IWD's configured WPA-Enterprise
networks to be seen as valid by NM, add a new value for the eap key in
802-1x settings.  802-1x.eap stores EAP method names.  In the IWD
connections we don't know what EAP method is configured and we don't
have any of the other 802-1x properties that would be required for the
settings to verify.

Alternatively I could use a new flag property on the general connection
setting object to signal that some other settings are not visible or
editable.

Obviously these connections can't be activated on devices not controlled
by IWD.  This change may also need the eap=extern value to be documented
and checks may be needed to prevent this value from being used in
connections created through DBus.
---
 libnm-core/nm-setting-8021x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libnm-core/nm-setting-8021x.c b/libnm-core/nm-setting-8021x.c
index 3b4240e64..eda85ed8a 100644
--- a/libnm-core/nm-setting-8021x.c
+++ b/libnm-core/nm-setting-8021x.c
@@ -3088,6 +3088,7 @@ static EAPMethodsTable eap_methods_table[] = {
{ "sim", need_secrets_sim, NULL },
{ "gtc", need_secrets_password, verify_identity },
{ "otp", NULL, NULL },  // FIXME: implement
+   { "extern", NULL, NULL },
{ NULL, NULL, NULL }
 };
 
@@ -3203,7 +3204,7 @@ verify (NMSetting *setting, NMConnection *connection, 
GError **error)
 {
NMSetting8021x *self = NM_SETTING_802_1X (setting);
NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self);
-   const char *valid_eap[] = { "leap", "md5", "tls", "peap", "ttls", 
"sim", "fast", "pwd", NULL };
+   const char *valid_eap[] = { "leap", "md5", "tls", "peap", "ttls", 
"sim", "fast", "pwd", "extern", NULL };
const char *valid_phase1_peapver[] = { "0", "1", NULL };
const char *valid_phase1_peaplabel[] = { "0", "1", NULL };
const char *valid_phase1_fast_pac[] = { "0", "1", "2", "3", NULL };
-- 
2.14.1

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[RFC PATCH 4/8] iwd: Add nm_iwd_manager_forget_network API

2018-06-12 Thread Andrew Zaborowski
Add a function that maps to the
net.connman.iwd.KnownNetworks.ForgetNetwork DBus call and causes an IWD
Known Network to be forgotten with its config file removed.
---
 src/devices/wifi/nm-iwd-manager.c | 36 
 src/devices/wifi/nm-iwd-manager.h |  2 ++
 2 files changed, 38 insertions(+)

diff --git a/src/devices/wifi/nm-iwd-manager.c 
b/src/devices/wifi/nm-iwd-manager.c
index 8897f43a4..d785c1100 100644
--- a/src/devices/wifi/nm-iwd-manager.c
+++ b/src/devices/wifi/nm-iwd-manager.c
@@ -639,6 +639,42 @@ nm_iwd_manager_network_connected (NMIwdManager *self, 
const gchar *name,
g_signal_emit (self, signals[KNOWN_NETWORKS_CHANGED], 0, 
priv->known_networks);
 }
 
+void
+nm_iwd_manager_forget_network (NMIwdManager *self, const gchar *name,
+   NMIwdNetworkSecurity security)
+{
+   NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE (self);
+   gs_unref_object GDBusInterface *known_networks_if = NULL;
+   const char *security_str =
+   security == NM_IWD_NETWORK_SECURITY_NONE ? "open" :
+   security == NM_IWD_NETWORK_SECURITY_PSK ? "psk" : "8021x";
+   const GSList *iter;
+
+   known_networks_if = g_dbus_object_manager_get_interface 
(priv->object_manager,
+"/",
+
NM_IWD_KNOWN_NETWORKS_INTERFACE);
+
+   g_dbus_proxy_call (G_DBUS_PROXY (known_networks_if),
+  "ForgetNetwork",
+  g_variant_new ("(ss)", name, security_str),
+  G_DBUS_CALL_FLAGS_NONE, -1,
+  NULL, NULL, NULL);
+
+   g_object_unref (known_networks_if);
+
+   for (iter = priv->known_networks; iter; iter = g_slist_next (iter)) {
+   const NMIwdKnownNetworkData *network = iter->data;
+
+   if (strcmp (network->name, name) || network->security != 
security)
+   continue;
+
+   priv->known_networks = g_slist_remove (priv->known_networks, 
network);
+   break;
+   }
+
+   g_signal_emit (self, signals[KNOWN_NETWORKS_CHANGED], 0, 
priv->known_networks);
+}
+
 /*/
 
 NM_DEFINE_SINGLETON_GETTER (NMIwdManager, nm_iwd_manager_get,
diff --git a/src/devices/wifi/nm-iwd-manager.h 
b/src/devices/wifi/nm-iwd-manager.h
index 96b5e2c26..a4491286e 100644
--- a/src/devices/wifi/nm-iwd-manager.h
+++ b/src/devices/wifi/nm-iwd-manager.h
@@ -69,5 +69,7 @@ gboolean nm_iwd_manager_is_known_network (NMIwdManager *self, 
const gchar *name,
   NMIwdNetworkSecurity security);
 void nm_iwd_manager_network_connected (NMIwdManager *self, const gchar *name,
NMIwdNetworkSecurity security);
+void nm_iwd_manager_forget_network (NMIwdManager *self, const gchar *name,
+NMIwdNetworkSecurity security);
 
 #endif /* __NETWORKMANAGER_IWD_MANAGER_H__ */
-- 
2.14.1

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


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

2018-06-12 Thread Andrew Zaborowski
---
 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, "{}", , )) {
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

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Problems in nmcli.1

2018-06-12 Thread esr
This is automatically generated email about markup problems in a man
page for which you appear to be responsible.  If you are not the right
person or list, please tell me so I can correct my database.

See http://catb.org/~esr/doclifter/bugs.html for details on how and
why these patches were generated.  Feel free to email me with any
questions.  Note: These patches do not change the modification date of
any manual page.  You may wish to do that by hand.

I apologize if this message seems spammy or impersonal. The volume of
markup bugs I am tracking is over five hundred - there is no real
alternative to generating bugmail from a database and template.

--
 Eric S. Raymond
Problems with nmcli.1:

Broken command synopsis syntax.  This may mean you're using a
construction in the command synopsis other than the standard
[ ] | { }, or it may mean you have running text in the command synopsis
section (the latter is not technically an error, but most cases of it
are impossible to translate into DocBook markup), or it may mean the
command syntax fails to match the description.

List syntax error. This means .IP, .TP or .RS/.RE markup is garbled.
Common causes include .TP just before a section header, .TP entries
with tags but no bodies, and mandoc lists with no trailing .El.
These confuse doclifter, and may also mess up stricter man-page
browsers like Xman and Rosetta.

Presentation-level use of .SS could not be structurally
translated. I changed lower-level instances to .TP or .B.

--- nmcli.1-unpatched   2016-03-02 01:49:37.245643661 -0500
+++ nmcli.1 2016-03-02 01:49:47.477617367 -0500
@@ -26,40 +26,29 @@
 .SH NAME
 nmcli \- command\(hyline tool for controlling NetworkManager
 .SH SYNOPSIS
-.ad l
 .B nmcli
-.RI " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
-.BR help " } "
-.sp
-
-.IR OBJECT " := { "
-.BR general " | " networking " | " radio " | " connection " | " device " | " 
agent
-.RI " }"
-.sp
-
-.IR OPTIONS " := { "
-.br
-\fB\-t\fR[\fIerse\fR]
-.br
-\fB\-p\fR[\fIretty\fR]
-.br
-\fB\-m\fR[\fImode\fR] tabular | multiline
-.br
-\fB\-f\fR[\fIields\fR]  | all | common
-.br
-\fB\-e\fR[\fIscape\fR] yes | no
-.br
-\fB\-n\fR[\fIocheck\fR]
 .br
-\fB\-a\fR[\fIsk\fR]
+[
+\fB\-terse\fR |
+\fB\-pretty\fR |
+\fB\-mmode\fR { tabular | multiline } |
+.br
+\fB\-fields\fR {  | all | common } |
+\fB\-escape\fR { yes | no } |
+.br
+\fB\-nocheck\fR |
+\fB\-ask\fR |
+\fB\-wait\fR  |
+\fB\-version\fR |
+\fB\-help\fR
+]
 .br
-\fB\-w\fR[\fIait\fR] 
-.br
-\fB\-v\fR[\fIersion\fR]
-.br
-\fB\-h\fR[\fIelp\fR]
+{
+.BR general " | " networking " | " radio " | " connection " | " device " | " 
agent
+}
 .br
-.RI "}"
+.RI "{ " COMMAND " | "
+.BR help " } "
 
 .SH DESCRIPTION
 .B nmcli
@@ -153,7 +142,7 @@
 Use this object to show NetworkManager status and permissions. You can also get
 and change system hostname, as well as NetworkManager logging level and 
domains.
 .TP
-.SS \fICOMMAND\fP := { status | hostname | permissions | logging }
+.B \fICOMMAND\fP := { status | hostname | permissions | logging }
 .sp
 .RS
 .TP
@@ -194,7 +183,7 @@
 networking. Disabling networking removes the configuration from all devices and
 changes them to the 'unmanaged' state.
 .TP
-.SS \fICOMMAND\fP := { [ on | off | connectivity ] }
+.B \fICOMMAND\fP := { [ on | off | connectivity ] }
 .sp
 .RS
 .TP
@@ -232,7 +221,7 @@
 Use this object to show radio switches status, or enable and disable
 the switches.
 .TP
-.SS \fICOMMAND\fP := { all | wifi | wwan | wimax }
+.B \fICOMMAND\fP := { all | wifi | wwan | wimax }
 .sp
 .RS
 .TP
@@ -278,7 +267,7 @@
 connected to the DHCP-enabled network the user would run "nmcli con up default"
 , and when connected to the static network the user would run "nmcli con up 
testing".
 .TP
-.SS \fICOMMAND\fP := { show | up | down | add | edit | modify | delete | 
reload | load }
+.B \fICOMMAND\fP := { show | up | down | add | edit | modify | delete | reload 
| load }
 .sp
 .RS
 .TP
@@ -330,8 +319,7 @@
 .RE
 .TP
 .B up [ id | uuid | path ]  [ifname ] [ap ] [nsp ] 
[passwd ]
-.RE
-.RS
+.TP
 .B up ifname  [ap ] [nsp ] [passwd ]
 .RS
 .br
@@ -627,8 +615,7 @@
 .RE
 .TP
 .B edit [id | uuid | path ]   - edit an existing connection
-.RE
-.RS
+.TP
 .B edit [type ] [con-name ]  - add a 
new connection
 .RS
 Edit an existing connection or add a new one, using an interactive editor.
@@ -649,12 +636,12 @@
 \(en type of the new connection; valid types are the same as for \fIconnection 
add\fP command
 .IP \fIcon-name\fP 13
 \(en name for the new connection. It can be changed later in the editor.
-.RE
 .RS
 .sp
 See also \fInm-settings\fP(5) for all NetworkManager settings and property 
names, and their
 descriptions; and \fInmcli-examples\fP(5) for sample editor sessions.
 .RE
+.RE
 .TP
 .B modify [--temporary] [ id | uuid | path ]  [+|-]. 

 .B [+|-].  ...
@@ -711,7 +698,7 @@
 .B device - show and manage network interfaces
 .br
 .TP
-.SS \fICOMMAND\fP := { status | show | connect | disconnect | delete | wifi | 
wimax