Index: /branches/rel_apv_10_4_0_112_gail/usr/click/lib/libparser/commands.pm
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/click/lib/libparser/commands.pm	(revision 38073)
+++ /branches/rel_apv_10_4_0_112_gail/usr/click/lib/libparser/commands.pm	(working copy)
@@ -53417,6 +53417,37 @@
         },
         {
                 obj_type => "ITEM",
+                name => "session_q_count",
+                menu => "root_show_qos",
+                cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_GLOBAL|CMD_KERN_API",
+                user_level => "CLI_LEVEL_ENGINEER",
+                help_string => "Show current Queue count for sessions",
+                function_name => "show_current_queue_count_for_sessions",
+                function_args => [],
+        },
+        {
+                obj_type => "ITEM",
+                name => "display_queues_for_session",
+                menu => "root_show_qos",
+                cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_GLOBAL|CMD_KERN_API",
+                user_level => "CLI_LEVEL_ENGINEER",
+                help_string => "Show Queues for QoS Session",
+                function_name => "show_session_qos_queue_root_kern",
+                function_args => [],
+        },
+        {
+                obj_type => "ITEM",
+                name => "display_filters_for_session",
+                menu => "root_show_qos",
+                cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_GLOBAL|CMD_KERN_API",
+                user_level => "CLI_LEVEL_ENGINEER",
+                help_string => "Show filters for QoS Session",
+                function_name => "show_session_qos_filter_kern",
+                function_args => [],
+        },
+
+        {
+                obj_type => "ITEM",
                 name => "session",
                 menu => "root_no_qos",
                 cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_GLOBAL|CMD_KERN_API",
Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_classifier.c
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_classifier.c	(revision 38073)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_classifier.c	(working copy)
@@ -57,7 +57,11 @@
 #include <click/app/fastlog/fastlog.h>
 #include <click/app/qos/qos_dynamic.h>
 
-#define MAX_DYN_QUEUE 100000
+/* MAX 100000 queues are supported. However if 'qos session' feature is enabled,
+    then administrator can only configure upto 1000 static queues/filter(using CLI or UI) and rest reserved
+    for 'qos session' feature which envolves creating queues/filters dynamically */
+
+#define MAX_DYN_QUEUE 99000
 
 static void delete_queue_filter (unsigned int count);
 static int qos_filter_add_table(qos_filter_share_t *qs, qos_filter_t *pfltr);
@@ -235,11 +239,14 @@
         enq_idx = 0;
     sprintf (q_dynamic_list[enq_idx++], "%s", q_name);
     ++current_dyn_q_count;
+    if (current_dyn_q_count % 1000 == 0)
+	    fastlog_syslog(LOG_DEBUG, "Current QoS Session queues : %u\n", current_dyn_q_count);
 
 /*
 If current Queue utilization is 100% then delete 30% of the queue(and corresponding filter)
 */
     if (current_dyn_q_count >= MAX_DYN_QUEUE) {
+	    fastlog_syslog(LOG_DEBUG, "QoS session queues reached maximum limit : %u. Deleting old %u queues.\n", MAX_DYN_QUEUE, MAX_DYN_QUEUE * 0.3);
         delete_queue_filter(0.3 * MAX_DYN_QUEUE);
     }
 }
@@ -968,7 +975,6 @@
 		return QOS_FAILURE;
 	}
 
-	fastlog_syslog(LOG_DEBUG, "Creating QoS filter \"%s\"\n", qos_filter->fltr_name);
 	/*
 	 * Get queue information from queue name.
 	 */
