1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 (c) 2005 U.S. Robotics Corporation
7 <title>Quality of Service</title>
9 <link href="usr_main.css" rel="stylesheet" type="text/css">
10 <link href="usr_menus.css" rel="stylesheet" type="text/css"><script src="usr_menus.js" type="text/javascript"></script><script src="usr_menus_build.js" type="text/javascript"></script>
11 <script src="usr_common.js" type="text/javascript"></script>
12 <script src="portName.js" type="text/javascript"></script>
14 <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
16 <script type="text/javascript" src="util.js"></script>
17 <script type="text/javascript">
20 setPageTitle("<%ejGetWlJS(wlInterface)%>");
23 var loc = 'qoscls.cmd?action=add';
25 with ( document.forms[0] ) {
26 if ( txtclsname.value == '' )
28 alert('Please enter a Quality of Service class name.');
32 if (!isValidName(txtclsname.value))
34 alert('Please enter valid Quality of Service class name. Special characters are not permitted.');
38 // priority.selected index == 0 is valid value.
40 // Some conditions are specified by default.
42 if (optTraffic[0].checked)
44 if (srcaddr.value != "" && !isValidIpAddress(srcaddr.value))
46 alert('Source address "' + srcaddr.value + '" is an invalid IP address.');
50 if (srcmask.value != "" && !isValidSubnetMask(srcmask.value))
52 alert('Source subnet mask "' + srcmask.value + '" is an invalid subnet mask.');
56 if ( srcaddr.value == "" && srcmask.value != "" ) {
57 alert('Cannot have source subnet mask without source IP address.');
61 if (srcport.value != "" && !isValidPort(srcport.value))
63 alert('Source port "' + srcport.value + '" is an invalid port number or port range.');
67 if (dstaddr.value != "" && !isValidIpAddress(dstaddr.value))
69 alert('Destination address "' + dstaddr.value + '" is invalid IP address.');
73 if (dstmask.value != "" && !isValidSubnetMask(dstmask.value))
75 alert('Destination subnet mask "' + dstmask.value + '" is an invalid subnet mask.');
79 if ( dstaddr.value == "" && dstmask.value != "" ) {
80 alert('Cannot have destination subnet mask without destination IP address.');
84 if (dstport.value != "" && !isValidPort(dstport.value))
86 alert('Destination port "' + dstport.value + '" is invalid port number or port range.');
90 if ( (srcport.value != "" || dstport.value != "") &&
91 (protocol.selectedIndex > 2) )
93 alert("The ports must be entered if the TCP or UDP protocol is selected.");
99 loc += '&clsName=' + encodeUrl(txtclsname.value);
102 var idx = priority.selectedIndex;
103 val = priority.options[idx].value;
104 loc += '&priority=' + val;
106 // IP precedence bits
107 idx = precedence.selectedIndex;
108 val = precedence.options[idx].value;
109 loc += '&precedence=' + val;
111 // IP type of service bits
112 idx = tos.selectedIndex;
113 val = tos.options[idx].value;
114 loc += '&tos=' + val;
116 if (optTraffic[0].checked)
118 // physical lan port ifc name
119 idx = lanIfcName.selectedIndex;
120 val = lanIfcName.options[idx].value;
121 loc += '&lanIfcName=' + val;
124 idx = protocol.selectedIndex;
125 val = protocol.options[idx].value;
126 loc += '&protocol=' + val;
128 // VLAN 802.1p priority
129 loc += '&vlan8021p=-1';
133 // physical lan port ifc name
134 loc += '&lanIfcName=';
137 loc += '&protocol=-1';
139 // VLAN 802.1p priority
140 idx = vlan8021p.selectedIndex;
141 val = vlan8021p.options[idx].value;
142 loc += '&vlan8021p=' + val;
146 if ( srcaddr.value != "" )
147 loc += '&srcAddr=' + srcaddr.value;
149 // source subnet mask
150 if ( srcmask.value != "" )
151 loc += '&srcMask=' + srcmask.value;
154 if ( srcport.value != "" )
155 loc += '&srcPort=' + srcport.value;
157 // destination address
158 if ( dstaddr.value != "" )
159 loc += '&dstAddr=' + dstaddr.value;
161 // destination subnet mask
162 if ( dstaddr.value != "" )
163 loc += '&dstMask=' + dstmask.value;
166 if ( dstport.value != "" )
167 loc += '&dstPort=' + dstport.value;
169 // WAN 802.1p priority
170 idx = wanVlan8021p.selectedIndex;
171 val = wanVlan8021p.options[idx].value;
172 loc += '&wanVlan8021p=' + val;
175 var code = 'location = "' + loc + '"';
179 function manageTrafficOptions()
181 with ( document.forms[0] )
183 setVisibility("idIPtraffic", optTraffic[0].checked);
184 setVisibility("id8021p", optTraffic[1].checked);
185 if (optTraffic[1].checked)
193 vlan8021p.selectedIndex = 0;
194 lanIfcName.selectedIndex = 0;
201 <body onload="initMenu(); manageTrafficOptions();">
203 <script type="text/javascript">
204 writeHeader("Add Network Traffic Class");
208 <p>This page creates a traffic class rule to classify the upstream traffic,
209 assign queuing priority, and optionally overwrite the IP header TOS byte. A rule
210 consists of a class name and at least one condition below. All of the specified
211 conditions in this classification rule must be satisfied for the rule to take
212 effect. Press <b>Apply</b> to save and activate the rule.</p>
213 <p><label for="txtclsname">Traffic class name:</label>
214 <input type='text' size="20" name="txtclsname" id="txtclsname"></p>
216 <h4>Class Priority, IP Precedence, and Type of Service</h4>
217 <p>If a non-zero value is selected for <b>IP Precedence</b> or
218 a value other than "Normal" for <b>IP Type of Service</b>,
219 the corresponding TOS byte in the IP header of the upstream packet will be
220 overwritten by the selected value.</p>
223 <td><label>ATM transmit priority:</label></td>
224 <td><select name='priority' id='priority'>
225 <option value="1">Low</option>
226 <option value="2">Medium</option>
227 <option value="3">High</option>
231 <td><label>IP precedence:</label></td>
232 <td><select name='precedence' id='precedence'>
233 <option value="-1" selected>(None)</option>
234 <option value="0">0</option>
235 <option value="1">1</option>
236 <option value="2">2</option>
237 <option value="3">3</option>
238 <option value="4">4</option>
239 <option value="5">5</option>
240 <option value="6">6</option>
241 <option value="7">7</option>
245 <td><label>IP type of service:</label></td>
246 <td><select name='tos' id='tos'>
247 <option value="-1" selected>(None)</option>
248 <option value="0">Normal service</option>
249 <option value="2">Minimize cost</option>
250 <option value="4">Maximize reliability</option>
251 <option value="8">Maximize throughput</option>
252 <option value="16">Minimize delay</option>
256 <td><label>802.1p (if 802.1q is enabled on WAN):</label></td>
257 <td><select name="wanVlan8021p" id="wanVlan8021p">
258 <option value="-1" selected>(None)</option>
259 <option value="0">0</option>
260 <option value="1">1</option>
261 <option value="2">2</option>
262 <option value="3">3</option>
263 <option value="4">4</option>
264 <option value="5">5</option>
265 <option value="6">6</option>
266 <option value="7">7</option>
271 <h4>Class Traffic Conditions</h4>
272 <p>Please select a method for controlling the data traffic priority.</p>
275 <input type="radio" name="optTraffic" id="optIP" value="trafficIP" onclick="manageTrafficOptions();" checked /> <label for="optIP">IP traffic</label><br/>
276 <input type="radio" name="optTraffic" id="opt8021p" value="traffic8021p" onclick="manageTrafficOptions();" /> <label for="opt8021p">802.1p priority</label>
279 <table id="idIPtraffic" border="0">
281 <td><label>Physical LAN port:</label></td>
282 <td><select name="lanIfcName" id="lanIfcName">
283 <option value="" selected>(None)</option>
284 <script type="text/javascript">
288 var interfaceInfo = '';
290 var brdId = '<%ejGetJS(boardID)%>';
292 interfaceInfo = '<%ejGetOther(bridgeInterfaceInfo, all)%>';
293 var interfaces = interfaceInfo.split('|');
295 for ( i = 0; i < interfaces.length; i++ ) {
296 dispName = getUNameByLName(brdId + '|' + interfaces[i]);
297 if (dispName.indexOf('nas_') != -1)
298 continue; // skip nas_ ifc
299 if (interfaces[i] != '') {
300 document.writeln(" <option value='" + interfaces[i] + "'>" + dispName + "</option>");
310 <td><label>Protocol:</label></td>
311 <td><select name='protocol' id='protocol'>
312 <option value="0">TCP/UDP</option>
313 <option value="1">TCP</option>
314 <option value="2">UDP</option>
315 <option value="3">ICMP</option>
319 <tr><th align="left" colspan="2">Source</td></tr>
321 <td><label for="srcaddr">IP address:</label></td>
322 <td><input type='text' size="20" name="srcaddr" id="srcaddr"></td>
325 <td><label for="srcport">UDP/TCP port(s):</label></td>
326 <td><input type='text' size="20" name="srcport" id="srcport"> <label class="clsNote" for="srcport">(port or port:port)</label></td>
329 <td><label for="srcmask">Subnet mask:</label></td>
330 <td><input type='text' size="20" name="srcmask" id="srcmask"></td>
333 <tr><th align="left" colspan="2">Destination</th></tr>
335 <td><label for="dstaddr">IP address:</label></td>
336 <td><input type='text' size="20" name="dstaddr" id="dstaddr"></td>
339 <td><label for="dstport">UDP/TCP port(s):</label></td>
340 <td><input type='text' size="20" name="dstport" id="dstport"> <label class="clsNote" for="dstport">(port or port:port)</label></td>
343 <td><label for="dstmask">Subnet mask:</label></td>
344 <td><input type='text' size="20" name="dstmask" id="dstmask"></td>
348 <p id="id8021p"><label>802.1p priority:</label>
349 <select name='vlan8021p' id='vlan8021p'>
350 <option value="0">0</option>
351 <option value="1">1</option>
352 <option value="2">2</option>
353 <option value="3">3</option>
354 <option value="4">4</option>
355 <option value="5">5</option>
356 <option value="6">6</option>
357 <option value="7">7</option>
361 <p><input type='button' onClick='btnApply()' value='Apply'></p>
364 <script type="text/javascript">