summaryrefslogtreecommitdiff
path: root/vpn/plugins/openvpn.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-11-30 09:30:35 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-11-30 13:01:18 (GMT)
commita4c8f6b74733d0cf1d8c730aabd2ff5a7be0c124 (patch)
tree482caff971b44e952ae053cbd40e02c346c28d55 /vpn/plugins/openvpn.c
parent2e9c60a0539679ac982282ebe9fc9c9cc43e492c (diff)
downloadconnman-a4c8f6b74733d0cf1d8c730aabd2ff5a7be0c124.zip
connman-a4c8f6b74733d0cf1d8c730aabd2ff5a7be0c124.tar.gz
connman-a4c8f6b74733d0cf1d8c730aabd2ff5a7be0c124.tar.bz2
vpn: Add initial support for async connect
Needed for agent VPN support.
Diffstat (limited to 'vpn/plugins/openvpn.c')
-rw-r--r--vpn/plugins/openvpn.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/vpn/plugins/openvpn.c b/vpn/plugins/openvpn.c
index 84583cd..87549ca 100644
--- a/vpn/plugins/openvpn.c
+++ b/vpn/plugins/openvpn.c
@@ -229,10 +229,11 @@ static int task_append_config_data(struct vpn_provider *provider,
}
static int ov_connect(struct vpn_provider *provider,
- struct connman_task *task, const char *if_name)
+ struct connman_task *task, const char *if_name,
+ vpn_provider_connect_cb_t cb, void *user_data)
{
const char *option;
- int err, fd;
+ int err = 0, fd;
option = vpn_provider_get_string(provider, "Host");
if (option == NULL) {
@@ -304,10 +305,15 @@ static int ov_connect(struct vpn_provider *provider,
NULL, &fd, &fd);
if (err < 0) {
connman_error("openvpn failed to start");
- return -EIO;
+ err = -EIO;
+ goto done;
}
- return 0;
+done:
+ if (cb != NULL)
+ cb(provider, user_data, err);
+
+ return err;
}
static struct vpn_driver vpn_driver = {