summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamed Abbas <mabbas@linux.intel.com>2011-01-27 20:55:35 -0800
committerSamuel Ortiz <sameo@linux.intel.com>2011-01-28 12:38:03 +0100
commitb9777fec492db5fb556568bcd9a267fc7e19ce67 (patch)
treeb3c418172938027488faec77809e6d35c96d7903
parentc1d9897d3fedd611fb0091d60787aebf8b7b1cda (diff)
downloadconnman-b9777fec492db5fb556568bcd9a267fc7e19ce67.tar.gz
connman-b9777fec492db5fb556568bcd9a267fc7e19ce67.tar.bz2
connman-b9777fec492db5fb556568bcd9a267fc7e19ce67.zip
vpnc: error_code implementation
-rw-r--r--plugins/vpnc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/vpnc.c b/plugins/vpnc.c
index b04ad24f..4e48611b 100644
--- a/plugins/vpnc.c
+++ b/plugins/vpnc.c
@@ -254,9 +254,22 @@ static int vc_connect(struct connman_provider *provider,
return err;
}
+static int vc_error_code(int exit_code)
+{
+ switch (exit_code) {
+ case 1:
+ return CONNMAN_PROVIDER_ERROR_CONNECT_FAILED;
+ case 2:
+ return CONNMAN_PROVIDER_ERROR_LOGIN_FAILED;
+ default:
+ return CONNMAN_PROVIDER_ERROR_UNKNOWN;
+ }
+}
+
static struct vpn_driver vpn_driver = {
.notify = vc_notify,
.connect = vc_connect,
+ .error_code = vc_error_code,
};
static int vpnc_init(void)