diff options
author | Dan Williams <dcbw@redhat.com> | 2014-05-14 21:21:10 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-06-06 13:43:46 -0500 |
commit | 90b747fa116db600723227648afd5049ad53999e (patch) | |
tree | f96f3131af998e852b7102a639949a823476d19d /src/nm-dispatcher.h | |
parent | 5150cb88c26d13e8c7c188f4f10614b6d318ad89 (diff) | |
download | NetworkManager-90b747fa116db600723227648afd5049ad53999e.tar.gz |
dispatcher: add synchronous dispatcher calls
On shutdown we can't defer the response to a callback, so we need to
use synchronous D-Bus calls. Second, sometimes we want to block on
the dispatcher response, like for pre-down.
Diffstat (limited to 'src/nm-dispatcher.h')
-rw-r--r-- | src/nm-dispatcher.h | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/nm-dispatcher.h b/src/nm-dispatcher.h index 179eb2f31e..cf3e62613f 100644 --- a/src/nm-dispatcher.h +++ b/src/nm-dispatcher.h @@ -42,24 +42,37 @@ typedef enum { DISPATCHER_ACTION_DHCP6_CHANGE } DispatcherAction; -typedef void (*DispatcherFunc) (gconstpointer call, gpointer user_data); +typedef void (*DispatcherFunc) (gconstpointer call_id, gpointer user_data); -gconstpointer nm_dispatcher_call (DispatcherAction action, +gboolean nm_dispatcher_call (DispatcherAction action, + NMConnection *connection, + NMDevice *device, + DispatcherFunc callback, + gpointer user_data, + gconstpointer *out_call_id); + +gboolean nm_dispatcher_call_sync (DispatcherAction action, NMConnection *connection, - NMDevice *device, - DispatcherFunc callback, - gpointer user_data); + NMDevice *device); + +gboolean nm_dispatcher_call_vpn (DispatcherAction action, + NMConnection *connection, + NMDevice *parent_device, + const char *vpn_iface, + NMIP4Config *vpn_ip4_config, + NMIP6Config *vpn_ip6_config, + DispatcherFunc callback, + gpointer user_data, + gconstpointer *out_call_id); -gconstpointer nm_dispatcher_call_vpn (DispatcherAction action, +gboolean nm_dispatcher_call_vpn_sync (DispatcherAction action, NMConnection *connection, - NMDevice *device, + NMDevice *parent_device, const char *vpn_iface, NMIP4Config *vpn_ip4_config, - NMIP6Config *vpn_ip6_config, - DispatcherFunc callback, - gpointer user_data); + NMIP6Config *vpn_ip6_config); -void nm_dispatcher_call_cancel (gconstpointer call); +void nm_dispatcher_call_cancel (gconstpointer call_id); void nm_dispatcher_init (void); |