Add special state for portal login step
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 29 Jan 2010 16:36:45 +0000 (17:36 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 29 Jan 2010 16:36:45 +0000 (17:36 +0100)
doc/overview-api.txt
doc/service-api.txt
include/service.h
src/service.c

index 90ae4df..8ab687f 100644 (file)
@@ -292,15 +292,18 @@ the "idle" state since the service is not connected.
                      V                           |              |
                +---------------+                 |              |
                | configuration |-----------------+              |
-               +---------------+      error                     |
-                     |                                          |
-                     | success                                  |
-                     V                                          |
-               +---------------+                                |
-               | ready         |                                |
-               +---------------+                                |
-                     |                                          |
-                     | success                                  |
+               +---------------+      error      |              |
+                     |                           |              |
+                     | success                   |              |
+                     V                           |              |
+               +---------------+            +-------------+     |
+               | ready         |----------->| login       |     |
+               +---------------+            +-------------+     |
+                     |                           |              |
+                     | success                   |              |
+                     |                           |              |
+                     +---------------------------+              |
+                     |           authentication                 |
                      V                                          |
                +---------------+                                |
                | online        |<----------------+              |
index b5617a6..e488d7a 100644 (file)
@@ -116,6 +116,10 @@ Properties string State [readonly]
                        Valid states are "idle", "failure", "association",
                        "configuration" and "ready".
 
+                       Also "login" and "online" states are used. The
+                       state "online" signals that an Internet connection
+                       is available and has been verified.
+
                string Error [readonly]
 
                        The service error status details.
index 170cd6c..8abca13 100644 (file)
@@ -71,9 +71,10 @@ enum connman_service_state {
        CONNMAN_SERVICE_STATE_ASSOCIATION   = 2,
        CONNMAN_SERVICE_STATE_CONFIGURATION = 3,
        CONNMAN_SERVICE_STATE_READY         = 4,
-       CONNMAN_SERVICE_STATE_ONLINE        = 5,
-       CONNMAN_SERVICE_STATE_DISCONNECT    = 6,
-       CONNMAN_SERVICE_STATE_FAILURE       = 7,
+       CONNMAN_SERVICE_STATE_LOGIN         = 5,
+       CONNMAN_SERVICE_STATE_ONLINE        = 6,
+       CONNMAN_SERVICE_STATE_DISCONNECT    = 7,
+       CONNMAN_SERVICE_STATE_FAILURE       = 8,
 };
 
 enum connman_service_error {
index 4e5a43f..1eccbac 100644 (file)
@@ -203,6 +203,8 @@ static const char *state2string(enum connman_service_state state)
                return "configuration";
        case CONNMAN_SERVICE_STATE_READY:
                return "ready";
+       case CONNMAN_SERVICE_STATE_LOGIN:
+               return "login";
        case CONNMAN_SERVICE_STATE_ONLINE:
                return "online";
        case CONNMAN_SERVICE_STATE_DISCONNECT:
@@ -431,6 +433,7 @@ static void append_ethernet(DBusMessageIter *iter, void *user_data)
        case CONNMAN_SERVICE_STATE_ASSOCIATION:
        case CONNMAN_SERVICE_STATE_CONFIGURATION:
        case CONNMAN_SERVICE_STATE_READY:
+       case CONNMAN_SERVICE_STATE_LOGIN:
        case CONNMAN_SERVICE_STATE_ONLINE:
                break;
        }
@@ -452,6 +455,7 @@ static void append_ipv4(DBusMessageIter *iter, void *user_data)
        case CONNMAN_SERVICE_STATE_CONFIGURATION:
                return;
        case CONNMAN_SERVICE_STATE_READY:
+       case CONNMAN_SERVICE_STATE_LOGIN:
        case CONNMAN_SERVICE_STATE_ONLINE:
                break;
        }
@@ -481,6 +485,7 @@ static void append_proxy(DBusMessageIter *iter, void *user_data)
        case CONNMAN_SERVICE_STATE_CONFIGURATION:
                return;
        case CONNMAN_SERVICE_STATE_READY:
+       case CONNMAN_SERVICE_STATE_LOGIN:
        case CONNMAN_SERVICE_STATE_ONLINE:
                break;
        }
@@ -846,6 +851,7 @@ static connman_bool_t is_connecting(struct connman_service *service)
        case CONNMAN_SERVICE_STATE_FAILURE:
        case CONNMAN_SERVICE_STATE_DISCONNECT:
        case CONNMAN_SERVICE_STATE_READY:
+       case CONNMAN_SERVICE_STATE_LOGIN:
        case CONNMAN_SERVICE_STATE_ONLINE:
                break;
        case CONNMAN_SERVICE_STATE_ASSOCIATION: