Port libnm-core/libnm to GDBus.
The NetworkManager daemon continues to use dbus-glib; the
previously-added connection hash/variant conversion methods are now
moved to NetworkManagerUtils (along with a few other utilities that
are now only needed by the daemon code).
The ConnectInteractive() -> Connect() fallback code doesn't work, because
_connect_internal() changes the state to NM_VPN_SERVICE_STATE_STARTING before
checking if it can implement ConnectInteractive(), and then when the Connect()
call comes in, the VPN is not in STOPPED or INIT, so it returns an error.
The commit moves setting state to STARTING after the ConnectInteractive() check
availability, in the plugin. We introduce new plugin error and set it when the
the plugin does not implement ConnectInteractive(). NetworkManager uses this
error for ConnectInteractive() -> Connect() fallback.
https://bugzilla.gnome.org/show_bug.cgi?id=708255
There are three additions to the D-Bus interface for VPN plugins as
part of this patch:
1) ConnectInteractive(): called by NM instead of Connect() to let
the plugin know that it can request additional secrets during the
connection process using SecretsRequired
2) SecretsRequired: a new signal emitted by the plugin to indicate
to NetworkManager that additional secrets are required to connect;
can only be called if NetworkManager initiated the connection by
calling the ConnectInteractive() method
3) NewSecrets(): a new method of the plugin that NetworkManager calls
when new secrets requested by the SecretsRequired signal have been
retrieved from secret agents
We need new methods because agents need to be aware of the hints that
the VPN plugins may send with the SecretsRequired signal (detailing
the specific secrets that are required) and at this time, not all
agents support passing those hints to the VPN plugin authentication
dialogs.
Add new API to allow passing both IPv4 and IPv6 configuration
information from VPN plugins to the backend.
Now instead of a single Ip4Config, a plugin has Config, Ip4Config, and
Ip6Config. "Config" contains information which is neither IPv4 nor
IPv6 specific, and also indicates which of Ip4Config and Ip6Config are
present. Ip4Config now only contains the IPv4-specific bits of
configuration.
There is backward compatibility in both directions: if the daemon is
new and the VPN plugin is old, then NM will notice that the plugin
emitted the Ip4Config signal without having emitted the Config signal
first, and so will assume that it is IPv4-only, and that the generic
bits of configuration have been included with the Ip4Config. If the
daemon is old and the plugin is new, then NMVPNPlugin will copy the
values from the generic config into the IPv4 config as well. (In fact,
NMVPNPlugin *always* does this, because it's harmless, and it's easier
than actually checking the daemon version.)
Currently the VPN is still configured all-at-once, after both IPv4 and
IPv6 information has been received, but the APIs allow for the
possibility of configuring them one at a time in the future.
* src/vpn-manager/nm-vpn-connection.c: Add a signal handler for the
"Failure" signal from VPN plugins, store the failure reason, and
use it when the state is changed to failure.
* introspection/nm-vpn-plugin.xml: Fix the "Failure" signal's type
description.
* include/NetworkManagerVPN.h (NMVPNConnectionStateReason): Add a new
reason to the end of the list to not break the API.
(NMVPNPluginFailure): Move it here (from libnm-glib/nm-vpn-plugin.h)
so it can be shared by plugins and daemon.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4088 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Patch from Will Stephenson <wstephenson@kde.org>
* Makefile.am
configure.in
- Set up spec autogeneration infrastructure
* docs/NetworkManager DBUS API.txt
- Note how old this doc is and where to look for the canonical
D-Bus specification
* introspection/*
- Add annotations and comments
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3345 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* introspection/nm-vpn-plugin.xml
libnm-glib/nm-vpn-plugin.c
libnm-glib/nm-vpn-plugin.h
- (impl_vpn_plugin_need_secrets): implement a call that should return
the name of the NMSetting in an NMConnection that may require
secrets specific to that VPN plugin
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2892 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-glib/nm-vpn-plugin.c (nm_vpn_plugin_connect): Update the
* plugin activation
method.
(impl_vpn_plugin_connect): Convert properties hash to
NMConnection, activate, and
unreference the connection.
* introspection/nm-vpn-plugin.xml: Modify the 'Connect' method
* arguments: instead of
passing properties hash and routes string list, pass
NMConnection (in hashed form).
* src/vpn-manager/nm-vpn-connection.c
* (nm_vpn_connection_get_routes): Return routes
as GSList, no need to copy stuff around anymore.
(nm_vpn_connection_activate): Update the plugin activation
method.
* src/NetworkManagerSystem.c
* (nm_system_vpn_device_set_from_ip4_config): Convert
routes argument to GSList.
* vpn-daemons/vpnc/src/nm-vpnc-service.c (real_connect):
The arguments have changed, update.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2890 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 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