summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-07-10 18:13:46 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-07-13 06:38:48 -0300
commit065b492c30fec0890d74d9868a1a8c41de867d82 (patch)
treee9e9f4cb6b8e27e6e25638fc45cd613c901b4c32
parentdb3177379603c6fcbc21096ea6d769ff77bafb93 (diff)
downloadconnman-065b492c30fec0890d74d9868a1a8c41de867d82.tar.gz
connman-065b492c30fec0890d74d9868a1a8c41de867d82.tar.bz2
connman-065b492c30fec0890d74d9868a1a8c41de867d82.zip
config: Read hidden AP information from config file
-rw-r--r--src/config.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 5363dc3e..de43933c 100644
--- a/src/config.c
+++ b/src/config.c
@@ -51,6 +51,7 @@ struct connman_config_service {
GSList *service_identifiers;
char *config_ident; /* file prefix */
char *config_entry; /* entry name */
+ connman_bool_t hidden;
};
struct connman_config {
@@ -89,6 +90,7 @@ static connman_bool_t cleanup = FALSE;
#define SERVICE_KEY_IDENTITY "Identity"
#define SERVICE_KEY_PHASE2 "Phase2"
#define SERVICE_KEY_PASSPHRASE "Passphrase"
+#define SERVICE_KEY_HIDDEN "Hidden"
static const char *config_possible_keys[] = {
CONFIG_KEY_NAME,
@@ -110,6 +112,7 @@ static const char *service_possible_keys[] = {
SERVICE_KEY_IDENTITY,
SERVICE_KEY_PHASE2,
SERVICE_KEY_PASSPHRASE,
+ SERVICE_KEY_HIDDEN,
NULL,
};
@@ -387,6 +390,9 @@ static int load_service(GKeyFile *keyfile, const char *group,
service->config_ident = g_strdup(config->ident);
service->config_entry = g_strdup_printf("service_%s", service->ident);
+ service->hidden = g_key_file_get_boolean(keyfile, group,
+ SERVICE_KEY_HIDDEN, NULL);
+
if (service_created)
g_hash_table_insert(config->service_table, service->ident,
service);
@@ -849,6 +855,9 @@ static void provision_service(gpointer key, gpointer value, gpointer user_data)
if (config->passphrase != NULL)
__connman_service_set_string(service, "Passphrase", config->passphrase);
+ if (config->hidden == TRUE)
+ __connman_service_set_hidden(service);
+
__connman_service_mark_dirty();
__connman_service_save(service);