From 864c2f1123c8db196c7a9225ba3f5f4851ef8678 Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Thu, 27 Jan 2011 20:55:33 -0800 Subject: provider: Report VPN error code --- src/provider.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/provider.c') diff --git a/src/provider.c b/src/provider.c index e6bcb3df..6bd2df52 100644 --- a/src/provider.c +++ b/src/provider.c @@ -393,6 +393,30 @@ int connman_provider_set_state(struct connman_provider *provider, return -EINVAL; } +int connman_provider_indicate_error(struct connman_provider *provider, + enum connman_provider_error error) +{ + enum connman_service_error service_error; + + switch (error) { + case CONNMAN_PROVIDER_ERROR_LOGIN_FAILED: + service_error = CONNMAN_SERVICE_ERROR_LOGIN_FAILED; + break; + case CONNMAN_PROVIDER_ERROR_AUTH_FAILED: + service_error = CONNMAN_SERVICE_ERROR_AUTH_FAILED; + break; + case CONNMAN_PROVIDER_ERROR_CONNECT_FAILED: + service_error = CONNMAN_SERVICE_ERROR_CONNECT_FAILED; + break; + default: + service_error = CONNMAN_SERVICE_ERROR_UNKNOWN; + break; + } + + return __connman_service_indicate_error(provider->vpn_service, + service_error); +} + static void unregister_provider(gpointer data) { struct connman_provider *provider = data; -- cgit v1.2.3