Commit Graph

16 Commits

Author SHA1 Message Date
Lubomir Rintel
42ee2e6792 vpn-service-plugin: correctly emit ip6-config signal on dbus skeleton 2015-11-13 16:13:40 +01:00
Lubomir Rintel
a5feb44a44 libnm,vpn-service-plugin: remove old connect timer when adding new one
If the plugin didn't succeed connecting once, don't let the old timer fire
during a subsequent connection.

https://bugzilla.redhat.com/show_bug.cgi?id=1271973
2015-10-23 18:24:45 +02:00
Beniamino Galvani
1136de4221 libnm,libnm-core: fix GTK-Doc warnings 2015-10-16 17:33:12 +02:00
Lubomir Rintel
700061f270 libnm/vpn-service-plugin: leave the state property in place
It's part of the DBus API; the skeleton has it and we can't remove it.

This partially reverts commit fd61b21706.
2015-10-14 18:44:57 +02:00
Lubomir Rintel
fd61b21706 libnm/vpn-service-plugin: remove nm_vpn_service_plugin_{get,set}_state()
The plugins set state only on failures and often forget to do that. Do the
correct status transition to STOPPED in nm_vpn_service_plugin_failure() instead.

The get_state() is only used to find out whether to fail or orderly disconnect
depending on whether we're STARTING or already STARTED. Handle that in
nm_vpn_service_plugin_disconnect() in a generic manner instead.
2015-10-13 18:20:55 +02:00
Lubomir Rintel
78f263a5fd libnm/vpn-service-plugin: quit when the peer we watch disconnects
We're of no use anymore as another user would start an instance with
a different bus name.
2015-10-13 18:20:55 +02:00
Lubomir Rintel
9f15abbda7 libnm/vpn-service-plugin: add watch-peer property
Make it possible to construct the plugin instance in a way that disconnects the
connection if the DBus client that activated it drops off the bus. This makes the
plugins conveniently clean up when NetworkManager crashes.

We need this, as with multiple VPN support we can loose track of the client bus
names when the daemon crashes leaving to nice way to clean up on respawn.

However, this behavior is not desired for debugging or hypotetical VPN plugin
users other than NetworkManager (say; "gdbus call -m o.fd.NM.VPN.Plugin.Connect").
Let the plugin decide when to use it.
2015-10-13 18:20:55 +02:00
Lubomir Rintel
1bb553798c libnm/vpn-service-plugin: add a missing return 2015-10-13 18:20:55 +02:00
Lubomir Rintel
b1512221bc nm-vpn-service-plugin: increase the quit timer
We now (since 3272ff6 libnm/libnm-glib: don't quit in the middle of asking for
secrets) always hook on the quit timer when NM asks the plugin if it needs
secrets. The timer is 20 seconds, which seems too short.

Let's make it three minutes. Don't bother adding another timer or using a
distinct timeout: it does no harm for the plugin to remain unused for three
minutes on a bus.

Another option would be to completely unhook it; however the plugin wouldn't
learn if the user cancelled the NM's secrets request and would remain unused
on the bus forever.
2015-10-01 17:17:52 +02:00
Thomas Haller
803fc616fd libnm: properly handle floating references in nm_vpn_service_plugin_set_ip6_config() 2015-08-25 18:53:39 +02:00
Lubomir Rintel
1eedcb44fe libnm,vpn-service-plugin: fix double address-of for variants
They are already GVariant pointers.
2015-08-17 17:10:42 +02:00
Lubomir Rintel
bcf2b1295c libnm,vpn-service-plugin: emit signals also for the dbus skeleton
Otherwise they won't just reach the bus.

https://bugzilla.gnome.org/show_bug.cgi?id=753663
2015-08-17 17:10:42 +02:00
Dan Winship
22e1a97e12 all: drop includes to <glib/gi18n.h> for "nm-default.h"
The localization headers are now included via "nm-default.h".

Also fixes several places, where we wrongly included <glib/gi18n-lib.h>
instead of <glib/gi18n.h>. For example under "clients/" directory.
2015-08-05 15:35:51 +02:00
Thomas Haller
6be8a1f549 libnm/vpn: add annotations for new NMVpnServicePlugin API 2015-07-29 22:34:35 +02:00
Thomas Haller
867227dd4a libnm/vpn: add new NMVpnServicePlugin class
After copying "nm-vpn-plugin-old.*" to "nm-vpn-service-plugin.*",
rename the class and add it to the Makefile.

This will become the new VPN Service API for libnm 1.2. No changes
done yet except renaming of the classes and functions.

Rename the previous classes NMVpnPlugin(Old) to NMVpnServicePlugin
to have a distinct name from NMVpnEditorPlugin. Buth are plugins, but
with a different use.

https://bugzilla.gnome.org/show_bug.cgi?id=749951
2015-07-29 22:34:35 +02:00
Thomas Haller
87f631f2f1 libnm/vpn: copy 'nm-vpn-plugin-old' files to 'nm-vpn-service-plugin'
Files are yet unchanged, only copy them to get a nicer history.

  /bin/cp libnm/nm-vpn-plugin-old.c libnm/nm-vpn-service-plugin.c
  /bin/cp libnm/nm-vpn-plugin-old.h libnm/nm-vpn-service-plugin.h
2015-07-29 22:34:35 +02:00