@@ -1389,8 +1395,6 @@
 {
 	QOS_CHECK_LICENSE;
 
-	fastlog_syslog(LOG_DEBUG, "Deleting QoS filter \"%s\"\n", fltr_name);
-
 	if(QOS_FAILURE == qos_filter_del(pcb, fltr_name)) {
 		qos_filter_share.fltr_g_stats.count_del_table_fail++;
 		/*app_printf(pcb, "Fail to delete filter\n");*/
@@ -1496,6 +1500,71 @@
 	}
 
 	return QOS_SUCCESS;
+}
+
+int show_current_queue_count_for_sessions(void *pcb)
+{
+	app_printf(pcb, "Session Queues count : %u\n\n", current_dyn_q_count);
+	return QOS_SUCCESS;
+}
+
+int show_session_qos_filter_kern(void *pcb)
+{
+	qos_filter_share_t *qs;
+	qos_filter_t *pfltr;
+	int i;
+	int isfound;
+	struct in_addr smask, dmask;
+	char sip_str[16], smsk_str[16],dip_str[16], dmsk_str[16], pro_str[16];
+
+	QOS_CHECK_LICENSE;
+
+	qs = &qos_filter_share;
+
+	isfound = 0;
+	for(i=0; i < QOS_MAX_FLTR_NUM; i++) {
+		pfltr = &qs->a_fltrs[i];
+
+		/*
+		 * Find a valid item.
+		 */
+		if(!pfltr->used) {
+			continue;
+		}
+
+		if (strncmp(pfltr->fltr_name, DYNAMIC_FILTER_PREFIX, strlen(DYNAMIC_FILTER_PREFIX))) {
+			continue;
+		}
+		isfound = 1;
+
+		smask.s_addr = pfltr->tp.smask;
+		dmask.s_addr = pfltr->tp.dmask;
+		snprintf(sip_str, 16, "%s", inet_ntoa(pfltr->tp.sip));
+		snprintf(smsk_str, 16, "%s", inet_ntoa(smask));
+		snprintf(dip_str, 16, "%s", inet_ntoa(pfltr->tp.dip));
+		snprintf(dmsk_str, 16, "%s", inet_ntoa(dmask));
+
+		if(IPPROTO_TCP == pfltr->tp.proto) {
+			snprintf(pro_str, 16, "%s", PROTO_TCP_STR);
+		}
+		else if(IPPROTO_UDP == pfltr->tp.proto) {
+			snprintf(pro_str, 16, "%s", PROTO_UDP_STR);
+		}
+		else if(IPPROTO_IP == pfltr->tp.proto) {
+			snprintf(pro_str, 16, "%s", PROTO_ANY_STR);
+		}
+		else {
+			snprintf(pro_str, 16, "%s", "ERROR");
+		}
+
+		app_printf(pcb, "qos filter \"%s\" \"%s\" %s %s %d %s %s %d %s %d\n",
+				pfltr->fltr_name, pfltr->qqi_name,
+				sip_str, smsk_str, ntohs(pfltr->tp.sport),
+				dip_str, dmsk_str, ntohs(pfltr->tp.dport),
+				pro_str, pfltr->priority);
+	}
+
+	return QOS_SUCCESS;
 }
 
 
Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.c
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.c	(revision 38073)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.c	(working copy)
@@ -68,7 +68,10 @@
             (pALTQ == NULL) || (sizeof(struct altq_conf) != nALTQ)) {
         return(QOS_USERLAND_FAILURE);
     }
-
+    if (!sip && !dip) {
+        app_printf(pcb, "ERROR : wildcard entries for both source IP and destination IP are not allowed.\n");
+        return(QOS_USERLAND_FAILURE);
+    }
     pQoSQRoot = (qos_queue_root_t *)pRoot;
     pALTQConf = (struct altq_conf *)pALTQ;
 
@@ -181,7 +184,7 @@
 
 int show_qos_session_config(void *pcb, char *name) {
 
-    if (qos_session_status == SESSION_ENABLE)
+    if (qos_session_status == SESSION_ENABLE) 
         app_printf(pcb, "qos session_on\n");
     else
         app_printf(pcb, "qos session_off\n");
Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_scheduler.c
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_scheduler.c	(revision 38073)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_scheduler.c	(working copy)
@@ -696,8 +696,6 @@
 	pQoSQRoot = (qos_queue_root_t *)pRoot;
 	pALTQConf = (struct altq_conf *)pALTQ;
 
-	fastlog_syslog(LOG_DEBUG, "Creating QoS queue \"%s\"\n", pQoSQRoot->sQName);
-
 	/* Check default */
 	if (pALTQConf->pq_u.cbq_opts.flags & CBQCLF_DEFCLASS) {
 		iErrCode = qos_has_default_kern(pcb, pALTQConf->ifname, pALTQConf->direction);
@@ -834,8 +832,6 @@
 
 	QOS_CHECK_LICENSE;
 
-	fastlog_syslog(LOG_DEBUG, "Deleting QoS Queue \"%s\"\n", sQueue);
-
 	bzero(&confALTQ, sizeof(confALTQ));
 	bzero(&infoQoSQueue, sizeof(infoQoSQueue));
 
@@ -1575,9 +1571,6 @@
 			}
 		}
 
