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).
Due to limitations in dbus-glib, where one GObject cannot have more
than one introspection XML object attached to it, we used to include
more than one <interface> in the VPNConnection object introspection
XML. This was suboptimal for two reasons:
1) it duplicated the Connection.Active introspection XML which
made it harder for clients to use the introspection data in a
dynamic fashion, besides looking ugly in the docs
2) not many other programs use this feature of dbus-glib, which
means it didn't get a lot of testing, and broke, which sucks
for NM.
To fix this issue, create a base class for NMVpnConnection that
handles the Connection.Active API, and make NMVpnConnection itself
handle just the VPN pieces that it layers on top. This makes
dbus-glib happy because we aren't using two <interface> blocks
in the same introspection XML, and it makes the NM code more
robust because we can re-use the existing Connection.Active
introspection XML in the NMVpnConnectionBase class.
Due to dbus-glib limitations we still have to keep two copies of this,
and furthermore PropertiesChanged won't yet trigger for the VPN bits
since there's no way to push out signals on a different interface.
* introspection/nm-active-connection.xml
introspection/nm-vpn-connection.xml
libnm-glib/nm-active-connection.c
src/nm-activation-request.c
src/nm-active-connection.h
src/vpn-manager/nm-vpn-connection.c
- Remove "SharedServiceName" and "SharedConnection" bits from the D-Bus
and libnm-glib API since sharing didn't get implemented that way
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3797 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* include/NetworkManager.h
- Add NMActiveConnectionState enum
* introspection/nm-active-connection.xml
introspection/nm-vpn-connection.xml
- Add 'State' property for overall active connection state
- Add 'Default' property, when True means this active connection
has the default route
- Add PropertyChanged signals so changes actually go out over the bus
* src/nm-active-connection.h
- Add defines for State & Default properties
* src/nm-activation-request.c
- Add 'state' and 'default' properties, hook up to device 'state-changed'
signal to determine active connection state
* src/vpn-manager/nm-vpn-connection.c
src/vpn-manager/nm-vpn-connection.h
src/vpn-manager/nm-vpn-manager.c
src/vpn-manager/nm-vpn-service.c
- Rename old 'state' to 'vpn-state'
- Rename nm_vpn_connection_get_state() -> nm_vpn_connection_get_vpn_state()
- Add 'state' and 'default' properties, hook up to the vpn connection's
'vpn-state-changed' signal
* libnm-glib/nm-active-connection.c
libnm-glib/nm-active-connection.h
- Add new 'state' and 'default' properties and accessors
* libnm-glib/nm-vpn-connection.c
libnm-glib/nm-vpn-connection.h
- Rename old 'state' property to 'vpn-state'
- Add new 'state' and 'default' properties and accessors
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3582 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Rework VPN connection handling for a more consistent D-Bus API. The
VPNManager object has been removed, and active VPN connections are now the
same as any other active connection. The Manager object's ActivateConnection
and DeactivateConnection methods are used to start and stop a VPN connection,
and the VPNConnection objects are subclasses of the ActiveConnection objects.
When activating a VPN connection, pass the path of the active connection
to which the VPN connection is tied in the 'specific_object' argument.
Consequently, the libnm-glib API has been reworked to match this arrangement,
with the VPNManager object removed, and the NMVPNConnection objects now
being subclasses of NMActiveConnection.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3504 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
* include/NetworkManagerVPN.h
- define VPN connection state change reason codes
* src/vpn-manager/Makefile.am
src/vpn-manager/nm-vpn-marshal.list
src/vpn-manager/nm-vpn-marshal-main.c
- Add marshallers for StateChanged signal
* introspection/nm-vpn-connection.xml
- New Banner property
- StateChanged signal now includes a 'reason' argument
* src/vpn-manager/nm-vpn-connection.c
src/vpn-manager/nm-vpn-connection.h
- Add a "Banner" property that contains the returned VPN server login
banner (if any); valid only in the ACTIVATED state
- (nm_vpn_connection_set_state, nm_vpn_connection_disconnect): now takes
a 'reason' argument and emits that reason along with the
state-changed signal
- Fix up calls to nm_vpn_connection_set_state() to include a reason
- (nm_vpn_connection_ip4_config_get): save banner for later
- (nm_vpn_connection_get_banner, get_property,
nm_vpn_connection_class_init): implement Banner property
* src/vpn-manager/nm-vpn-service.c
- (nm_vpn_service_connections_stop): take a reason argument; copy the
connection list because elements may get added/removed from it
while iterating over the list
- (connection_state_changed): signal now includes the 'reason' argument
* libnm-glib/nm-vpn-connection.c
libnm-glib/nm-vpn-connection.h
- (nm_vpn_connection_get_banner): new function
- (state_changed_proxy): handle reason argument
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2916 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