www.usr.com/support/gpl/USR9113_release1.0.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / wlqosedit.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--
3         (c) 2005 U.S. Robotics Corporation.
4 -->
5 <html>
6 <head>
7         <title>Add Wireless QoS Rule</title>
8         <meta http-equiv="Pragma" content="no-cache">
9
10         <link href="usr_menus_dropdown.css" rel="stylesheet" type="text/css">
11         <script src="usr_menus_dropdown.js" type="text/javascript"></script>
12         <script src="usr_menus_build.js" type="text/javascript"></script>
13         <link href="usr_layout.css" type="text/css" rel="stylesheet" /><script src="usr_layout.js" type="text/javascript"></script>
14         <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>
15
16         <script type="text/javascript" src="util.js"></script>
17         <script type="text/javascript" src="portName.js"></script>
18         <script type="text/javascript">
19 <!-- hide
20
21 <%ejGetWlStr(wlQosVars)%>
22
23 function frmLoad() {
24    with ( document.forms[0] ) {
25       // class name
26       txtclsname.value = v_clsName;
27       // priority
28       setSelect(priority, v_priority);
29       // protocol
30       setSelect(protocol, v_protocol);
31       // source address
32       srcaddr.value = v_srcAddr;
33       // source subnet mask
34       srcmask.value = v_srcMask;
35       // source port
36       srcport.value = v_srcPort;
37       // destination address
38       dstaddr.value = v_dstAddr;
39       // destination subnet mask
40       dstmask.value = v_dstMask;
41       // destination port
42       dstport.value = v_dstPort;
43   }
44 }
45
46
47 function btnApply() {
48    var loc = 'wlqos.cmd?action=editsubmit';
49
50    with ( document.forms[0] ) {
51       if ( txtclsname.value == '' ) {
52          alert('Please enter the QoS class name.');
53          return;
54       }
55
56       if ( isValidName(txtclsname.value) == false ) {
57          alert("The QoS class name cannot use special characters.");
58          return;
59       }
60
61       if ( srcaddr.value == "" && srcmask.value == "" && srcport.value == "" &&
62            dstaddr.value == "" && dstmask.value == "" && dstport.value == "" &&
63            protocol.selectedIndex < 0 ) {
64          alert("At least one condition must be specified.");
65          return;
66       }
67
68       if ( srcaddr.value != "" && isValidIpAddress(srcaddr.value) == false ) {
69          alert('Source address "' + srcaddr.value + '" is an invalid IP address.');
70          return;
71       }
72
73       if ( srcmask.value != "" && isValidSubnetMask(srcmask.value) == false ) {
74          alert('Source subnet mask "' + srcmask.value + '" is an invalid subnet mask.');
75          return;
76       }
77
78       if ( srcaddr.value == "" && srcmask.value != "" ) {
79          alert('A source subnet mask requires a source IP address.');
80          return;
81       }
82
83       if ( srcport.value != "" && isValidPort(srcport.value) == false ) {
84          alert('Source port "' + srcport.value + '" is an invalid port number or port range.');
85          return;
86       }
87
88       if ( dstaddr.value != "" && isValidIpAddress(dstaddr.value) == false ) {
89          alert('Destination address "' + dstaddr.value + '" is an invalid IP address.');
90          return;
91       }
92
93       if ( dstmask.value != "" && isValidSubnetMask(dstmask.value) == false ) {
94          alert('Destination subnet mask "' + dstmask.value + '" is an invalid subnet mask.');
95          return;
96       }
97
98       if ( dstaddr.value == "" && dstmask.value != "" ) {
99          alert('A destination subnet mask requires a destination IP address.');
100          return;
101       }
102
103       if ( dstport.value != "" && isValidPort(dstport.value) == false ) {
104          alert('Destination port "' + dstport.value + '" is an invalid port number or port range.');
105          return;
106       }
107
108       if ( (srcport.value != "" || dstport.value != "") &&
109            (protocol.selectedIndex > 2) ) {
110          alert('TCP or UDP Protocol must be selected together with port number.');
111               return;
112       }
113
114       // previous name
115       loc += '&prevName=' + encodeUrl(v_clsName);
116
117       // class name
118       loc += '&clsName=' + encodeUrl(txtclsname.value);
119
120       // priority
121       var idx = priority.selectedIndex;
122       var val = priority.options[idx].value;
123       loc += '&priority=' + val;
124
125       // protocol
126       idx = protocol.selectedIndex;
127       val = protocol.options[idx].value;
128       loc += '&protocol=' + val;
129
130       // source address
131       if ( srcaddr.value != "" )
132          loc += '&srcAddr=' + srcaddr.value;
133
134       // source subnet mask
135       if ( srcmask.value != "" )
136          loc += '&srcMask=' + srcmask.value;
137
138       // source port
139       if ( srcport.value != "" )
140          loc += '&srcPort=' + srcport.value;
141
142       // destination address
143       if ( dstaddr.value != "" )
144          loc += '&dstAddr=' + dstaddr.value;
145
146       // destination subnet mask
147       if ( dstmask.value != "" )
148          loc += '&dstMask=' + dstmask.value;
149
150       // destination port
151       if ( dstport.value != "" )
152          loc += '&dstPort=' + dstport.value;
153    }
154    eval('location = "' + loc + '"');
155 }
156
157 // done hiding -->
158    </script>
159 </head>
160 <body onload="frmLoad(); initMenu();">
161
162 <script type="text/javascript">
163         writeHeader("Add Wireless QoS Rule");
164 </script>
165
166 <form>
167         <p>A wireless QoS rule consists of a class name and at least one of the conditions below.
168         All of the specified conditions in this classification rule must be satisfied for the
169         rule to take effect.
170         Press the <b>Save</b> button to save and activate the rule.</p>
171
172         <table border="0">
173                 <tr>
174                         <td><label for="txtclsname">Traffic class name:</label></td>
175                         <td><input type="text" size="22" maxlength="22" name="txtclsname" id="txtclsname"></td>
176                 </tr>
177                 <tr>
178                         <td><label>Transmit priority:</label></td>
179                         <td><select name="priority">
180                                         <option value="0" selected>0 - WMM Best Effort (default)</option>
181                                         <option value="1">1 - WMM Background</option>
182                                         <option value="2">2 - WMM Background</option>
183                                         <option value="3">3 - WMM Best Effort</option>
184                                         <option value="4">4 - WMM Video Priority</option>
185                                         <option value="5">5 - WMM Video Priority</option>
186                                         <option value="6">6 - WMM Voice Priority</option>
187                                         <option value="7">7 - WMM Voice Priority</option>
188                                 </select></td>
189                 </tr>
190                 <tr>
191                         <td>Protocol:</td>
192                         <td><select size="1" name="protocol">
193                                         <option value="0">TCP/UDP</option>
194                                         <option value="1">TCP</option>
195                                         <option value="2">UDP</option>
196                                         <option value="3">ICMP</option>
197                                 </select></td>
198                 </tr>
199                 <tr>
200                         <td><label for="srcaddr">Source IP address:</td>
201                         <td><input type="text" size="22" maxlength="22" name="srcaddr" id="srcaddr"></td>
202                 </tr>
203                 <tr>
204                         <td><label for="srcmask">Source subnet mask:</td>
205                         <td><input type="text" size="22" maxlength="22" name="srcmask" id="srcmask"></td>
206                 </tr>
207                 <tr>
208                         <td><label for="srcport">UDP/TCP source port:</td>
209                         <td><input type="text" size="22" maxlength="22" name="srcport" id="srcport"> <span class="clsNote">(port or port:port)</span></td>
210                 </tr>
211                 <tr>
212                         <td><label for="dstaddr">Destination IP address:</td>
213                         <td><input type="text" size="22" maxlength="22" name="dstaddr" id="dstaddr"></td>
214                 </tr>
215                 <tr>
216                         <td><label for="dstmask">Destination subnet mask:</td>
217                         <td><input type="text" size="22" maxlength="22" name="dstmask" id="dstmask"></td>
218                 </tr>
219                 <tr>
220                         <td><label for="dstport">UDP/TCP destination port:</td>
221                         <td><input type="text" size="22" maxlength="22" name="dstport" id="dstport"> <span class="clsNote">(port or port:port)</span></td>
222                 </tr>
223         </table>
224
225         <p><input type='button' onClick='btnApply()' value="Save"></p>
226 </form>
227
228 <script type="text/javascript">
229         writeFooter();
230 </script>
231
232 </body>
233 </html>