Commit 587a50e6 authored by Ray Strode's avatar Ray Strode
Browse files

2005-03-09 Ray Strode <rstrode@redhat.com>

	Second (unfinished, unworking) cut at porting to
	dbus 0.30 api.

	* dispatcher-daemon/NetworkManagerDispatcher.c
	* info-daemon/NetworkManagerInfoDbus.c:
	* panel-applet/NMWirelessAppletDbus.c:
	* src/NetworkManagerDbusUtils.c:
	* src/NetworkManagerDbusUtils.h:
	* src/nm-dbus-device.c:
	* src/nm-dbus-nm.c:
	* test/nmtest.c: support dbus "object path" type

	* configure.in:
	* Makefile.am:
	* info-daemon/Makefile.am:
	* libnm_glib/Makefile.am:
	* panel-applet/Makefile.am:
	* dispatcher-daemon/Makefile.am
	* src/Makefile.am:
	* test/Makefile.am:
	* utils/Makefile.am:
	* utils/nm-utils.c:
	* utils/nm-utils.h: new utils static lib


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@494 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent a5d937a6
2005-03-09 Ray Strode <rstrode@redhat.com>
Second (unfinished, unworking) cut at porting to
dbus 0.30 api.
* dispatcher-daemon/NetworkManagerDispatcher.c
* info-daemon/NetworkManagerInfoDbus.c:
* panel-applet/NMWirelessAppletDbus.c:
* src/NetworkManagerDbusUtils.c:
* src/NetworkManagerDbusUtils.h:
* src/nm-dbus-device.c:
* src/nm-dbus-nm.c:
* test/nmtest.c: support dbus "object path" type
* configure.in:
* Makefile.am:
* info-daemon/Makefile.am:
* libnm_glib/Makefile.am:
* panel-applet/Makefile.am:
* dispatcher-daemon/Makefile.am
* src/Makefile.am:
* test/Makefile.am:
* utils/Makefile.am:
* utils/nm-utils.c:
* utils/nm-utils.h: new utils static lib
2005-03-07 Ray Strode <rstrode@redhat.com>
* info-daemon/NetworkManagerInfoDbus.c:
......
SUBDIRS = dhcpcd named src libnm_glib dispatcher-daemon $(notification_icon_dir) info-daemon initscript test po
SUBDIRS = utils dhcpcd named src libnm_glib dispatcher-daemon $(notification_icon_dir) info-daemon initscript test po
EXTRA_DIST = CONTRIBUTING NetworkManager.pc.in NetworkManager.h
......
......@@ -264,6 +264,7 @@ fi
AC_OUTPUT([
Makefile
utils/Makefile
src/Makefile
dispatcher-daemon/Makefile
info-daemon/Makefile
......
INCLUDES = \
INCLUDES = -I${top_srcdir} -I${top_srcdir}/utils
NULL=
bin_PROGRAMS = NetworkManagerDispatcher
NetworkManagerDispatcher_CFLAGS = \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
-Wall \
-DDBUS_API_SUBJECT_TO_CHANGE \
-DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\"
bin_PROGRAMS = NetworkManagerDispatcher
-DDATADIR=\"$(datadir)\" \
$(NULL)
NetworkManagerDispatcher_SOURCES = NetworkManagerDispatcher.c
NetworkManagerDispatcher_LDADD = $(DBUS_LIBS) $(GTHREAD_LIBS)
NetworkManagerDispatcher_LDADD = \
$(DBUS_LIBS) \
$(GTHREAD_LIBS) \
$(top_builddir)/utils/libnmutils.la
......@@ -35,6 +35,8 @@
#include <dirent.h>
#include <string.h>
#include "nm-utils.h"
#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager"
#define NM_DBUS_PATH "/org/freedesktop/NetworkManager"
......@@ -234,10 +236,15 @@ static DBusHandlerResult nmd_dbus_filter (DBusConnection *connection, DBusMessag
if (action != NMD_DEVICE_DONT_KNOW)
{
if (dbus_message_get_args (message, &error, DBUS_TYPE_STRING, &dev_object_path, DBUS_TYPE_INVALID))
if (dbus_message_get_args (message, &error, DBUS_TYPE_OBJECT_PATH, &dev_object_path, DBUS_TYPE_INVALID))
{
char *dev_iface_name = nmd_get_device_name (connection, dev_object_path);
guint32 dev_ip4_address = nmd_get_device_ip4_address (connection, dev_object_path);
char *dev_iface_name;
guint32 dev_ip4_address;
dev_object_path = nm_dbus_unescape_object_path (dev_object_path);
dev_ip4_address = nmd_get_device_ip4_address (connection, dev_object_path);
dev_iface_name = nmd_get_device_name (connection, dev_object_path);
if (action == NMD_DEVICE_NOW_ACTIVE || action == NMD_DEVICE_NOW_INACTIVE)
{
......
INCLUDES = -I${top_srcdir}
INCLUDES = -I${top_srcdir}
AM_CPPFLAGS = \
$(DBUS_CFLAGS) \
......@@ -44,7 +43,8 @@ NetworkManagerInfo_LDADD = \
$(GTK_LIBS) \
$(GDK_PIXBUF_LIBS) \
$(GNOME_KEYRING_LIBS) \
$(LIBGNOMEUI_LIBS)
$(LIBGNOMEUI_LIBS)
gladedir = $(datadir)/NetworkManagerInfo/glade
glade_DATA = passphrase.glade keyring.png networks.glade
......
......@@ -861,108 +861,3 @@ int nmi_dbus_service_init (DBusConnection *dbus_connection, NMIAppInfo *info)
return (0);
}
gchar *nm_dbus_escape_object_path (const gchar *utf8_string)
{
const gchar *p;
gchar *object_path;
GString *string;
g_return_val_if_fail (utf8_string != NULL, NULL);
g_return_val_if_fail (g_utf8_validate (utf8_string, -1, NULL), NULL);
string = g_string_sized_new ((strlen (utf8_string) + 1) * 6);
for (p = utf8_string; *p != '\0'; p = g_utf8_next_char (p))
{
gunichar character;
character = g_utf8_get_char (p);
if (((character >= ((gunichar) 'a')) &&
(character <= ((gunichar) 'z'))) ||
((character >= ((gunichar) 'A')) &&
(character <= ((gunichar) 'Z'))) ||
((character >= ((gunichar) '0')) &&
(character <= ((gunichar) '9'))) ||
(character == ((gunichar) '/')))
{
g_string_append_c (string, (gchar) character);
continue;
}
g_string_append_printf (string, "_%x_", character);
}
object_path = string->str;
g_string_free (string, FALSE);
return object_path;
}
gchar *nm_dbus_unescape_object_path (const gchar *object_path)
{
const gchar *p;
gchar *utf8_string;
GString *string;
g_return_val_if_fail (object_path != NULL, NULL);
string = g_string_sized_new (strlen (object_path) + 1);
for (p = object_path; *p != '\0'; p++)
{
const gchar *q;
gchar *hex_digits, *end, utf8_character[6] = { '\0' };
gint utf8_character_size;
gunichar character;
gulong hex_value;
if (*p != '_')
{
g_string_append_c (string, *p);
continue;
}
q = strchr (p + 1, '_');
if ((q == NULL) || (q == p + 1))
{
g_string_free (string, TRUE);
return NULL;
}
hex_digits = g_strndup (p + 1, (q - 1) - p);
hex_value = strtoul (hex_digits, &end, 16);
character = (gunichar) hex_value;
if (((hex_value == G_MAXLONG) && (errno == ERANGE)) ||
(hex_value > G_MAXUINT32) ||
(*end != '\0') ||
(!g_unichar_validate (character)))
{
g_free (hex_digits);
g_string_free (string, TRUE);
return NULL;
}
utf8_character_size =
g_unichar_to_utf8 (character, utf8_character);
g_assert (utf8_character_size > 0);
g_string_append_len (string, utf8_character,
utf8_character_size);
p = q;
}
utf8_string = string->str;
g_string_free (string, FALSE);
return utf8_string;
}
INCLUDES = -I${top_srcdir}
INCLUDES = -I${top_srcdir} -I${top_srcdir}/utils
lib_LTLIBRARIES=libnm_glib.la
......@@ -15,6 +15,8 @@ libnm_glib_la_LDFLAGS= \
$(DBUS_LIBS) \
$(GTHREAD_LIBS)
libnm_glib_la_LIBADD = $(top_builddir)/utils/libnmutils.la
libnm_glib_includedir=$(includedir)/NetworkManager
libnm_glib_include_HEADERS = libnm_glib.h
......
......@@ -3,7 +3,7 @@ SUBDIRS=icons
NULL=
NOTIFICATION_ICON_SOURCE=@NOTIFICATION_ICON_SRC@
INCLUDES = -I${top_srcdir}
INCLUDES = -I${top_srcdir} -I${top_srcdir}/utils
noinst_LTLIBRARIES = libnm_notification_applet.la
......@@ -65,7 +65,10 @@ libexec_PROGRAMS = NetworkManagerNotification
NetworkManagerNotification_CFLAGS = $(libnm_notification_applet_la_CPPFLAGS)
NetworkManagerNotification_SOURCES = main.c
NetworkManagerNotification_LDADD = ./libnm_notification_applet.la
NetworkManagerNotification_LDADD = \
./libnm_notification_applet.la \
$(top_builddir)/utils/libnmutils.la
CLEANFILES = $(server_DATA) *.bak *.gladep
......
......@@ -30,10 +30,16 @@
#include "NMWirelessAppletDbus.h"
#include "NMWirelessApplet.h"
#include "nm-utils.h"
#define DBUS_NO_SERVICE_ERROR "org.freedesktop.DBus.Error.ServiceDoesNotExist"
#define DBUS_TYPE_STRING_ARRAY ((int) '$')
/* FIXME: This just seems like a bad idea. The call_nm_method function
* interface should just be changed to handle arrays better.
*/
#define NM_DBUS_TYPE_STRING_ARRAY ((DBUS_TYPE_STRING << 8) | DBUS_TYPE_ARRAY)
#define NM_DBUS_TYPE_OBJECT_PATH_ARRAY ((DBUS_TYPE_OBJECT_PATH << 8) | DBUS_TYPE_ARRAY)
/*
* nmwa_dbus_call_nm_method
......@@ -52,20 +58,21 @@ static int nmwa_dbus_call_nm_method (DBusConnection *con, const char *path, cons
char *dbus_string = NULL;
int dbus_int = 0;
gboolean dbus_bool = FALSE;
char **dbus_string_array = NULL;
char **dbus_array = NULL;
int num_items = 0;
dbus_bool_t ret = TRUE;
g_return_val_if_fail (con != NULL, RETURN_FAILURE);
g_return_val_if_fail (path != NULL, RETURN_FAILURE);
g_return_val_if_fail (method != NULL, RETURN_FAILURE);
g_return_val_if_fail (((arg_type == DBUS_TYPE_STRING) || (arg_type == DBUS_TYPE_INT32) || (arg_type == DBUS_TYPE_UINT32) || (arg_type == DBUS_TYPE_BOOLEAN) || (arg_type == DBUS_TYPE_STRING_ARRAY)), RETURN_FAILURE);
g_return_val_if_fail (((arg_type == DBUS_TYPE_OBJECT_PATH) || (arg_type == DBUS_TYPE_STRING) || (arg_type == DBUS_TYPE_INT32) || (arg_type == DBUS_TYPE_UINT32) || (arg_type == DBUS_TYPE_BOOLEAN) || (arg_type == NM_DBUS_TYPE_STRING_ARRAY) || (arg_type == NM_DBUS_TYPE_OBJECT_PATH_ARRAY)), RETURN_FAILURE);
g_return_val_if_fail (arg != NULL, RETURN_FAILURE);
if ((arg_type == DBUS_TYPE_STRING) || (arg_type == DBUS_TYPE_STRING_ARRAY))
if ((arg_type == DBUS_TYPE_STRING) || (arg_type == NM_DBUS_TYPE_STRING_ARRAY) || (arg_type == DBUS_TYPE_OBJECT_PATH) || (arg_type == NM_DBUS_TYPE_OBJECT_PATH_ARRAY))
g_return_val_if_fail (*arg == NULL, RETURN_FAILURE);
if (arg_type == DBUS_TYPE_STRING_ARRAY)
if ((arg_type == NM_DBUS_TYPE_STRING_ARRAY) ||
(arg_type == NM_DBUS_TYPE_OBJECT_PATH_ARRAY))
{
g_return_val_if_fail (item_count != NULL, RETURN_FAILURE);
*item_count = 0;
......@@ -110,11 +117,17 @@ static int nmwa_dbus_call_nm_method (DBusConnection *con, const char *path, cons
dbus_error_init (&error);
switch (arg_type)
{
case DBUS_TYPE_OBJECT_PATH:
ret = dbus_message_get_args (reply, &error, DBUS_TYPE_OBJECT_PATH, &dbus_string, DBUS_TYPE_INVALID);
break;
case DBUS_TYPE_STRING:
ret = dbus_message_get_args (reply, &error, DBUS_TYPE_STRING, &dbus_string, DBUS_TYPE_INVALID);
break;
case DBUS_TYPE_STRING_ARRAY:
ret = dbus_message_get_args (reply, &error, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &dbus_string_array, &num_items, DBUS_TYPE_INVALID);
case NM_DBUS_TYPE_OBJECT_PATH_ARRAY:
ret = dbus_message_get_args (reply, &error, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH, &dbus_array, &num_items, DBUS_TYPE_INVALID);
break;
case NM_DBUS_TYPE_STRING_ARRAY:
ret = dbus_message_get_args (reply, &error, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &dbus_array, &num_items, DBUS_TYPE_INVALID);
break;
case DBUS_TYPE_INT32:
ret = dbus_message_get_args (reply, &error, DBUS_TYPE_INT32, &dbus_int, DBUS_TYPE_INVALID);
......@@ -142,13 +155,28 @@ static int nmwa_dbus_call_nm_method (DBusConnection *con, const char *path, cons
switch (arg_type)
{
case DBUS_TYPE_OBJECT_PATH:
*((char **)(arg)) = nm_dbus_unescape_object_path (dbus_string);
break;
case NM_DBUS_TYPE_OBJECT_PATH_ARRAY:
{
int i;
*((char ***) (arg)) = g_new0 (char *, num_items + 1);
for (i = 0; i < num_items; i++)
(*((char ***) (arg)))[i] = nm_dbus_unescape_object_path (dbus_array[i]);
*item_count = num_items;
break;
}
case DBUS_TYPE_STRING:
*((char **)(arg)) = g_strdup (dbus_string);
break;
case DBUS_TYPE_STRING_ARRAY:
*((char ***)(arg)) = g_strdupv (dbus_string_array);
case NM_DBUS_TYPE_STRING_ARRAY:
*((char ***)(arg)) = g_strdupv (dbus_array);
*item_count = num_items;
g_strfreev (dbus_string_array);
g_strfreev (dbus_array);
break;
case DBUS_TYPE_INT32:
case DBUS_TYPE_UINT32:
......@@ -177,7 +205,7 @@ static char * nmwa_dbus_get_active_device (NMWirelessApplet *applet, AppletState
{
char *active_device = NULL;
switch (nmwa_dbus_call_nm_method (applet->connection, NM_DBUS_PATH, "getActiveDevice", DBUS_TYPE_STRING, (void **)(&active_device), NULL))
switch (nmwa_dbus_call_nm_method (applet->connection, NM_DBUS_PATH, "getActiveDevice", DBUS_TYPE_OBJECT_PATH, (void **)(&active_device), NULL))
{
case (RETURN_NO_NM):
applet->applet_state = APPLET_STATE_NO_NM;
......@@ -501,7 +529,7 @@ static char **nmwa_dbus_get_device_networks (NMWirelessApplet *applet, char *pat
char **array = NULL;
int items;
switch (nmwa_dbus_call_nm_method (applet->connection, path, "getNetworks", DBUS_TYPE_STRING_ARRAY, (void **)(&array), &items))
switch (nmwa_dbus_call_nm_method (applet->connection, path, "getNetworks", NM_DBUS_TYPE_OBJECT_PATH_ARRAY, (void **)(&array), &items))
{
case (RETURN_NO_NM):
applet->applet_state = APPLET_STATE_NO_NM;
......@@ -1388,7 +1416,8 @@ static void nmwa_dbus_update_devices (NMWirelessApplet *applet)
if (!(nm_status = nmwa_dbus_get_nm_status (applet, APPLET_STATE_NO_CONNECTION)))
return;
switch (nmwa_dbus_call_nm_method (applet->connection, NM_DBUS_PATH, "getDevices", DBUS_TYPE_STRING_ARRAY, (void **)(&devices), &num_items))
switch (nmwa_dbus_call_nm_method (applet->connection, NM_DBUS_PATH, "getDevices", NM_DBUS_TYPE_OBJECT_PATH_ARRAY,
(void **)(&devices), &num_items))
{
case (RETURN_NO_NM):
applet->applet_state = APPLET_STATE_NO_NM;
......
INCLUDES = -I${top_srcdir} -I${top_srcdir}/named
INCLUDES = -I${top_srcdir} -I${top_srcdir}/named -I${top_srcdir}/utils
bin_PROGRAMS = NetworkManager
......@@ -61,7 +61,15 @@ if !WITH_GCRYPT
NetworkManager_SOURCES += gnome-keyring-md5.c gnome-keyring-md5.h
endif
NetworkManager_LDADD = $(DBUS_LIBS) $(GTHREAD_LIBS) $(HAL_LIBS) $(IWLIB) libnmbackend.la ../dhcpcd/libdhcpc.a ../named/libnamed.la
NetworkManager_LDADD = \
$(DBUS_LIBS) \
$(GTHREAD_LIBS) \
$(HAL_LIBS) \
$(IWLIB) \
libnmbackend.la \
$(top_builddir)/utils/libnmutils.la \
../dhcpcd/libdhcpc.a \
../named/libnamed.la
if WITH_GCRYPT
NetworkManager_LDADD += $(LIBGCRYPT_LIBS)
endif
......
......@@ -20,7 +20,6 @@
*/
#include <syslog.h>
#include "NetworkManagerDevice.h"
#include "NetworkManagerDbusUtils.h"
......
......@@ -27,7 +27,6 @@
#include <dbus/dbus-glib-lowlevel.h>
#include <dbus/dbus-glib.h>
#include "NetworkManagerMain.h"
#include "NetworkManagerDevice.h"
#include "dhcpcd/dhcpcd.h"
......
......@@ -26,15 +26,13 @@
#include <stdarg.h>
#include <syslog.h>
#include "nm-utils.h"
#include "NetworkManagerDevice.h"
#include "NetworkManagerDbus.h"
#include "NetworkManagerDbusUtils.h"
#include "NetworkManagerPolicy.h"
#include "nm-dbus-device.h"
static gchar *nm_dbus_unescape_object_path (const gchar *object_path);
static gchar *nm_dbus_escape_object_path (const gchar *utf8_string);
static DBusMessage *nm_dbus_device_get_name (DBusConnection *connection, DBusMessage *message, NMDbusCBData *data)
{
DBusMessage *reply = NULL;
......@@ -236,7 +234,7 @@ static DBusMessage *nm_dbus_device_get_networks (DBusConnection *connection, DBu
*escaped_object_path;
dbus_message_iter_init_append (reply, &iter);
dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING_AS_STRING, &iter_array);
dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &iter_array);
if ((ap_list = nm_device_ap_list_get (dev)))
{
......@@ -351,108 +349,3 @@ NMDbusMethodList *nm_dbus_device_methods_setup (void)
return (list);
}
static gchar *nm_dbus_escape_object_path (const gchar *utf8_string)
{
const gchar *p;
gchar *object_path;
GString *string;
g_return_val_if_fail (utf8_string != NULL, NULL);
g_return_val_if_fail (g_utf8_validate (utf8_string, -1, NULL), NULL);
string = g_string_sized_new ((strlen (utf8_string) + 1) * 6);
for (p = utf8_string; *p != '\0'; p = g_utf8_next_char (p))
{
gunichar character;
character = g_utf8_get_char (p);
if (((character >= ((gunichar) 'a')) &&
(character <= ((gunichar) 'z'))) ||
((character >= ((gunichar) 'A')) &&
(character <= ((gunichar) 'Z'))) ||
((character >= ((gunichar) '0')) &&
(character <= ((gunichar) '9'))) ||
(character == ((gunichar) '/')))
{
g_string_append_c (string, (gchar) character);
continue;
}
g_string_append_printf (string, "_%x_", character);
}
object_path = string->str;
g_string_free (string, FALSE);
return object_path;
}
static gchar *nm_dbus_unescape_object_path (const gchar *object_path)
{
const gchar *p;
gchar *utf8_string;
GString *string;
g_return_val_if_fail (object_path != NULL, NULL);
string = g_string_sized_new (strlen (object_path) + 1);
for (p = object_path; *p != '\0'; p++)
{
const gchar *q;
gchar *hex_digits, *end, utf8_character[6] = { '\0' };
gint utf8_character_size;
gunichar character;
gulong hex_value;
if (*p != '_')
{
g_string_append_c (string, *p);
continue;
}
q = strchr (p + 1, '_');
if ((q == NULL) || (q == p + 1))
{
g_string_free (string, TRUE);
return NULL;
}
hex_digits = g_strndup (p + 1, (q - 1) - p);
hex_value = strtoul (hex_digits, &end, 16);
character = (gunichar) hex_value;
if (((hex_value == G_MAXLONG) && (errno == ERANGE)) ||
(hex_value > G_MAXUINT32) ||
(*end != '\0') ||
(!g_unichar_validate (character)))
{
g_free (hex_digits);
g_string_free (string, TRUE);
return NULL;
}
utf8_character_size =
g_unichar_to_utf8 (character, utf8_character);
g_assert (utf8_character_size > 0);
g_string_append_len (string, utf8_character,
utf8_character_size);
p = q;
}
utf8_string = string->str;
g_string_free (string, FALSE);
return utf8_string;
}
......@@ -25,16 +25,13 @@
#include <dbus/dbus-glib.h>
#include <stdarg.h>
#include "nm-dbus-nm.h"
#include "nm-utils.h"
#include "NetworkManagerDbus.h"
#include "NetworkManagerDbusUtils.h"
#include "NetworkManagerUtils.h"
#include "NetworkManagerPolicy.h"
static gchar *nm_dbus_escape_object_path (const gchar *utf8_string);
static gchar *nm_dbus_unescape_object_path (const gchar *object_path);
/*
* nm_dbus_nm_get_active_device
......@@ -54,14 +51,16 @@ static DBusMessage *nm_dbus_nm_get_active_device (DBusConnection *connection, DB
/* Construct object path of "active" device and return it */
if (data->data->active_device)
{
char *object_path;
char *object_path, *escaped_object_path;
reply = dbus_message_new_method_return (message);
if (!reply)
return (NULL);
object_path = g_strdup_printf ("%s/%s", NM_DBUS_PATH_DEVICES, nm_device_get_iface (data->data->active_device));
dbus_message_append_args (reply, DBUS_TYPE_STRING, &object_path, DBUS_TYPE_INVALID);
escaped_object_path = nm_dbus_escape_object_path (object_path);
dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &escaped_object_path, DBUS_TYPE_INVALID);
g_free (escaped_object_path);
g_free (object_path);
}
else
......@@ -107,7 +106,7 @@ static DBusMessage *nm_dbus_nm_get_devices (DBusConnection *connection, DBusMess
GSList *elt;
gboolean appended = FALSE;
dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING_AS_STRING, &iter_array);
dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &iter_array);
for (elt = data->data->dev_list; elt; elt = g_slist_next (elt))
{
......@@ -116,10 +115,10 @@ static DBusMessage *nm_dbus_nm_get_devices (DBusConnection *connection, DBusMess
if (dev && (nm_device_get_driver_support_level (dev) != NM_DRIVER_UNSUPPORTED))
{
char *object_path, *escaped_object_path;