Commit 326d1e86 authored by Tambet Ingo's avatar Tambet Ingo
Browse files

2007-09-12 Tambet Ingo <tambet@gmail.com>

        * src/vpn-manager/nm-vpn-connection.[ch]: 
        * src/vpn-manager/nm-vpn-manager.[ch]:
        * src/vpn-manager/nm-vpn-service.[ch]: Rewrite the vpn handling
        * code. Using 
        dbus-glib, GObjects, signals etc.

        * libnm-glib/nm-vpn-manager.[ch]: 
        * libnm-glib/nm-vpn-connection.[ch]: Now that the NM
        * implementation changed
        so much, rewrite these too.

        * libnm-glib/Makefile.am: Add new files to build, build new
        * binding files for
        the new introspection files.

        * libnm-glib/nm-client.[ch]: Remove all VPN related stuff from
        * here.

        * libnm-glib/nm-dbus-utils.[ch]: Renamed from nm-utils.[ch] that
        * was shadowing
        the header with the same name from libnm-utils.

        * libnm-glib/nm-vpn-plugin.[ch]: Implement.

        * libnm-util/Makefile.am: Add nm-utils.[ch] to build.

        * introspection/nm-vpn-plugin.xml: Implement.

        * introspection/nm-vpn-connection.xml: Implement.

        * introspection/nm-vpn-manager.xml: Implement.

        * src/NetworkManagerSystem.c
        * (nm_system_vpn_device_set_from_ip4_config): Remove
        the named manager argument, it can just as easily get it as the
caller.
        (nm_system_vpn_device_unset_from_ip4_config): Ditto.

        * src/vpn-manager/nm-dbus-vpn.[ch]: Remove.

        * src/nm-dbus-manager.h: Fix up the name_owner signal signature.

        * src/dhcp-manager/nm-dhcp-manager.c (garray_to_string): Remove,
        * use one from
        libnm-utils.

        * libnm-util/nm-connection.c: Ditto.

        * src/NetworkManagerMain.h: Remove, it's finally empty.

        * configure.in: Remove utils/ from build.

        * include/NetworkManagerVPN.h: Add some more defines to reduce
        * the amount
        of hard-coded strings.

        * utils/: Move it over to libnm-util.

        * test/Makefile.am: Link against libnm-util now that util/ is
        * gone.

        * dispatcher-daemon/Makefile.am: Ditto.

        * src/Makefile.am: Ditto.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2798 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent be3a380b
