http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / broadcom / cfm / html / pvccfg.html
index e8722bf..f51dfe9 100755 (executable)
 <html>
    <head>
       <meta http-equiv="Pragma" content="no-cache">
+      <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
       <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">
 <!-- hide
-var upRate = parseInt('<%ejGetOther(lineRate, 0, 0)%>');
-var pcrMax = 255000;   // Assuming nitro: 255000 * 49 * 8 = 100Mbps  // SASHA: VDSL
-// var pcrMax = 1887;   // 1887 * 53 * 8 = 800000
-var serviceCat = '<%ejGet(atmServiceCategory)%>';
-var qos = '<%ejGet(enblQos)%>';
-var hideQos = false;
+parent.helpframe.location.href="hlppvccfg.html";
+var randomNum = '<%ejGet(CheckNum)%>';
+var glbatmvpi = '<%ejGet(atmVpi)%>';
+var glbatmvci = '<%ejGet(atmVci)%>';
+var glbsercat = '<%ejGet(atmServiceCategory)%>';
+var glbpeakcell = '<%ejGet(atmPeakCellRate)%>'; 
+var glbsustaincell = '<%ejGet(atmSustainedCellRate)%>'; 
+var glbmaxburst = '<%ejGet(atmMaxBurstSize)%>';
 var serviceId = '<%ejGet(serviceId)%>';
