IPACM: Add support for AP-AP mode with internet only guest profile

This change is for AP+AP mode with internet only guest access profile
support. Guest AP clients are forbidden from accessing Primary AP,
USB clients and embedded applications running on A7.

Change-Id: I6bd60c3611559e4bd09cb1b8ea188ace2a386fe5
diff --git a/ipacm/inc/IPACM_Config.h b/ipacm/inc/IPACM_Config.h
index fa705e2..2e2da22 100644
--- a/ipacm/inc/IPACM_Config.h
+++ b/ipacm/inc/IPACM_Config.h
@@ -117,6 +117,9 @@
 
 	int ipa_nat_iface_entries;
 
+	/* Store the total number of wlan guest ap configured */
+	int ipa_num_wlan_guest_ap;
+
 	/* Max valid rm entry */
 	int ipa_max_valid_rm_entry;
 
diff --git a/ipacm/inc/IPACM_Defs.h b/ipacm/inc/IPACM_Defs.h
index f90ada4..dad3d9a 100644
--- a/ipacm/inc/IPACM_Defs.h
+++ b/ipacm/inc/IPACM_Defs.h
@@ -71,6 +71,7 @@
 
 #define IPA_MAX_IFACE_ENTRIES 15
 #define IPA_MAX_PRIVATE_SUBNET_ENTRIES 3
+#define IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES 2
 #define IPA_MAX_ALG_ENTRIES 20
 #define IPA_MAX_RM_ENTRY 6
 
@@ -206,7 +207,13 @@
 {
 	ROUTER = 0,
 	BRIDGE
-} ipacm_iface_mode;
+} ipacm_cradle_iface_mode;
+
+typedef enum
+{
+	FULL,
+	INTERNET
+} ipacm_wlan_access_mode;
 
 typedef struct
 {
@@ -218,7 +225,8 @@
 {
 	char iface_name[IPA_IFACE_NAME_LEN];
 	ipacm_iface_type if_cat;
-	ipacm_iface_mode if_mode;
+	ipacm_cradle_iface_mode if_mode;
+	ipacm_wlan_access_mode wlan_mode;
 	int netlink_interface_index;
 } ipa_ifi_dev_name_t;
 
@@ -242,7 +250,7 @@
 
 typedef struct
 {
-	ipacm_iface_mode cradle_wan_mode;
+	ipacm_cradle_iface_mode cradle_wan_mode;
 } ipacm_event_cradle_wan_mode;
 
 typedef struct
diff --git a/ipacm/inc/IPACM_Wlan.h b/ipacm/inc/IPACM_Wlan.h
index cbbb4c2..0d8a3b7 100644
--- a/ipacm/inc/IPACM_Wlan.h
+++ b/ipacm/inc/IPACM_Wlan.h
@@ -104,7 +104,7 @@
 
 	uint32_t wlan_guest_ap_flt_rule_hdl_v4[IPA_MAX_PRIVATE_SUBNET_ENTRIES];
 
-	uint32_t wlan_guest_ap_flt_rule_hdl_v6;
+	uint32_t wlan_guest_ap_flt_rule_hdl_v6[IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES];
 
 	static lan2lan_flt_rule_hdl self_client_flt_rule_hdl_v4[IPA_LAN_TO_LAN_MAX_WLAN_CLIENT];
 	static lan2lan_flt_rule_hdl self_client_flt_rule_hdl_v6[IPA_LAN_TO_LAN_MAX_WLAN_CLIENT];
@@ -327,6 +327,9 @@
 
 	int eth_bridge_modify_wlan_rt_rule(uint8_t* mac, eth_bridge_src_iface src_iface, ipa_ip_type iptyp);
 
+	/*handle wlan access mode switch */
+	void eth_bridge_handle_wlan_mode_switch();
+
 };
 
 
diff --git a/ipacm/inc/IPACM_Xml.h b/ipacm/inc/IPACM_Xml.h
index 53cabad..cde9283 100644
--- a/ipacm/inc/IPACM_Xml.h
+++ b/ipacm/inc/IPACM_Xml.h
@@ -54,12 +54,12 @@
 #include <libxml/parser.h>
 #include <libxml/tree.h>
   
