Add basic support for immutable services
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 20 Dec 2009 21:32:05 +0000 (13:32 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 20 Dec 2009 21:32:05 +0000 (13:32 -0800)
doc/service-api.txt
src/service.c

index caf1dbe..1fe37ea 100644 (file)
@@ -214,6 +214,15 @@ Properties string State [readonly]
                        it back to false the Remove() method needs to be
                        used.
 
+               boolean Immutable [readonly]
+
+                       This value will be set to true if the service is
+                       configured externally via a configuration file.
+
+                       The only valid operation are Connect() and of
+                       course Disconnect(). The Remove() method will
+                       result in an error.
+
                boolean AutoConnect [readwrite]
 
                        If set to true, this service will auto-connect
index dec8622..d3089a0 100644 (file)
@@ -47,6 +47,7 @@ struct connman_service {
        enum connman_service_error error;
        connman_uint8_t strength;
        connman_bool_t favorite;
+       connman_bool_t immutable;
        connman_bool_t hidden;
        connman_bool_t ignore;
        connman_bool_t autoconnect;
@@ -489,6 +490,9 @@ static DBusMessage *get_properties(DBusConnection *conn,
        connman_dbus_dict_append_basic(&dict, "Favorite",
                                        DBUS_TYPE_BOOLEAN, &service->favorite);
 
+       connman_dbus_dict_append_basic(&dict, "Immutable",
+                                       DBUS_TYPE_BOOLEAN, &service->immutable);
+
        if (service->favorite == TRUE)
                connman_dbus_dict_append_basic(&dict, "AutoConnect",
                                DBUS_TYPE_BOOLEAN, &service->autoconnect);
@@ -1216,7 +1220,8 @@ static void __connman_service_initialize(struct connman_service *service)
        service->security = CONNMAN_SERVICE_SECURITY_UNKNOWN;
        service->state    = CONNMAN_SERVICE_STATE_UNKNOWN;
 
-       service->favorite = FALSE;
+       service->favorite  = FALSE;
+       service->immutable = FALSE;
        service->hidden = FALSE;
 
        service->ignore = FALSE;