Merge "Store DHCP Server Address in net_dev_info_s structure" into tizen accepted/tizen/unified/20170427.015558 submit/tizen/20170424.014832 submit/tizen/20170425.040532
authortaesub kim <taesub.kim@samsung.com>
Mon, 24 Apr 2017 00:48:26 +0000 (00:48 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 24 Apr 2017 00:48:26 +0000 (00:48 +0000)
include/profile/network-pm-config.h
src/network-profile-intf.c

index d59f811..f2594f8 100755 (executable)
@@ -364,6 +364,11 @@ typedef struct
        /** Gateway address */
        net_addr_t      GatewayAddr;
 
+       /** Whether DHCP Server address present or not */
+       char            BServerAddr;
+       /** DHCP Server Address */
+       net_addr_t      ServerAddr;
+
        /** Proxy Method type */
        net_proxy_type_t        ProxyMethod;
        /** Proxy address */
index 0614dc1..02e541c 100755 (executable)
@@ -120,6 +120,9 @@ static int __net_pm_init_profile_info(net_device_t profile_type, net_profile_inf
                net_info->BDefGateway = FALSE;
                net_info->GatewayAddr.Type = NET_ADDR_IPV4;
                net_info->GatewayAddr.Data.Ipv4.s_addr = 0;
+               net_info->BServerAddr = FALSE;
+               net_info->ServerAddr.Type = NET_ADDR_IPV4;
+               net_info->ServerAddr.Data.Ipv4.s_addr = 0;
 
                net_info->IpConfigType6 = 0;
                net_info->IpAddr6.Type = NET_ADDR_IPV6;
@@ -903,6 +906,12 @@ static int __net_extract_common_info(const char *key, GVariant *variant, net_pro
                                else if (g_strcmp0(value, "off") == 0)
                                        net_info->IpConfigType = NET_IP_CONFIG_TYPE_OFF;
 
+                               if (net_info->IpConfigType != NET_IP_CONFIG_TYPE_DYNAMIC) {
+                                       net_info->BServerAddr = FALSE;
+                                       net_info->ServerAddr.Type = NET_ADDR_IPV4;
+                                       net_info->ServerAddr.Data.Ipv4.s_addr = 0;
+                               }
+
                        } else if (g_strcmp0(subKey, "Address") == 0) {
                                value = g_variant_get_string(var, NULL);
 
@@ -918,6 +927,11 @@ static int __net_extract_common_info(const char *key, GVariant *variant, net_pro
 
                                __net_extract_ip(value, &net_info->GatewayAddr);
                                net_info->BDefGateway = TRUE;
+                       } else if (g_strcmp0(subKey, "DHCPServerIP") == 0) {
+                               value = g_variant_get_string(var, NULL);
+
+                               __net_extract_ip(value, &net_info->ServerAddr);
+                               net_info->BServerAddr = TRUE;
                        }
                }
                g_variant_iter_free(iter);