http://downloads.netgear.com/files/GPL/DM111PSP_v3.61d_GPL.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / qoscls.html
1 <html>
2    <head>
3       <meta http-equiv="Pragma" content="no-cache">
4       <LINK href="stylemain.css" type="text/css" rel="stylesheet">
5          <LINK href="colors.css" type="text/css" rel="stylesheet">
6             <script language="javascript" src="util.js"></script>
7             <script language="javascript" src="portName.js"></script>
8             <script language="javascript">
9 <!-- hide
10 var glbDisplayPhysicalPort = false;
11
12 if (document.getElementById) onload = function () {
13    var i, a;
14    for(i=0; (a = document.getElementsByTagName('tr')[i]); i++) {
15       if ((/SrcMacAddr/i.test(a.id)) ||
16           (/SrcMacMask/i.test(a.id)) ||
17           (/DstMacAddr/i.test(a.id)) ||
18           (/DstMacMask/i.test(a.id)) ||
19           (/DscpMark/i.test(a.id))) {
20          a.className = 'hide';
21       } else
22          a.className = '';
23    }
24 }
25
26 function diffServCfgCb (cb) {
27    var i, a;
28    if (cb.checked == true) {
29       for(i=0; (a = document.getElementsByTagName('tr')[i]); i++) {
30          if ((/IpPre/i.test(a.id)) ||
31              (/IpTos/i.test(a.id))) {
32             a.className = 'hide';
33          }
34          if ((/SrcMacAddr/i.test(a.id)) ||
35              (/SrcMacMask/i.test(a.id)) ||
36              (/DstMacAddr/i.test(a.id)) ||
37              (/DstMacMask/i.test(a.id)) ||
38              (/DscpMark/i.test(a.id))) {
39             a.className = '';
40          }
41       }
42    } else {
43       for(i=0; (a = document.getElementsByTagName('tr')[i]); i++) {
44          if ((/SrcMacAddr/i.test(a.id)) ||
45              (/SrcMacMask/i.test(a.id)) ||
46              (/DstMacAddr/i.test(a.id)) ||
47              (/DstMacMask/i.test(a.id)) ||
48              (/DscpMark/i.test(a.id))) {
49             a.className = 'hide';
50          } else
51             a.className = '';
52       }
53    }
54 }
55
56 function btnApply() {
57    var loc = 'qoscls.cmd?action=add';
58
59    with ( document.forms[0] ) {
60       if ( txtclsname.value == '' ) {
61          msg = 'Please enter QoS class name.';
62          alert(msg);
63          return;
64       }
65
66       if ( isValidName(txtclsname.value) == false ) {
67          msg = 'Please enter valid QoS class name: No special characters.';
68          alert(msg);
69          return;
70       }
71       if (txtclsname.value.length > 15) {
72          msg = 'Maximum QoS class name cannot exceed 15 characters.';
73          alert(msg);
74          return;
75       }
76       idx = priority.selectedIndex;
77       if ( idx == 0 ) {
78          msg = 'There is no selected priority.';
79          alert(msg);
80          return;
81       }
82
83
84       if ( srcaddr.value == "" && srcmask.value == "" && srcport.value == "" &&
85            dstaddr.value == "" && dstmask.value == "" && dstport.value == "" &&
86              vlan8021p.selectedIndex == 0 &&
87             protocol.selectedIndex == 0 && vlan8021p.selectedIndex == 0 ) {
88          if (!(glbDisplayPhysicalPort && lanIfcName.selectedIndex != 0)) {
89             msg = 'At least one condition must be specified.'
90             alert(msg);
91             return;
92          }
93       }
94
95       if ( srcaddr.value != "" && isValidIpAddress(srcaddr.value) == false ) {
96          msg = 'Source address "' + srcaddr.value + '" is invalid IP address.';
97          alert(msg);
98          return;
99       }
100
101       if ( srcmask.value != "" && isValidSubnetMask(srcmask.value) == false ) {
102          msg = 'Source subnet mask "' + srcmask.value + '" is invalid subnet mask.';
103          alert(msg);
104          return;
105       }
106
107       if ( srcaddr.value == "" && srcmask.value != "" ) {
108          msg = 'Cannot have source subnet mask without source IP address.';
109          alert(msg);
110          return;
111       }
112
113       if ( srcport.value != "" && isValidPort(srcport.value) == false ) {
114          msg = 'Source port "' + srcport.value + '" is invalid port number or port range.';
115          alert(msg);
116          return;
117       }
118
119       if ( dstaddr.value != "" && isValidIpAddress(dstaddr.value) == false ) {
120          msg = 'Destination address "' + dstaddr.value + '" is invalid IP address.';
121          alert(msg);
122          return;
123       }
124
125       if ( dstmask.value != "" && isValidSubnetMask(dstmask.value) == false ) {
126          msg = 'Destination subnet mask "' + dstmask.value + '" is invalid subnet mask.';
127          alert(msg);
128          return;
129       }
130
131       if ( dstaddr.value == "" && dstmask.value != "" ) {
132          msg = 'Cannot have destination subnet mask without destination IP address.';
133          alert(msg);
134          return;
135       }
136
137       if ( dstport.value != "" && isValidPort(dstport.value) == false ) {
138          msg = 'Destination port "' + dstport.value + '" is invalid port number or port range.';
139          alert(msg);
140          return;
141       }
142
143       if ( (srcport.value != "" || dstport.value != "") &&
144            (protocol.selectedIndex == 0 || protocol.selectedIndex == 4) ) {
145          msg = 'TCP or UDP Protocol must be selected together with port number.';
146               alert(msg);
147               return;
148       }
149
150       if ( (vlan8021p.selectedIndex != 0) &&
151            (dstaddr.value != "" || dstaddr.value != "" ||
152                 srcaddr.value != "" || srcport.value != "" ||  protocol.selectedIndex != 0) ) {
153          msg = '802.1p Priority cannot be selected together with IP traffic condition.';
154               alert(msg);
155               return;
156       }
157
158       // class name
159       loc += '&clsName=' + encodeUrl(txtclsname.value);
160
161       // priority
162       idx = priority.selectedIndex;
163       val = priority.options[idx].value;
164       loc += '&priority=' + val;
165
166       // Check if the DiffServ configuration is enabled
167       if (enblDiffServCb.checked == false) {
168          // IP precedence bits
169          idx = precedence.selectedIndex;
170          val = precedence.options[idx].value;
171          loc += '&precedence=' + val;
172
173          // IP type of service bits
174          idx = tos.selectedIndex;
175          val = tos.options[idx].value;
176          loc += '&tos=' + val;
177       } else {
178          idx = dscp.selectedIndex;
179          if ( idx > 0 ) {
180             loc += '&dscpMark=' + dscp.options[idx].value;
181          }
182       }
183
184       // physical lan port ifc name
185      if (glbDisplayPhysicalPort)
186         loc += '&lanIfcName=' + lanIfcName.options[lanIfcName.selectedIndex].value;;
187       // protocol
188       idx = protocol.selectedIndex;
189       val = protocol.options[idx].value;
190       loc += '&protocol=' + val;
191
192       // source address
193       if ( srcaddr.value != "" )
194          loc += '&srcAddr=' + srcaddr.value;
195
196       // source subnet mask
197       if ( srcmask.value != "" )
198          loc += '&srcMask=' + srcmask.value;
199
200       // source port
201       if ( srcport.value != "" )
202          loc += '&srcPort=' + srcport.value;
203
204       // destination address
205       if ( dstaddr.value != "" )
206          loc += '&dstAddr=' + dstaddr.value;
207
208       // destination subnet mask
209       if ( dstaddr.value != "" )
210          loc += '&dstMask=' + dstmask.value;
211
212       // destination port
213       if ( dstport.value != "" )
214          loc += '&dstPort=' + dstport.value;
215
216       // DiffServ configuration
217       if ( enblDiffServCb.checked == true ) {
218          loc += '&diffServCfg=' + 3;
219       } else {
220          loc += '&diffServCfg=' + 0;
221       }
222
223       // source MAC address
224       if ( srcmacaddr.value != "" )
225          loc += '&srcMacAddr=' + srcmacaddr.value;
226
227       // destination MAC address
228       if ( dstmacaddr.value != "" )
229          loc += '&dstMacAddr=' + dstmacaddr.value;
230
231       // source MAC mask
232       if ( srcmacmask.value != "" )
233          loc += '&srcMacMask=' + srcmacmask.value;
234
235       // destination MAC mask
236       if ( dstmacmask.value != "" )
237          loc += '&dstMacMask=' + dstmacmask.value;
238
239       // Check if DiffServ configuration is enabled
240       //if (enblDiffServCb.checked == false) {
241       // VLAN 802.1p priority
242       idx = vlan8021p.selectedIndex;
243       val = vlan8021p.options[idx].value;
244       loc += '&vlan8021p=' + val;
245
246            // WAN 802.1p priority
247       idx = wanVlan8021p.selectedIndex;
248       val = wanVlan8021p.options[idx].value;
249       loc += '&wanVlan8021p=' + val;
250       //}
251    }
252    var code = 'location="' + loc + '"';
253    eval(code);
254 }
255
256 // done hiding -->
257 </script>
258
259    </head>
260       <body>
261          <blockquote>
262             <form>
263                <b>Add Network Traffic Class Rule</b><br>
264                <br>
265                The screen creates a traffic class rule to classify the upstream traffic,
266                assign queuing priority and optionally overwrite the IP header TOS byte. A rule
267                consists of a class name and at least one condition below. All of the specified
268                conditions in this classification rule must be satisfied for the rule to take
269                effect. Click 'Save/Apply' to save and activate the rule.
270                <br><br>
271                <p>Traffic Class Name: &nbsp;&nbsp;<input type="text" size="22" name="txtclsname"></p>
272                <p>
273                   <input type="checkbox" name="enblDiffServCb" onClick="diffServCfgCb(this)">
274                   &nbsp;&nbsp;Enable Differentiated Service Configuration
275                </p>
276                <b>Assign ATM Priority and/or IP Precedence and/or Type Of Service
277                   for the class</b><br>
278                   If non-blank value is selected for 'Mark IP Precedence' and/or
279                   'Mark IP Type Of Service', the correcponding TOS byte in the IP
280                   header of the upstream packet is overwritten by the selected value.
281                   <br><br>
282                   <b>Note: If Differentiated Service Configuration checkbox is selected,
283                      you will only need to assign ATM priority. IP Precedence will not 
284                      be used for classification. IP TOS byte will be used for DSCP mark.
285                   </b><br><br>
286
287                <table id="qosCls" cellSpacing="0" cellPadding="0" border="0">
288                   <tr id="tblItmAtmPrio">
289                      <td width="350">Assign ATM Transmit Priority:
290                      </td>
291                      <td> <select size="1" name="priority">
292                               <option value="0" selected>
293                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
294                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
295                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
296                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
297                               <option value="1">
298                               Low<option value="2">
299                               Medium<option value="3">
300                               High</option>
301                            </select>
302                      </td>
303                   </tr>
304                   <tr id="tblItmDscpMark">
305                      <td width="350">Assign Differentiated Services Code Point (DSCP) Mark:
306                      </td>
307                      <td> <select size="1" name="dscp">
308                               <option value="0" selected>
309                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
310                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
311                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
312                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
313                               <option value="0">
314                               default(000000)<option value="56">
315                               AF13(001110)<option value="48">
316                               AF12(001010)<option value="40">
317                               AF11(001001)<option value="32">
318                               CS1(001000)<option value="88">
319                               AF23(010110)<option value="80">
320                               AF22(010010)<option value="72">
321                               AF21(010001)<option value="64">
322                               CS2(010000)<option value="120">
323                               AF33(011110)<option value="112">
324                               AF32(011010)<option value="104">
325                               AF31(011001)<option value="96">
326                               CS3(011000)<option value="152">
327                               AF43(100110)<option value="144">
328                               AF42(100010)<option value="136">
329                               AF41(100001)<option value="128">
330                               CS4(100000)<option value="184">
331                               EF(101110)<option value="160">
332                               CS5(101000)<option value="192">
333                               CS6(110000)<option value="224">
334                               CS7(111000)</option>
335                            </select>
336                      </td>
337                   </tr>
338                   <tr id="tblItmIpPre">
339                      <td width="350">Mark IP Precedence:
340                      </td>
341                      <td> <select size="1" name="precedence">
342                               <option value="-1" selected>
343                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
344                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
345                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
346                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
347                               <option value="0">
348                               0<option value="1">
349                               1<option value="2">
350                               2<option value="3">
351                               3<option value="4">
352                               4<option value="5">
353                               5<option value="6">
354                               6<option value="7">
355                               7</option>
356                         </select>
357                      </td>
358                   </tr>
359                   <tr id="tblItmIpTos">
360                         <td width="350">Mark IP Type Of Service:
361                         </td>
362                         <td> <select size="1" name="tos">
363                                  <option value="-1" selected>
364                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
365                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
366                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
367                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
368                                  <option value="0">
369                                  Normal Service<option value="2">
370                                  Minimize Cost<option value="4">
371                                  Maximize Reliability<option value="8">
372                                  Maximize Throughput<option value="16">
373                                  Minimize Delay</option>
374                            </select>
375                         </td>
376                   </tr>
377                   <tr id="tblItmDot1p">
378                         <td width="350">Mark 802.1p if 802.1q is enabled on WAN:
379                         </td>
380                         <td><select size="1" name="wanVlan8021p">
381                                  <option value="-1" selected>
382                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
383                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
384                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
385                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
386                                  <option value="0">
387                                  0<option value="1">
388                                  1<option value="2">
389                                  2<option value="3">
390                                  3<option value="4">
391                                  4<option value="5">
392                                  5<option value="6">
393                                  6<option value="7">
394                                  7</option>
395                            </select>
396                         </td>
397                   </tr>
398                   <tr>
399                      <td colspan="2">&nbsp;
400                      </td>
401                   </tr>
402                   <tr>
403                      <td align="left" colspan="2">
404                         <p><b>Specify Traffic Classification Rules</b></P>
405                   </tr>
406                   <tr id="tblItmCond">
407                      <td align="left" colspan="2">
408                         <P><b>Enter the following conditions either for IP level, SET-1, or for IEEE 802.1p,
409                            SET-2.</b></p>
410                      </td>
411                   </tr>
412                   <tr>
413                      <td colSpan="2">&nbsp;
414                      </td>
415                   </tr>
416                   <tr id="tblItmSet1">
417                      <td><b>SET-1</b>
418                      </td>
419                   </tr>
420                  
421 <script language="javascript">
422 <!-- hide
423 {
424    var i = 0;
425    var interfaceInfo = '';
426    var dispName = '';
427    var brdId = '<%ejGet(boardID)%>';
428
429    interfaceInfo = '<%ejGetOther(bridgeInterfaceInfo, all)%>';
430    var interfaces = interfaceInfo.split('|');   
431    interfaces.sort();
432    if (interfaces.length > 1) {
433       glbDisplayPhysicalPort = true;
434       document.writeln("           <tr>");
435       document.writeln("               <td width='350'>Physical LAN Port:");
436       document.writeln("               </td>");
437       document.writeln("               <td><select size='1' name='lanIfcName'>");
438       document.writeln("                      <option value='' selected>");
439       document.writeln("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
440            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
441            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
442            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
443       var interfaces = interfaceInfo.split('|');
444         interfaces.sort();
445         for ( i = 0; i < interfaces.length; i++ ) {
446            dispName = getUNameByLName(brdId + '|' + interfaces[i]);
447          if (dispName.indexOf('nas_') != -1)
448             continue;      // skip nas_ ifc
449          if (interfaces[i] != '')
450           document.writeln("  <option value='" + interfaces[i] + "'>" + dispName);
451       }
452         document.writeln("                    </select>");
453       document.writeln("                </td>");
454       document.writeln("            </tr>");      
455    }
456 }
457 // done hiding -->  
458 </script>  
459                 
460
461                   <tr>
462                      <td width="350">Protocol:
463                      </td>
464                      <td><select size="1" name="protocol">
465                             <option value="-1" selected>
466                             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
467                             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
468                             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
469                             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
470                             <option value="0">
471                             TCP/UDP<option value="1">
472                             TCP<option value="2">
473                             UDP<option value="3">
474                             ICMP</option>
475                         </select>
476                      </td>
477                   </tr>
478                   <tr>
479                      <td width="350">Source IP Address:
480                      </td>
481                      <td><input type="text" size="22" name="srcaddr">
482                      </td>
483                   </tr>
484                   <tr>
485                      <td width="350">Source Subnet Mask:
486                      </td>
487                      <td><input type="text" size="22" name="srcmask">&nbsp;
488                      </td>
489                   </tr>
490                   <tr>
491                      <td width="350">UDP/TCP Source Port (port or port:port):
492                      </td>
493                      <td><input type="text" size="22" name="srcport">
494                      </td>
495                   </tr>
496                   <tr>
497                      <td width="350">Destination IP Address:
498                      </td>
499                      <td><input type="text" size="22" name="dstaddr">
500                      </td>
501                   </tr>
502                   <tr>
503                      <td width="350">Destination Subnet Mask:
504                      </td>
505                      <td><input type="text" size="22" name="dstmask">
506                      </td> 
507                   </tr>
508                   <tr>
509                      <td width="350">UDP/TCP Destination Port (port or port:port):
510                      </td>
511                      <td><input type="text" size="22" name="dstport">
512                      </td>
513                   </tr>
514                   <tr id="tblItmSrcMacAddr">
515                      <td width="350">Source MAC Address:
516                      </td>
517                      <td><input type="text" size="22" name="srcmacaddr">
518                      </td>
519                   </tr>
520                   <tr id="tblItmSrcMacMask">
521                      <td width="350">Source MAC Mask:
522                      </td>
523                      <td><input type="text" size="22" name="srcmacmask">
524                      </td>
525                   </tr>
526                   <tr id="tblItmDstMacAddr">
527                      <td width="350">Destination MAC Address:
528                      </td>
529                      <td><input type="text" size="22" name="dstmacaddr">
530                      </td>
531                   </tr>
532                   <tr id="tblItmDstMacMask">
533                      <td width="350">Destination MAC Mask:
534                      </td>
535                      <td><input type="text" size="22" name="dstmacmask">
536                      </td>
537                   </tr>
538                   <tr>
539                      <td colSpan="2">&nbsp;
540                      </td>
541                   </tr>
542                   <tr id="tblItmSet2">
543                      <td><b>SET-2</b>
544                      </td>
545                   </tr>
546                   <tr id="tblItmDot1p">
547                      <td>802.1p Priority:
548                      </td>
549                         <td><select size="1" name="vlan8021p">
550                            <option value="-1" selected>
551                             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
552                             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
553                             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
554                             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
555                             <option value="0">
556                             0<option value="1">
557                             1<option value="2">
558                             2<option value="3">
559                             3<option value="4">
560                             4<option value="5">
561                             5<option value="6">
562                             6<option value="7">
563                             7</option>
564                            </select>
565                         </td>
566                   </tr>
567                </table>
568                <br>
569                <br>
570                <center><input type='button' onClick='btnApply()' value='Save/Apply'></center>
571             </form>
572          </blockquote>
573       </body>
574 </html>