diff options
author | Niraj Kumar Goit <niraj.g@samsung.com> | 2019-09-27 16:05:24 +0530 |
---|---|---|
committer | Jaehyun Kim <jeik01.kim@samsung.com> | 2019-10-08 00:37:20 +0000 |
commit | b7ff33d7bc0b2b6efaf8e2f0c69c75b8efbc2490 (patch) | |
tree | 832ac3d6c92583fc803c445c7903e4bdf1acc882 /src/main.c | |
parent | 0702eaff61dc1d59ed60800bd984b2a364849e5d (diff) | |
download | connman-b7ff33d7bc0b2b6efaf8e2f0c69c75b8efbc2490.tar.gz connman-b7ff33d7bc0b2b6efaf8e2f0c69c75b8efbc2490.tar.bz2 connman-b7ff33d7bc0b2b6efaf8e2f0c69c75b8efbc2490.zip |
Added an option in main.conf to set global DNS.
Change-Id: I52f95964f82a88389e98592c64bf4820c1da5887
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -97,6 +97,7 @@ static struct { char **cellular_interfaces; bool tizen_tv_extension; bool auto_ip; + char *global_nameserver; #endif } connman_settings = { .bg_scan = true, @@ -124,6 +125,7 @@ static struct { .cellular_interfaces = NULL, .tizen_tv_extension = false, .auto_ip = true, + .global_nameserver = NULL, #endif }; @@ -152,6 +154,7 @@ static struct { #define CONF_CELLULAR_INTERFACE "NetworkCellularInterfaceList" #define CONF_TIZEN_TV_EXT "TizenTVExtension" #define CONF_ENABLE_AUTO_IP "EnableAutoIp" +#define CONF_GLOBAL_NAMESERVER "GlobalNameserver" #endif static const char *supported_options[] = { @@ -178,6 +181,8 @@ static const char *supported_options[] = { #if defined TIZEN_EXT CONF_CELLULAR_INTERFACE, CONF_TIZEN_TV_EXT, + CONF_ENABLE_AUTO_IP, + CONF_GLOBAL_NAMESERVER, #endif NULL }; @@ -298,6 +303,7 @@ static void check_Tizen_configuration(GKeyFile *config) { GError *error = NULL; char **cellular_interfaces; + char *global_nameserver; bool boolean; gsize len; @@ -322,6 +328,13 @@ static void check_Tizen_configuration(GKeyFile *config) connman_settings.auto_ip = boolean; g_clear_error(&error); + + global_nameserver = __connman_config_get_string(config, "General", + CONF_GLOBAL_NAMESERVER, &error); + if (!error) + connman_settings.global_nameserver = global_nameserver; + + g_clear_error(&error); } static void set_nofile_inc(void) @@ -735,6 +748,10 @@ const char *connman_option_get_string(const char *key) return option_wifi; } +#if defined TIZEN_EXT + if (g_str_equal(key, CONF_GLOBAL_NAMESERVER)) + return connman_settings.global_nameserver; +#endif return NULL; } |