diff --git a/ipacm/inc/IPACM_ConntrackClient.h b/ipacm/inc/IPACM_ConntrackClient.h
index 58c6316..a6076cf 100644
--- a/ipacm/inc/IPACM_ConntrackClient.h
+++ b/ipacm/inc/IPACM_ConntrackClient.h
@@ -59,17 +59,6 @@
 #define UDP_TIMEOUT_UPDATE 20
 #define BROADCAST_IPV4_ADDR 0xFFFFFFFF
 
-
-#define IPACM_TCP_UDP_DIR_NAME       "/proc/sys/net/ipv4/netfilter"
-#define IPACM_TCP_FILE_NAME  "ip_conntrack_tcp_timeout_established"
-#define IPACM_UDP_FILE_NAME   "ip_conntrack_udp_timeout_stream"
-
-#define IPACM_TCP_FULL_FILE_NAME  "/proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established"
-#define IPACM_UDP_FULL_FILE_NAME   "/proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout_stream"
-
-#define INOTIFY_EVT_SIZE  (sizeof(struct inotify_event))
-#define INOTIFY_BUFFER_LEN     (INOTIFY_EVT_SIZE + 2*sizeof(IPACM_TCP_FILE_NAME))
-
 class IPACM_ConntrackClient
 {
 
@@ -95,7 +84,6 @@
    static void* TCPRegisterWithConnTrack(void *);
    static void* UDPRegisterWithConnTrack(void *);
    static void* UDPConnTimeoutUpdate(void *);
-   static void* TCPUDP_Timeout_monitor(void *);
 
    static void UpdateUDPFilters(void *, bool);
    static void UpdateTCPFilters(void *, bool);
diff --git a/ipacm/inc/IPACM_Conntrack_NATApp.h b/ipacm/inc/IPACM_Conntrack_NATApp.h
index 836241a..e6c27af 100644
--- a/ipacm/inc/IPACM_Conntrack_NATApp.h
+++ b/ipacm/inc/IPACM_Conntrack_NATApp.h
@@ -44,6 +44,9 @@
 
 #define MAX_TEMP_ENTRIES 25
 
+#define IPACM_TCP_FULL_FILE_NAME  "/proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established"
+#define IPACM_UDP_FULL_FILE_NAME   "/proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout_stream"
+
 typedef struct _nat_table_entry
 {
 	uint32_t private_ip;
@@ -117,7 +120,7 @@
 	int DelEntriesOnClntDiscon(uint32_t);
 	int DelEntriesOnSTAClntDiscon(uint32_t);
 
-	void UpdateTcpUdpTo(uint32_t, int proto);
+	void Read_TcpUdp_Timeout(void);
 
 	void AddTempEntry(const nat_table_entry *);
 	void CacheEntry(const nat_table_entry *);
diff --git a/ipacm/src/IPACM_ConntrackClient.cpp b/ipacm/src/IPACM_ConntrackClient.cpp
index 9de5911..2a670c8 100644
--- a/ipacm/src/IPACM_ConntrackClient.cpp
+++ b/ipacm/src/IPACM_ConntrackClient.cpp
@@ -445,7 +445,7 @@
 	}
 
 	/* Register callback with netfilter handler */
-	IPACMDBG("tcp handle:%p, fd:%d\n", pClient->tcp_hdl, nfct_fd(pClient->tcp_hdl));
+	IPACMDBG_H("tcp handle:%p, fd:%d\n", pClient->tcp_hdl, nfct_fd(pClient->tcp_hdl));
 #ifndef CT_OPT
 	nfct_callback_register(pClient->tcp_hdl,
 			(nf_conntrack_msg_type)	(NFCT_T_UPDATE | NFCT_T_DESTROY | NFCT_T_NEW),
@@ -476,7 +476,7 @@
 	nfct_callback_unregister(pClient->tcp_hdl);
 	/* close the handle */
 	nfct_close(pClient->tcp_hdl);
-  pClient->tcp_hdl = NULL;
+	pClient->tcp_hdl = NULL;
 
 	pthread_exit(NULL);
 	return NULL;
@@ -522,7 +522,7 @@
 	}
 
 	/* Register callback with netfilter handler */
-	IPACMDBG("udp handle:%p, fd:%d\n", pClient->udp_hdl, nfct_fd(pClient->udp_hdl));
+	IPACMDBG_H("udp handle:%p, fd:%d\n", pClient->udp_hdl, nfct_fd(pClient->udp_hdl));
 	nfct_callback_register(pClient->udp_hdl,
 												 (nf_conntrack_msg_type)(NFCT_T_NEW | NFCT_T_DESTROY),
 												 IPAConntrackEventCB,
@@ -650,140 +650,3 @@
   return;
 }
 
-void IPACM_ConntrackClient::Read_TcpUdp_Timeout(char *in, int len)
-{
-	int proto;
-	FILE *fd = NULL;
-	char to_str[10];
-	uint32_t value;
-	NatApp *nat_inst = NULL;
-
-	nat_inst = NatApp::GetInstance();
-	if(nat_inst == NULL)
-	{
-		IPACMERR("unable to create nat instance\n");
-		return;
-	}
-
-	if(!strncmp(in, IPACM_TCP_FILE_NAME, len))
-	{
-		proto = IPPROTO_TCP;
-	}
-	else if(!strncmp(in, IPACM_UDP_FILE_NAME, len))
-	{
-		proto = IPPROTO_UDP;
-	}
-	else
-	{
-		return;
-	}
-
-	if(proto == IPPROTO_TCP)
-	{
-		fd = fopen(IPACM_TCP_FULL_FILE_NAME, "r");
-	}
-	else
-	{
-		fd = fopen(IPACM_UDP_FULL_FILE_NAME, "r");
-	}
-	if(fd == NULL)
-	{
-		PERROR("unable to open file");
-		return;
-	}
-
-	fgets(to_str, sizeof(to_str), fd);
-	value = atoi(to_str);
-	IPACMDBG("Protocol %d file \"%s\" value: %d\n", proto, in, value);
-	nat_inst->UpdateTcpUdpTo(value, proto);
-
-	fclose(fd);
-	return;
-}
-
-void *IPACM_ConntrackClient::TCPUDP_Timeout_monitor(void *)
-{
-  int length;
-	int wd;
-	char buffer[INOTIFY_BUFFER_LEN];
-	int inotify_fd;
-	uint32_t mask = IN_MODIFY;
-	FILE *to_fd = NULL;
-	char to_str[10];
-	uint32_t value=0;
-	NatApp *nat_inst = NULL;
-
-	nat_inst = NatApp::GetInstance();
-	if(nat_inst == NULL)
-	{
-		IPACMERR("unable to create nat instance\n");
-		return NULL;
-	}
-
-	to_fd = fopen(IPACM_TCP_FULL_FILE_NAME, "r");
-	if(to_fd == NULL)
-	{
-	  PERROR("unable to open file \"ip_conntrack_tcp_timeout_established\" ");
-		return NULL;
-	}
-	memset(to_str, 0, sizeof(to_str));
-	fgets(to_str, sizeof(to_str), to_fd);
-	value = atoi(to_str);
-	IPACMDBG("ip conntrack tcp timeout initial value:%d\n", value);
-	nat_inst->UpdateTcpUdpTo(value, IPPROTO_TCP);
-	fclose(to_fd);
-
-	to_fd = fopen(IPACM_UDP_FULL_FILE_NAME, "r");
-	if(to_fd == NULL)
-	{
-	  PERROR("unable to open file \"ip_conntrack_udp_timeout_stream\" ");
-		return NULL;
-	}
-	memset(to_str, 0, sizeof(to_str));
-	fgets(to_str, sizeof(to_str), to_fd);
-	value = atoi(to_str);
-	IPACMDBG("ip conntrack udp timeout:%d\n", value);
-	nat_inst->UpdateTcpUdpTo(value, IPPROTO_UDP);
-	fclose(to_fd);
-
-	inotify_fd = inotify_init();
-	if (inotify_fd < 0)
-	{
-		PERROR("inotify_init");
-		return NULL;
-	}
-
-	IPACMDBG("Waiting for nofications in dir %s with mask: 0x%x\n",
-					              IPACM_TCP_UDP_DIR_NAME, mask);
-
-	wd = inotify_add_watch(inotify_fd,
-												 IPACM_TCP_UDP_DIR_NAME,
-												 mask);
-
-	while (1)
-	{
-		length = read(inotify_fd, buffer, INOTIFY_BUFFER_LEN);
-		struct inotify_event *event = (struct inotify_event *)buffer;
-
-		if (length < 0)
-		{
-			IPACMERR("inotify read() error return length: %d and mask: 0x%x 0x%x\n",
-							         length, event->mask, mask);
-			return NULL;
-		}
-
-		if( (event->len > 0) && (event->mask & IN_MODIFY) )
-		{
-			if(!(event->mask & IN_ISDIR))
-			{
-				IPACMDBG("Received inotify event for file %s with mask %x value",
-								       event->name, event->mask);
-				Read_TcpUdp_Timeout(event->name, event->len);
-			}
-		}
-	}
-
-	(void)inotify_rm_watch(inotify_fd, wd);
-	(void)close(inotify_fd);
-	return NULL;
-}
diff --git a/ipacm/src/IPACM_ConntrackListener.cpp b/ipacm/src/IPACM_ConntrackListener.cpp
index 996dbfa..ab25bde 100644
--- a/ipacm/src/IPACM_ConntrackListener.cpp
+++ b/ipacm/src/IPACM_ConntrackListener.cpp
@@ -90,7 +90,7 @@
 #endif
 
 	 case IPA_HANDLE_WAN_UP:
-			IPACMDBG("Received IPA_HANDLE_WAN_UP event\n");
+			IPACMDBG_H("Received IPA_HANDLE_WAN_UP event\n");
 			CreateConnTrackThreads();
 			if(!isWanUp())
 			{
@@ -99,7 +99,7 @@
 			break;
 
 	 case IPA_HANDLE_WAN_DOWN:
-			IPACMDBG("Received IPA_HANDLE_WAN_DOWN event\n");
+			IPACMDBG_H("Received IPA_HANDLE_WAN_DOWN event\n");
 			wan_down = (ipacm_event_iface_up *)data;
 			if(isWanUp())
 			{
@@ -111,7 +111,7 @@
 		 tcp/udp filters to ignore local wlan or lan connections */
 	 case IPA_HANDLE_WLAN_UP:
 	 case IPA_HANDLE_LAN_UP:
-			IPACMDBG("Received event: %d with ifname: %s and address: 0x%x\n",
+			IPACMDBG_H("Received event: %d with ifname: %s and address: 0x%x\n",
 							 evt, ((ipacm_event_iface_up *)data)->ifname,
 							 ((ipacm_event_iface_up *)data)->ipv4_addr);
 			CreateConnTrackThreads();
@@ -136,7 +136,7 @@
 		return;
 	}
 
-  IPACMDBG("\n");
+	IPACMDBG("\n");
 	IPACMDBG("Received interface index %d with ip type: %d", data->if_index, data->iptype);
 	iptodot(" and ipv4 address", data->ipv4_addr);
 
@@ -152,28 +152,25 @@
 
 
 	cnt = pConfig->GetNatIfacesCnt();
-		NatIfaceCnt = cnt;
-		if(pNatIfaces != NULL)
-		{
-			free(pNatIfaces);
-			pNatIfaces = NULL;
-		}
+	NatIfaceCnt = cnt;
+	if (pNatIfaces != NULL) {
+		free(pNatIfaces);
+		pNatIfaces = NULL;
+	}
 
-		len = (sizeof(NatIfaces) * NatIfaceCnt);
-		pNatIfaces = (NatIfaces *)malloc(len);
-		if(pNatIfaces == NULL)
-		{
-			IPACMERR("Unable to allocate memory for non nat ifaces\n");
-			return;
-		}
-		memset(pNatIfaces, 0, len);
+	len = (sizeof(NatIfaces) * NatIfaceCnt);
+	pNatIfaces = (NatIfaces *)malloc(len);
+	if (pNatIfaces == NULL) {
+		IPACMERR("Unable to allocate memory for non nat ifaces\n");
+		return;
+	}
+	memset(pNatIfaces, 0, len);
 
-		if(pConfig->GetNatIfaces(NatIfaceCnt, pNatIfaces) != 0)
-		{
-			IPACMERR("Unable to retrieve non nat ifaces\n");
-			return;
-		}
-  IPACMDBG("Update %d Nat ifaces\n", NatIfaceCnt);
+	if (pConfig->GetNatIfaces(NatIfaceCnt, pNatIfaces) != 0) {
+		IPACMERR("Unable to retrieve non nat ifaces\n");
+		return;
+	}
+	IPACMDBG("Update %d Nat ifaces\n", NatIfaceCnt); 
 
 
 	/* Search/Configure linux interface-index and map it to IPA interface-index */
@@ -227,8 +224,10 @@
 
 
 			isNatIface = true;
-			IPACMDBG("Nating connections of Interface (%s), entry (%d) ", pNatIfaces[i].iface_name, j);
-			iptodot("with ipv4 address", nat_iface_ipv4_addr[j]);
+			IPACMDBG_H("Nating connections of Interface (%s), entry (%d) ", pNatIfaces[i].iface_name, j);
+			IPACMDBG_H(" with ipv4 address(0x%x): %d.%d.%d.%d\n", nat_iface_ipv4_addr[j],
+					    ((nat_iface_ipv4_addr[j]>>24) & 0xFF), ((nat_iface_ipv4_addr[j]>>16) & 0xFF), 
+					    ((nat_iface_ipv4_addr[j]>>8) & 0xFF), (nat_iface_ipv4_addr[j] & 0xFF));
 			break;
 		}
 	}
@@ -281,7 +280,7 @@
 	}
 
 	nat_inst->FlushTempEntries(ipv4_addr, false);