2007-09-12 Tambet Ingo <tambet@gmail.com>
* src/vpn-manager/nm-vpn-connection.[ch]:
* src/vpn-manager/nm-vpn-manager.[ch]:
* src/vpn-manager/nm-vpn-service.[ch]: Rewrite the vpn handling code. Using
dbus-glib, GObjects, signals etc.
* libnm-glib/nm-vpn-manager.[ch]:
* libnm-glib/nm-vpn-connection.[ch]: Now that the NM implementation changed
so much, rewrite these too.
* libnm-glib/Makefile.am: Add new files to build, build new binding files for
the new introspection files.
* libnm-glib/nm-client.[ch]: Remove all VPN related stuff from here.
* libnm-glib/nm-dbus-utils.[ch]: Renamed from nm-utils.[ch] that was shadowing
the header with the same name from libnm-utils.
* libnm-glib/nm-vpn-plugin.[ch]: Implement.
* libnm-util/Makefile.am: Add nm-utils.[ch] to build.
* introspection/nm-vpn-plugin.xml: Implement.
* introspection/nm-vpn-connection.xml: Implement.
* introspection/nm-vpn-manager.xml: Implement.
* src/NetworkManagerSystem.c (nm_system_vpn_device_set_from_ip4_config): Remove
the named manager argument, it can just as easily get it as the caller.
(nm_system_vpn_device_unset_from_ip4_config): Ditto.
* src/vpn-manager/nm-dbus-vpn.[ch]: Remove.
* src/nm-dbus-manager.h: Fix up the name_owner signal signature.
* src/dhcp-manager/nm-dhcp-manager.c (garray_to_string): Remove, use one from
libnm-utils.
* libnm-util/nm-connection.c: Ditto.
* src/NetworkManagerMain.h: Remove, it's finally empty.
* configure.in: Remove utils/ from build.
* include/NetworkManagerVPN.h: Add some more defines to reduce the amount
of hard-coded strings.
* utils/: Move it over to libnm-util.
* test/Makefile.am: Link against libnm-util now that util/ is gone.
* dispatcher-daemon/Makefile.am: Ditto.
* src/Makefile.am: Ditto.
2007-09-12 Dan Williams <dcbw@redhat.com>
Wireless connections can be made with config data from the applet now.
......
SUBDIRS = \
utils \
libnm-util \
libnm-glib \
src \
......
......@@ -258,7 +258,6 @@ fi
AC_OUTPUT([
Makefile
include/Makefile
utils/Makefile
src/Makefile
src/named-manager/Makefile
src/vpn-manager/Makefile
......
......@@ -8,7 +8,6 @@ NetworkManagerDispatcher_SOURCES = \
NetworkManagerDispatcher_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/utils \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_srcdir)/libnm-glib \
......@@ -26,7 +25,6 @@ NetworkManagerDispatcher_CFLAGS = \
$(NULL)
NetworkManagerDispatcher_LDADD = \
$(top_builddir)/utils/libnmutils.la \
$(top_builddir)/libnm-util/libnm-util.la\
$(top_builddir)/libnm-glib/libnm_glib.la\
$(DBUS_LIBS) \
......
......@@ -25,9 +25,14 @@
/*
* dbus services details
*/
#define NM_DBUS_PATH_VPN "/org/freedesktop/NetworkManager/VPNConnections"
#define NM_DBUS_INTERFACE_VPN "org.freedesktop.NetworkManager.VPNConnections"
#define NM_DBUS_PATH_VPN "/org/freedesktop/NetworkManager/VPN/Manager"
#define NM_DBUS_INTERFACE_VPN "org.freedesktop.NetworkManager.VPN.Manager"
#define NM_DBUS_PATH_VPN_CONNECTION "/org/freedesktop/NetworkManager/VPN/Connection"
#define NM_DBUS_INTERFACE_VPN_CONNECTION "org.freedesktop.NetworkManager.VPN.Connection"
#define NM_VPN_DBUS_PLUGIN_PATH "/org/freedesktop/NetworkManager/VPN/Plugin"
#define NM_VPN_DBUS_PLUGIN_INTERFACE "org.freedesktop.NetworkManager.VPN.Plugin"
/*
* VPN Errors
......@@ -77,14 +82,25 @@ typedef enum NMVPNServiceState
typedef enum NMVPNConnectionState
{
NM_VPN_CONNECTION_STATE_UNKNOWN = 0,
NM_VPN_CONNECTION_STATE_DISCONNECTED,
NM_VPN_CONNECTION_STATE_PREPARE,
NM_VPN_CONNECTION_STATE_CONNECT,
NM_VPN_CONNECTION_STATE_IP_CONFIG_GET,
NM_VPN_CONNECTION_STATE_ACTIVATED,
NM_VPN_CONNECTION_STATE_FAILED,
NM_VPN_CONNECTION_STATE_CANCELED
NM_VPN_CONNECTION_STATE_DISCONNECTED,
} NMVPNConnectionState;
#define NM_VPN_PLUGIN_IP4_CONFIG_GATEWAY "gateway"
#define NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS "address"
#define NM_VPN_PLUGIN_IP4_CONFIG_PTP "ptp"
#define NM_VPN_PLUGIN_IP4_CONFIG_NETMASK "netmask"
#define NM_VPN_PLUGIN_IP4_CONFIG_DNS "dns"
#define NM_VPN_PLUGIN_IP4_CONFIG_NBNS "nbns"
#define NM_VPN_PLUGIN_IP4_CONFIG_MSS "mss"
#define NM_VPN_PLUGIN_IP4_CONFIG_MTU "mtu"
#define NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV "tundev"
#define NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN "domain"
#define NM_VPN_PLUGIN_IP4_CONFIG_BANNER "banner"
#endif /* NETWORK_MANAGER_VPN_H */
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/">
<interface name="org.freedesktop.NetworkManager.VPN.Connection">
<method name="Disconnect">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_vpn_connection_disconnect"/>
</method>
<property name="Name" type="s" access="read"/>
<property name="State" type="u" access="read"/>
<signal name="StateChanged">
<arg name="state" type="u"/>
</signal>
</interface>
</node>
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/">
<interface name="org.freedesktop.NetworkManager.VPN.Manager">
<method name="Connect">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_vpn_manager_connect"/>
<arg name="type" type="s" direction="in"/>
<arg name="name" type="s" direction="in"/>
<arg name="properties" type="a{sv}" direction="in"/>
<arg name="device" type="o" direction="in"/>
<arg name="routes" type="as" direction="in"/>
<arg name="connection" type="o" direction="out"/>
</method>
<method name="ListConnections">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_vpn_manager_get_connections"/>
<arg name="connections" type="ao" direction="out"/>
</method>
</interface>
</node>
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/">
<interface name="org.freedesktop.NetworkManager.VPN.Plugin">
<method name="Connect">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_vpn_plugin_connect"/>
<arg name="connection" type="a{sv}" direction="in"/>
<arg name="routes" type="as" direction="in"/>
</method>
<method name="Disconnect">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_vpn_plugin_disconnect"/>
</method>
<method name="SetIp4Config">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_vpn_plugin_set_ip4_config"/>
<arg name="config" type="a{sv}" direction="in"/>
</method>
<method name="SetFailure">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_vpn_plugin_set_failure"/>
<arg name="reason" type="s" direction="in"/>
</method>
<property name="State" type="u" access="read"/>
<signal name="StateChanged">
<arg name="state" type="u"/>
</signal>
<signal name="Ip4Config">
<arg name="ip4config" type="a{sv}"/>
</signal>
<signal name="LoginBanner">
<arg name="banner" type="s"/>
</signal>
<signal name="Failure">
<arg name="reason" type="u"/>
</signal>
</interface>
</node>
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/utils -I$(top_srcdir)/libnm-util
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/libnm-util
BUILT_SOURCES = \
nm-access-point-bindings.h \
......@@ -9,9 +9,12 @@ BUILT_SOURCES = \
nm-marshal.h \
nm-marshal.c \
nm-settings-connection-glue.h \
nm-settings-glue.h
nm-settings-glue.h \
nm-vpn-manager-bindings.h \
nm-vpn-connection-bindings.h \
nm-vpn-plugin-glue.h
lib_LTLIBRARIES = libnm_glib.la
lib_LTLIBRARIES = libnm_glib.la libnm_glib_vpn.la
libnm_glib_la_CFLAGS = \
$(GLIB_CFLAGS) \
......@@ -32,12 +35,16 @@ libnminclude_HEADERS = \
nm-access-point.h \
nm-ip4-config.h \
nm-settings.h \
nm-vpn-connection.h
nm-vpn-connection.h \
nm-vpn-manager.h \
nm-vpn-plugin.h
libnm_glib_la_SOURCES = \
libnm_glib.c \
nm-object.c \
nm-client.c \
nm-dbus-utils.c \
nm-dbus-utils.h \
nm-device.c \
nm-device-private.h \
nm-device-802-3-ethernet.c \
......@@ -46,10 +53,10 @@ libnm_glib_la_SOURCES = \
nm-ip4-config.c \
nm-settings.c \
nm-vpn-connection.c \
nm-vpn-manager.c \
nm-marshal-main.c
libnm_glib_la_LIBADD = \
$(top_builddir)/utils/libnmutils.la \
$(top_builddir)/libnm-util/libnm-util.la \
$(GLIB_LIBS) \
$(GTHREAD_LIBS) \
......@@ -63,6 +70,11 @@ libnm_glib_test_SOURCES = libnm-glib-test.c
libnm_glib_test_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS)
libnm_glib_test_LDADD = libnm_glib.la $(top_builddir)/libnm-util/libnm-util.la $(GLIB_LIBS) $(DBUS_LIBS)
libnm_glib_vpn_la_SOURCES = nm-vpn-plugin.c
libnm_glib_vpn_la_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS)
libnm_glib_vpn_la_LIBADD = $(top_builddir)/libnm-util/libnm-util.la $(GLIB_LIBS) $(DBUS_LIBS)
nm-marshal.h: Makefile.am nm-marshal.list
$(GLIB_GENMARSHAL) --prefix=nm_marshal $(srcdir)/nm-marshal.list --header > \
xgen-gmh \
......@@ -98,6 +110,15 @@ nm-settings-glue.h: $(top_srcdir)/introspection/nm-settings.xml
nm-settings-connection-glue.h: $(top_srcdir)/introspection/nm-settings-connection.xml
dbus-binding-tool --prefix=nm_connection_settings --mode=glib-server --output=nm-settings-connection-glue.h $(top_srcdir)/introspection/nm-settings-connection.xml
nm-vpn-manager-bindings.h: $(top_srcdir)/introspection/nm-vpn-manager.xml
dbus-binding-tool --prefix=nm_vpn_manager --mode=glib-client --output=nm-vpn-manager-bindings.h $(top_srcdir)/introspection/nm-vpn-manager.xml
nm-vpn-connection-bindings.h: $(top_srcdir)/introspection/nm-vpn-connection.xml
dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-client --output=nm-vpn-connection-bindings.h $(top_srcdir)/introspection/nm-vpn-connection.xml
nm-vpn-plugin-glue.h: $(top_srcdir)/introspection/nm-vpn-plugin.xml
dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-server --output=nm-vpn-plugin-glue.h $(top_srcdir)/introspection/nm-vpn-plugin.xml
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libnm_glib.pc
......
......@@ -19,11 +19,6 @@ typedef struct {
NMState state;
gboolean have_device_list;
GHashTable *devices;
DBusGProxy *vpn_proxy;
NMVPNConnectionState vpn_state;
gboolean have_vpn_connections;
GHashTable *vpn_connections;
} NMClientPrivate;
enum {
......@@ -32,10 +27,6 @@ enum {
DEVICE_REMOVED,
STATE_CHANGE,
VPN_CONNECTION_ADDED,
VPN_CONNECTION_REMOVED,
VPN_STATE_CHANGE,
LAST_SIGNAL
};
......@@ -51,9 +42,6 @@ static void client_state_change_proxy (DBusGProxy *proxy, guint state, gpointer
static void client_device_added_proxy (DBusGProxy *proxy, char *path, gpointer user_data);
static void client_device_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data);
static void setup_vpn_proxy (NMClient *client, DBusGConnection *connection);
static void clear_vpn_connections (NMClient * client);
static void
nm_client_init (NMClient *client)
{
......@@ -63,12 +51,6 @@ nm_client_init (NMClient *client)
priv->devices = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_object_unref);
priv->vpn_connections = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
NULL);
priv->vpn_state = NM_VPN_CONNECTION_STATE_UNKNOWN;
}
static GObject*
......@@ -116,8 +98,6 @@ constructor (GType type,
object,
NULL);
setup_vpn_proxy (NM_CLIENT (object), connection);
priv->bus_proxy = dbus_g_proxy_new_for_name (connection,
"org.freedesktop.DBus",
"/org/freedesktop/DBus",
......@@ -149,11 +129,9 @@ finalize (GObject *object)
{
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object);
g_object_unref (priv->vpn_proxy);
g_object_unref (priv->client_proxy);
g_object_unref (priv->bus_proxy);
g_hash_table_destroy (priv->devices);
g_hash_table_destroy (priv->vpn_connections);
}
static void
......@@ -165,9 +143,6 @@ manager_running (NMClient *client, gboolean running)
priv->state = NM_STATE_UNKNOWN;
g_hash_table_remove_all (priv->devices);
priv->have_device_list = FALSE;
clear_vpn_connections (client);
priv->have_vpn_connections = FALSE;
}
}
......@@ -223,36 +198,6 @@ nm_client_class_init (NMClientClass *client_class)
g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE, 1,
G_TYPE_UINT);
signals[VPN_CONNECTION_ADDED] =
g_signal_new ("vpn-connection-added",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMClientClass, vpn_connection_added),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
signals[VPN_CONNECTION_REMOVED] =
g_signal_new ("vpn-connection-removed",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMClientClass, vpn_connection_removed),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
signals[VPN_STATE_CHANGE] =
g_signal_new ("vpn-state-change",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMClientClass, state_change),
NULL, NULL,
g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE, 1,
G_TYPE_UINT);
}
NMClient *
......@@ -498,288 +443,3 @@ nm_client_sleep (NMClient *client, gboolean sleep)
g_error_free (err);
}
}
/* VPN */
/*
* This "best" state is the summary of all states from all connections and
* available for convenience.
* For the exact state, each connection has it's own state which' changes
* are also signalled.
*/
static NMVPNConnectionState
nm_client_get_best_vpn_state (NMClient *client)
{
GSList *iter, *list;
NMVPNConnectionState state;
NMVPNConnectionState best_state = NM_VPN_CONNECTION_STATE_UNKNOWN;
list = nm_client_get_vpn_connections (client);
for (iter = list; iter; iter = iter->next) {
state = nm_vpn_connection_get_state (NM_VPN_CONNECTION (iter->data));
if (state > best_state && state < NM_VPN_CONNECTION_STATE_FAILED)
best_state = state;
}
g_slist_free (list);
return best_state;
}
static void
proxy_vpn_state_change (DBusGProxy *proxy,
char *connection_name,
NMVPNConnectionState state,
gpointer user_data)
{
NMClient *client = NM_CLIENT (user_data);
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
NMVPNConnection *connection;
NMVPNConnectionState best_state;
connection = nm_client_get_vpn_connection_by_name (client, connection_name);
if (connection)
nm_vpn_connection_set_state (connection, state);
best_state = nm_client_get_best_vpn_state (client);
if (best_state != priv->vpn_state) {
priv->vpn_state = state;
g_signal_emit (client, signals[VPN_STATE_CHANGE], 0, best_state);
}
}
static void
proxy_vpn_connection_added (DBusGProxy *proxy, char *name, gpointer user_data)
{
NMClient *client = NM_CLIENT (user_data);
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
NMVPNConnection *connection;
if (g_hash_table_lookup (priv->vpn_connections, name))
return;
connection = nm_vpn_connection_new (proxy, name);
if (connection == NULL) {
g_log (G_LOG_DOMAIN,
G_LOG_LEVEL_WARNING,
"Warning: out of memory creating NMVPNConnection for '%s'\n",
name);
return;
}
g_hash_table_insert (priv->vpn_connections, g_strdup (name), connection);
g_signal_emit (client, signals[VPN_CONNECTION_ADDED], 0, connection);
}
static void
proxy_vpn_connection_removed (DBusGProxy *proxy, char *name, gpointer user_data)
{
NMClient *client = NM_CLIENT (user_data);
NMVPNConnection *connection;
connection = nm_client_get_vpn_connection_by_name (client, name);
if (connection)
nm_client_remove_vpn_connection (client, connection);
}
static void
proxy_vpn_connection_update (DBusGProxy *proxy, char *name, gpointer user_data)
{
NMClient *client = NM_CLIENT (user_data);
NMVPNConnection *connection;
connection = nm_client_get_vpn_connection_by_name (client, name);
if (connection)
nm_vpn_connection_update (connection);
}
static void
setup_vpn_proxy (NMClient *client, DBusGConnection *connection)
{
DBusGProxy *proxy;
proxy = dbus_g_proxy_new_for_name (connection,
NM_DBUS_SERVICE,
NM_DBUS_PATH_VPN,
NM_DBUS_INTERFACE_VPN);
dbus_g_object_register_marshaller (nm_marshal_VOID__STRING_INT,
G_TYPE_NONE, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INVALID);
dbus_g_proxy_add_signal (proxy, "VPNConnectionStateChange", G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INVALID);
dbus_g_proxy_connect_signal (proxy, "VPNConnectionStateChange",
G_CALLBACK (proxy_vpn_state_change),
client, NULL);
dbus_g_proxy_add_signal (proxy, "VPNConnectionAdded", G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_connect_signal (proxy, "VPNConnectionAdded",
G_CALLBACK (proxy_vpn_connection_added),
client, NULL);
dbus_g_proxy_add_signal (proxy, "VPNConnectionRemoved", G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_connect_signal (proxy, "VPNConnectionRemoved",
G_CALLBACK (proxy_vpn_connection_removed),
client, NULL);
dbus_g_proxy_add_signal (proxy, "VPNConnectionUpdate", G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_connect_signal (proxy, "VPNConnectionUpdate",
G_CALLBACK (proxy_vpn_connection_update),
client, NULL);
NM_CLIENT_GET_PRIVATE (client)->vpn_proxy = proxy;
}
static void
get_connections (NMClient *client)
{
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
char **name;
char **vpn_names = NULL;
GError *err = NULL;
if (!dbus_g_proxy_call (priv->vpn_proxy, "getVPNConnections", &err,
G_TYPE_INVALID,
G_TYPE_STRV, &vpn_names,
G_TYPE_INVALID)) {
g_warning ("Error while getting VPN connections: %s", err->message);
g_error_free (err);
return;
}
for (name = vpn_names; *name; name++)
proxy_vpn_connection_added (priv->vpn_proxy, *name, client);
g_strfreev (vpn_names);
}
static void
signal_one_vpn_connection_removed (gpointer data,
gpointer user_data)
{
NMClient * client = NM_CLIENT (user_data);
NMVPNConnection * connection = NM_VPN_CONNECTION (data);
g_signal_emit (client, signals[VPN_CONNECTION_REMOVED], 0, connection);
}
static void
clear_vpn_connections (NMClient * client)
{
NMClientPrivate * priv;
GSList * list;
g_return_if_fail (NM_IS_CLIENT (client));
priv = NM_CLIENT_GET_PRIVATE (client);
list = nm_client_get_vpn_connections (client);
g_hash_table_remove_all (priv->vpn_connections);
g_slist_foreach (list, signal_one_vpn_connection_removed, client);
g_slist_foreach (list, (GFunc) g_object_unref, NULL);
g_slist_free (list);
}
static void
vpn_connections_to_slist (gpointer key, gpointer value, gpointer user_data)
{
GSList **list = (GSList **) user_data;
*list = g_slist_prepend (*list, value);
}
GSList *
nm_client_get_vpn_connections (NMClient *client)
{
NMClientPrivate *priv;
GSList * list = NULL;