diff options
author | Mohamed Abbas <mabbas@linux.intel.com> | 2011-01-27 20:55:35 -0800 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-01-28 12:38:03 +0100 |
commit | b9777fec492db5fb556568bcd9a267fc7e19ce67 (patch) | |
tree | b3c418172938027488faec77809e6d35c96d7903 | |
parent | c1d9897d3fedd611fb0091d60787aebf8b7b1cda (diff) | |
download | connman-b9777fec492db5fb556568bcd9a267fc7e19ce67.tar.gz connman-b9777fec492db5fb556568bcd9a267fc7e19ce67.tar.bz2 connman-b9777fec492db5fb556568bcd9a267fc7e19ce67.zip |
vpnc: error_code implementation
-rw-r--r-- | plugins/vpnc.c | 13 |
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) |