-#define IPACM_ASSERT(a)                                            \
-if (!(a)) {                                             \
-    fprintf(stderr, "%s, %d: assertion (a) failed!",    \
-            __FILE__,                                   \
-            __LINE__);                                  \
-    abort();                                         \
+#define IPACM_ASSERT(a)                                     \
+if (!(a)) {                                                 \
+	fprintf(stderr, "%s, %d: assertion (a) failed!",    \
+	__FILE__,                                           \
+	__LINE__);                                          \
+	abort();                                            \
 }
   
 /* Max allowed size of the XML file (2 MB) */
@@ -93,6 +93,9 @@
 #define WANIF_TAG                            "WAN"
 #define LANIF_TAG                            "LAN"
 #define WLANIF_TAG                           "WLAN"
+#define WLAN_FULL_MODE_TAG                   "full"
+#define WLAN_INTERNET_MODE_TAG               "internet"
+#define WLAN_MODE_TAG                        "WlanMode"
 #define VIRTUALIF_TAG                        "VIRTUAL"
 #define UNKNOWNIF_TAG                        "UNKNOWN"
 #define ODUIF_TAG                            "ODU"
@@ -181,31 +184,31 @@
 ---------------------------------------------------------------------------*/
 typedef enum
 {
-  IPACM_FIREWALL_IPV6_BASE_HDR        = 4,                               /* IPv6 Base Header           */
-  IPACM_FIREWALL_IPPROTO_HOP_BY_HOP_OPT_HDR = 0,                         /* Hop-by-hop Option Header   */
-  IPACM_FIREWALL_IPPROTO_ICMP         = 1,                               /* ICMP protocol */
-  IPACM_FIREWALL_IPPROTO_IGMP         = 2,                               /* IGMP protocol */
-  IPACM_FIREWALL_IPPROTO_IP           = IPACM_FIREWALL_IPV6_BASE_HDR,    /* IPv4          */
-  IPACM_FIREWALL_IPPROTO_TCP          = 6,                               /* TCP Protocol */
-  IPACM_FIREWALL_IPPROTO_UDP          = 17,                              /* UDP Protocol */
-  IPACM_FIREWALL_IPPROTO_IPV6         = 41,                              /* IPv6                       */
-  IPACM_FIREWALL_IPPROTO_ROUTING_HDR  = 43,                              /* Routing Header             */
-  IPACM_FIREWALL_IPPROTO_FRAG_HDR     = 44,                              /* Fragmentation Header       */
-  IPACM_FIREWALL_IPPROTO_GRE          = 47,                              /* GRE Protocol */
-  IPACM_FIREWALL_IPPROTO_ESP          = 50,                              /* ESP Protocol */
-  IPACM_FIREWALL_IPPROTO_AH           = 51,                              /* Authentication Header      */
-  IPACM_FIREWALL_IPPROTO_ICMP6        = 58,                              /* ICMPv6                     */
-  IPACM_FIREWALL_NO_NEXT_HDR          = 59,                              /* No Next Header for IPv6    */
-  IPACM_FIREWALL_IPPROTO_DEST_OPT_HDR = 60,                              /* Destination Options Header */
-  IPACM_FIREWALL_IPPROTO_MOBILITY_HDR = 135,                             /* Mobility Header            */
-  IPACM_FIREWALL_IPPROTO_TCP_UDP      = 253                              /* Unspecified protocol used for IPACM */
+	IPACM_FIREWALL_IPV6_BASE_HDR        = 4,                               /* IPv6 Base Header           */
+	IPACM_FIREWALL_IPPROTO_HOP_BY_HOP_OPT_HDR = 0,                         /* Hop-by-hop Option Header   */
+	IPACM_FIREWALL_IPPROTO_ICMP         = 1,                               /* ICMP protocol */
+	IPACM_FIREWALL_IPPROTO_IGMP         = 2,                               /* IGMP protocol */
+	IPACM_FIREWALL_IPPROTO_IP           = IPACM_FIREWALL_IPV6_BASE_HDR,    /* IPv4          */
+	IPACM_FIREWALL_IPPROTO_TCP          = 6,                               /* TCP Protocol */
+	IPACM_FIREWALL_IPPROTO_UDP          = 17,                              /* UDP Protocol */
+	IPACM_FIREWALL_IPPROTO_IPV6         = 41,                              /* IPv6                       */
+	IPACM_FIREWALL_IPPROTO_ROUTING_HDR  = 43,                              /* Routing Header             */
+	IPACM_FIREWALL_IPPROTO_FRAG_HDR     = 44,                              /* Fragmentation Header       */
+	IPACM_FIREWALL_IPPROTO_GRE          = 47,                              /* GRE Protocol */
+	IPACM_FIREWALL_IPPROTO_ESP          = 50,                              /* ESP Protocol */
+	IPACM_FIREWALL_IPPROTO_AH           = 51,                              /* Authentication Header      */
+	IPACM_FIREWALL_IPPROTO_ICMP6        = 58,                              /* ICMPv6                     */
+	IPACM_FIREWALL_NO_NEXT_HDR          = 59,                              /* No Next Header for IPv6    */
+	IPACM_FIREWALL_IPPROTO_DEST_OPT_HDR = 60,                              /* Destination Options Header */
+	IPACM_FIREWALL_IPPROTO_MOBILITY_HDR = 135,                             /* Mobility Header            */
+	IPACM_FIREWALL_IPPROTO_TCP_UDP      = 253                              /* Unspecified protocol used for IPACM */
 } ipacm_firewall_ip_protocol_enum_type;
 
 /* define as mobileap firewall rule format*/
 typedef enum
 {
-  IP_V4 = 4,
-  IP_V6 = 6
+	IP_V4 = 4,
+	IP_V6 = 6
 } firewall_ip_version_enum;
   
 /*---------------------------------------------------------------------------
@@ -213,8 +216,8 @@
 ---------------------------------------------------------------------------*/
 typedef struct
 {
-  struct ipa_rule_attrib attrib;
-  firewall_ip_version_enum  ip_vsn;
+	struct ipa_rule_attrib attrib;
+	firewall_ip_version_enum  ip_vsn;
 } IPACM_extd_firewall_entry_conf_t;
 
 
@@ -223,72 +226,72 @@
 ---------------------------------------------------------------------------*/
 typedef union
 {
-  IPACM_extd_firewall_entry_conf_t extd_firewall_entry;
+	IPACM_extd_firewall_entry_conf_t extd_firewall_entry;
 } IPACM_extd_firewall_conf_t;
 
 
 typedef struct
 {
-  char     firewall_config_file[IPA_MAX_FILE_LEN];
-  uint8_t    num_extd_firewall_entries;
-  IPACM_extd_firewall_entry_conf_t extd_firewall_entries[IPACM_MAX_FIREWALL_ENTRIES];
-	bool     rule_action_accept;
-	bool     firewall_enable;	
+	char firewall_config_file[IPA_MAX_FILE_LEN];
+	uint8_t  num_extd_firewall_entries;
+	IPACM_extd_firewall_entry_conf_t extd_firewall_entries[IPACM_MAX_FIREWALL_ENTRIES];
+	bool rule_action_accept;
+	bool firewall_enable;
 } IPACM_firewall_conf_t;
   
 
 
 typedef struct
 {
-  uint8_t    num_iface_entries;
-  ipa_ifi_dev_name_t iface_entries[IPA_MAX_IFACE_ENTRIES];
+	uint8_t num_iface_entries;
+	ipa_ifi_dev_name_t iface_entries[IPA_MAX_IFACE_ENTRIES];
 } ipacm_iface_conf_t;
 
 typedef struct
 {
-  uint8_t    num_subnet_entries;
-  ipa_private_subnet private_subnet_entries[IPA_MAX_PRIVATE_SUBNET_ENTRIES];
+	uint8_t num_subnet_entries;
+	ipa_private_subnet private_subnet_entries[IPA_MAX_PRIVATE_SUBNET_ENTRIES];
 } ipacm_private_subnet_conf_t;
 
 typedef struct
 {
-  uint8_t protocol;
-  uint16_t port;
+	uint8_t protocol;
+	uint16_t port;
 } ipacm_alg;
 
 typedef struct
 {
-  uint8_t    num_alg_entries;
-  ipacm_alg alg_entries[IPA_MAX_ALG_ENTRIES];
+	uint8_t num_alg_entries;
+	ipacm_alg alg_entries[IPA_MAX_ALG_ENTRIES];
 } ipacm_alg_conf_t;
 
  
 typedef struct  _IPACM_conf_t
 {
-  ipacm_iface_conf_t iface_config;
-  ipacm_private_subnet_conf_t private_subnet_config;
-  ipacm_alg_conf_t alg_config;
+	ipacm_iface_conf_t iface_config;
+	ipacm_private_subnet_conf_t private_subnet_config;
+	ipacm_alg_conf_t alg_config;
 	int nat_max_entries;
-  bool odu_enable;
-  bool router_mode_enable;
-  bool odu_embms_enable;
+	bool odu_enable;
+	bool router_mode_enable;
+	bool odu_embms_enable;
+	int num_wlan_guest_ap;
 } IPACM_conf_t;  
 
 /* This function read IPACM XML configuration*/
 int ipacm_read_cfg_xml
 (
-  char *xml_file,                              /* Filename and path     */
-  IPACM_conf_t *config                         /* Mobile AP config data */
+	char *xml_file,                              /* Filename and path     */
+	IPACM_conf_t *config                         /* Mobile AP config data */
 );
 
 /* This function reads QCMAP Firewall XML and store in IPACM Firewall stucture */
 int IPACM_read_firewall_xml
 (
-  char *xml_file,                                 /* Filename and path     */
-  IPACM_firewall_conf_t *config                   /* Mobile AP config data */
+	char *xml_file,                                 /* Filename and path     */
+	IPACM_firewall_conf_t *config                   /* Mobile AP config data */
 );
 
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/ipacm/src/IPACM_Config.cpp b/ipacm/src/IPACM_Config.cpp
index 0bd47ce..38b3752 100644
--- a/ipacm/src/IPACM_Config.cpp
+++ b/ipacm/src/IPACM_Config.cpp
@@ -53,9 +53,10 @@
 	alg_table = NULL;
 	memset(&ipa_client_rm_map_tbl, 0, sizeof(ipa_client_rm_map_tbl));
 	memset(&ipa_rm_tbl, 0, sizeof(ipa_rm_tbl));
-    ipa_rm_a2_check=0;
+	ipa_rm_a2_check=0;
 	ipacm_odu_enable = false;
 	ipacm_odu_router_mode = false;
+	ipa_num_wlan_guest_ap = 0;
 
 	ipa_num_ipa_interfaces = 0;
 	ipa_num_private_subnet = 0;
@@ -127,6 +128,14 @@
 		goto fail;
 	}
 
+	/* Check wlan AP-AP access mode configuration */
+	if (cfg->num_wlan_guest_ap == 2)
+	{
+		IPACMDBG_H("IPACM_Config::Both wlan APs can not be configured in guest ap mode. \n");
+		IPACMDBG_H("IPACM_Config::configure both APs in full access mode or at least one in guest ap mode. \n");
+		ret = IPACM_FAILURE;
+		goto fail;
+	}
 	/* Construct IPACM Iface table */
 	ipa_num_ipa_interfaces = cfg->iface_config.num_iface_entries;
 	if (iface_table != NULL)
@@ -149,8 +158,9 @@
 		strncpy(iface_table[i].iface_name, cfg->iface_config.iface_entries[i].iface_name, sizeof(iface_table[i].iface_name));
 		iface_table[i].if_cat = cfg->iface_config.iface_entries[i].if_cat;
 		iface_table[i].if_mode = cfg->iface_config.iface_entries[i].if_mode;
-		IPACMDBG_H("IPACM_Config::iface_table[%d] = %s, cat=%d, mode=%d\n", i, iface_table[i].iface_name,
-				iface_table[i].if_cat, iface_table[i].if_mode);
+		iface_table[i].wlan_mode = cfg->iface_config.iface_entries[i].wlan_mode;
+		IPACMDBG_H("IPACM_Config::iface_table[%d] = %s, cat=%d, mode=%d wlan-mode=%d \n", i, iface_table[i].iface_name,
+				iface_table[i].if_cat, iface_table[i].if_mode, iface_table[i].wlan_mode);
 		/* copy bridge interface name to ipacmcfg */
 		if( iface_table[i].if_cat == VIRTUAL_IF)
 		{
@@ -218,6 +228,8 @@
 	IPACMDBG_H("ipacm_odu_enable %d\n", ipacm_odu_enable);
 	IPACMDBG_H("ipacm_odu_mode %d\n", ipacm_odu_router_mode);
 	IPACMDBG_H("ipacm_odu_embms_enable %d\n", ipacm_odu_embms_enable);
+	ipa_num_wlan_guest_ap = cfg->num_wlan_guest_ap;
+	IPACMDBG_H("ipa_num_wlan_guest_ap %d\n",ipa_num_wlan_guest_ap);
 
 	/* Allocate more non-nat entries if the monitored iface dun have Tx/Rx properties */
 	if (pNatIfaces != NULL)
diff --git a/ipacm/src/IPACM_IfaceManager.cpp b/ipacm/src/IPACM_IfaceManager.cpp
index b2e7ea7..ecc3c9b 100644
--- a/ipacm/src/IPACM_IfaceManager.cpp
+++ b/ipacm/src/IPACM_IfaceManager.cpp
@@ -327,6 +327,7 @@
 				IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_LAN_CLIENT_DEL_EVENT, wl);
 				IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_HDR_PROC_CTX_SET_EVENT, wl);
 				IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT, wl);
+				IPACM_EvtDispatcher::registr(IPA_CFG_CHANGE_EVENT, wl);
 #endif
 				IPACM_EvtDispatcher::registr(IPA_CRADLE_WAN_MODE_SWITCH, wl);
 				IPACM_EvtDispatcher::registr(IPA_WLAN_LINK_DOWN_EVENT, wl);
diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp
index 6a5705f..ef58227 100644
--- a/ipacm/src/IPACM_Wlan.cpp
+++ b/ipacm/src/IPACM_Wlan.cpp
@@ -113,8 +113,8 @@
 #ifdef FEATURE_ETH_BRIDGE_LE
 	exp_index_v4 = IPV4_DEFAULT_FILTERTING_RULES + 2 * IPACM_Iface::ipacmcfg->ipa_num_private_subnet
 			+ IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT + NUM_IPV4_ICMP_FLT_RULE;
-	exp_index_v6 = IPV6_DEFAULT_FILTERTING_RULES + 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT + NUM_IPV6_PREFIX_FLT_RULE
-				+ NUM_IPV6_ICMP_FLT_RULE;
+	exp_index_v6 = IPV6_DEFAULT_FILTERTING_RULES + IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT
+			+ NUM_IPV6_PREFIX_FLT_RULE + NUM_IPV6_ICMP_FLT_RULE;
 #else
 #ifndef CT_OPT
 	exp_index_v4 = 2*(IPV4_DEFAULT_FILTERTING_RULES + MAX_OFFLOAD_PAIR + IPACM_Iface::ipacmcfg->ipa_num_private_subnet) + NUM_IPV4_ICMP_FLT_RULE;
@@ -133,7 +133,7 @@
 	add_dummy_flt_rule();
 
 	memset(wlan_guest_ap_flt_rule_hdl_v4, 0, IPA_MAX_PRIVATE_SUBNET_ENTRIES * sizeof(uint32_t));
-	wlan_guest_ap_flt_rule_hdl_v6 = 0;
+	memset(wlan_guest_ap_flt_rule_hdl_v6, 0, IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES * sizeof(uint32_t));
 	is_guest_ap = false;
 
 	memset(eth_bridge_lan_client_flt_info, 0, IPA_LAN_TO_LAN_MAX_LAN_CLIENT * sizeof(eth_bridge_client_flt_info));
@@ -182,6 +182,11 @@
 					}
 				}
 			}
+			if (IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].wlan_mode == INTERNET)
+			{
+				is_guest_ap = true;
+			}
+			IPACMDBG_H("Guest ap enable: %d\n",is_guest_ap);
 		}
 	}
 #endif
@@ -478,7 +483,18 @@
 		IPACMDBG_H("Received IPA_WAN_V6_DOWN in WLAN-instance and need clean up client IPv6 address \n");
 		/* reset wifi-client ipv6 rt-rules */
 		handle_wlan_client_reset_rt(IPA_IP_v6);
-
+#ifdef FEATURE_ETH_BRIDGE_LE
+		if (is_guest_ap == true)
+		{
+			/* delete wlan guest ap global flt rule */
+			if (reset_to_dummy_flt_rule(IPA_IP_v6, wlan_guest_ap_flt_rule_hdl_v6[1]) == IPACM_FAILURE)
+			{
+				IPACMERR("Error deleting wlan guest ap global IPv6 flt rules.\n");
+				return;
+			}
+			wlan_guest_ap_flt_rule_hdl_v6[1] = 0;
+		}
+#endif
 		IPACMDBG_H("Backhaul is sta mode?%d\n", data_wan->is_sta);
 		if(data_wan->is_sta == false && wlan_ap_index > 0)
 		{
@@ -506,25 +522,28 @@
 				{
 					if(data->attribs[i].attrib_type == WLAN_HDR_ATTRIB_MAC_ADDR)
 					{
-						if(IPACM_Lan::wlan_to_wlan_hdr_proc_ctx.valid == true)
+						if (is_guest_ap == false)
 						{
-							eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_WLAN, IPA_IP_v4);
-							eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_WLAN, IPA_IP_v6);
+							if(IPACM_Lan::wlan_to_wlan_hdr_proc_ctx.valid == true)
+							{
+								eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_WLAN, IPA_IP_v4);
+								eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_WLAN, IPA_IP_v6);
+							}
+							if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == true)
+							{
+								eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_LAN, IPA_IP_v4);
+								eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_LAN, IPA_IP_v6);
+							}
+							if(ip_type == IPA_IP_v4 || ip_type == IPA_IP_MAX)
+							{
+								eth_bridge_add_self_client_flt_rule(data->attribs[i].u.mac_addr, IPA_IP_v4);
+							}
+							if(ip_type == IPA_IP_v6 || ip_type == IPA_IP_MAX)
+							{
+								eth_bridge_add_self_client_flt_rule(data->attribs[i].u.mac_addr, IPA_IP_v6);
+							}
+							eth_bridge_post_lan_client_event(data->attribs[i].u.mac_addr, IPA_ETH_BRIDGE_WLAN_CLIENT_ADD_EVENT);
 						}
-						if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == true)
-						{
-							eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_LAN, IPA_IP_v4);
-							eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_LAN, IPA_IP_v6);
-						}
-						if(ip_type == IPA_IP_v4 || ip_type == IPA_IP_MAX)
-						{
-							eth_bridge_add_self_client_flt_rule(data->attribs[i].u.mac_addr, IPA_IP_v4);
-						}
-						if(ip_type == IPA_IP_v6 || ip_type == IPA_IP_MAX)
-						{
-							eth_bridge_add_self_client_flt_rule(data->attribs[i].u.mac_addr, IPA_IP_v6);
-						}
-						eth_bridge_post_lan_client_event(data->attribs[i].u.mac_addr, IPA_ETH_BRIDGE_WLAN_CLIENT_ADD_EVENT);
 						eth_bridge_add_wlan_client(data->attribs[i].u.mac_addr, ipa_if_num);
 						break;
 					}
@@ -544,13 +563,16 @@
 			{
 				IPACMDBG_H("Received IPA_WLAN_CLIENT_DEL_EVENT\n");
 #ifdef FEATURE_ETH_BRIDGE_LE
-				eth_bridge_del_wlan_client_rt_rule(data->mac_addr, SRC_WLAN);
-				if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == true)
+				if (is_guest_ap == false)
 				{
-					eth_bridge_del_wlan_client_rt_rule(data->mac_addr, SRC_LAN);
+					eth_bridge_del_wlan_client_rt_rule(data->mac_addr, SRC_WLAN);
+					if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == true)
+					{
+						eth_bridge_del_wlan_client_rt_rule(data->mac_addr, SRC_LAN);
+					}
+					eth_bridge_del_self_client_flt_rule(data->mac_addr);
+					eth_bridge_post_lan_client_event(data->mac_addr, IPA_ETH_BRIDGE_WLAN_CLIENT_DEL_EVENT);
 				}
-				eth_bridge_del_self_client_flt_rule(data->mac_addr);
-				eth_bridge_post_lan_client_event(data->mac_addr, IPA_ETH_BRIDGE_WLAN_CLIENT_DEL_EVENT);
 				eth_bridge_del_wlan_client(data->mac_addr);
 #endif
 				/* support lan2lan ipa-HW feature*/
@@ -596,25 +618,24 @@
 					get_client_memptr(wlan_client, wlan_index)->power_save_set = false;
 
 					/* First add route rules and then nat rules */
-                    if(get_client_memptr(wlan_client, wlan_index)->ipv4_set == true) /* for ipv4 */
-				    {
+					if(get_client_memptr(wlan_client, wlan_index)->ipv4_set == true) /* for ipv4 */
+					{
 						     IPACMDBG_H("recover client index(%d):ipv4 address: 0x%x\n",
 										 wlan_index,
 										 get_client_memptr(wlan_client, wlan_index)->v4_addr);
 
 						IPACMDBG_H("Adding Route Rules\n");
-					    handle_wlan_client_route_rule(data->mac_addr, IPA_IP_v4);
-
+						handle_wlan_client_route_rule(data->mac_addr, IPA_IP_v4);
 						IPACMDBG_H("Adding Nat Rules\n");
 						Nat_App->ResetPwrSaveIf(get_client_memptr(wlan_client, wlan_index)->v4_addr);
-				    }
+					}
 
-				    if(get_client_memptr(wlan_client, wlan_index)->ipv6_set != 0) /* for ipv6 */
-				    {
-					    handle_wlan_client_route_rule(data->mac_addr, IPA_IP_v6);
-				    }
-			    }
-		    }
+					if(get_client_memptr(wlan_client, wlan_index)->ipv6_set != 0) /* for ipv6 */
+					{
+						handle_wlan_client_route_rule(data->mac_addr, IPA_IP_v6);
+					}
+				}
+			}
 		}
 		break;
 
@@ -802,6 +823,32 @@
 		}
 	}
 	break;
+	case IPA_CFG_CHANGE_EVENT:
+	{
+		IPACMDBG_H("Received IPA_CFG_CHANGE_EVENT event for %s with new wlan-mode: %s old wlan-mode: %s",
+				IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].iface_name,
+				(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].wlan_mode == 0) ? "full" : "internet",
+				(is_guest_ap == true) ? "internet" : "full");
+
+		if (is_guest_ap == true && (IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].wlan_mode == FULL))
+		{
+			is_guest_ap = false;
+			IPACMDBG_H("wlan mode is switched to full access mode. \n");
+			eth_bridge_handle_wlan_mode_switch();
+		}
+		else if (is_guest_ap == false && (IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].wlan_mode == INTERNET))
+		{
+			is_guest_ap = true;
+			IPACMDBG_H("wlan mode is switched to internet only access mode. \n");
+			eth_bridge_handle_wlan_mode_switch();
+		}
+		else
+		{
+			IPACMDBG_H("No change in %s access mode. \n",
+					IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].iface_name);
+		}
+	}
+	break;
 
 	default:
 		break;
