Add network type for cable/carrier detection
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 29 Nov 2009 19:33:09 +0000 (20:33 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 29 Nov 2009 19:33:09 +0000 (20:33 +0100)
include/network.h
src/network.c
src/service.c

index 2378d30..c95d4c6 100644 (file)
@@ -37,8 +37,9 @@ extern "C" {
 
 enum connman_network_type {
        CONNMAN_NETWORK_TYPE_UNKNOWN       = 0,
-       CONNMAN_NETWORK_TYPE_WIFI          = 1,
-       CONNMAN_NETWORK_TYPE_WIMAX         = 2,
+       CONNMAN_NETWORK_TYPE_CABLE         = 1,
+       CONNMAN_NETWORK_TYPE_WIFI          = 2,
+       CONNMAN_NETWORK_TYPE_WIMAX         = 3,
        CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN = 8,
        CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN = 9,
        CONNMAN_NETWORK_TYPE_CELLULAR      = 10,
index 727cfa3..c885122 100644 (file)
@@ -75,6 +75,8 @@ static const char *type2string(enum connman_network_type type)
        case CONNMAN_NETWORK_TYPE_UNKNOWN:
        case CONNMAN_NETWORK_TYPE_VENDOR:
                break;
+       case CONNMAN_NETWORK_TYPE_CABLE:
+               return "cable";
        case CONNMAN_NETWORK_TYPE_WIFI:
                return "wifi";
        case CONNMAN_NETWORK_TYPE_WIMAX:
@@ -552,6 +554,7 @@ void connman_network_set_group(struct connman_network *network,
 
        switch (network->type) {
        case CONNMAN_NETWORK_TYPE_UNKNOWN:
+       case CONNMAN_NETWORK_TYPE_CABLE:
        case CONNMAN_NETWORK_TYPE_VENDOR:
                return;
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN:
@@ -609,6 +612,7 @@ connman_bool_t __connman_network_get_weakness(struct connman_network *network)
        switch (network->type) {
        case CONNMAN_NETWORK_TYPE_UNKNOWN:
        case CONNMAN_NETWORK_TYPE_VENDOR:
+       case CONNMAN_NETWORK_TYPE_CABLE:
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN:
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN:
        case CONNMAN_NETWORK_TYPE_CELLULAR:
@@ -1336,6 +1340,7 @@ static int network_probe(struct connman_element *element)
        case CONNMAN_NETWORK_TYPE_UNKNOWN:
        case CONNMAN_NETWORK_TYPE_VENDOR:
                break;
+       case CONNMAN_NETWORK_TYPE_CABLE:
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN:
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN:
        case CONNMAN_NETWORK_TYPE_CELLULAR:
@@ -1367,6 +1372,7 @@ static void network_remove(struct connman_element *element)
        case CONNMAN_NETWORK_TYPE_UNKNOWN:
        case CONNMAN_NETWORK_TYPE_VENDOR:
                break;
+       case CONNMAN_NETWORK_TYPE_CABLE:
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN:
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN:
        case CONNMAN_NETWORK_TYPE_CELLULAR:
index a3a6cf3..3175471 100644 (file)
@@ -1595,6 +1595,7 @@ static connman_bool_t prepare_network(struct connman_service *service)
                connman_network_set_string(service->network,
                                "WiFi.Passphrase", service->passphrase);
                break;
+       case CONNMAN_NETWORK_TYPE_CABLE:
        case CONNMAN_NETWORK_TYPE_WIMAX:
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN:
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN:
@@ -2207,6 +2208,8 @@ static enum connman_service_type convert_network_type(struct connman_network *ne
        case CONNMAN_NETWORK_TYPE_UNKNOWN:
        case CONNMAN_NETWORK_TYPE_VENDOR:
                break;
+       case CONNMAN_NETWORK_TYPE_CABLE:
+               return CONNMAN_SERVICE_TYPE_ETHERNET;
        case CONNMAN_NETWORK_TYPE_WIFI:
                return CONNMAN_SERVICE_TYPE_WIFI;
        case CONNMAN_NETWORK_TYPE_WIMAX: