http://downloads.netgear.com/files/GPL/DM111PSP_v3.61d_GPL.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / qoscls.html
index 622777b..b64a7e8 100755 (executable)
@@ -1,56 +1,42 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<!--
-       (c) 2005 U.S. Robotics Corporation
--->
 <html>
-<head>
-       <title>Add Network Traffic Class</title>
-
-       <link href="usr_layout.css" type="text/css" rel="stylesheet" /><script src="usr_layout.js" type="text/javascript"></script>
-       <link href="usr_menus_dropdown.css" rel="stylesheet" type="text/css"><script src="usr_menus_dropdown.js" type="text/javascript"></script><script src="usr_menus_build.js" type="text/javascript"></script>
-       <link href="usr_device.css" type="text/css" rel="stylesheet" /><script src="usr_device.js" type="text/javascript"></script><link href="usr_91xx.css" type="text/css" rel="stylesheet" /><script src="usr_91xx.js" type="text/javascript"></script><script src="usr_resources.js" type="text/javascript"></script>
-       <script src="portName.js" type="text/javascript"></script>
-
-   <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
-
-   <script type="text/javascript" src="util.js"></script>
-   <script type="text/javascript">
+   <head>
+      <meta http-equiv="Pragma" content="no-cache">
+      <LINK href="stylemain.css" type="text/css" rel="stylesheet">
+         <LINK href="colors.css" type="text/css" rel="stylesheet">
+            <script language="javascript" src="util.js"></script>
+            <script language="javascript" src="portName.js"></script>
+            <script language="javascript">
 <!-- hide
-
 var glbDisplayPhysicalPort = false;
 
-/*if (document.getElementById) onload = function () {
+if (document.getElementById) onload = function () {
    var i, a;
    for(i=0; (a = document.getElementsByTagName('tr')[i]); i++) {
       if ((/SrcMacAddr/i.test(a.id)) ||
           (/SrcMacMask/i.test(a.id)) ||
           (/DstMacAddr/i.test(a.id)) ||
           (/DstMacMask/i.test(a.id)) ||
-          (/DscpMark/i.test(a.id)))
-               {
-         a.style.display = "none";
-      }
-      else
-         a.style.display = "";
+          (/DscpMark/i.test(a.id))) {
+         a.className = 'hide';
+      } else
+         a.className = '';
    }
 }
-*/
+
 function diffServCfgCb (cb) {
    var i, a;
    if (cb.checked == true) {
       for(i=0; (a = document.getElementsByTagName('tr')[i]); i++) {
          if ((/IpPre/i.test(a.id)) ||
-             (/IpTos/i.test(a.id)))
-               {
-                a.style.display = "none";
+             (/IpTos/i.test(a.id))) {
+            a.className = 'hide';
          }
          if ((/SrcMacAddr/i.test(a.id)) ||
              (/SrcMacMask/i.test(a.id)) ||
              (/DstMacAddr/i.test(a.id)) ||
              (/DstMacMask/i.test(a.id)) ||
-             (/DscpMark/i.test(a.id)))
-       {
-               a.style.display = "";
+             (/DscpMark/i.test(a.id))) {
+            a.className = '';
          }
       }
    } else {
@@ -59,12 +45,10 @@ function diffServCfgCb (cb) {
              (/SrcMacMask/i.test(a.id)) ||
              (/DstMacAddr/i.test(a.id)) ||
              (/DstMacMask/i.test(a.id)) ||
-             (/DscpMark/i.test(a.id)))
-         {
-                a.style.display = "none";
-         }
-         else
-                a.style.display = "";
+             (/DscpMark/i.test(a.id))) {
+            a.className = 'hide';
+         } else
+            a.className = '';
       }
    }
 }