@@ -981,7 +1028,7 @@
 			return IPACM_FAILURE;
 		}
 #ifdef FEATURE_ETH_BRIDGE_LE
-		offset = 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT;
+		offset = IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT;
 #else
 #ifndef CT_OPT
 		offset = wlan_ap_index * (IPV6_DEFAULT_FILTERTING_RULES + MAX_OFFLOAD_PAIR) + MAX_OFFLOAD_PAIR;
@@ -2390,16 +2437,21 @@
 		}
 #endif
 #ifdef FEATURE_ETH_BRIDGE_LE
-		if(is_guest_ap == true)
+		if (is_guest_ap == true)
 		{
-			if(reset_to_dummy_flt_rule(IPA_IP_v6, wlan_guest_ap_flt_rule_hdl_v6) == IPACM_FAILURE)
+			IPACMDBG_H("Delete wlan guest ap IPv6 flt rules.\n");
+			for (i=0; i<IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES; i++)
 			{
-				IPACMERR("Error deleting wlan guest ap IPv6 flt rules.\n");
-				res = IPACM_FAILURE;
-				goto fail;
+				if (reset_to_dummy_flt_rule(IPA_IP_v6, wlan_guest_ap_flt_rule_hdl_v6[i]) == IPACM_FAILURE)
+				{
+					IPACMERR("Error deleting wlan guest ap IPv6 flt rules.\n");
+					res = IPACM_FAILURE;
+					goto fail;
+				}
+				wlan_guest_ap_flt_rule_hdl_v6[i] = 0;
 			}
 		}
-		IPACMDBG_H("Deleted wlan guest ap v6 filter rules successfully.\n");
+		IPACMDBG_H("Deleted wlan guest ap IPv6 filter rules successfully.\n");
 #endif
 	}
 	IPACMDBG_H("finished delete filtering rules\n ");
@@ -2452,10 +2504,13 @@
 	{
 #ifdef FEATURE_ETH_BRIDGE_LE
 		eth_bridge_del_wlan_client(get_client_memptr(wlan_client, i)->mac);
-		eth_bridge_del_self_client_flt_rule(get_client_memptr(wlan_client, i)->mac);
-		eth_bridge_post_lan_client_event(get_client_memptr(wlan_client, i)->mac, IPA_ETH_BRIDGE_WLAN_CLIENT_DEL_EVENT);
-		eth_bridge_del_wlan_client_rt_rule(get_client_memptr(wlan_client, i)->mac, SRC_WLAN);
-		eth_bridge_del_wlan_client_rt_rule(get_client_memptr(wlan_client, i)->mac, SRC_LAN);
+		if (is_guest_ap == false)
+		{
+			eth_bridge_del_self_client_flt_rule(get_client_memptr(wlan_client, i)->mac);
+			eth_bridge_post_lan_client_event(get_client_memptr(wlan_client, i)->mac, IPA_ETH_BRIDGE_WLAN_CLIENT_DEL_EVENT);
+			eth_bridge_del_wlan_client_rt_rule(get_client_memptr(wlan_client, i)->mac, SRC_WLAN);
+			eth_bridge_del_wlan_client_rt_rule(get_client_memptr(wlan_client, i)->mac, SRC_LAN);
+		}
 #endif
 		/* First reset nat rules and then route rules */
 		if(get_client_memptr(wlan_client, i)->ipv4_set == true)
@@ -2483,8 +2538,8 @@
 		handle_lan2lan_msg_post(get_client_memptr(wlan_client, i)->mac, IPA_LAN_CLIENT_DISCONNECT, IPA_IP_v4);
 		handle_lan2lan_msg_post(get_client_memptr(wlan_client, i)->mac, IPA_LAN_CLIENT_DISCONNECT, IPA_IP_v6);
 
-        if(get_client_memptr(wlan_client, i)->ipv4_header_set == true)
-        {
+		if(get_client_memptr(wlan_client, i)->ipv4_header_set == true)
+		{
 			if (m_header.DeleteHeaderHdl(get_client_memptr(wlan_client, i)->hdr_hdl_v4)
 				== false)
 			{
@@ -2493,8 +2548,8 @@
 			}
 		}
 
-        if(get_client_memptr(wlan_client, i)->ipv6_header_set == true)
-        {
+		if(get_client_memptr(wlan_client, i)->ipv6_header_set == true)
+		{
 			if (m_header.DeleteHeaderHdl(get_client_memptr(wlan_client, i)->hdr_hdl_v6)
 					== false)
 			{
@@ -2991,7 +3046,7 @@
 		}
 #ifdef FEATURE_ETH_BRIDGE_LE
 		num_v4_dummy_rule = IPV4_DEFAULT_FILTERTING_RULES + IPACM_Iface::ipacmcfg->ipa_num_private_subnet + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT + IPACM_Iface::ipacmcfg->ipa_num_private_subnet;
-		num_v6_dummy_rule = IPV6_DEFAULT_FILTERTING_RULES + 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT;
+		num_v6_dummy_rule = IPV6_DEFAULT_FILTERTING_RULES + IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT;
 #else
 #ifndef CT_OPT
 		num_v4_dummy_rule = 2*(IPV4_DEFAULT_FILTERTING_RULES + MAX_OFFLOAD_PAIR + IPACM_Iface::ipacmcfg->ipa_num_private_subnet);
@@ -3194,7 +3249,7 @@
 
 #ifdef FEATURE_ETH_BRIDGE_LE
 		num_v4_dummy_rule = IPV4_DEFAULT_FILTERTING_RULES + IPACM_Iface::ipacmcfg->ipa_num_private_subnet + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT + IPACM_Iface::ipacmcfg->ipa_num_private_subnet;
-		num_v6_dummy_rule = IPV6_DEFAULT_FILTERTING_RULES + 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT;
+		num_v6_dummy_rule = IPV6_DEFAULT_FILTERTING_RULES + IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT;
 #endif
 
 		if(m_filtering.DeleteFilteringHdls(IPACM_Wlan::dummy_flt_rule_hdl_v4, IPA_IP_v4, num_v4_dummy_rule) == false)
@@ -3414,7 +3469,6 @@
 		IPACMDBG_H("This is not WLAN guest AP, do nothing.\n");
 		return IPACM_SUCCESS;
 	}
-
 	int len, i, offset, res = IPACM_SUCCESS;
 	struct ipa_flt_rule_mdfy flt_rule;
 	struct ipa_ioc_mdfy_flt_rule* pFilteringTable = NULL;
@@ -3425,7 +3479,7 @@
 			IPACMERR("Dummy ipv4 flt rule has not been installed.\n");
 			return IPACM_FAILURE;
 		}
-
+		IPACMDBG_H("Install guest ap filtering rule for IPv4 \n");
 		offset = IPV4_DEFAULT_FILTERTING_RULES;
 		len = sizeof(struct ipa_ioc_mdfy_flt_rule) + (IPACM_Iface::ipacmcfg->ipa_num_private_subnet) * sizeof(struct ipa_flt_rule_mdfy);
 		pFilteringTable = (struct ipa_ioc_mdfy_flt_rule*)malloc(len);
@@ -3474,10 +3528,7 @@
 	}
 	else
 	{
-		if(IPACM_Wan::wan_up_v6 == true)
-		{
-			eth_bridge_install_wlan_guest_ap_ipv6_flt_rule();
-		}
+		eth_bridge_install_wlan_guest_ap_ipv6_flt_rule();
 	}
 fail:
 	if(pFilteringTable != NULL)
@@ -3509,7 +3560,6 @@
 		IPACMERR("Dummy ipv6 flt rule has not been installed.\n");
 		return IPACM_FAILURE;
 	}
-
 	offset = 0;
 	len = sizeof(struct ipa_ioc_mdfy_flt_rule) + sizeof(struct ipa_flt_rule_mdfy);
 	pFilteringTable = (struct ipa_ioc_mdfy_flt_rule*)malloc(len);
@@ -3532,14 +3582,15 @@
 	flt_rule.rule.action = IPA_PASS_TO_EXCEPTION;
 	flt_rule.rule.eq_attrib_type = 0;
 
+	IPACMDBG_H("Install guest ap Link-local filtering rule for IPv6. \n");
 	memcpy(&flt_rule.rule.attrib, &rx_prop->rx[0].attrib, sizeof(flt_rule.rule.attrib));
 	flt_rule.rule.attrib.attrib_mask |= IPA_FLT_DST_ADDR;
-	flt_rule.rule.attrib.u.v6.dst_addr[0] = IPACM_Wan::backhaul_ipv6_prefix[0];
-	flt_rule.rule.attrib.u.v6.dst_addr[1] = IPACM_Wan::backhaul_ipv6_prefix[1];
+	flt_rule.rule.attrib.u.v6.dst_addr[0] = 0xFE800000;
+	flt_rule.rule.attrib.u.v6.dst_addr[1] = 0x0;
 	flt_rule.rule.attrib.u.v6.dst_addr[2] = 0x0;
-	flt_rule.rule.attrib.u.v6.dst_addr[3] = 0x0;
-	flt_rule.rule.attrib.u.v6.dst_addr_mask[0] = 0xFFFFFFFF;
-	flt_rule.rule.attrib.u.v6.dst_addr_mask[1] = 0xFFFFFFFF;
+	flt_rule.rule.attrib.u.v6.dst_addr[3] = 0X0;
+	flt_rule.rule.attrib.u.v6.dst_addr_mask[0] = 0xFFC00000;
+	flt_rule.rule.attrib.u.v6.dst_addr_mask[1] = 0x0;
 	flt_rule.rule.attrib.u.v6.dst_addr_mask[2] = 0x0;
 	flt_rule.rule.attrib.u.v6.dst_addr_mask[3] = 0x0;
 
@@ -3552,9 +3603,35 @@
 		res = IPACM_FAILURE;
 		goto fail;
 	}
-
 	/* copy filter rule hdls */
-	wlan_guest_ap_flt_rule_hdl_v6 = pFilteringTable->rules[0].rule_hdl;
+	wlan_guest_ap_flt_rule_hdl_v6[0] = pFilteringTable->rules[0].rule_hdl;
+
+	if (IPACM_Wan::wan_up_v6 == true)
+	{
+		IPACMDBG_H("Install guest ap global filtering rule for IPv6. \n");
+		memcpy(&flt_rule.rule.attrib, &rx_prop->rx[0].attrib, sizeof(flt_rule.rule.attrib));
+		flt_rule.rule.attrib.attrib_mask |= IPA_FLT_DST_ADDR;
+		flt_rule.rule.attrib.u.v6.dst_addr[0] = IPACM_Wan::backhaul_ipv6_prefix[0];
+		flt_rule.rule.attrib.u.v6.dst_addr[1] = IPACM_Wan::backhaul_ipv6_prefix[1];
+		flt_rule.rule.attrib.u.v6.dst_addr[2] = 0x0;
+		flt_rule.rule.attrib.u.v6.dst_addr[3] = 0x0;
+		flt_rule.rule.attrib.u.v6.dst_addr_mask[0] = 0xFFFFFFFF;
+		flt_rule.rule.attrib.u.v6.dst_addr_mask[1] = 0xFFFFFFFF;
+		flt_rule.rule.attrib.u.v6.dst_addr_mask[2] = 0x0;
+		flt_rule.rule.attrib.u.v6.dst_addr_mask[3] = 0x0;
+
+		flt_rule.rule_hdl = IPACM_Wlan::dummy_flt_rule_hdl_v6[offset+1];
+		memcpy(&(pFilteringTable->rules[0]), &flt_rule, sizeof(struct ipa_flt_rule_mdfy));
+
+		if (false == m_filtering.ModifyFilteringRule(pFilteringTable))
+		{
+			IPACMERR("Failed to modify wlan guest AP IPv6 filtering rules.\n");
+			res = IPACM_FAILURE;
+			goto fail;
+		}
+		/* copy filter rule hdls */
+		wlan_guest_ap_flt_rule_hdl_v6[1] = pFilteringTable->rules[0].rule_hdl;
+	}
 
 fail:
 	if(pFilteringTable != NULL)
@@ -3580,7 +3657,11 @@
 		}
 		else
 		{
-			offset = 1;
+			/* Reserve 2 dummy rules for guest_ap_ipv6
+			   1st for Link-local meta-data based rule
+			   2nd for Global address meta-data based rule
+			*/
+			offset = IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES;
 			for(i=0; i<IPA_LAN_TO_LAN_MAX_WLAN_CLIENT; i++)
 			{
 				self_client_flt_rule_hdl_v6[i].rule_hdl = IPACM_Wlan::dummy_flt_rule_hdl_v6[offset+i];
@@ -3608,7 +3689,7 @@
 		}
 		else
 		{
-			offset = 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT;
+			offset = IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT;
 			for(i=0; i<IPA_LAN_TO_LAN_MAX_LAN_CLIENT; i++)
 			{
 				lan_client_flt_rule_hdl_v6[i].rule_hdl = IPACM_Wlan::dummy_flt_rule_hdl_v6[offset+i];
@@ -5164,3 +5245,73 @@
 	}
 	return IPACM_SUCCESS;
 }
+
+void IPACM_Wlan::eth_bridge_handle_wlan_mode_switch()
+{
+	int i;
+
+	if (is_guest_ap == true) /* Wlan internet mode */
+	{
+		IPACMDBG_H("Install wlan guest ap IPv4 flt rules.\n");
+		eth_bridge_add_wlan_guest_ap_flt_rule(IPA_IP_v4);
+		IPACMDBG_H("Install wlan guest ap IPv6 flt rules.\n");
+		eth_bridge_add_wlan_guest_ap_flt_rule(IPA_IP_v6);
+
+		for (i=0; i<IPACM_Lan::num_wlan_client; i++)
+		{
+			if (IPACM_Lan::eth_bridge_wlan_client[i].ipa_if_num == ipa_if_num)
+			{
+				eth_bridge_del_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_WLAN);
+				if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == true)
+				{
+					eth_bridge_del_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_LAN);
+				}
+				eth_bridge_del_self_client_flt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac);
+				eth_bridge_post_lan_client_event(IPACM_Lan::eth_bridge_wlan_client[i].mac, IPA_ETH_BRIDGE_WLAN_CLIENT_DEL_EVENT);
+			}
+		}
+	}
+	else /* Wlan full mode */
+	{
+		if (IPACM_Iface::ipacmcfg->ipa_num_wlan_guest_ap == 0)
+		{
+			IPACMDBG_H("Delete wlan guest ap IPv4 flt rules.\n");
+			for (i=0; i<IPACM_Iface::ipacmcfg->ipa_num_private_subnet; i++)
+			{
+				if (reset_to_dummy_flt_rule(IPA_IP_v4, wlan_guest_ap_flt_rule_hdl_v4[i]) == IPACM_FAILURE)
+				{
+					IPACMERR("Error deleting wlan guest ap IPv4 flt rules.\n");
+					return;
+				}
+			}
+			IPACMDBG_H("Delete wlan guest ap IPv6 filter rules. \n");
+			for (i=0; i<IPA_GUEST_AP_IPv6_FLT_RULE_ENTRIES; i++)
+			{
+				if (reset_to_dummy_flt_rule(IPA_IP_v6, wlan_guest_ap_flt_rule_hdl_v6[i]) == IPACM_FAILURE)
+				{
+					IPACMERR("Error deleting wlan guest ap IPv6 flt rules.\n");
+					return;
+				}
+				wlan_guest_ap_flt_rule_hdl_v6[i] = 0;
+			}
+		}
+
+		for (i=0; i<IPACM_Lan::num_wlan_client; i++)
+		{
+			if (IPACM_Lan::eth_bridge_wlan_client[i].ipa_if_num == ipa_if_num)
+			{
+				eth_bridge_add_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_WLAN, IPA_IP_v4);
+				eth_bridge_add_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_WLAN, IPA_IP_v6);
+				if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == true)
+				{
+					eth_bridge_add_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_LAN, IPA_IP_v4);
+					eth_bridge_add_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_LAN, IPA_IP_v6);
+				}
+				eth_bridge_add_self_client_flt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, IPA_IP_v4);
+				eth_bridge_add_self_client_flt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, IPA_IP_v6);
+				eth_bridge_post_lan_client_event(IPACM_Lan::eth_bridge_wlan_client[i].mac, IPA_ETH_BRIDGE_WLAN_CLIENT_ADD_EVENT);
+			}
+		}
+	}
+	IPACMDBG_H("Wlan mode switch is successful. ");
+}
diff --git a/ipacm/src/IPACM_Xml.cpp b/ipacm/src/IPACM_Xml.cpp
index 03af08c..bcb5b6b 100644
--- a/ipacm/src/IPACM_Xml.cpp
+++ b/ipacm/src/IPACM_Xml.cpp
@@ -158,7 +158,6 @@
 
 	if (NULL == xml_node)
 		return ret_val;
