summaryrefslogtreecommitdiff
path: root/src/supplicant/nm-supplicant-interface.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-02-14 19:30:21 +0100
committerThomas Haller <thaller@redhat.com>2017-02-17 14:41:26 +0100
commit66c45d0fdcbd9e87b5164c5f77f914141cbb9419 (patch)
tree88ce455719641afa2d135cefc8dfdfdc2c05de3c /src/supplicant/nm-supplicant-interface.h
parentb4a976fd1175c2311bd2c2ee6b23345cfd56efd7 (diff)
supplicant: rework nm_supplicant_interface_set_config() to invoke result callback
Instead of having a NM_SUPPLICANT_INTERFACE_CONNECTION_ERROR signal to notify about failures during AddNetwork/SelectNetwork, accept a callback to report success/failure. Thereby, rename nm_supplicant_interface_set_config() to nm_supplicant_interface_assoc(). The async callback is guaranteed to: - be invoked exactly once, signalling success or failure - always being invoked asyncronously. The pending request can be (synchronously) cancelled via nm_supplicant_interface_disconnect() or by disposing the interface instance. In those cases the callback will be invoked too, with error code cancelled/disposing.
Diffstat (limited to 'src/supplicant/nm-supplicant-interface.h')
-rw-r--r--src/supplicant/nm-supplicant-interface.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/supplicant/nm-supplicant-interface.h b/src/supplicant/nm-supplicant-interface.h
index d78cd28ec..3498bb592 100644
--- a/src/supplicant/nm-supplicant-interface.h
+++ b/src/supplicant/nm-supplicant-interface.h
@@ -68,7 +68,6 @@ typedef enum {
#define NM_SUPPLICANT_INTERFACE_BSS_UPDATED "bss-updated"
#define NM_SUPPLICANT_INTERFACE_BSS_REMOVED "bss-removed"
#define NM_SUPPLICANT_INTERFACE_SCAN_DONE "scan-done"
-#define NM_SUPPLICANT_INTERFACE_CONNECTION_ERROR "connection-error"
#define NM_SUPPLICANT_INTERFACE_CREDENTIALS_REQUEST "credentials-request"
typedef struct _NMSupplicantInterfaceClass NMSupplicantInterfaceClass;
@@ -83,9 +82,15 @@ NMSupplicantInterface * nm_supplicant_interface_new (const char *ifname,
void nm_supplicant_interface_set_supplicant_available (NMSupplicantInterface *self,
gboolean available);
-gboolean nm_supplicant_interface_set_config (NMSupplicantInterface * iface,
- NMSupplicantConfig * cfg,
- GError **error);
+typedef void (*NMSupplicantInterfaceAssocCb) (NMSupplicantInterface *iface,
+ GError *error,
+ gpointer user_data);
+
+void
+nm_supplicant_interface_assoc (NMSupplicantInterface *self,
+ NMSupplicantConfig *cfg,
+ NMSupplicantInterfaceAssocCb callback,
+ gpointer user_data);
void nm_supplicant_interface_disconnect (NMSupplicantInterface * iface);