summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-04-25 14:47:48 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-26 12:31:27 +0300
commit03055c5a5eabca0f8bc1daf9e7f20708fa11e324 (patch)
treeddcb214a4de36e61e246a7435cbee0c7a0e0419a /src/main.c
parent78daeb197605d997cf6c00a5dfce36afde0b6cc9 (diff)
downloadconnman-03055c5a5eabca0f8bc1daf9e7f20708fa11e324.tar.gz
connman-03055c5a5eabca0f8bc1daf9e7f20708fa11e324.tar.bz2
connman-03055c5a5eabca0f8bc1daf9e7f20708fa11e324.zip
main: Add support for AllowedTetheringTechnologies configuration variable
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index a76ec3ba..8ed04b89 100644
--- a/src/main.c
+++ b/src/main.c
@@ -70,6 +70,7 @@ static struct {
char **blacklisted_interfaces;
connman_bool_t allow_hostname_updates;
connman_bool_t single_tech;
+ char **allowed_tethering_technologies;
} connman_settings = {
.bg_scan = TRUE,
.pref_timeservers = NULL,
@@ -81,6 +82,7 @@ static struct {
.blacklisted_interfaces = NULL,
.allow_hostname_updates = TRUE,
.single_tech = FALSE,
+ .allowed_tethering_technologies = NULL,
};
#define CONF_BG_SCAN "BackgroundScanning"
@@ -93,6 +95,7 @@ static struct {
#define CONF_BLACKLISTED_INTERFACES "NetworkInterfaceBlacklist"
#define CONF_ALLOW_HOSTNAME_UPDATES "AllowHostnameUpdates"
#define CONF_SINGLE_TECH "SingleConnectedTechnology"
+#define CONF_ALLOWED_TETHERING_TECHNOLOGIES "AllowedTetheringTechnologies"
static const char *supported_options[] = {
CONF_BG_SCAN,
@@ -105,6 +108,7 @@ static const char *supported_options[] = {
CONF_BLACKLISTED_INTERFACES,
CONF_ALLOW_HOSTNAME_UPDATES,
CONF_SINGLE_TECH,
+ CONF_ALLOWED_TETHERING_TECHNOLOGIES,
NULL
};
@@ -225,6 +229,7 @@ static void parse_config(GKeyFile *config)
char **timeservers;
char **interfaces;
char **str_list;
+ char **tethering;
gsize len;
int timeout;
@@ -327,6 +332,14 @@ static void parse_config(GKeyFile *config)
connman_settings.single_tech = boolean;
g_clear_error(&error);
+
+ tethering = g_key_file_get_string_list(config, "General",
+ CONF_ALLOWED_TETHERING_TECHNOLOGIES, &len, &error);
+
+ if (error == NULL)
+ connman_settings.allowed_tethering_technologies = tethering;
+
+ g_clear_error(&error);
}
static int config_init(const char *file)
@@ -512,6 +525,9 @@ char **connman_setting_get_string_list(const char *key)
if (g_str_equal(key, CONF_BLACKLISTED_INTERFACES) == TRUE)
return connman_settings.blacklisted_interfaces;
+ if (g_str_equal(key, CONF_ALLOWED_TETHERING_TECHNOLOGIES) == TRUE)
+ return connman_settings.allowed_tethering_technologies;
+
return NULL;
}
@@ -721,6 +737,7 @@ int main(int argc, char *argv[])
g_free(connman_settings.preferred_techs);
g_strfreev(connman_settings.fallback_nameservers);
g_strfreev(connman_settings.blacklisted_interfaces);
+ g_strfreev(connman_settings.allowed_tethering_technologies);
g_free(option_debug);