summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-12-09 00:57:23 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-12-09 00:57:23 +0100
commit2bbb7defdac7cb915a57a9d69b6ae029865ffc97 (patch)
treede76633d3b05a3c15b6b0a7486197ff608aef6ed
parent24837833d154b693f6abc33ff3fce875d61af326 (diff)
downloadconnman-2bbb7defdac7cb915a57a9d69b6ae029865ffc97.tar.gz
connman-2bbb7defdac7cb915a57a9d69b6ae029865ffc97.tar.bz2
connman-2bbb7defdac7cb915a57a9d69b6ae029865ffc97.zip
Add service types for system and VPN connections
-rw-r--r--include/service.h12
-rw-r--r--plugins/iospm.c2
-rw-r--r--src/element.c6
-rw-r--r--src/notifier.c14
-rw-r--r--src/service.c20
5 files changed, 49 insertions, 5 deletions
diff --git a/include/service.h b/include/service.h
index ec80ab35..ad2e963b 100644
--- a/include/service.h
+++ b/include/service.h
@@ -36,11 +36,13 @@ extern "C" {
enum connman_service_type {
CONNMAN_SERVICE_TYPE_UNKNOWN = 0,
- CONNMAN_SERVICE_TYPE_ETHERNET = 1,
- CONNMAN_SERVICE_TYPE_WIFI = 2,
- CONNMAN_SERVICE_TYPE_WIMAX = 3,
- CONNMAN_SERVICE_TYPE_BLUETOOTH = 4,
- CONNMAN_SERVICE_TYPE_CELLULAR = 5,
+ CONNMAN_SERVICE_TYPE_SYSTEM = 1,
+ CONNMAN_SERVICE_TYPE_ETHERNET = 2,
+ CONNMAN_SERVICE_TYPE_WIFI = 3,
+ CONNMAN_SERVICE_TYPE_WIMAX = 4,
+ CONNMAN_SERVICE_TYPE_BLUETOOTH = 5,
+ CONNMAN_SERVICE_TYPE_CELLULAR = 6,
+ CONNMAN_SERVICE_TYPE_VPN = 7,
};
enum connman_service_mode {
diff --git a/plugins/iospm.c b/plugins/iospm.c
index 02e532ed..9908cfe3 100644
--- a/plugins/iospm.c
+++ b/plugins/iospm.c
@@ -66,10 +66,12 @@ static void iospm_service_enabled(enum connman_service_type type,
{
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIFI:
case CONNMAN_SERVICE_TYPE_WIMAX:
case CONNMAN_SERVICE_TYPE_CELLULAR:
+ case CONNMAN_SERVICE_TYPE_VPN:
break;
case CONNMAN_SERVICE_TYPE_BLUETOOTH:
send_indication(IOSPM_BLUETOOTH, enabled);
diff --git a/src/element.c b/src/element.c
index b1663c6b..5530e439 100644
--- a/src/element.c
+++ b/src/element.c
@@ -354,9 +354,11 @@ static gboolean request_scan(GNode *node, gpointer user_data)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_BLUETOOTH:
case CONNMAN_SERVICE_TYPE_CELLULAR:
+ case CONNMAN_SERVICE_TYPE_VPN:
return FALSE;
case CONNMAN_SERVICE_TYPE_WIFI:
case CONNMAN_SERVICE_TYPE_WIMAX:
@@ -397,6 +399,8 @@ static gboolean enable_technology(GNode *node, gpointer user_data)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_VPN:
return FALSE;
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIFI:
@@ -440,6 +444,8 @@ static gboolean disable_technology(GNode *node, gpointer user_data)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_VPN:
return FALSE;
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIFI:
diff --git a/src/notifier.c b/src/notifier.c
index c9bcac81..8f7d4b08 100644
--- a/src/notifier.c
+++ b/src/notifier.c
@@ -235,6 +235,8 @@ void __connman_notifier_register(enum connman_service_type type)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_VPN:
return;
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIFI:
@@ -254,6 +256,8 @@ void __connman_notifier_unregister(enum connman_service_type type)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_VPN:
return;
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIFI:
@@ -273,6 +277,8 @@ void __connman_notifier_enable(enum connman_service_type type)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_VPN:
return;
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIFI:
@@ -292,6 +298,8 @@ void __connman_notifier_disable(enum connman_service_type type)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_VPN:
return;
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIFI:
@@ -311,6 +319,8 @@ void __connman_notifier_connect(enum connman_service_type type)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_VPN:
return;
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIFI:
@@ -330,6 +340,8 @@ void __connman_notifier_disconnect(enum connman_service_type type)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_VPN:
return;
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIFI:
@@ -434,6 +446,8 @@ connman_bool_t __connman_notifier_is_enabled(enum connman_service_type type)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_VPN:
return FALSE;
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIFI:
diff --git a/src/service.c b/src/service.c
index c4485ac5..c4118282 100644
--- a/src/service.c
+++ b/src/service.c
@@ -120,6 +120,8 @@ const char *__connman_service_type2string(enum connman_service_type type)
switch (type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
break;
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ return "system";
case CONNMAN_SERVICE_TYPE_ETHERNET:
return "ethernet";
case CONNMAN_SERVICE_TYPE_WIFI:
@@ -130,6 +132,8 @@ const char *__connman_service_type2string(enum connman_service_type type)
return "bluetooth";
case CONNMAN_SERVICE_TYPE_CELLULAR:
return "cellular";
+ case CONNMAN_SERVICE_TYPE_VPN:
+ return "vpn";
}
return NULL;
@@ -415,10 +419,12 @@ static void passphrase_changed(struct connman_service *service)
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIMAX:
case CONNMAN_SERVICE_TYPE_BLUETOOTH:
case CONNMAN_SERVICE_TYPE_CELLULAR:
+ case CONNMAN_SERVICE_TYPE_VPN:
return;
case CONNMAN_SERVICE_TYPE_WIFI:
required = FALSE;
@@ -466,10 +472,12 @@ static void apn_changed(struct connman_service *service)
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIMAX:
case CONNMAN_SERVICE_TYPE_BLUETOOTH:
case CONNMAN_SERVICE_TYPE_WIFI:
+ case CONNMAN_SERVICE_TYPE_VPN:
return;
case CONNMAN_SERVICE_TYPE_CELLULAR:
break;
@@ -561,9 +569,11 @@ static DBusMessage *get_properties(DBusConnection *conn,
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIMAX:
case CONNMAN_SERVICE_TYPE_BLUETOOTH:
+ case CONNMAN_SERVICE_TYPE_VPN:
break;
case CONNMAN_SERVICE_TYPE_CELLULAR:
connman_dbus_dict_append_variant(&dict, "Roaming",
@@ -1349,7 +1359,9 @@ static gint service_compare(gconstpointer a, gconstpointer b,
if (service_a->type != service_b->type) {
switch (service_a->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
case CONNMAN_SERVICE_TYPE_ETHERNET:
+ case CONNMAN_SERVICE_TYPE_VPN:
break;
case CONNMAN_SERVICE_TYPE_WIFI:
return 1;
@@ -1620,6 +1632,8 @@ int __connman_service_connect(struct connman_service *service)
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_VPN:
return -EINVAL;
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIMAX:
@@ -2278,9 +2292,11 @@ struct connman_service *__connman_service_create_from_network(struct connman_net
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIMAX:
case CONNMAN_SERVICE_TYPE_BLUETOOTH:
+ case CONNMAN_SERVICE_TYPE_VPN:
service->autoconnect = FALSE;
break;
case CONNMAN_SERVICE_TYPE_WIFI:
@@ -2411,7 +2427,9 @@ static int service_load(struct connman_service *service)
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
case CONNMAN_SERVICE_TYPE_ETHERNET:
+ case CONNMAN_SERVICE_TYPE_VPN:
break;
case CONNMAN_SERVICE_TYPE_WIFI:
if (service->name == NULL) {
@@ -2555,7 +2573,9 @@ update:
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
case CONNMAN_SERVICE_TYPE_ETHERNET:
+ case CONNMAN_SERVICE_TYPE_VPN:
break;
case CONNMAN_SERVICE_TYPE_WIFI:
if (service->network) {