-  nat_inst->DelEntriesOnClntDiscon(ipv4_addr);
+	nat_inst->DelEntriesOnClntDiscon(ipv4_addr);
 	return;
 }
 
@@ -289,8 +288,8 @@
 {
 	 ipacm_event_iface_up *wanup_data = (ipacm_event_iface_up *)in_param;
 
-	 IPACMDBG("Recevied below information during wanup,\n");
-	 IPACMDBG("if_name:%s, ipv4_address:0x%x\n",
+	 IPACMDBG_H("Recevied below information during wanup,\n");
+	 IPACMDBG_H("if_name:%s, ipv4_address:0x%x\n",
 						wanup_data->ifname, wanup_data->ipv4_addr);
 
 	 if(wanup_data->ipv4_addr == 0)
@@ -367,11 +366,10 @@
 int IPACM_ConntrackListener::CreateNatThreads(void)
 {
 	int ret;
-	pthread_t udpcto_thread = 0, to_monitor_thread = 0;
+	pthread_t udpcto_thread = 0;
 
 	if(isNatThreadStart == false)
 	{
-
 		if(!udpcto_thread)
 		{
 			ret = pthread_create(&udpcto_thread, NULL, IPACM_ConntrackClient::UDPConnTimeoutUpdate, NULL);
@@ -389,23 +387,6 @@
 			}
 		}
 
-		if(!to_monitor_thread)
-		{
-			ret = pthread_create(&to_monitor_thread, NULL, IPACM_ConntrackClient::TCPUDP_Timeout_monitor, NULL);
-			if(0 != ret)
-			{
-				IPACMERR("unable to create tcp/udp timeout monitor thread\n");
-				PERROR("unable to create tcp/udp timeout monitor\n");
-				goto error;
-			}
-
-			IPACMDBG("created tcp/udp timeout monitor thread\n");
-			if(pthread_setname_np(to_monitor_thread, "tcp udp timeout mtr") != 0)
-			{
-				IPACMERR("unable to set thread name\n");
-			}
-		}
-
 		isNatThreadStart = true;
 	}
 	return 0;
@@ -416,8 +397,11 @@
 
 void IPACM_ConntrackListener::TriggerWANDown(uint32_t wan_addr)
 {
-	 IPACMDBG("Deleting ipv4 nat table with");
-	 iptodot("public ip address", wan_addr);
+	 IPACMDBG_H("Deleting ipv4 nat table with");
+	 IPACMDBG_H(" public ip address(0x%x): %d.%d.%d.%d\n", wan_addr,
+		    ((wan_addr>>24) & 0xFF), ((wan_addr>>16) & 0xFF), 
+		    ((wan_addr>>8) & 0xFF), (wan_addr & 0xFF));
+	 
 	 WanUp = false;
 
 	 if(nat_inst != NULL)
@@ -624,8 +608,7 @@
 	 out_flags = (NFCT_OF_SHOW_LAYER3 | NFCT_OF_TIME | NFCT_OF_ID);
 	 nfct_snprintf(buf, sizeof(buf), evt_data->ct,
 								 evt_data->type, NFCT_O_PLAIN, out_flags);
-	 IPACMDBG("%s\n", buf);
-	 IPACMDBG("\n");
+	 IPACMDBG_H("%s\n", buf);
 
 	 ParseCTMessage(evt_data->ct);
 #endif
@@ -711,7 +694,7 @@
 		}
 		else
 		{
-			IPACMDBG("Neither orig src ip:0x%x Nor orig Dst IP:0x%x equal to wan ip:0x%x\n",
+			IPACMDBG_H("Neither orig src ip:0x%x Nor orig Dst IP:0x%x equal to wan ip:0x%x\n",
 					orig_src_ip, orig_dst_ip, wan_ipaddr);
 
 #ifdef CT_OPT
@@ -841,7 +824,7 @@
 				 {
 					 IPACMDBG("matched nat_iface_ipv4_addr entry(%d)\n", cnt);
 					 iptodot("ProcessTCPorUDPMsg(): Nat entry match with ip addr",
-																					nat_iface_ipv4_addr[cnt]);
+									nat_iface_ipv4_addr[cnt]);
 					 break;
 				 }
 			 }
@@ -849,7 +832,7 @@
 
 		if(cnt == MAX_NAT_IFACES)
 		{
-			IPACMDBG("Not mtaching with nat ifaces\n");
+			IPACMDBG_H("Not mtaching with nat ifaces\n");
 			if(pConfig == NULL)
 			{
 				goto IGNORE;
@@ -909,13 +892,13 @@
 		}
 	 }
 
-	IPACMDBG("Not matching with STA Clnt Ip Addrs 0x%x\n",
+	IPACMDBG_H("Not matching with STA Clnt Ip Addrs 0x%x\n",
 		rule.target_ip);
 	isTempEntry = true;
 
 
 ADD:
-	 IPACMDBG("Nat Entry with below information will either be added or deleted\n");
+	 IPACMDBG_H("Nat Entry with below information will either be added or deleted\n");
 	 iptodot("target ip or dst ip", rule.target_ip);
 	 IPACMDBG("target port or dst port: 0x%x Decimal:%d\n", rule.target_port, rule.target_port);
 	 iptodot("private ip or src ip", rule.private_ip);
@@ -1003,7 +986,7 @@
 	 return;
 
 IGNORE:
-	IPACMDBG("ignoring below Nat Entry\n");
+	IPACMDBG_H("ignoring below Nat Entry\n");
 	iptodot("target ip or dst ip", rule.target_ip);
 	IPACMDBG("target port or dst port: 0x%x Decimal:%d\n", rule.target_port, rule.target_port);
 	iptodot("private ip or src ip", rule.private_ip);
@@ -1017,7 +1000,7 @@
 void IPACM_ConntrackListener::HandleSTAClientAddEvt(uint32_t clnt_ip_addr)
 {
 	 int cnt;
-	 IPACMDBG("Received STA client 0x%x\n", clnt_ip_addr);
+	 IPACMDBG_H("Received STA client 0x%x\n", clnt_ip_addr);
 
 	 if(StaClntCnt >= MAX_STA_CLNT_IFACES)
 	 {
@@ -1053,7 +1036,7 @@
 void IPACM_ConntrackListener::HandleSTAClientDelEvt(uint32_t clnt_ip_addr)
 {
 	 int cnt;
-	 IPACMDBG("Received STA client 0x%x\n", clnt_ip_addr);
+	 IPACMDBG_H("Received STA client 0x%x\n", clnt_ip_addr);
 
 	 for(cnt=0; cnt<MAX_STA_CLNT_IFACES; cnt++)
 	 {
diff --git a/ipacm/src/IPACM_Conntrack_NATApp.cpp b/ipacm/src/IPACM_Conntrack_NATApp.cpp
index 348faa9..6efb475 100644
--- a/ipacm/src/IPACM_Conntrack_NATApp.cpp
+++ b/ipacm/src/IPACM_Conntrack_NATApp.cpp
@@ -232,6 +232,7 @@
 {
 	int cnt = 0;
 	IPACMDBG("%s() %d\n", __FUNCTION__, __LINE__);
+
 	for(; cnt < max_entries; cnt++)
 	{
 		if(cache[cnt].private_ip == rule->private_ip &&
@@ -275,11 +276,11 @@
 					IPACMERR("%s() %d deletion failed\n", __FUNCTION__, __LINE__);
 				}
 
-				IPACMDBG("Deleted Nat entry(%d) Successfully\n", cnt);
+				IPACMDBG_H("Deleted Nat entry(%d) Successfully\n", cnt);
 			}
 			else
 			{
-				IPACMDBG("Deleted Nat entry(%d) only from cache\n", cnt);
+				IPACMDBG_H("Deleted Nat entry(%d) only from cache\n", cnt);
 			}
 
 			memset(&cache[cnt], 0, sizeof(cache[cnt]));
@@ -305,7 +306,7 @@
 	if(isAlgPort(rule->protocol, rule->private_port) ||
 		 isAlgPort(rule->protocol, rule->target_port))
 	{
-		IPACMERR("connection using ALG Port. Dont insert into nat table\n");
+		IPACMERR("connection using ALG Port, ignore\n");
 		return -1;
 	}
 
@@ -386,11 +387,11 @@
 
 	if(cache[cnt].enabled == true)
 	{
-		IPACMDBG("Added rule(%d) successfully\n", cnt);
+		IPACMDBG_H("Added rule(%d) successfully\n", cnt);
 	}
   else
   {
-    IPACMDBG("Cached rule(%d) successfully\n", cnt);
+    IPACMDBG_H("Cached rule(%d) successfully\n", cnt);
   }
 
 	return 0;
@@ -484,6 +485,7 @@
 {
 	int cnt;
 	uint32_t ts;
+	bool read_to = false;
 
 	for(cnt = 0; cnt < max_entries; cnt++)
 	{
@@ -504,6 +506,11 @@
 				continue;
 			}
 
+			if (read_to == false) {
+				read_to = true;
+				Read_TcpUdp_Timeout();
+			}
+
 			UpdateCTUdpTs(&cache[cnt], ts);
 		} /* end of outer if */
 
@@ -545,7 +552,7 @@
 int NatApp::UpdatePwrSaveIf(uint32_t client_lan_ip)
 {
 	int cnt;
-	IPACMDBG("Received IP address: 0x%x\n", client_lan_ip);
+	IPACMDBG_H("Received IP address: 0x%x\n", client_lan_ip);
 
 	if(client_lan_ip == INVALID_IP_ADDR)
 	{
@@ -596,7 +603,7 @@
 	int cnt;
 	ipa_nat_ipv4_rule nat_rule;
 
-	IPACMDBG("Received ip address: 0x%x\n", client_lan_ip);
+	IPACMDBG_H("Received ip address: 0x%x\n", client_lan_ip);
 
 	if(client_lan_ip == INVALID_IP_ADDR)
 	{
@@ -650,20 +657,6 @@
 	return -1;
 }
 
-void NatApp::UpdateTcpUdpTo(uint32_t new_value, int proto)
-{
-	if(proto == IPPROTO_TCP)
-	{
-		tcp_timeout = new_value;
-		IPACMDBG("new nat tcp timeout value: %d\n", tcp_timeout);
-	}
-	else if(proto == IPPROTO_UDP)
-	{
-		udp_timeout = new_value;
-		IPACMDBG("new nat udp timeout value: %d\n", udp_timeout);
-	}
-}
-
 uint32_t NatApp::GetTableHdl(uint32_t in_ip_addr)
 {
 	if(in_ip_addr == pub_ip_addr)
@@ -757,8 +750,8 @@
 	int cnt;
 	int ret;
 
-	IPACMDBG("Received below with isAdd:%d\n", isAdd);
-	iptodot("IP Address:", ip_addr);
+	IPACMDBG_H("Received below with isAdd:%d ", isAdd);
+	IPACMDBG_H("IP Address: (ox%x)\n", ip_addr);
 
 	for(cnt=0; cnt<MAX_TEMP_ENTRIES; cnt++)
 	{
@@ -787,7 +780,7 @@
 int NatApp::DelEntriesOnClntDiscon(uint32_t ip_addr)
 {
 	int cnt, tmp = 0;
-	IPACMDBG("Received IP address: 0x%x\n", ip_addr);
+	IPACMDBG_H("Received IP address: 0x%x\n", ip_addr);
 
 	if(ip_addr == INVALID_IP_ADDR)
 	{
@@ -834,7 +827,7 @@
 int NatApp::DelEntriesOnSTAClntDiscon(uint32_t ip_addr)
 {
 	int cnt, tmp = curCnt;
-	IPACMDBG("Received IP address: 0x%x\n", ip_addr);
+	IPACMDBG_H("Received IP address: 0x%x\n", ip_addr);
 
 	if(ip_addr == INVALID_IP_ADDR)
 	{
@@ -923,3 +916,43 @@
 	IPACMDBG("Cached rule(%d) successfully\n", cnt);
 	return;
 }
+
+void NatApp::Read_TcpUdp_Timeout(void) {
+	FILE *udp_fd = NULL, *tcp_fd = NULL;
+
+	/* Read UDP timeout value */
+	udp_fd = fopen(IPACM_UDP_FULL_FILE_NAME, "r");
+	if (udp_fd == NULL) {
+		IPACMERR("unable to open %s\n", IPACM_UDP_FULL_FILE_NAME);
+		goto fail;
+	}
+
+	if (fscanf(udp_fd, "%d", &udp_timeout) != 1) {
+		IPACMERR("Error reading udp timeout\n");
+	}
+	IPACMDBG_H("udp timeout value: %d\n", udp_timeout);
+
+
+	/* Read TCP timeout value */
+	tcp_fd = fopen(IPACM_TCP_FULL_FILE_NAME, "r");
+	if (tcp_fd == NULL) {
+		IPACMERR("unable to open %s\n", IPACM_TCP_FULL_FILE_NAME);
+		goto fail;
+	}
+
+
+	if (fscanf(tcp_fd, "%d", &tcp_timeout) != 1) {
+		IPACMERR("Error reading tcp timeout\n");
+	}
+	IPACMDBG_H("tcp timeout value: %d\n", tcp_timeout);
+
+fail:
+	if (udp_fd) {
+		fclose(udp_fd);
+	}
+	if (tcp_fd) {
+		fclose(tcp_fd);
+	}
+
+	return;
+}
