summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMohamed Abbas <mabbas@linux.intel.com>2011-01-27 20:55:33 -0800
committerSamuel Ortiz <sameo@linux.intel.com>2011-01-28 12:33:09 +0100
commit864c2f1123c8db196c7a9225ba3f5f4851ef8678 (patch)
tree99418f9471add704cad9b5bdd674f163aa6784b4 /src
parentab4cdff6852fd5fe26ee3ad588f0200952841ffe (diff)
downloadconnman-864c2f1123c8db196c7a9225ba3f5f4851ef8678.tar.gz
connman-864c2f1123c8db196c7a9225ba3f5f4851ef8678.tar.bz2
connman-864c2f1123c8db196c7a9225ba3f5f4851ef8678.zip
provider: Report VPN error code
Diffstat (limited to 'src')
-rw-r--r--src/provider.c24
-rw-r--r--src/service.c4
2 files changed, 28 insertions, 0 deletions
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;
diff --git a/src/service.c b/src/service.c
index 6417d10d..fa2d3e4d 100644
--- a/src/service.c
+++ b/src/service.c
@@ -261,6 +261,10 @@ static const char *error2string(enum connman_service_error error)
return "dhcp-failed";
case CONNMAN_SERVICE_ERROR_CONNECT_FAILED:
return "connect-failed";
+ case CONNMAN_SERVICE_ERROR_LOGIN_FAILED:
+ return "login-failed";
+ case CONNMAN_SERVICE_ERROR_AUTH_FAILED:
+ return "auth-failed";
}
return NULL;