-
 	while ( xml_node != NULL &&
 				 ret_val == IPACM_SUCCESS)
 	{
@@ -166,55 +165,40 @@
 		{
 		case XML_ELEMENT_NODE:
 			{
-				if (IPACM_util_icmp_string((char*)xml_node->name,
-																	 system_TAG) == 0 ||
-						IPACM_util_icmp_string((char*)xml_node->name,
-																	 ODU_TAG) == 0 ||
-						IPACM_util_icmp_string((char*)xml_node->name,
-																	 IPACMCFG_TAG) == 0 ||
-						IPACM_util_icmp_string((char*)xml_node->name,
-																	 IPACMIFACECFG_TAG) == 0 ||
-						IPACM_util_icmp_string((char*)xml_node->name,
-																	 IFACE_TAG) == 0 ||
-						IPACM_util_icmp_string((char*)xml_node->name,
-																	 IPACMPRIVATESUBNETCFG_TAG) == 0 ||
-						IPACM_util_icmp_string((char*)xml_node->name,
-																	 SUBNET_TAG) == 0 ||
-						IPACM_util_icmp_string((char*)xml_node->name,
-																	 IPACMALG_TAG) == 0 ||
-						IPACM_util_icmp_string((char*)xml_node->name,
-																	 ALG_TAG) == 0 ||
-						IPACM_util_icmp_string((char*)xml_node->name,
-																	 IPACMNat_TAG) == 0)
+				if (IPACM_util_icmp_string((char*)xml_node->name, system_TAG) == 0 ||
+						IPACM_util_icmp_string((char*)xml_node->name, ODU_TAG) == 0 ||
+						IPACM_util_icmp_string((char*)xml_node->name, IPACMCFG_TAG) == 0 ||
+						IPACM_util_icmp_string((char*)xml_node->name, IPACMIFACECFG_TAG) == 0 ||
+						IPACM_util_icmp_string((char*)xml_node->name, IFACE_TAG) == 0 ||
+						IPACM_util_icmp_string((char*)xml_node->name, IPACMPRIVATESUBNETCFG_TAG) == 0 ||
+						IPACM_util_icmp_string((char*)xml_node->name, SUBNET_TAG) == 0 ||
+						IPACM_util_icmp_string((char*)xml_node->name, IPACMALG_TAG) == 0 ||
+						IPACM_util_icmp_string((char*)xml_node->name, ALG_TAG) == 0 ||
+						IPACM_util_icmp_string((char*)xml_node->name, IPACMNat_TAG) == 0)
 				{
-					if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																					IFACE_TAG))
+					if (0 == IPACM_util_icmp_string((char*)xml_node->name, IFACE_TAG))
 					{
 						/* increase iface entry number */
 						config->iface_config.num_iface_entries++;
 					}
 
-					if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																					SUBNET_TAG))
+					if (0 == IPACM_util_icmp_string((char*)xml_node->name, SUBNET_TAG))
 					{
 						/* increase iface entry number */
 						config->private_subnet_config.num_subnet_entries++;
 					}
 
-					if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																					ALG_TAG))
+					if (0 == IPACM_util_icmp_string((char*)xml_node->name, ALG_TAG))
 					{
 						/* increase iface entry number */
 						config->alg_config.num_alg_entries++;
 					}
 					/* go to child */
-					ret_val = ipacm_cfg_xml_parse_tree(xml_node->children,
-																						 config);
+					ret_val = ipacm_cfg_xml_parse_tree(xml_node->children, config);
 				}
-				else if (IPACM_util_icmp_string((char*)xml_node->name,
-																	ODUMODE_TAG) == 0)
+				else if (IPACM_util_icmp_string((char*)xml_node->name, ODUMODE_TAG) == 0)
 				{
-					IPACMDBG("inside ODU-XML\n");
+					IPACMDBG_H("inside ODU-XML\n");
 					content = IPACM_read_content_element(xml_node);
 					if (content)
 					{
@@ -224,19 +208,18 @@
 						if (0 == strncasecmp(content_buf, ODU_ROUTER_TAG, str_size))
 						{
 							config->router_mode_enable = true;
-							IPACMDBG("router-mode enable %d\n", config->router_mode_enable);
+							IPACMDBG_H("router-mode enable %d\n", config->router_mode_enable);
 						}
 						else if (0 == strncasecmp(content_buf, ODU_BRIDGE_TAG, str_size))
 						{
 							config->router_mode_enable = false;
-							IPACMDBG("router-mode enable %d\n", config->router_mode_enable);
+							IPACMDBG_H("router-mode enable %d\n", config->router_mode_enable);
 						}
 					}
 				}
-				else if (IPACM_util_icmp_string((char*)xml_node->name,
-																	ODUEMBMS_OFFLOAD_TAG) == 0)
+				else if (IPACM_util_icmp_string((char*)xml_node->name, ODUEMBMS_OFFLOAD_TAG) == 0)
 				{
-					IPACMDBG("inside ODU-XML\n");
+					IPACMDBG_H("inside ODU-XML\n");
 					content = IPACM_read_content_element(xml_node);
 					if (content)
 					{
@@ -246,17 +229,16 @@
 						if (atoi(content_buf))
 						{
 							config->odu_embms_enable = true;
-							IPACMDBG("router-mode enable %d buf(%d)\n", config->odu_embms_enable, atoi(content_buf));
+							IPACMDBG_H("router-mode enable %d buf(%d)\n", config->odu_embms_enable, atoi(content_buf));
 						}
 						else
 						{
 							config->odu_embms_enable = false;
-							IPACMDBG("router-mode enable %d buf(%d)\n", config->odu_embms_enable, atoi(content_buf));
+							IPACMDBG_H("router-mode enable %d buf(%d)\n", config->odu_embms_enable, atoi(content_buf));
 						}
 					}
 				}
-				else if (IPACM_util_icmp_string((char*)xml_node->name,
-																				NAME_TAG) == 0)
+				else if (IPACM_util_icmp_string((char*)xml_node->name, NAME_TAG) == 0)
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -268,8 +250,7 @@
 						IPACMDBG_H("Name %s\n", config->iface_config.iface_entries[config->iface_config.num_iface_entries - 1].iface_name);
 					}
 				}
-				else if (IPACM_util_icmp_string((char*)xml_node->name,
-																				CATEGORY_TAG) == 0)
+				else if (IPACM_util_icmp_string((char*)xml_node->name, CATEGORY_TAG) == 0)
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -334,8 +315,32 @@
 						}
 					}
 				}
-				else if (IPACM_util_icmp_string((char*)xml_node->name,
-																				SUBNETADDRESS_TAG) == 0)
+				else if (IPACM_util_icmp_string((char*)xml_node->name, WLAN_MODE_TAG) == 0)
+				{
+					IPACMDBG_H("Inside WLAN-XML\n");
+					content = IPACM_read_content_element(xml_node);
+					if (content)
+					{
+						str_size = strlen(content);
+						memset(content_buf, 0, sizeof(content_buf));
+						memcpy(content_buf, (void *)content, str_size);
+
+						if (0 == strncasecmp(content_buf, WLAN_FULL_MODE_TAG, str_size))
+						{
+							config->iface_config.iface_entries[config->iface_config.num_iface_entries - 1].wlan_mode = FULL;
+							IPACMDBG_H("Wlan-mode full(%d)\n",
+									config->iface_config.iface_entries[config->iface_config.num_iface_entries - 1].wlan_mode);
+						}
+						else  if (0 == strncasecmp(content_buf, WLAN_INTERNET_MODE_TAG, str_size))
+						{
+							config->iface_config.iface_entries[config->iface_config.num_iface_entries - 1].wlan_mode = INTERNET;
+							config->num_wlan_guest_ap++;
+							IPACMDBG_H("Wlan-mode internet(%d)\n",
+									config->iface_config.iface_entries[config->iface_config.num_iface_entries - 1].wlan_mode);
+						}
+					}
+				}
+				else if (IPACM_util_icmp_string((char*)xml_node->name, SUBNETADDRESS_TAG) == 0)
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -349,8 +354,7 @@
 						IPACMDBG_H("subnet_addr: %s \n", content_buf);
 					}
 				}
-				else if (IPACM_util_icmp_string((char*)xml_node->name,
-																				SUBNETMASK_TAG) == 0)
+				else if (IPACM_util_icmp_string((char*)xml_node->name, SUBNETMASK_TAG) == 0)
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -364,8 +368,7 @@
 						IPACMDBG_H("subnet_mask: %s \n", content_buf);
 					}
 				}
-				else if (IPACM_util_icmp_string((char*)xml_node->name,
-																				Protocol_TAG) == 0)
+				else if (IPACM_util_icmp_string((char*)xml_node->name, Protocol_TAG) == 0)
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -378,17 +381,18 @@
 						if (0 == strncasecmp(content_buf, TCP_PROTOCOL_TAG, str_size))
 						{
 							config->alg_config.alg_entries[config->alg_config.num_alg_entries - 1].protocol = IPPROTO_TCP;
-							IPACMDBG_H("Protocol %s: %d\n", content_buf, config->alg_config.alg_entries[config->alg_config.num_alg_entries - 1].protocol);
+							IPACMDBG_H("Protocol %s: %d\n",
+									content_buf, config->alg_config.alg_entries[config->alg_config.num_alg_entries - 1].protocol);
 						}
 						else if (0 == strncasecmp(content_buf, UDP_PROTOCOL_TAG, str_size))
 						{
 							config->alg_config.alg_entries[config->alg_config.num_alg_entries - 1].protocol = IPPROTO_UDP;
-							IPACMDBG_H("Protocol %s: %d\n", content_buf, config->alg_config.alg_entries[config->alg_config.num_alg_entries - 1].protocol);
+							IPACMDBG_H("Protocol %s: %d\n",
+									content_buf, config->alg_config.alg_entries[config->alg_config.num_alg_entries - 1].protocol);
 						}
 					}
 				}
