From b9777fec492db5fb556568bcd9a267fc7e19ce67 Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Thu, 27 Jan 2011 20:55:35 -0800 Subject: vpnc: error_code implementation --- plugins/vpnc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'plugins') 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) -- cgit v1.2.3