-		if (!strncmp(pQoSQRoot->sQName, Q_NAME_PREFIX_FOR_SESSION_BASED_QOS, strlen(Q_NAME_PREFIX_FOR_SESSION_BASED_QOS))) {
-			continue;
-		}
 		if (!strncmp(pQoSQRoot->sQName, DYNAMIC_QUEUE_PREFIX, strlen(DYNAMIC_QUEUE_PREFIX))) {
 			continue;
 		}
@@ -1595,6 +1588,30 @@
 	}
 
 	return QOS_SUCCESS;
+}
+
+
+int show_session_qos_queue_root_kern(void *pcb)
+{
+	int i;
+	qos_queue_root_t *pQoSQRoot = NULL;
+
+	QOS_CHECK_LICENSE;
+
+	STAILQ_FOREACH(pQoSQRoot, &qos_queue_root_head, list_entry) {
+		/* check qos queue name */
+
+		if (strncmp(pQoSQRoot->sQName, DYNAMIC_QUEUE_PREFIX, strlen(DYNAMIC_QUEUE_PREFIX))) {
+			continue;
+		}
+
+		app_printf(pcb, "qos queue root \"%s\" \"%s\" %s %s %d %s %s\n",
+				pQoSQRoot->sQName, pQoSQRoot->sIfName, pQoSQRoot->sDir,
+				pQoSQRoot->sBand, pQoSQRoot->iPri, pQoSQRoot->sBorrow,
+				pQoSQRoot->sDefault);
+	}
+
+	return QOS_SUCCESS;
 }
 
 
Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_subr.c
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_subr.c	(revision 38073)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_subr.c	(working copy)
@@ -473,11 +473,9 @@
 				continue;
 			}
 
-#if 1
-        if (!strncmp(pQoSQRoot->sQName, DYNAMIC_QUEUE_PREFIX, strlen(DYNAMIC_QUEUE_PREFIX))) {
-            continue;
-        }
-#endif
+        	if (!strncmp(pQoSQRoot->sQName, DYNAMIC_QUEUE_PREFIX, strlen(DYNAMIC_QUEUE_PREFIX))) {
+            	continue;
+        	}
 			app_printf(pcb, "%sqos queue root \"%s\" \"%s\" %s %s %d %s %s\n",
 					QOS_INDENT_1, pQoSQRoot->sQName, pQoSQRoot->sIfName, pQoSQRoot->sDir,
 					pQoSQRoot->sBand, pQoSQRoot->iPri, pQoSQRoot->sBorrow,
@@ -595,7 +593,7 @@
 		return QOS_USERLAND_FAILURE;
 	}
 
-	show_qos_session_config (pcb, QOS_NAME_FOR_ALL);
+        show_qos_session_config (pcb, QOS_NAME_FOR_ALL);
 
 	return QOS_SUCCESS;
 }
@@ -833,7 +831,7 @@
 	 * write qos queue root
 	 */
 	STAILQ_FOREACH(pQoSQRoot, &qos_queue_root_head, list_entry) {
-		if (!strncmp(pQoSQRoot->sQName, Q_NAME_PREFIX_FOR_SESSION_BASED_QOS, strlen(Q_NAME_PREFIX_FOR_SESSION_BASED_QOS))) {
+		if (!strncmp(pQoSQRoot->sQName, DYNAMIC_QUEUE_PREFIX, strlen(DYNAMIC_QUEUE_PREFIX))) {
 			continue;
 		}
 
@@ -862,14 +860,10 @@
 		if(!pfltr->used) {
 			continue;
 		}
-		if (!strncmp(pfltr->fltr_name, FILTER_NAME_PREFIX_FOR_SESSION_BASED_QOS, strlen(FILTER_NAME_PREFIX_FOR_SESSION_BASED_QOS))) {
-			continue;
+
+		if (!strncmp(pfltr->fltr_name, DYNAMIC_FILTER_PREFIX, strlen(DYNAMIC_FILTER_PREFIX))) {
+		    continue;
 		}
-#if 1
-        if (!strncmp(pfltr->fltr_name, DYNAMIC_FILTER_PREFIX, strlen(DYNAMIC_FILTER_PREFIX))) {
-            continue;
-        }
-#endif
 
 		smask.s_addr = pfltr->tp.smask;
 		dmask.s_addr = pfltr->tp.dmask;