-				else if (IPACM_util_icmp_string((char*)xml_node->name,
-																				Port_TAG) == 0)
+				else if (IPACM_util_icmp_string((char*)xml_node->name, Port_TAG) == 0)
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -401,8 +405,7 @@
 						IPACMDBG_H("port %d\n", config->alg_config.alg_entries[config->alg_config.num_alg_entries - 1].port);
 					}
 				}
-				else if (IPACM_util_icmp_string((char*)xml_node->name,
-																				NAT_MaxEntries_TAG) == 0)
+				else if (IPACM_util_icmp_string((char*)xml_node->name, NAT_MaxEntries_TAG) == 0)
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -437,10 +440,10 @@
 
 	/* invoke the XML parser and obtain the parse tree */
 	doc = xmlReadFile(xml_file, "UTF-8", XML_PARSE_NOBLANKS);
-    if (doc == NULL) {
-        IPACMDBG_H("IPACM_xml_parse: libxml returned parse error\n");
+	if (doc == NULL) {
+		IPACMDBG_H("IPACM_xml_parse: libxml returned parse error\n");
 		return IPACM_FAILURE;
-    }
+	}
 	/*get the root of the tree*/
 	root = xmlDocGetRootElement(doc);
 
@@ -453,7 +456,7 @@
 	}
 
 	/* free the tree */
-    xmlFreeDoc(doc);
+	xmlFreeDoc(doc);
 
 	return ret_val;
 }
@@ -486,31 +489,19 @@
 
 		case XML_ELEMENT_NODE:
 			{
-				if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																				system_TAG) ||
-						0 == IPACM_util_icmp_string((char*)xml_node->name,
-																				MobileAPFirewallCfg_TAG) ||
-						0 == IPACM_util_icmp_string((char*)xml_node->name,
-																				Firewall_TAG) ||
-
-						0 == IPACM_util_icmp_string((char*)xml_node->name,
-																				FirewallEnabled_TAG)  ||
-						0 == IPACM_util_icmp_string((char*)xml_node->name,
-																				FirewallPktsAllowed_TAG)
-
-
-																				)
+				if (0 == IPACM_util_icmp_string((char*)xml_node->name, system_TAG) ||
+						0 == IPACM_util_icmp_string((char*)xml_node->name, MobileAPFirewallCfg_TAG) ||
+						0 == IPACM_util_icmp_string((char*)xml_node->name, Firewall_TAG) ||
+						0 == IPACM_util_icmp_string((char*)xml_node->name, FirewallEnabled_TAG)  ||
+						0 == IPACM_util_icmp_string((char*)xml_node->name, FirewallPktsAllowed_TAG))
 				{
-					if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																					Firewall_TAG))
+					if (0 == IPACM_util_icmp_string((char*)xml_node->name, Firewall_TAG))
 					{
 						/* increase firewall entry num */
 						config->num_extd_firewall_entries++;
 					}
 
-
-					if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																					FirewallPktsAllowed_TAG))
+					if (0 == IPACM_util_icmp_string((char*)xml_node->name, FirewallPktsAllowed_TAG))
 					{
 						/* setup action of matched rules */
 					    content = IPACM_read_content_element(xml_node);
@@ -521,18 +512,17 @@
 						        memcpy(content_buf, (void *)content, str_size);
 							if (atoi(content_buf)==1)
 							{
-					    	            config->rule_action_accept = true;
+								config->rule_action_accept = true;
 							}
 							else
 							{
-					    	            config->rule_action_accept = false;
+								config->rule_action_accept = false;
 							}
-				    	                IPACMDBG_H(" Allow traffic which matches rules ?:%d\n",config->rule_action_accept);
+							IPACMDBG_H(" Allow traffic which matches rules ?:%d\n",config->rule_action_accept);
 					    }
 				        }
 
-					if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																					FirewallEnabled_TAG))
+					if (0 == IPACM_util_icmp_string((char*)xml_node->name, FirewallEnabled_TAG))
 					{
 						/* setup if firewall enable or not */
 					    content = IPACM_read_content_element(xml_node);
@@ -543,21 +533,19 @@
 						        memcpy(content_buf, (void *)content, str_size);
 							if (atoi(content_buf)==1)
 							{
-					    	            config->firewall_enable = true;
+								config->firewall_enable = true;
 							}
 						        else
 							{
-					    	            config->firewall_enable = false;
+								config->firewall_enable = false;
 							}
-				    	                IPACMDBG_H(" Firewall Enable?:%d\n", config->firewall_enable);
+							IPACMDBG_H(" Firewall Enable?:%d\n", config->firewall_enable);
 				            }
 					}
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPFamily_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPFamily_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -568,20 +556,16 @@
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].ip_vsn
 							 = (firewall_ip_version_enum)atoi(content_buf);
 						IPACMDBG_H("\n IP family type is %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].ip_vsn);
-
+								config->extd_firewall_entries[config->num_extd_firewall_entries - 1].ip_vsn);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV4SourceAddress_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV4SourceAddress_TAG))
 				{
 					config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_ADDR;
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV4SourceIPAddress_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV4SourceIPAddress_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -595,8 +579,7 @@
 						IPACMDBG_H("IPv4 source address is: %s \n", content_buf);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV4SourceSubnetMask_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV4SourceSubnetMask_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -610,16 +593,13 @@
 						IPACMDBG_H("IPv4 source subnet mask is: %s \n", content_buf);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV4DestinationAddress_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV4DestinationAddress_TAG))
 				{
 					config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_ADDR;
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV4DestinationIPAddress_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV4DestinationIPAddress_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -633,8 +613,7 @@
 						IPACMDBG_H("IPv4 destination address is: %s \n", content_buf);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV4DestinationSubnetMask_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV4DestinationSubnetMask_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -643,24 +622,21 @@
 						memset(content_buf, 0, sizeof(content_buf));
 						memcpy(content_buf, (void *)content, str_size);
 						content_buf[MAX_XML_STR_LEN-1] = '\0';
-							if (content_buf > 0)
-							{
-						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.dst_addr_mask
-							 = ntohl(inet_addr(content_buf));
-						IPACMDBG_H("IPv4 destination subnet mask is: %s \n", content_buf);
+						if (content_buf > 0)
+						{
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.dst_addr_mask
+								 = ntohl(inet_addr(content_buf));
+							IPACMDBG_H("IPv4 destination subnet mask is: %s \n", content_buf);
+						}
 					}
 				}
-				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV4TypeOfService_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV4TypeOfService_TAG))
 				{
 					config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_TOS;
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TOSValue_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TOSValue_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -670,13 +646,11 @@
 						memcpy(content_buf, (void *)content, str_size);
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.tos
 							 = atoi(content_buf);
-
 						IPACMDBG_H("\n IPV4 TOS val is %d \n",
 										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.tos);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TOSMask_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TOSMask_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -686,13 +660,11 @@
 						memcpy(content_buf, (void *)content, str_size);
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.tos
 							 &= atoi(content_buf);
-
 						IPACMDBG_H("\n IPv4 TOS mask is %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.tos);
+								config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.tos);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV4NextHeaderProtocol_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV4NextHeaderProtocol_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -701,24 +673,19 @@
 						memset(content_buf, 0, sizeof(content_buf));
 						memcpy(content_buf, (void *)content, str_size);
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_PROTOCOL;
-
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.protocol = atoi(content_buf);
-
 						IPACMDBG_H("\n IPv4 next header prot is %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.protocol);
+								 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.protocol);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV6SourceAddress_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV6SourceAddress_TAG))
 				{
 					config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |=
 						 IPA_FLT_SRC_ADDR;
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV6SourceIPAddress_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV6SourceIPAddress_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -735,11 +702,10 @@
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.src_addr[3]=ntohl(config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.src_addr[3]);
 
 						IPACMDBG_H("\n ipv6 source addr is %d \n ",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.src_addr[0]);
+								config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.src_addr[0]);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV6SourcePrefix_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV6SourcePrefix_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -761,21 +727,17 @@
 								mask_value_v6 = 0;
 							}
 						}
-						IPACMDBG_H("\n ipv6 source prefix is %d \n",
-										 atoi(content_buf));
+						IPACMDBG_H("\n ipv6 source prefix is %d \n", atoi(content_buf));
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV6DestinationAddress_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV6DestinationAddress_TAG))
 				{
 					config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |=
 						 IPA_FLT_DST_ADDR;
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV6DestinationIPAddress_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV6DestinationIPAddress_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -791,11 +753,10 @@
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.dst_addr[2]=ntohl(config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.dst_addr[2]);
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.dst_addr[3]=ntohl(config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.dst_addr[3]);
 						IPACMDBG_H("\n ipv6 dest addr is %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.dst_addr[0]);
+								 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.dst_addr[0]);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV6DestinationPrefix_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV6DestinationPrefix_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -817,20 +778,16 @@
 								mask_value_v6 = 0;
 							}
 						}
