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 38044)
+++ /branches/rel_apv_10_4_0_112_gail/usr/click/lib/libparser/commands.pm	(working copy)
@@ -53345,113 +53345,14 @@
 							},
 						],
 	},
-        {
-                obj_type => "ITEM",
-                name => "session",
-                menu => "root_qos",
-                cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_GLOBAL",
-                user_level => "CLI_LEVEL_CONFIG",
-                help_string => "Configure QoS session",
-                function_name => "session_qos",
-                function_args => [
-                                                        {
-                                                                type => "STRING",
-                                                                help_string => "name",
-                                                                optional => "NO",
-                                                        },
-                                                        {
-                                                                type => "STRING",
-                                                                help_string => "Interface name (<system_ifname>|<vlan_ifname>|<bond_ifname>)",
-                                                                optional => "NO",
-                                                        },
-                                                        {
-                                                                type => "STRING",
-                                                                help_string => "Output/input direction (OUT/IN/Both)",
-                                                                optional => "NO",
-                                                        },
-                                                        {
-                                                                type => "STRING",
-                                                                help_string => "Bandwidth per Session, suffixes may be b, Kb, Mb, and Gb",
-                                                                optional => "NO",
-                                                        },
-                                                        {
-                                                                type => "DOTTEDIP",
-                                                                help_string => "Source IP",
-                                                                optional => "NO",
-                                                        },
-                                                       {
-                                                                type => "DOTTEDIP",
-                                                                help_string => "Netmask for source IP",
-                                                                optional => "NO",
-                                                        },
-                                                        {
-                                                                type => "U16",
-                                                                help_string => "Source port",
-                                                                optional => "NO",
-                                                        },
-                                            {
-                                                                type => "DOTTEDIP",
-                                                                help_string => "Destination IP",
-                                                                optional => "NO",
-                                                        },
-                                                        {
-                                                                type => "DOTTEDIP",
-                                                                help_string => "Netmask for destination IP",
-                                                                optional => "NO",
-                                                        },
-                                                        {
-                                                                type => "U16",
-                                                                help_string => "Destination port",
-                                                                optional => "NO",
-                                                        },
-                                                        {
-                                                                type => "STRING",
-                                                                help_string => "Protocol (tcp, udp or any)",
-                                                                optional => "NO",
-                                                        },
-                                                ],
-        },
-        {
-                obj_type => "ITEM",
-                name => "session",
-                menu => "root_show_qos",
-                cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_GLOBAL|CMD_KERN_API",
-                user_level => "CLI_LEVEL_ENABLE",
-                help_string => "Show configurations of QoS session",
-                function_name => "show_session_qos_kern",
-                function_args => [
-                                                        {
-                                                                type => "STRING",
-                                                                help_string => "Session QoS, (optional, default is ALL)",
-                                                                optional => "YES",
-                                                                default_value => "\"ALL\"",
-                                                        },
-                                                ],
-        },
-        {
-                obj_type => "ITEM",
-                name => "session",
-                menu => "root_no_qos",
-                cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_GLOBAL|CMD_KERN_API",
-                user_level => "CLI_LEVEL_CONFIG",
-                help_string => "Delete configuration of QoS session",
-                function_name => "no_session_qos_kern",
-                function_args => [
-                                                        {
-                                                                type => "STRING",
-                                                                help_string => "name",
-                                                                optional => "NO",
-                                                        },
-                                                ],
-        },
 
         {
                 obj_type => "ITEM",
-                name => "dynamic",
+                name => "session",
                 menu => "root_qos",
                 cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_GLOBAL",
                 user_level => "CLI_LEVEL_CONFIG",
-                help_string => "Configure QoS dynamic session",
+                help_string => "Configure QoS Session",
                 function_name => "qos_session_config",
                 function_args => [
                                                         {
@@ -53499,16 +53400,16 @@
 
         {
                 obj_type => "ITEM",
-                name => "dynamic",
+                name => "session",
                 menu => "root_show_qos",
                 cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_GLOBAL|CMD_KERN_API",
                 user_level => "CLI_LEVEL_ENABLE",
-                help_string => "Show configurations of QoS dynamic session",
+                help_string => "Show configurations of QoS Session",
                 function_name => "show_qos_session_config",
                 function_args => [
                                                         {
                                                                 type => "STRING",
-                                                                help_string => "Session dynamic QoS, (optional, default is ALL)",
+                                                                help_string => "Session QoS, (optional, default is ALL)",
                                                                 optional => "YES",
                                                                 default_value => "\"ALL\"",
                                                         },
@@ -53516,11 +53417,11 @@
         },
         {
                 obj_type => "ITEM",
-                name => "dynamic",
+                name => "session",
                 menu => "root_no_qos",
                 cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_GLOBAL|CMD_KERN_API",
                 user_level => "CLI_LEVEL_CONFIG",
-                help_string => "Delete configuration of dynamic QoS session",
+                help_string => "Delete configuration of QoS Session",
                 function_name => "delete_qos_session_config",
                 function_args => [
                                                         {
@@ -53530,6 +53431,27 @@
                                                         },
                                                 ],
         },
+        {
+                obj_type => "ITEM",
+                name => "session_on",
+                menu => "root_qos",
+                help_string => "Activate QoS Session",
+                cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_GLOBAL|CMD_KERN_API",
+                user_level => "CLI_LEVEL_CONFIG",
+                function_name => "enable_session",
+                function_args => [],
+        },
+
+        {
+                obj_type => "ITEM",
+                name => "session_off",
+                menu => "root_qos",
+                help_string => "Deactivate QoS Session",
+                cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_GLOBAL|CMD_KERN_API",
+                user_level => "CLI_LEVEL_CONFIG",
+                function_name => "disable_session",
+                function_args => [],
+        },
 
 	{
 		obj_type => "ITEM",
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 38044)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_classifier.c	(working copy)
@@ -131,6 +131,7 @@
  */
 qos_filter_share_t qos_filter_share;
 extern uint32_t **clickrule_notfound;
+extern int qos_session_status;
 
 /******************************************************************************
  * Return the current valid class poniter.
@@ -389,7 +390,11 @@
 	 */
 
 	if (NULL == ifn_p) {
+            if (qos_session_status == SESSION_ENABLE)
 		goto label;
+            pktattr->pattr_class = NULL;
+            qos_filter_share.fltr_g_stats.hits_interface_fail++;
+            return;
 	}
 
 #if 0
@@ -518,59 +523,61 @@
 
 
 label:
-	if (QOSD_OUTPUT == direction) {
+        if (qos_session_status == SESSION_ENABLE) {
+	    if (QOSD_OUTPUT == direction) {
 		rorder = (uint8_t *) o_net_order;
-        sDir = "OUT";
-        *((uint8_t *)&src_port_qos + 0) = rtuple[rorder[4]];
-        *((uint8_t *)&src_port_qos + 1) = rtuple[rorder[3]];
-
-        *((uint8_t *)&dst_port_qos + 0) = rtuple[rorder[2]];
-        *((uint8_t *)&dst_port_qos + 1) = rtuple[rorder[1]];
-    } else {
+                sDir = "OUT";
+                *((uint8_t *)&src_port_qos + 0) = rtuple[rorder[4]];
+                *((uint8_t *)&src_port_qos + 1) = rtuple[rorder[3]];
+
+                *((uint8_t *)&dst_port_qos + 0) = rtuple[rorder[2]];
+                *((uint8_t *)&dst_port_qos + 1) = rtuple[rorder[1]];
+            } else {
 		rorder = (uint8_t *) i_net_order;
-        sDir = "IN";
-        *((uint8_t *)&src_port_qos + 0) = rtuple[rorder[2]];
-        *((uint8_t *)&src_port_qos + 1) = rtuple[rorder[1]];
+                sDir = "IN";
+                *((uint8_t *)&src_port_qos + 0) = rtuple[rorder[2]];
+                *((uint8_t *)&src_port_qos + 1) = rtuple[rorder[1]];
 
-        *((uint8_t *)&dst_port_qos + 0) = rtuple[rorder[4]];
-        *((uint8_t *)&dst_port_qos + 1) = rtuple[rorder[3]];
-    }
+                *((uint8_t *)&dst_port_qos + 0) = rtuple[rorder[4]];
+                *((uint8_t *)&dst_port_qos + 1) = rtuple[rorder[3]];
+            }
 
-    src_ip_index = 5;
-    dst_ip_index = 9;
+            src_ip_index = 5;
+            dst_ip_index = 9;
 
 
-    for (i = 0; i < 4; i++) {
-        *((uint8_t *)&src_ip_qos + i) = rtuple[rorder[i+src_ip_index]];
-    }
-    for (i = 0; i < 4; i++) {
-        *((uint8_t *)&dst_ip_qos + i) = rtuple[rorder[i+dst_ip_index]];
-    }
+            for (i = 0; i < 4; i++) {
+                *((uint8_t *)&src_ip_qos + i) = rtuple[rorder[i+src_ip_index]];
+            }
+            for (i = 0; i < 4; i++) {
+                *((uint8_t *)&dst_ip_qos + i) = rtuple[rorder[i+dst_ip_index]];
+            }
 #if 0
 	fastlog_syslog(LOG_DEBUG, "TO CHECK ..src ip : %u, src_port : %u, dst_ip : %u, dst_port : %u, dir : %d\n",src_ip_qos, src_port_qos, dst_ip_qos, dst_port_qos, direction);
 #endif
 
-    temp = qos_session_lookup(src_ip_qos, src_port_qos, dst_ip_qos, dst_port_qos, direction);
+            temp = qos_session_lookup(src_ip_qos, src_port_qos, dst_ip_qos, dst_port_qos, direction);
 
-    if (temp && !strcmp(temp->qos_session_altq_conf_save->ifname, ifp->if_xname) 
-        && !strcmp(temp->qos_session_q_save->sDir, sDir))    {
+            if (temp && !strcmp(temp->qos_session_altq_conf_save->ifname, ifp->if_xname) 
+                && !strcmp(temp->qos_session_q_save->sDir, sDir))    {
 
-            if (!temp->is_sip_match) {
-                src_ip_qos = 0;
-            }
-            if (!src_ip_qos && !temp->is_sport_match) {
-                src_port_qos = 0;
-            }
-            if (!temp->is_dip_match) {
-                dst_ip_qos = 0;
-            }
-            if (!dst_ip_qos && !temp->is_dport_match) {
-                dst_port_qos = 0;
-            }
+                if (!temp->is_sip_match) {
+                    src_ip_qos = 0;
+                }
+                if (!src_ip_qos && !temp->is_sport_match) {
+                    src_port_qos = 0;
+                }
+                if (!temp->is_dip_match) {
+                    dst_ip_qos = 0;
+                }
+                if (!dst_ip_qos && !temp->is_dport_match) {
+                    dst_port_qos = 0;
+                }
 
-            create_queue_filter(src_ip_qos, src_port_qos, dst_ip_qos, dst_port_qos, sDir, temp->qos_session_q_save,
-                 temp->qos_session_altq_conf_save);
-    }
+                create_queue_filter(src_ip_qos, src_port_qos, dst_ip_qos, dst_port_qos, sDir, temp->qos_session_q_save,
+                    temp->qos_session_altq_conf_save);
+            }
+        }
 
 	pktattr->pattr_class = NULL;
 	qos_filter_share.fltr_g_stats.hits_filter_fail++;
Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.h
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.h	(revision 38044)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.h	(working copy)
@@ -3,7 +3,8 @@
 #define QOS_SNAME_MAX  15
 #define PORT_NAME_MAX  8
 #define N_CHILDREN 256
-
+#define SESSION_ENABLE  1
+#define SESSION_DISABLE 0
 #define DYNAMIC_QUEUE_PREFIX  "qd_"
 #define DYNAMIC_FILTER_PREFIX "fd_"
 
@@ -46,3 +47,5 @@
 void remove_tuple_from_lookup (unsigned char tuple[]);
 void free_qos_session_lookup(dyn_qos_session_lookup_t *root);
 static int qos_session_config_count(void);
+int enable_session (void *pcb);
+int disable_session (void *pcb);
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 38044)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.c	(working copy)
@@ -28,6 +28,8 @@
 
 #define TUPLE_LEN 12 /* src ip + src port + dest ip + dst port */
 
+int qos_session_status = SESSION_DISABLE;
+
 struct dyn_session_qos_conf_head dyn_session_qos_conf_head = STAILQ_HEAD_INITIALIZER(dyn_session_qos_conf_head);
 
 dyn_qos_session_lookup_t *dyn_qos_session_lookup_root = NULL;
@@ -359,3 +361,15 @@
     del_dyn_qos_session_config (pcb, name);
     return QOS_SUCCESS;
 }
+
+int enable_session (void *pcb) {
+    qos_session_status = SESSION_ENABLE;
+    fastlog_syslog(LOG_DEBUG, "enable syslog %d\n", qos_session_status);
+    return QOS_SUCCESS;
+}
+
+int disable_session (void *pcb) {
+    qos_session_status = SESSION_DISABLE;
+    fastlog_syslog(LOG_DEBUG, "disable syslog %d\n", qos_session_status);
+    return QOS_SUCCESS;
+}
