summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2019-09-23 15:45:33 +0530
committerNiraj Kumar Goit <niraj.g@samsung.com>2019-09-23 17:08:24 +0530
commita0c29c7da07fa8bf3e8839a4a64a183a02296a32 (patch)
tree6e92a0c4a208e00c275ee546b485e12c6575c145 /src/main.c
parent83d8c81d27d65f9d4a3bdc3c3685d4b03a13ab70 (diff)
downloadconnman-a0c29c7da07fa8bf3e8839a4a64a183a02296a32.tar.gz
connman-a0c29c7da07fa8bf3e8839a4a64a183a02296a32.tar.bz2
connman-a0c29c7da07fa8bf3e8839a4a64a183a02296a32.zip
Added support to enable/disable Auto-IP option using main.conf Change-Id: Iea1cae5a28681a90a5f79735c7374791a227feb7 Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 8221c35a..0e603b8f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -96,6 +96,7 @@ static struct {
#if defined TIZEN_EXT
char **cellular_interfaces;
bool tizen_tv_extension;
+ bool auto_ip;
#endif
} connman_settings = {
.bg_scan = true,
@@ -122,6 +123,7 @@ static struct {
#if defined TIZEN_EXT
.cellular_interfaces = NULL,
.tizen_tv_extension = false,
+ .auto_ip = true,
#endif
};
@@ -149,6 +151,7 @@ static struct {
#if defined TIZEN_EXT
#define CONF_CELLULAR_INTERFACE "NetworkCellularInterfaceList"
#define CONF_TIZEN_TV_EXT "TizenTVExtension"
+#define CONF_ENABLE_AUTO_IP "EnableAutoIp"
#endif
static const char *supported_options[] = {
@@ -312,6 +315,13 @@ static void check_Tizen_configuration(GKeyFile *config)
connman_settings.tizen_tv_extension = boolean;
g_clear_error(&error);
+
+ boolean = __connman_config_get_bool(config, "General",
+ CONF_ENABLE_AUTO_IP, &error);
+ if (!error)
+ connman_settings.auto_ip = boolean;
+
+ g_clear_error(&error);
}
static void set_nofile_inc(void)
@@ -760,6 +770,11 @@ bool connman_setting_get_bool(const char *key)
if (g_str_equal(key, CONF_USE_GATEWAYS_AS_TIMESERVERS))
return connman_settings.use_gateways_as_timeservers;
+#if defined TIZEN_EXT
+ if (g_str_equal(key, CONF_ENABLE_AUTO_IP))
+ return connman_settings.auto_ip;
+#endif
+
return false;
}