build: stop using client-side generated dbus bindings
We removed these from libnm-glib last year, but there was still one place where we were using them in the core.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -154,7 +154,6 @@ initscript/*/rc.networkmanager-dispatcher
|
|||||||
initscript/*/[Nn]etwork[Mm]anager
|
initscript/*/[Nn]etwork[Mm]anager
|
||||||
|
|
||||||
*-glue.h
|
*-glue.h
|
||||||
*-bindings.h
|
|
||||||
callouts/tests/test-dispatcher-envp
|
callouts/tests/test-dispatcher-envp
|
||||||
libnm-glib/libnm-glib-test
|
libnm-glib/libnm-glib-test
|
||||||
src/NetworkManager
|
src/NetworkManager
|
||||||
|
@@ -40,13 +40,8 @@ libvpn_manager_la_LIBADD = \
|
|||||||
nm-vpn-connection-glue.h: $(top_srcdir)/introspection/nm-vpn-connection.xml
|
nm-vpn-connection-glue.h: $(top_srcdir)/introspection/nm-vpn-connection.xml
|
||||||
$(AM_V_GEN) dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-server --output=$@ $<
|
$(AM_V_GEN) dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-server --output=$@ $<
|
||||||
|
|
||||||
nm-vpn-plugin-bindings.h: $(top_srcdir)/introspection/nm-vpn-plugin.xml
|
|
||||||
$(AM_V_GEN) dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-client --output=$@ $<
|
|
||||||
|
|
||||||
|
|
||||||
BUILT_SOURCES = \
|
BUILT_SOURCES = \
|
||||||
nm-vpn-connection-glue.h \
|
nm-vpn-connection-glue.h
|
||||||
nm-vpn-plugin-bindings.h
|
|
||||||
|
|
||||||
CLEANFILES = $(BUILT_SOURCES)
|
CLEANFILES = $(BUILT_SOURCES)
|
||||||
|
|
||||||
|
@@ -37,7 +37,6 @@
|
|||||||
#include "nm-system.h"
|
#include "nm-system.h"
|
||||||
#include "nm-logging.h"
|
#include "nm-logging.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-vpn-plugin-bindings.h"
|
|
||||||
#include "nm-active-connection.h"
|
#include "nm-active-connection.h"
|
||||||
#include "nm-properties-changed-signal.h"
|
#include "nm-properties-changed-signal.h"
|
||||||
#include "nm-dbus-glib-types.h"
|
#include "nm-dbus-glib-types.h"
|
||||||
@@ -148,7 +147,9 @@ call_plugin_disconnect (NMVPNConnection *self)
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (priv->proxy) {
|
if (priv->proxy) {
|
||||||
org_freedesktop_NetworkManager_VPN_Plugin_disconnect (priv->proxy, &error);
|
dbus_g_proxy_call (priv->proxy, "Disconnect", &error,
|
||||||
|
G_TYPE_INVALID,
|
||||||
|
G_TYPE_INVALID);
|
||||||
if (error)
|
if (error)
|
||||||
nm_log_warn (LOGD_VPN, "error disconnecting VPN: %s", error->message);
|
nm_log_warn (LOGD_VPN, "error disconnecting VPN: %s", error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
@@ -1065,17 +1066,20 @@ nm_vpn_connection_ip_config_timeout (gpointer user_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_vpn_connection_connect_cb (DBusGProxy *proxy, GError *err, gpointer user_data)
|
nm_vpn_connection_connect_cb (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
|
||||||
{
|
{
|
||||||
NMVPNConnection *connection = NM_VPN_CONNECTION (user_data);
|
NMVPNConnection *connection = NM_VPN_CONNECTION (user_data);
|
||||||
NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
|
NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
|
||||||
|
GError *err = NULL;
|
||||||
|
|
||||||
nm_log_info (LOGD_VPN, "VPN connection '%s' (Connect) reply received.",
|
nm_log_info (LOGD_VPN, "VPN connection '%s' (Connect) reply received.",
|
||||||
nm_connection_get_id (priv->connection));
|
nm_connection_get_id (priv->connection));
|
||||||
|
|
||||||
|
dbus_g_proxy_end_call (proxy, call, &err, G_TYPE_INVALID);
|
||||||
if (err) {
|
if (err) {
|
||||||
nm_log_warn (LOGD_VPN, "VPN connection '%s' failed to connect: '%s'.",
|
nm_log_warn (LOGD_VPN, "VPN connection '%s' failed to connect: '%s'.",
|
||||||
nm_connection_get_id (priv->connection), err->message);
|
nm_connection_get_id (priv->connection), err->message);
|
||||||
|
g_error_free (err);
|
||||||
nm_vpn_connection_set_vpn_state (connection,
|
nm_vpn_connection_set_vpn_state (connection,
|
||||||
NM_VPN_CONNECTION_STATE_FAILED,
|
NM_VPN_CONNECTION_STATE_FAILED,
|
||||||
NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED);
|
NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED);
|
||||||
@@ -1156,10 +1160,10 @@ really_activate (NMVPNConnection *connection, const char *username)
|
|||||||
connection, NULL);
|
connection, NULL);
|
||||||
|
|
||||||
hash = _hash_with_username (priv->connection, username);
|
hash = _hash_with_username (priv->connection, username);
|
||||||
org_freedesktop_NetworkManager_VPN_Plugin_connect_async (priv->proxy,
|
dbus_g_proxy_begin_call (priv->proxy, "Connect",
|
||||||
hash,
|
nm_vpn_connection_connect_cb, connection, NULL,
|
||||||
nm_vpn_connection_connect_cb,
|
DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, hash,
|
||||||
connection);
|
G_TYPE_INVALID);
|
||||||
g_hash_table_destroy (hash);
|
g_hash_table_destroy (hash);
|
||||||
|
|
||||||
nm_vpn_connection_set_vpn_state (connection,
|
nm_vpn_connection_set_vpn_state (connection,
|
||||||
@@ -1306,14 +1310,16 @@ nm_vpn_connection_disconnect (NMVPNConnection *connection,
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
plugin_need_secrets_cb (DBusGProxy *proxy,
|
plugin_need_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
|
||||||
char *setting_name,
|
|
||||||
GError *error,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
{
|
||||||
NMVPNConnection *self = NM_VPN_CONNECTION (user_data);
|
NMVPNConnection *self = NM_VPN_CONNECTION (user_data);
|
||||||
NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
|
NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
|
||||||
|
GError *error = NULL;
|
||||||
|
char *setting_name;
|
||||||
|
|
||||||
|
dbus_g_proxy_end_call (proxy, call, &error,
|
||||||
|
G_TYPE_STRING, &setting_name,
|
||||||
|
G_TYPE_INVALID);
|
||||||
if (error) {
|
if (error) {
|
||||||
nm_log_err (LOGD_VPN, "(%s/%s) plugin NeedSecrets request #%d failed: %s %s",
|
nm_log_err (LOGD_VPN, "(%s/%s) plugin NeedSecrets request #%d failed: %s %s",
|
||||||
nm_connection_get_uuid (priv->connection),
|
nm_connection_get_uuid (priv->connection),
|
||||||
@@ -1322,6 +1328,7 @@ plugin_need_secrets_cb (DBusGProxy *proxy,
|
|||||||
g_quark_to_string (error->domain),
|
g_quark_to_string (error->domain),
|
||||||
error->message);
|
error->message);
|
||||||
nm_vpn_connection_fail (self, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS);
|
nm_vpn_connection_fail (self, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS);
|
||||||
|
g_error_free (error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1385,10 +1392,10 @@ get_secrets_cb (NMSettingsConnection *connection,
|
|||||||
|
|
||||||
/* Ask the VPN service if more secrets are required */
|
/* Ask the VPN service if more secrets are required */
|
||||||
hash = _hash_with_username (priv->connection, priv->username);
|
hash = _hash_with_username (priv->connection, priv->username);
|
||||||
org_freedesktop_NetworkManager_VPN_Plugin_need_secrets_async (priv->proxy,
|
dbus_g_proxy_begin_call (priv->proxy, "NeedSecrets",
|
||||||
hash,
|
plugin_need_secrets_cb, self, NULL,
|
||||||
plugin_need_secrets_cb,
|
DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, hash,
|
||||||
self);
|
G_TYPE_INVALID);
|
||||||
g_hash_table_destroy (hash);
|
g_hash_table_destroy (hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user