-						IPACMDBG_H("\n ipv6 dest prefix is %d \n",
-										 atoi(content_buf));
+						IPACMDBG_H("\n ipv6 dest prefix is %d \n", atoi(content_buf));
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV6TrafficClass_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV6TrafficClass_TAG))
 				{
 					config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_TC;
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TrfClsValue_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TrfClsValue_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -838,15 +795,13 @@
 						str_size = strlen(content);
 						memset(content_buf, 0, sizeof(content_buf));
 						memcpy(content_buf, (void *)content, str_size);
-
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.tc
 							 = atoi(content_buf);
 						IPACMDBG_H("\n ipv6 trf class val is %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.tc);
+								 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.tc);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TrfClsMask_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TrfClsMask_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -856,13 +811,10 @@
 						memcpy(content_buf, (void *)content, str_size);
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.tc
 							 &= atoi(content_buf);
-
-						IPACMDBG_H("\n ipv6 trf class mask is %d \n",
-										 atoi(content_buf));
+						IPACMDBG_H("\n ipv6 trf class mask is %d \n", atoi(content_buf));
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 IPV6NextHeaderProtocol_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV6NextHeaderProtocol_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -871,22 +823,18 @@
 						memset(content_buf, 0, sizeof(content_buf));
 						memcpy(content_buf, (void *)content, str_size);
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_NEXT_HDR;
-
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.next_hdr
 							 = atoi(content_buf);
 						IPACMDBG_H("\n ipv6 next header protocol is %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.next_hdr);
+								 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v6.next_hdr);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCPSource_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCPSource_TAG))
 				{
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCPSourcePort_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCPSourcePort_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -894,13 +842,11 @@
 						str_size = strlen(content);
 						memset(content_buf, 0, sizeof(content_buf));
 						memcpy(content_buf, (void *)content, str_size);
-
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port
 							 = atoi(content_buf);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCPSourceRange_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCPSourceRange_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -910,34 +856,30 @@
 						memcpy(content_buf, (void *)content, str_size);
 						if (atoi(content_buf) != 0)
 						{
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT_RANGE;
- 						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port;
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port + atoi(content_buf);
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port
-							 = 0;
-						  IPACMDBG_H("\n tcp source port from %d to %d \n",
-						                 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo,
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT_RANGE;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port + atoi(content_buf);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port = 0;
+							IPACMDBG_H("\n tcp source port from %d to %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo,
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi);
 						}
 						else
 						{
-					       config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT;
-                           IPACMDBG_H("\n tcp source port= %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT;
+							IPACMDBG_H("\n tcp source port= %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port);
 						}
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCPDestination_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCPDestination_TAG))
 				{
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCPDestinationPort_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCPDestinationPort_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -949,8 +891,7 @@
 							 = atoi(content_buf);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCPDestinationRange_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCPDestinationRange_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -960,34 +901,30 @@
 						memcpy(content_buf, (void *)content, str_size);
 						if(atoi(content_buf)!=0)
 						{
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT_RANGE;
- 						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port;
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port + atoi(content_buf);
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port
-							 = 0;
-						  IPACMDBG_H("\n tcp dest port from %d to %d \n",
-						                 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo,
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT_RANGE;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port + atoi(content_buf);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port = 0;
+							IPACMDBG_H("\n tcp dest port from %d to %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo,
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi);
 						}
 						else
 						{
-					      config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT;
-						  IPACMDBG_H("\n tcp dest port= %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT;
+							IPACMDBG_H("\n tcp dest port= %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port);
 						}
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 UDPSource_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, UDPSource_TAG))
 				{
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 UDPSourcePort_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, UDPSourcePort_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -999,8 +936,7 @@
 							 = atoi(content_buf);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 UDPSourceRange_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, UDPSourceRange_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -1010,35 +946,30 @@
 						memcpy(content_buf, (void *)content, str_size);
 						if(atoi(content_buf)!=0)
 						{
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT_RANGE;
- 						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port;
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port + atoi(content_buf);
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port
-							 = 0;
-						  IPACMDBG_H("\n udp source port from %d to %d \n",
-						                 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo,
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT_RANGE;
+ 							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port + atoi(content_buf);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port = 0;
+							IPACMDBG_H("\n udp source port from %d to %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo,
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi);
 						}
 						else
 						{
-					      config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT;
-						  IPACMDBG_H("\n udp source port= %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port);
-
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT;
+							IPACMDBG_H("\n udp source port= %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port);
 						}
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 UDPDestination_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, UDPDestination_TAG))
 				{
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 UDPDestinationPort_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, UDPDestinationPort_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -1050,8 +981,7 @@
 							 = atoi(content_buf);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 UDPDestinationRange_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, UDPDestinationRange_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -1061,28 +991,25 @@
 						memcpy(content_buf, (void *)content, str_size);
 						if(atoi(content_buf)!=0)
 						{
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT_RANGE;
- 						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port;
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port + atoi(content_buf);
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port
-							 = 0;
-						  IPACMDBG_H("\n UDP dest port from %d to %d \n",
-						                 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo,
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT_RANGE;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port + atoi(content_buf);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port = 0;
+							IPACMDBG_H("\n UDP dest port from %d to %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo,
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi);
 						}
 						else
 						{
-					      config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT;
-						  IPACMDBG_H("\n UDP dest port= %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port);
-
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT;
+							IPACMDBG_H("\n UDP dest port= %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port);
 						}
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 ICMPType_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, ICMPType_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -1093,11 +1020,10 @@
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.type = atoi(content_buf);
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_TYPE;
 						IPACMDBG_H("\n icmp type is %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.type);
+								 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.type);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 ICMPCode_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, ICMPCode_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -1108,11 +1034,10 @@
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.code = atoi(content_buf);
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_CODE;
 						IPACMDBG_H("\n icmp code is %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.code);
+								 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.code);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 ESPSPI_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, ESPSPI_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -1123,18 +1048,15 @@
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.spi = atoi(content_buf);
 						config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SPI;
 						IPACMDBG_H("\n esp spi is %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.spi);
+								config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.spi);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCP_UDPSource_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCP_UDPSource_TAG))
 				{
 					/* go to child */
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCP_UDPSourcePort_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCP_UDPSourcePort_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -1146,8 +1068,7 @@
 							 = atoi(content_buf);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCP_UDPSourceRange_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCP_UDPSourceRange_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -1157,34 +1078,30 @@
 						memcpy(content_buf, (void *)content, str_size);
 						if(atoi(content_buf)!=0)
 						{
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT_RANGE;
- 						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port;
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port + atoi(content_buf);
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port
-							 = 0;
-						  IPACMDBG_H("\n tcp_udp source port from %d to %d \n",
-						                 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo,
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT_RANGE;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port + atoi(content_buf);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port = 0;
+							IPACMDBG_H("\n tcp_udp source port from %d to %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_lo,
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port_hi);
 						}
 						else
 						{
-	  				      config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT;
-						  IPACMDBG_H("\n tcp_udp source port= %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_SRC_PORT;
+							IPACMDBG_H("\n tcp_udp source port= %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.src_port);
 
 						}
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCP_UDPDestination_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCP_UDPDestination_TAG))
 				{
-					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children,
-																									config);
+					ret_val = IPACM_firewall_xml_parse_tree(xml_node->children, config);
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCP_UDPDestinationPort_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCP_UDPDestinationPort_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -1196,8 +1113,7 @@
 							 = atoi(content_buf);
 					}
 				}
-				else if (0 == IPACM_util_icmp_string((char*)xml_node->name,
-																						 TCP_UDPDestinationRange_TAG))
+				else if (0 == IPACM_util_icmp_string((char*)xml_node->name, TCP_UDPDestinationRange_TAG))
 				{
 					content = IPACM_read_content_element(xml_node);
 					if (content)
@@ -1207,23 +1123,21 @@
 						memcpy(content_buf, (void *)content, str_size);
 						if(atoi(content_buf)!=0)
 						{
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT_RANGE;
- 						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port;
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi
-							 = config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port + atoi(content_buf);
-						  config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port
-							 = 0;
-						  IPACMDBG_H("\n tcp_udp dest port from %d to %d \n",
-						                 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo,
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT_RANGE;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port;
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi
+								= config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port + atoi(content_buf);
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port = 0;
+							IPACMDBG_H("\n tcp_udp dest port from %d to %d \n",
+								config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_lo,
+								config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port_hi);
 						}
 						else
 						{
-					      config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT;
-						  IPACMDBG_H("\n tcp_udp dest port= %d \n",
-										 config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port);
-
+							config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= IPA_FLT_DST_PORT;
+							IPACMDBG_H("\n tcp_udp dest port= %d \n",
+									config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.dst_port);
 						}
 					}
 				}
@@ -1238,5 +1152,3 @@
 	} /* end while */
 	return ret_val;
 }
-
-
diff --git a/ipacm/src/IPACM_cfg.xml b/ipacm/src/IPACM_cfg.xml
index 6b3d6b9..9a23c7c 100644
--- a/ipacm/src/IPACM_cfg.xml
+++ b/ipacm/src/IPACM_cfg.xml
@@ -50,10 +50,12 @@
 			<Iface>
 			   <Name>wlan0</Name>
 			   <Category>UNKNOWN</Category>
+			   <WlanMode>full</WlanMode>
 			</Iface>			
 			<Iface>
 			   <Name>wlan1</Name>
 			   <Category>UNKNOWN</Category>
+			   <WlanMode>internet</WlanMode>
 			</Iface>
 			<Iface>
 			   <Name>eth0</Name>