summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-04-08 20:08:33 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-04-11 12:02:44 +0200
commit3f4d27ea71e6cdbffe363fb6b91c7cf710b9cb4a (patch)
tree78c6525c7ee37115782872fd5b90f92c81f507f4 /src/config.c
parent69ac23af8924400b6f99135b68822de839a10a89 (diff)
downloadconnman-3f4d27ea71e6cdbffe363fb6b91c7cf710b9cb4a.tar.gz
connman-3f4d27ea71e6cdbffe363fb6b91c7cf710b9cb4a.tar.bz2
connman-3f4d27ea71e6cdbffe363fb6b91c7cf710b9cb4a.zip
config: Add configuration protected flag
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index d27fb732..98da9d03 100644
--- a/src/config.c
+++ b/src/config.c
@@ -54,6 +54,7 @@ struct connman_config {
char *ident;
char *name;
char *description;
+ connman_bool_t protected;
GHashTable *service_table;
};
@@ -69,6 +70,7 @@ static uint inotify_watch = 0;
/* Definition of possible strings in the .config files */
#define CONFIG_KEY_NAME "Name"
#define CONFIG_KEY_DESC "Description"
+#define CONFIG_KEY_PROT "Protected"
#define SERVICE_KEY_TYPE "Type"
#define SERVICE_KEY_NAME "Name"
@@ -86,6 +88,7 @@ static uint inotify_watch = 0;
static const char *config_possible_keys[] = {
CONFIG_KEY_NAME,
CONFIG_KEY_DESC,
+ CONFIG_KEY_PROT,
NULL,
};
@@ -323,6 +326,7 @@ static int load_config(struct connman_config *config)
gsize length;
char **groups;
char *str;
+ gboolean protected;
int i;
DBG("config %p", config);
@@ -346,6 +350,10 @@ static int load_config(struct connman_config *config)
config->description = str;
}
+ protected = g_key_file_get_boolean(keyfile, "global",
+ CONFIG_KEY_PROT, NULL);
+ config->protected = protected;
+
groups = g_key_file_get_groups(keyfile, &length);
for (i = 0; groups[i] != NULL; i++) {