@@ -73,145 +57,112 @@ function btnApply() {
    var loc = 'qoscls.cmd?action=add';
 
    with ( document.forms[0] ) {
-      if ( txtclsname.value == '' )
-      {
-         alert('Please enter a Quality of Service class name.');
+      if ( txtclsname.value == '' ) {
+         msg = 'Please enter QoS class name.';
+         alert(msg);
+         return;
+      }
+
+      if ( isValidName(txtclsname.value) == false ) {
+         msg = 'Please enter valid QoS class name: No special characters.';
+         alert(msg);
+         return;
+      }
+      if (txtclsname.value.length > 15) {
+         msg = 'Maximum QoS class name cannot exceed 15 characters.';
+         alert(msg);
+         return;
+      }
+      idx = priority.selectedIndex;
+      if ( idx == 0 ) {
+         msg = 'There is no selected priority.';
+         alert(msg);
          return;
       }
 
-      if (!isValidName(txtclsname.value))
-      {
-         alert('Please enter valid Quality of Service class name. Special characters are not permitted.');
+
+      if ( srcaddr.value == "" && srcmask.value == "" && srcport.value == "" &&
+           dstaddr.value == "" && dstmask.value == "" && dstport.value == "" &&
+            vlan8021p.selectedIndex == 0 &&
+            protocol.selectedIndex == 0 && vlan8021p.selectedIndex == 0 ) {
+         if (!(glbDisplayPhysicalPort && lanIfcName.selectedIndex != 0)) {
+            msg = 'At least one condition must be specified.'
+            alert(msg);
+            return;
+         }
+      }
+
+      if ( srcaddr.value != "" && isValidIpAddress(srcaddr.value) == false ) {
+         msg = 'Source address "' + srcaddr.value + '" is invalid IP address.';
+         alert(msg);
          return;
       }
 
-// priority.selected index == 0 is valid value.
-
-// Some conditions are specified by default.
-
-      if (optTraffic[0].checked)
-      {
-               if (srcaddr.value != "" && !isValidIpAddress(srcaddr.value))
-               {
-                       alert('Source address "' + srcaddr.value + '" is an invalid IP address.');
-                       return;
-               }
-
-               if (srcmask.value != "" && !isValidSubnetMask(srcmask.value))
-               {
-                       alert('Source subnet mask "' + srcmask.value + '" is an invalid subnet mask.');
-                       return;
-               }
-
-               if ( srcaddr.value == "" && srcmask.value != "" ) {
-                       alert('Cannot have source subnet mask without source IP address.');
-                       return;
-               }
-
-               if (srcport.value != "" && !isValidPort(srcport.value))
-               {
-                       alert('Source port "' + srcport.value + '" is an invalid port number or port range.');
-                       return;
-               }
-
-               if (dstaddr.value != "" && !isValidIpAddress(dstaddr.value))
-               {
-                       alert('Destination address "' + dstaddr.value + '" is invalid IP address.');
-                       return;
-               }
-
-               if (dstmask.value != "" && !isValidSubnetMask(dstmask.value))
-               {
-                       alert('Destination subnet mask "' + dstmask.value + '" is an invalid subnet mask.');
-                       return;
-               }
-
-               if ( dstaddr.value == "" && dstmask.value != "" ) {
-                       alert('Cannot have destination subnet mask without destination IP address.');
-                       return;
-                       }
-
-               if (dstport.value != "" && !isValidPort(dstport.value))
-               {
-                       alert('Destination port "' + dstport.value + '" is invalid port number or port range.');
-                       return;
-               }
-
-               if ( srcmacaddr.value != "" && isValidMacAddress(srcmacaddr.value) == false ) {
-                       alert('Source MAC address "' + srcmacaddr.value + '" is invalid MAC address.');
-                       return;
-               }
-               
-               if ( srcmacaddr.value == "" && srcmacmask.value != "" ) {
-                       alert('Cannot have source MAC mask without source MAC address.');
-                       return;
-               }
-               
-               if ( dstmacaddr.value != "" && isValidMacAddress(dstmacaddr.value) == false ) {
-                       alert('Destination MAC address "' + dstmacaddr.value + '" is invalid MAC address.');
-                       return;
-               }
-               
-               if ( dstmacaddr.value == "" && dstmacmask.value != "" ) {
-                       alert('Cannot have destination MAC mask without destination MAC address.');
-                       return;
-               }
-
-               if ( (srcport.value != "" || dstport.value != "") &&
-                       (protocol.selectedIndex > 2) )
-               {
-                       alert("The ports must be entered if the TCP or UDP protocol is selected.");
-                       return;
-               }
+      if ( srcmask.value != "" && isValidSubnetMask(srcmask.value) == false ) {
+         msg = 'Source subnet mask "' + srcmask.value + '" is invalid subnet mask.';
+         alert(msg);
+         return;
+      }
+
+      if ( srcaddr.value == "" && srcmask.value != "" ) {
+         msg = 'Cannot have source subnet mask without source IP address.';
+         alert(msg);
+         return;
+      }
+
+      if ( srcport.value != "" && isValidPort(srcport.value) == false ) {
+         msg = 'Source port "' + srcport.value + '" is invalid port number or port range.';
+         alert(msg);
+         return;
+      }
+
+      if ( dstaddr.value != "" && isValidIpAddress(dstaddr.value) == false ) {
+         msg = 'Destination address "' + dstaddr.value + '" is invalid IP address.';
+         alert(msg);
+         return;
+      }
+
+      if ( dstmask.value != "" && isValidSubnetMask(dstmask.value) == false ) {
+         msg = 'Destination subnet mask "' + dstmask.value + '" is invalid subnet mask.';
+         alert(msg);
+         return;
+      }
+
+      if ( dstaddr.value == "" && dstmask.value != "" ) {
+         msg = 'Cannot have destination subnet mask without destination IP address.';
+         alert(msg);
+         return;
+      }
+
+      if ( dstport.value != "" && isValidPort(dstport.value) == false ) {
+         msg = 'Destination port "' + dstport.value + '" is invalid port number or port range.';
+         alert(msg);
+         return;
+      }
+
+      if ( (srcport.value != "" || dstport.value != "") &&
+           (protocol.selectedIndex == 0 || protocol.selectedIndex == 4) ) {
+         msg = 'TCP or UDP Protocol must be selected together with port number.';
+              alert(msg);
+              return;
+      }
+
+      if ( (vlan8021p.selectedIndex != 0) &&
+           (dstaddr.value != "" || dstaddr.value != "" ||
+                srcaddr.value != "" || srcport.value != "" ||  protocol.selectedIndex != 0) ) {
+         msg = '802.1p Priority cannot be selected together with IP traffic condition.';
+              alert(msg);
+              return;
       }
 
       // class name
       loc += '&clsName=' + encodeUrl(txtclsname.value);
 
       // priority
-      var idx = priority.selectedIndex;
+      idx = priority.selectedIndex;
       val = priority.options[idx].value;
       loc += '&priority=' + val;
 
-      // IP precedence bits
-      idx = precedence.selectedIndex;
-      val = precedence.options[idx].value;
-      loc += '&precedence=' + val;
-
-      // IP type of service bits
-      idx = tos.selectedIndex;
-      val = tos.options[idx].value;
-      loc += '&tos=' + val;
-
-      if (optTraffic[0].checked)
-      {
-         // physical lan port ifc name
-         idx = lanIfcName.selectedIndex;
-         val = lanIfcName.options[idx].value;
-         loc += '&lanIfcName=' + val;
-
-         // protocol
-         idx = protocol.selectedIndex;
-         val = protocol.options[idx].value;
-         loc += '&protocol=' + val;
-
-         // VLAN 802.1p priority
-         loc += '&vlan8021p=-1';
-      } 
-      else 
-      {
-         // physical lan port ifc name
-         loc += '&lanIfcName=';
-
-         // protocol
-         loc += '&protocol=-1';
-
-         // VLAN 802.1p priority
-         idx = vlan8021p.selectedIndex;
-         val = vlan8021p.options[idx].value;
-         loc += '&vlan8021p=' + val;
-      }
-
       // Check if the DiffServ configuration is enabled
       if (enblDiffServCb.checked == false) {
          // IP precedence bits
@@ -232,7 +183,7 @@ function btnApply() {
 
       // physical lan port ifc name
      if (glbDisplayPhysicalPort)
-        loc += '&lanIfcName=' + lanIfcName.options[lanIfcName.selectedIndex].value;
+        loc += '&lanIfcName=' + lanIfcName.options[lanIfcName.selectedIndex].value;;
       // protocol
       idx = protocol.selectedIndex;
       val = protocol.options[idx].value;
@@ -302,246 +253,322 @@ function btnApply() {
    eval(code);
 }
 
-function manageTrafficOptions()
-{
-       with ( document.forms[0] )
-       {
-               setVisibility("idIPtraffic", optTraffic[0].checked);
-               setVisibility("id8021p", optTraffic[1].checked);
-          if (optTraffic[1].checked)
-          {
-             srcaddr.value = "";
-             srcmask.value = "";
-             srcport.value = "";
-             dstaddr.value = "";
-             dstmask.value = "";
-             dstport.value = "";
-              vlan8021p.selectedIndex = 0;
-              lanIfcName.selectedIndex = 0;
-          }
-       }
-}
 // done hiding -->
-   </script>
-</head>
-<body onload="initMenu(); manageTrafficOptions();">
-
-<script type="text/javascript">
-       writeHeader("Add Network Traffic Class");
 </script>
 
-<form>
-       <p>This page creates a traffic class rule to classify the upstream traffic,
-               assign queuing priority, and optionally overwrite the IP header TOS byte. A rule
-               consists of a class name and at least one condition below. All of the specified
-               conditions in this classification rule must be satisfied for the rule to take
-               effect. Press <b>Apply</b> to save and activate the rule.</p>
-       <p><label for="txtclsname">Traffic class name:</label>
-               <input type='text' size="20" name="txtclsname" id="txtclsname"></p>
-
-       <h4>Class Priority, IP Precedence, and Type of Service</h4>
-       <p>
-               <input type="checkbox" name="enblDiffServCb" id="enblDiffServCb" onClick="diffServCfgCb(this)">
-               <label for="enblDiffServCb">Enable differentiated service configuration</label>
-       </p>
-       <p>If a non-zero value is selected for <b>IP precedence</b> or
-       a value other than "Normal" for <b>IP type of service</b>,
-       the corresponding TOS byte in the IP header of the upstream packet will be
-       overwritten by the selected value.</p>
-       <p><b>Note:</b> If <b>Differentiated service configuration</b> checkbox is selected,
-       you will only need to assign <b>ATM transmit priority</b>. <b>IP Precedence</b> will not
-       be used for classification. IP TOS byte will be used for DSCP mark.</p>
-<table id="qosCls" border="0">
-      <tr id="tblItmAtmPrio">
-         <td><label>ATM transmit priority:</label></td>
-         <td><select name='priority' id='priority'>
-                               <option value="1">Low</option>
-                               <option value="2">Medium</option>
-                               <option value="3">High</option>
-            </select></td>
-      </tr>
-      <tr id="tblItmDscpMark" style="display: none">
-         <td><label>Differentiated services code point (DSCP):</label></td>
-         <td><select name="dscp" id="dscp">
-                               <option value="0" selected>None</option>
-                               <option value="0">default(000000)</option>
-                               <option value="56">AF13(001110)</option>
-                               <option value="48">AF12(001010)</option>
-                               <option value="40">AF11(001001)</option>
-                               <option value="32">CS1(001000)</option>
-                               <option value="88">AF23(010110)</option>
-                               <option value="80">AF22(010010)</option>
-                               <option value="72">AF21(010001)</option>
-                               <option value="64">CS2(010000)</option>
-                               <option value="120">AF33(011110)</option>
-                               <option value="112">AF32(011010)</option>
-                               <option value="104">AF31(011001)</option>
-                               <option value="96">CS3(011000)</option>
-                               <option value="152">AF43(100110)</option>
-                               <option value="144">AF42(100010)</option>
-                               <option value="136">AF41(100001)</option>
-                               <option value="128">CS4(100000)</option>
-                               <option value="184">EF(101110)</option>
-                               <option value="160">CS5(101000)</option>
-                               <option value="192">CS6(110000)</option>
-                               <option value="224">CS7(111000)</option>
-            </select></td>
-      </tr>
-      <tr id="tblItmIpPre">
-         <td><label>IP precedence:</label></td>
-         <td><select name='precedence' id='precedence'>
-                               <option value="-1" selected>None</option>
-                               <option value="0">0</option>
-                               <option value="1">1</option>
-                               <option value="2">2</option>
-                               <option value="3">3</option>
-                               <option value="4">4</option>
-                               <option value="5">5</option>
-                               <option value="6">6</option>
-                               <option value="7">7</option>
-            </select></td>
-      </tr>
-      <tr id="tblItmIpTos">
-         <td><label>IP type of service:</label></td>
-         <td><select name='tos' id='tos'>
-                               <option value="-1" selected>None</option>
-                               <option value="0">Normal service</option>
-                               <option value="2">Minimize cost</option>
-                               <option value="4">Maximize reliability</option>
-                               <option value="8">Maximize throughput</option>
-                               <option value="16">Minimize delay</option>
-            </select></td>
-      </tr>
-      <tr id="tblItmDot1p">
-            <td><label>802.1p (if 802.1q is enabled on WAN):</label></td>
-            <td><select name="wanVlan8021p" id="wanVlan8021p">
-                               <option value="-1" selected>None</option>
-                               <option value="0">0</option>
-                               <option value="1">1</option>
-                               <option value="2">2</option>
-                               <option value="3">3</option>
-                               <option value="4">4</option>
-                               <option value="5">5</option>
-                               <option value="6">6</option>
-                               <option value="7">7</option>
-                   </select></td>
-       </tr>
-       </table>
-
-       <h4>Class Traffic Conditions</h4>
-       <p>Please select a method for controlling the data traffic priority.</p>
-
-       <p>
-               <input type="radio" name="optTraffic" id="optIP" value="trafficIP" onclick="manageTrafficOptions();" checked /> <label for="optIP">IP traffic</label><br/>
-               <input type="radio" name="optTraffic" id="opt8021p" value="traffic8021p" onclick="manageTrafficOptions();" /> <label for="opt8021p">802.1p priority</label>
-       </p>
-
-   <table id="idIPtraffic" border="0">
-      <tr> 
-         <td><label>Physical LAN port:</label></td>
-         <td><select name="lanIfcName" id="lanIfcName">
-             <option value="" selected>None</option>
-<script type="text/javascript">
+   </head>
+      <body>
+         <blockquote>
+            <form>
+               <b>Add Network Traffic Class Rule</b><br>
+               <br>
+               The screen creates a traffic class rule to classify the upstream traffic,
+               assign queuing priority and optionally overwrite the IP header TOS byte. A rule
+               consists of a class name and at least one condition below. All of the specified
+               conditions in this classification rule must be satisfied for the rule to take
+               effect. Click 'Save/Apply' to save and activate the rule.
+               <br><br>
+               <p>Traffic Class Name: &nbsp;&nbsp;<input type="text" size="22" name="txtclsname"></p>
+               <p>
+                  <input type="checkbox" name="enblDiffServCb" onClick="diffServCfgCb(this)">
+                  &nbsp;&nbsp;Enable Differentiated Service Configuration
+               </p>
+               <b>Assign ATM Priority and/or IP Precedence and/or Type Of Service
+                  for the class</b><br>
+                  If non-blank value is selected for 'Mark IP Precedence' and/or
+                  'Mark IP Type Of Service', the correcponding TOS byte in the IP
+                  header of the upstream packet is overwritten by the selected value.
+                  <br><br>
+                  <b>Note: If Differentiated Service Configuration checkbox is selected,
+                     you will only need to assign ATM priority. IP Precedence will not 
+                     be used for classification. IP TOS byte will be used for DSCP mark.
+                  </b><br><br>
+
+               <table id="qosCls" cellSpacing="0" cellPadding="0" border="0">
+                  <tr id="tblItmAtmPrio">
+                     <td width="350">Assign ATM Transmit Priority:
+                     </td>
+                     <td> <select size="1" name="priority">
+                              <option value="0" selected>
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              <option value="1">
+                              Low<option value="2">
+                              Medium<option value="3">
+                              High</option>
+                           </select>
+                     </td>
+                  </tr>
+                  <tr id="tblItmDscpMark">
+                     <td width="350">Assign Differentiated Services Code Point (DSCP) Mark:
+                     </td>
+                     <td> <select size="1" name="dscp">
+                              <option value="0" selected>
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              <option value="0">
+                              default(000000)<option value="56">
+                              AF13(001110)<option value="48">
+                              AF12(001010)<option value="40">
+                              AF11(001001)<option value="32">
+                              CS1(001000)<option value="88">
+                              AF23(010110)<option value="80">
+                              AF22(010010)<option value="72">
+                              AF21(010001)<option value="64">
+                              CS2(010000)<option value="120">
+                              AF33(011110)<option value="112">
+                              AF32(011010)<option value="104">
+                              AF31(011001)<option value="96">
+                              CS3(011000)<option value="152">
+                              AF43(100110)<option value="144">
+                              AF42(100010)<option value="136">
+                              AF41(100001)<option value="128">
+                              CS4(100000)<option value="184">
+                              EF(101110)<option value="160">
+                              CS5(101000)<option value="192">
+                              CS6(110000)<option value="224">
+                              CS7(111000)</option>
+                           </select>
+                     </td>
+                  </tr>
+                  <tr id="tblItmIpPre">
+                     <td width="350">Mark IP Precedence:
+                     </td>
+                     <td> <select size="1" name="precedence">
+                              <option value="-1" selected>
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                              <option value="0">
+                              0<option value="1">
+                              1<option value="2">
+                              2<option value="3">
+                              3<option value="4">
+                              4<option value="5">
+                              5<option value="6">
+                              6<option value="7">
+                              7</option>
+                        </select>
+                     </td>
+                  </tr>
+                  <tr id="tblItmIpTos">
+                        <td width="350">Mark IP Type Of Service:
+                        </td>
+                        <td> <select size="1" name="tos">
+                                 <option value="-1" selected>
+                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                 <option value="0">
+                                 Normal Service<option value="2">
+                                 Minimize Cost<option value="4">
+                                 Maximize Reliability<option value="8">
+                                 Maximize Throughput<option value="16">
+                                 Minimize Delay</option>
+                           </select>
+                        </td>
+                  </tr>
+                  <tr id="tblItmDot1p">
+                        <td width="350">Mark 802.1p if 802.1q is enabled on WAN:
+                        </td>
+                        <td><select size="1" name="wanVlan8021p">
+                                 <option value="-1" selected>
+                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                 <option value="0">
+                                 0<option value="1">
+                                 1<option value="2">
+                                 2<option value="3">
+                                 3<option value="4">
+                                 4<option value="5">
+                                 5<option value="6">
+                                 6<option value="7">
+                                 7</option>
+                           </select>
+                        </td>
+                  </tr>
+                  <tr>
+                     <td colspan="2">&nbsp;
+                     </td>
+                  </tr>
+                  <tr>
+                     <td align="left" colspan="2">
+                        <p><b>Specify Traffic Classification Rules</b></P>
+                  </tr>
+                  <tr id="tblItmCond">
+                     <td align="left" colspan="2">
+                        <P><b>Enter the following conditions either for IP level, SET-1, or for IEEE 802.1p,
+                           SET-2.</b></p>
+                     </td>
+                  </tr>
+                  <tr>
+                     <td colSpan="2">&nbsp;
+                     </td>
+                  </tr>
+                  <tr id="tblItmSet1">
+                     <td><b>SET-1</b>
+                     </td>
+                  </tr>
+                 
+<script language="javascript">
 <!-- hide
 {
    var i = 0;
    var interfaceInfo = '';
    var dispName = '';
-   var brdId = '<%ejGetJS(boardID)%>';
-   
+   var brdId = '<%ejGet(boardID)%>';
+
    interfaceInfo = '<%ejGetOther(bridgeInterfaceInfo, all)%>';
-   var interfaces = interfaceInfo.split('|');
+   var interfaces = interfaceInfo.split('|');   
    interfaces.sort();
-   glbDisplayPhysicalPort = true;
-   for ( i = 0; i < interfaces.length; i++ ) {
-      dispName = getUNameByLName(brdId + '|' + interfaces[i]);
-      if (dispName.indexOf('nas_') != -1)
-         continue;      // skip nas_ ifc
-      if (interfaces[i] != '') {
-         document.writeln("  <option value='" + interfaces[i] + "'>" + dispName + "</option>");
+   if (interfaces.length > 1) {
+      glbDisplayPhysicalPort = true;
+      document.writeln("           <tr>");
+      document.writeln("               <td width='350'>Physical LAN Port:");
+      document.writeln("               </td>");
+      document.writeln("               <td><select size='1' name='lanIfcName'>");
+      document.writeln("                      <option value='' selected>");
+      document.writeln("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
+           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
+           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
+           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+      var interfaces = interfaceInfo.split('|');
+       interfaces.sort();
+       for ( i = 0; i < interfaces.length; i++ ) {
+          dispName = getUNameByLName(brdId + '|' + interfaces[i]);
+         if (dispName.indexOf('nas_') != -1)
+            continue;      // skip nas_ ifc
+         if (interfaces[i] != '')
+          document.writeln("  <option value='" + interfaces[i] + "'>" + dispName);
       }
+       document.writeln("                    </select>");
+      document.writeln("                </td>");
+      document.writeln("            </tr>");      
    }
 }
-// done hiding -->
-</script>
-            </select>
-         </td>
-      </tr>
-      <tr>
-         <td><label>Protocol:</label></td>
-         <td><select name='protocol' id='protocol'>
-               <option value="0">TCP/UDP</option>
-               <option value="1">TCP</option>
-               <option value="2">UDP</option>
-               <option value="3">ICMP</option>
-            </select></td>
-      </tr>
-
-      <tr><th align="left" colspan="2">Source</td></tr>
-      <tr>
-         <td><label for="srcaddr">IP address:</label></td>
-         <td><input type='text' size="20" name="srcaddr" id="srcaddr"></td>
-      </tr>
-      <tr>
-         <td><label for="srcport">UDP/TCP port(s):</label></td>
-         <td><input type='text' size="20" name="srcport" id="srcport"> <label class="clsNote" for="srcport">(port or port:port)</label></td>
-      </tr>
-      <tr>
-         <td><label for="srcmask">Subnet mask:</label></td>
-         <td><input type='text' size="20" name="srcmask" id="srcmask"></td>
-      </tr>
-         <tr id="tblItmSrcMacAddr" style="display: none">
-            <td><label>Source MAC address:</label></td>
-            <td><input type="text" size="20" name="srcmacaddr" id="srcmacaddr" maxlength="17"></td>
-         </tr>
-         <tr id="tblItmSrcMacMask" style="display: none">
-            <td><label>Source MAC mask:</label></td>
-            <td><input type="text" size="20" name="srcmacmask" id="srcmacmask" maxlength="17"></td>
-         </tr>
-
-      <tr><th align="left" colspan="2">Destination</th></tr>
-      <tr>
-         <td><label for="dstaddr">IP address:</label></td>
-         <td><input type='text' size="20" name="dstaddr" id="dstaddr"></td>
-      </tr>
-      <tr>
-         <td><label for="dstport">UDP/TCP port(s):</label></td>
-         <td><input type='text' size="20" name="dstport" id="dstport"> <label class="clsNote" for="dstport">(port or port:port)</label></td>
-      </tr>
-      <tr>
-         <td><label for="dstmask">Subnet mask:</label></td>
-         <td><input type='text' size="20" name="dstmask" id="dstmask"></td>
-      </tr>
-      <tr id="tblItmDstMacAddr" style="display: none">
-            <td><label>Destination MAC address:</label></td>
-            <td><input type="text" size="20" name="dstmacaddr" id="dstmacaddr" maxlength="17"></td>
-         </tr>
-         <tr id="tblItmDstMacMask" style="display: none">
-            <td><label>Destination MAC mask:</label></td>
-            <td><input type="text" size="20" name="dstmacmask" id="dstmacmask" maxlength="17"></td>
-         </tr>
-   </table>
-
-       <p id="id8021p"><label>802.1p priority:</label>
-               <select name='vlan8021p' id='vlan8021p'>
-                       <option value="0">0</option>
-                       <option value="1">1</option>
-                       <option value="2">2</option>
-                       <option value="3">3</option>
-                       <option value="4">4</option>
-                       <option value="5">5</option>
-                       <option value="6">6</option>
-                       <option value="7">7</option>
-               </select>
-       </p>
-
-       <p><input type='button' onClick='btnApply()' value='Apply'></p>
-</form>
-
-<script type="text/javascript">
-       writeFooter();
-</script>
-
-</body>
+// done hiding -->  
+</script>  
+                
+
+                  <tr>
+                     <td width="350">Protocol:
+                     </td>
+                     <td><select size="1" name="protocol">
+                            <option value="-1" selected>
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            <option value="0">
+                            TCP/UDP<option value="1">
+                            TCP<option value="2">
+                            UDP<option value="3">
+                            ICMP</option>
+                        </select>
+                     </td>
+                  </tr>
+                  <tr>
+                     <td width="350">Source IP Address:
+                     </td>
+                     <td><input type="text" size="22" name="srcaddr">
+                     </td>
+                  </tr>
+                  <tr>
+                     <td width="350">Source Subnet Mask:
+                     </td>
+                     <td><input type="text" size="22" name="srcmask">&nbsp;
+                     </td>
+                  </tr>
+                  <tr>
+                     <td width="350">UDP/TCP Source Port (port or port:port):
+                     </td>
+                     <td><input type="text" size="22" name="srcport">
+                     </td>
+                  </tr>
+                  <tr>
+                     <td width="350">Destination IP Address:
+                     </td>
+                     <td><input type="text" size="22" name="dstaddr">
+                     </td>
+                  </tr>
+                  <tr>
+                     <td width="350">Destination Subnet Mask:
+                     </td>
+                     <td><input type="text" size="22" name="dstmask">
+                     </td> 
+                  </tr>
+                  <tr>
+                     <td width="350">UDP/TCP Destination Port (port or port:port):
+                     </td>
+                     <td><input type="text" size="22" name="dstport">
+                     </td>
+                  </tr>
+                  <tr id="tblItmSrcMacAddr">
+                     <td width="350">Source MAC Address:
+                     </td>
+                     <td><input type="text" size="22" name="srcmacaddr">
+                     </td>
+                  </tr>
+                  <tr id="tblItmSrcMacMask">
+                     <td width="350">Source MAC Mask:
+                     </td>
+                     <td><input type="text" size="22" name="srcmacmask">
+                     </td>
+                  </tr>
+                  <tr id="tblItmDstMacAddr">
+                     <td width="350">Destination MAC Address:
+                     </td>
+                     <td><input type="text" size="22" name="dstmacaddr">
+                     </td>
+                  </tr>
+                  <tr id="tblItmDstMacMask">
+                     <td width="350">Destination MAC Mask:
+                     </td>
+                     <td><input type="text" size="22" name="dstmacmask">
+                     </td>
+                  </tr>
+                  <tr>
+                     <td colSpan="2">&nbsp;
+                     </td>
+                  </tr>
+                  <tr id="tblItmSet2">
+                     <td><b>SET-2</b>
+                     </td>
+                  </tr>
+                  <tr id="tblItmDot1p">
+                     <td>802.1p Priority:
+                     </td>
+                        <td><select size="1" name="vlan8021p">
+                           <option value="-1" selected>
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            <option value="0">
+                            0<option value="1">
+                            1<option value="2">
+                            2<option value="3">
+                            3<option value="4">
+                            4<option value="5">
+                            5<option value="6">
+                            6<option value="7">
+                            7</option>
+                           </select>
+                        </td>
+                  </tr>
+               </table>
+               <br>
+               <br>
+               <center><input type='button' onClick='btnApply()' value='Save/Apply'></center>
+            </form>
+         </blockquote>
+      </body>
 </html>
-