-var numQueue = parseInt('<%ejGetOther(memInfo, queueNum)%>');
-var numQueueMax = 8;
-
-var enetWan = parseInt('<%ejGet(enblEnetWan)%>');
-var vpi = '<%ejGet(atmVpi)%>';
-var vci = '<%ejGet(atmVci)%>';
-
-if ( isNaN(upRate) == false )
-   pcrMax = Math.ceil((upRate * 1000) / (49 * 8));  // SASHA new value for VDSL
-//    pcrMax = Math.ceil((upRate * 1000) / (53 * 8));
-
-var numPvcMax = 8;
-var chipId = <%ejGetOther(sysInfo, chipId)%>;
-
-if (( chipId == 0x6348 ) || ( chipId == 0x6358 ))
-   numPvcMax = 16;
-
-var numEnet = parseInt('<%ejGet(numEnet)%>');
-var numPvc = parseInt('<%ejGet(numPvc)%>');
-   
-function disableQos() {
-   with ( document.forms[0] ) {
-      enblQos.checked = false;
-      enblQos.disabled = 1;
-   }
-}
-
-function enableQos() {
-   with ( document.forms[0] ) {
-      if ( qos == '1' )
-         enblQos.checked = true;
-      else
-         enblQos.checked = false;
-      enblQos.disabled = 0;
-   }
-}
-
-function hideQosInfo(hide) {
-   var status = 'visible';
-
-   if ( hide == 1 ) {
-      status = 'hidden';
-      disableQos();
-   } else
-      enableQos();
-
-   if (document.getElementById)  // DOM3 = IE5, NS6
-      document.getElementById('qosInfo').style.visibility = status;
-   else {
-      if (document.layers == false) // IE4
-         document.all.qosInfo.style.visibility = status;
-   }
-}
-
-function hideInfo(hide) {
-
-   with (document.forms[0]) {
-      if (hide == 3)    // hide all 3
-      {
-         if (document.getElementById) { // DOM3 = IE5, NS6
-            document.getElementById('first1').style.visibility = 'hidden';
-            document.getElementById('2and3').style.visibility = 'hidden';
-         }
-         else { // add more
-         }
-      }
-      else if (hide == 2)  // hide 2 and 3
-      {
-         if (document.getElementById) { // DOM3 = IE5, NS6
-            document.getElementById('2and3').style.visibility = 'hidden';
-            document.getElementById('first1').style.visibility = 'visible';
-         }
-         else {// add more
-         }
-      }
-      else if (hide == 0) // hide none
-      {
-         if (document.getElementById) { // DOM3 = IE5, NS6
-            document.getElementById('first1').style.visibility = 'visible';
-            document.getElementById('2and3').style.visibility = 'visible';
-         }
-         else { // add more
-         }
-      }
-   }
-}
-
-function shouldQosBeHidden() {
-   var ret = false;
-   
-   // If WAN over Ethernet is enabled then everything is hidden
-   if (enetWan == 1) {
-      return ret;
-   }
-   // only allow QoS enabled for ubr, ubrwpcr, ntr_vbr
-   if ( serviceCat == 'UBR' ||
-             serviceCat == 'UBRwPCR' ||
-             serviceCat == 'NRT_VBR' ) {
-      // if PVC is not QoS enabled
-      if ( qos == '0' ) {
-         // if add new PVC
-         if ( serviceId == '0' ) {
-            if ( numQueue > 5 )   // 5 = 8 - 3
-               ret = true;
-         } else {   // if edit existed PVC
-            if ( numQueue > 6 )   // 6 = 8 - 3 + 1
-               ret = true;
-         }
-      }
-   } else
-      ret = true;
-      
-   return ret;
-}
-
-function hideVccInfo(hide) {
-   var status = 'visible';
+var queues = '<%ejGetOther(memInfo, queueNum)%>';
+var queueNum = parseInt(queues);
+var qos = '<%ejGet(enblQos)%>';
 
-   if ( hide == 1 ) {
-      status = 'hidden';
-      hideInfo(3);
-      hideQosInfo(1);
-   } else {
-      hideQosInfo(0);
-      hideInfo(3);
-   }
-   if (document.getElementById) {  // DOM3 = IE5, NS6
-      document.getElementById('vccInfo').style.visibility = status;
-   } else {
-      if (document.layers) { // Netscape 4
-         with ( document.forms[0] ) {
-            if ( hide == 1 ) {
-               atmVpi.value = '';
-               atmVci.value = '';
-            } else {
-               atmVpi.value = vpi;
-               atmVci.value = vci;
-            }
-         }
-      } else  // IE 4
-         document.all.vccInfo.style.visibility = status;
-   }
+function showcateinfo1(){
+       with (document.forms[0]) {
+               document.getElementById('CateInfo').innerHTML =
+               '<table border="0" cellpadding="0" cellspacing="0">'+
+            '<tr>'+
+            '<td width="135">Peak Cell Rate:</td>'+
+            '<td><input type="text" size="7" name="peakCell"> cells/s'+
+            '(1-2500)</td>'+
+            '</tr>'+
+            '</table>';
+        peakCell.value = glbpeakcell;          
+       }
 }
 
-function ethWanCfgCbClick(cb) {
-   if ( cb.checked == true )
-      hideVccInfo(1);
-   else
-      hideVccInfo(0);
+function showcateinfo(){
+       with (document.forms[0]) {
+               document.getElementById('CateInfo').innerHTML =
+                       '<table border="0" cellpadding="0" cellspacing="0">'+
+            '<tr>'+
+            '<td width="135">Peak Cell Rate:</td>'+
+            '<td><input type="text" size="7" name="peakCell"> cells/s'+
+            '(1-2500)</td>'+
+            '</tr>'+
+            '<tr>'+
+            '<td width="135">Sustainable Cell Rate:</td>'+
+            '<td><input id="Text5" type="text" size="7" name="sustainableCell"> cells/s'+
+            '(1-2499)</td>'+
+            '</tr>'+
+            '<tr>'+
+            '<td>Maximum Burst Size:</td>'+
+            '<td><input type="text" size="7" name="maximumBurst"> cells(1-1000000)</td>'+ 
+            '</tr>'+
+            '</table>';
+        peakCell.value  = glbpeakcell; 
+       sustainableCell.value = glbsustaincell; 
+       maximumBurst.value = glbmaxburst;       
+       }
 }
 
 function frmLoad() {
-   // If number of ethernet ports is less than 2 or number of PVCs configed is
-   // greater than 1 or if WAN over ethernet is disabled == 2 then hide it.
-   if (enetWan == 2 || numEnet < 2 || numPvc > 1 || (numPvc == 1 && serviceId == '0')) {
-      if (document.getElementById) {  // DOM3 = IE5, NS6
-         document.getElementById('enetwan').style.visibility = 'hidden';
-      }
-   } else if (numPvc == 1 && (numEnet == 2 && enetWan != 2 && serviceId != '0')) {
-      if (document.getElementById) {  // DOM3 = IE5, NS6
-         document.getElementById('enetwan').style.visibility = 'visible';
-         if (document.forms[0].enblEnetWanCb) {
-            if (enetWan == 1) {
-               document.forms[0].enblEnetWanCb.checked = true;
-            }
-         }
-      }
-   }
-   hideQos = shouldQosBeHidden();
-
-   if ( enetWan == 1 ) {
-      hideVccInfo(1);
-   } else if ( hideQos == true )
-      hideQosInfo(1);
-   else
-      hideQosInfo(0);
-   
-   with ( document.forms[0] ) {
-      atmVpi.value = '<%ejGet(atmVpi)%>';
-      atmVci.value = '<%ejGet(atmVci)%>';
-      peakCell.value  = '<%ejGet(atmPeakCellRate)%>';
-      sustainableCell.value = '<%ejGet(atmSustainedCellRate)%>';
-      maximumBurst.value = '<%ejGet(atmMaxBurstSize)%>'
-   }
-   
-   if (serviceCat == 'UBR') {
-      document.forms[0].serviceCategory[0].selected = true;
-      hideInfo(3);
-   }
-   else if (serviceCat == 'UBRwPCR') {
-      document.forms[0].serviceCategory[1].selected = true;
-      hideInfo(2);
-   }
-   else if (serviceCat == 'CBR') {
-     document.forms[0].serviceCategory[2].selected = true;
-      hideInfo(2);
-   }
-   else if (serviceCat == 'NRT_VBR') {
-      document.forms[0].serviceCategory[3].selected = true;
-      hideInfo(0);
-   }
-   else if (serviceCat == 'RT_VBR') {
-      document.forms[0].serviceCategory[4].selected = true;
-      hideInfo(0);
-   }
-
-   // if add new PVC
-   if ( serviceId == '0' ) {
-      // if it is 6348 or 6358 chip
-      if (( chipId == 0x6348 ) || ( chipId == 0x6358 )) {
-         // if PVC is available but queue is not then
-         // only allow to add UBR PVC
-         if ( numPvc < numPvcMax && numQueue >= numQueueMax ) {
-            for ( i = 4; i > 0; i-- )
-               document.forms[0].serviceCategory.options[i] = null;
-            hideInfo(3);
-         }
-      }
-   }
+       with ( document.forms[0] ) {
+       if (glbsercat == 'UBR'){
+               serviceCategory[0].selected = true;
+       } else if (glbsercat == 'UBRwPCR'){
+               serviceCategory[1].selected = true;
+                       showcateinfo1();
+       } else if (glbsercat == 'CBR'){
+               serviceCategory[2].selected = true;
+                       showcateinfo1();
+       } else if (glbsercat == 'NRT_VBR'){
+               serviceCategory[3].selected = true;
+                       showcateinfo();
+       } else {
+               serviceCategory[4].selected = true;
+                       showcateinfo();
+       }
+       atmVpi.value = glbatmvpi;
+       atmVci.value = glbatmvci;
+       }
 }
 
 function btnBack() {
-   var code = 'location="' + 'wancfg.cmd'+ '"';
+   var code = 'window.location.href="/wancfg.cmd"'; // for Mac safari browser compatibility
    eval(code);
 }
 
 
 function btnNext() {
-   var loc = 'ntwkprtcl.cgi?';
+   var loc = 'ntwkprtcl2.cgi?';
+   loc += 'checkNum=' + randomNum + '&';
 
    with ( document.forms[0] ) {
       if ( isNaN(parseInt(atmVpi.value)) == true ) {
@@ -271,8 +119,8 @@ function btnNext() {
             return;
          }
          peak = parseInt(peakCell.value);
-         if ( peak <= 0 || peak > pcrMax ) {
-            alert('Peak Cell Rate "' + peakCell.value + '" is out of range [1-' + pcrMax + '].');
+         if ( peak <= 0 || peak > 2500 ) {
+            alert('Peak Cell Rate "' + peakCell.value + '" is out of range [1-2500].');
             return;
          }
          loc += '&atmPeakCellRate=' + peakCell.value;
@@ -284,8 +132,8 @@ function btnNext() {
             return;
          }
          sustainable = parseInt(sustainableCell.value);
-         if ( sustainable <= 0 || sustainable > pcrMax ) {
-            alert('Sustainable Cell Rate "' + sustainableCell.value + '" is out of range [1-' + pcrMax + '].');
+         if ( sustainable <= 0 || sustainable > 2499 ) {
+            alert('Sustainable Cell Rate "' + sustainableCell.value + '" is out of range [1-2499].');
             return;
          }
          if ( sustainable >= peak) {
@@ -307,168 +155,86 @@ function btnNext() {
          loc += '&atmSustainedCellRate=0';
          loc += '&atmMaxBurstSize=0';
       }
-      if ( enblQos.checked == true )
-         loc += '&enblQos=1';
-      else
-         loc += '&enblQos=0';
-      if (enetWan <= 1 && numEnet == 2 && numPvc <= 1) {
-         if (document.forms[0].enblEnetWanCb) {
-            if ( document.forms[0].enblEnetWanCb.checked == true )
-               loc += '&enblEnetWan=1';
-            else
-               loc += '&enblEnetWan=0';
-         }
-      } else if (enetWan > 1) {
-          loc += '&enblEnetWan=0';
-      }
    }
    loc += '&quickSetup=' + 0;
 
-   var code = 'location="' + loc + '"';
+   var code = 'window.location.href="/'; // for Mac safari browser compatibility
+   code += loc + '"';
    eval(code);
 }
 
 
 function cbClick(obj) {
-   var idx = obj.selectedIndex;
-   var val = obj.options[idx].value;
-   if ( val == "UBR" )
-      hideInfo(3);
-   else if (val == "UBRwPCR" || val == "CBR")
-      hideInfo(2);
-   else
-      hideInfo(0);   
-   if (val == 'CBR' || val == 'RT_VBR')
-      hideQosInfo(1);     
-   else {
-      if ( hideQos == false )
-         hideQosInfo(0);    
-   }
+       var idx = obj.selectedIndex;
+       var val = obj.options[idx].value;
+       if ( val == "UBR" ){
+       document.getElementById('CateInfo').innerHTML ='';
+       } else if (val == "UBRwPCR" || val == "CBR"){
+               showcateinfo1();
+       }else{
+               showcateinfo(0);
+       }    
 }
 
 // done hiding -->
 </script>
    </head>
    <body onload="frmLoad()">
-      <blockquote>
-         <form ID="Form1">
-            <div id='enetwan'>
-            <strong>WAN Configuration</strong><br>
-            To configure the WAN interface, enter the appropriate ATM PVC or use the check box
-            to select WAN service over (<b>eth0</b>) interface. Note, before you select WAN
-            service over (<b>eth0</b>) interface, you must erase all existing ATM PVC 
-            configuration. Also, once you select WAN service over (<b>eth0</b>), you cannot
-            configure any other ATM PVCs until the WAN service over Ethernet entry is deleted.
-            <br>
-            <br>
-            </div>
-
-            <table border="0" cellpadding="4" cellspacing="0">
-               <tr>
-<script language="javascript">
-<!-- hide
-{
-   if ((numPvc < 1 && serviceId == '0') || (numPvc == 1 && serviceId != '0')) {
-      if (numEnet == 2 && enetWan != 2) {
-         if (enetWan == 1) {
-            document.write("  <td width='30' height='30'><input type='checkbox' name='enblEnetWanCb' onClick='ethWanCfgCbClick(this)' enabled></td>");
-         } else {
-            document.write("  <td width='30' height='30'><input type='checkbox' name='enblEnetWanCb' onClick='ethWanCfgCbClick(this)'></td>");
-         }
-         document.write("  <td>Enable WAN service on <b>eth0</b></td>");
-      }
-   }
-}
-// done hiding -->
-</script>
-               </tr>
+      
+         <form ID="Form1" class="formpadding">
+<table border="0" cellpadding="0" cellspacing="3" width="98%">
+<tr>
+  <td><b><font class="netgear">Configure Internet Connection -- ATM PVC</font></b></td>
+</tr>
+<tr><td>&nbsp;</td></tr>
+<tr>\r
+  <td background="liteblue.gif" height="12">&nbsp;</td>\r
+</tr>
+</table>
+            
+            <table border="0" cellpadding="0" cellspacing="0">
+            <tr><td width="590">Please enter VPI and VCI numbers for the Internet connection which is provided by your ISP.</td></tr>
             </table>
             <br>
-            <br>
-            <div id='vccInfo'>
-
-            <strong>ATM PVC Configuration</strong><br>
-            This screen allows you to configure an ATM PVC identifier (VPI and VCI) and 
-            select a service category. Otherwise choose an existing interface by selecting
-            the checkbox to enable it.
-            <br>
-            <br>
-            <table cellSpacing="4" cellPadding="0" border="0">
+            <table cellSpacing="0" cellPadding="0" border="0">
                <tr>
-                  <td>VPI: [0-255]</td>
-                  <td><input type="text" size="4" name="atmVpi"></td>
+                  <td>VPI:&nbsp;</td>
+                  <td><input type="text" size="4" name="atmVpi"> (0-255)</td>
                </tr>
                <tr>
-                  <td>VCI: [32-65535]
-                  </td>
-                  <td><input type="text" size="4" name="atmVci"></td>
+                  <td>VCI:&nbsp;</td>
+                  <td><input type="text" size="4" name="atmVci"> (32-65535)</td>
                </tr>
             </table>
             <br>
             <table border="0" cellpadding="0" cellspacing="0">
                <tr>
-                  <td>Service Category:</td>
+                  <td width="135">Service Category:</td>
                   <td><select name="serviceCategory" size="1" onClick='cbClick(this)'>
-                        <option value="UBR" selected>
-                        UBR Without PCR
-                        <option value="UBRwPCR">
-                        UBR With PCR
-                        <option value="CBR">
-                        CBR
-                        <option value="NRT_VBR">
-                        Non Realtime VBR
-                        <option value="RT_VBR">
-                           Realtime VBR</option>
+                        <option value="UBR" selected>UBR Without PCR</option>
+<script language="javascript">
+<!-- hide                        
+                        if (queueNum < 8 || (serviceId != '0' && glbsercat != 'UBR') || ( serviceId != '0' && qos == '1')){
+                               document.writeln("<option value='UBRwPCR'>UBR With PCR</option>");
+                               document.writeln("<option value='CBR'>CBR</option>");
+                               document.writeln("<option value='NRT_VBR'>Non Realtime VBR</option>");
+                               document.writeln("<option value='RT_VBR'>Realtime VBR</option>");
+                                               }
+// done hiding -->
+</script>                     
                      </select></td>
                </tr>
             </table>
-            <div id='first1'>
-               <table border="0" cellpadding="0" cellspacing="0">
-                  <tr>
-                     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Peak Cell Rate: 
-                        [cells/s]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</td>
-                     <td><input type="text" size="6" name="peakCell"></td>
-                  </tr>
-               </table>
-            </div>
-            <div id='2and3'>
-               <table border="0" cellpadding="0" cellspacing="0">
-                  <tr>
-                     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sustainable Cell Rate: [cells/s]</td>
-                     <td><input id="Text5" type="text" size="6" name="sustainableCell"></td>
-                  </tr>
-                  <tr>
-                     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Maximum Burst Size: 
-                        [cells]&nbsp;&nbsp;&nbsp;&nbsp;</td>
-                     <td><input type="text" size="6" name="maximumBurst"></td>
-                  </tr>
-               </table>
-            </div>
-            <div id='qosInfo'>
-               <br>
-               <b>Enable Quality Of Service</b>
-               <br>
-               <br>
-               Enabling packet level QoS for a PVC improves performance for selected classes 
-               of applications.&nbsp;&nbsp;QoS cannot be set for&nbsp;CBR and Realtime VBR. 
-               &nbsp;QoS consumes system resources; therefore the number of PVCs 
-               will be reduced. Use <b>Advanced Setup/Quality of Service</b> to 
-               assign priorities for the applications.<br>
-               <br>
-               <table border="0" cellpadding="4" cellspacing="0">
-                  <tr>
-                     <td>Enable Quality Of Service</td>
-                     <td width='30' height="30"><input type='checkbox' name='enblQos'></td>
-                  </tr>
-               </table>
-            </div>
-            </div>
-            <br>
-            <br>
-            <center>
-               <input type='button' onClick='btnBack()' value='Back'> <input type='button' onClick='btnNext()' value='Next'>
-            </center>
+            <p ID='CateInfo'></p>
+<table border="0" cellpadding="0" cellspacing="3" width="98%">
+<tr>\r
+  <td background="liteblue.gif" height="12">&nbsp;</td>\r
+</tr>
+</table>
+            <table width="520"><tr>
+               <td align="right"><input type='button' onClick='btnBack()' value='< Back'>&nbsp;<input type='button' onClick='btnNext()' value='Next >'></td>
+            </tr></table>
          </form>
-      </blockquote>
+      
    </body>
 </html>