};
enum connman_provider_error {
- CONNMAN_PROVIDER_ERROR_UNKNOWN = 0,
- CONNMAN_PROVIDER_ERROR_CONNECT_FAILED = 1,
+ CONNMAN_PROVIDER_ERROR_UNKNOWN = 0,
+ CONNMAN_PROVIDER_ERROR_CONNECT_FAILED = 1,
+ CONNMAN_PROVIDER_ERROR_LOGIN_FAILED = 2,
+ CONNMAN_PROVIDER_ERROR_AUTH_FAILED = 3,
};
struct connman_provider;
int connman_provider_set_state(struct connman_provider *provider,
enum connman_provider_state state);
+int connman_provider_indicate_error(struct connman_provider *provider,
+ enum connman_provider_error error);
+
void connman_provider_set_index(struct connman_provider *provider, int index);
int connman_provider_get_index(struct connman_provider *provider);
CONNMAN_SERVICE_ERROR_PIN_MISSING = 2,
CONNMAN_SERVICE_ERROR_DHCP_FAILED = 3,
CONNMAN_SERVICE_ERROR_CONNECT_FAILED = 4,
+ CONNMAN_SERVICE_ERROR_LOGIN_FAILED = 5,
+ CONNMAN_SERVICE_ERROR_AUTH_FAILED = 6,
};
enum connman_service_proxy_method {
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;
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;