www.usr.com/support/gpl/USR9113_release1.0.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / scoutflt.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 Outgoing IP Filter</title>
8
9         <link href="usr_layout.css" type="text/css" rel="stylesheet" /><script src="usr_layout.js" type="text/javascript"></script>
10         <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>
11         <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>
12
13    <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
14
15    <script type="text/javascript" src="util.js"></script>
16    <script type="text/javascript">
17 <!-- hide
18
19
20
21 function btnApply() {
22    var loc = 'scoutflt.cmd?action=add';
23
24    with ( document.forms[0] ) {
25       if ( txtfltname.value == '' ) {
26          msg = 'Please enter outgoing IP filtering name.';
27          alert(msg);
28          return;
29       }
30
31       if ( isValidName(txtfltname.value) == false ) {
32          msg = "The filter name is invalid. Only alphanumeric characters are allowed.";
33          alert(msg);
34          return;
35       }      
36
37       if ( srcaddr.value == "" && srcmask.value == "" && srcport.value == "" &&
38            dstaddr.value == "" && dstmask.value == "" && dstport.value == "" &&
39            protocol.selectedIndex < 0 ) {
40          msg = 'At least one condition must be specified.'
41          alert(msg);
42          return;
43       }      
44
45       if ( srcaddr.value != "" && isValidIpAddress(srcaddr.value) == false ) {
46          msg = 'Source address "' + srcaddr.value + '" is invalid IP address.';
47          alert(msg);
48          return;
49       }
50
51       if ( srcmask.value != "" && isValidSubnetMask(srcmask.value) == false ) {
52          msg = 'Source subnet mask "' + srcmask.value + '" is invalid subnet mask.';
53          alert(msg);
54          return;
55       }
56
57       if ( srcaddr.value == "" && srcmask.value != "" ) {
58          msg = 'Cannot have source subnet mask without source IP address.';
59          alert(msg);
60          return;
61       }
62
63       if ( srcport.value != "" && isValidPort(srcport.value) == false ) {
64          msg = 'Source port "' + srcport.value + '" is invalid port number or port range.';
65          alert(msg);
66          return;
67       }
68
69       if ( dstaddr.value != "" && isValidIpAddress(dstaddr.value) == false ) {
70          msg = 'Destination address "' + dstaddr.value + '" is invalid IP address.';
71          alert(msg);
72          return;
73       }
74
75       if ( dstmask.value != "" && isValidSubnetMask(dstmask.value) == false ) {
76          msg = 'Destination subnet mask "' + dstmask.value + '" is invalid subnet mask.';
77          alert(msg);
78          return;
79       }
80
81       if ( dstaddr.value == "" && dstmask.value != "" ) {
82          msg = 'Cannot have destination subnet mask without destination IP address.';
83          alert(msg);
84          return;
85       }
86
87       if ( dstport.value != "" && isValidPort(dstport.value) == false ) {
88          msg = 'Destination port "' + dstport.value + '" is invalid port number or port range.';
89          alert(msg);
90          return;
91       }
92
93       if ( (srcport.value != "" || dstport.value != "") &&
94            (protocol.selectedIndex < 0 || protocol.selectedIndex == 3) ) {
95          msg = 'TCP or UDP Protocol must be selected together with port number';
96          alert(msg);
97          return;
98       } 
99       
100       // outgoing IP filter name
101       loc += '&fltName=' + encodeUrl(txtfltname.value);
102
103       // protocol
104       idx = protocol.selectedIndex;
105       val = protocol.options[idx].value;
106       loc += '&protocol=' + val;
107
108       // source address
109       if ( srcaddr.value != "" )
110          loc += '&srcAddr=' + srcaddr.value;
111
112       // source subnet mask
113       if ( srcmask.value != "" )
114          loc += '&srcMask=' + srcmask.value;
115
116       // source port
117       if ( srcport.value != "" )
118          loc += '&srcPort=' + srcport.value;
119
120       // destination address
121       if ( dstaddr.value != "" )
122          loc += '&dstAddr=' + dstaddr.value;
123
124       // destination subnet mask
125       if ( dstaddr.value != "" )
126          loc += '&dstMask=' + dstmask.value;
127
128       // destination port
129       if ( dstport.value != "" )
130          loc += '&dstPort=' + dstport.value;
131    }
132
133    var code = 'location = "' + loc + '"';
134    eval(code);
135 }
136
137 // done hiding -->
138       </script>
139    </head>
140    <body onload="initMenu();">
141
142 <script type="text/javascript">
143         writeHeader("Add Outgoing IP Filter");
144 </script>
145
146 <form>
147
148         <p>Create a filter to identify the outgoing IP traffic by specifying at least one
149         condition below. If multiple conditions are specified, all of them take effect.
150         Press <b>Apply</b> to save and activate the filter.</p>
151
152         <table border="0" cellpadding="0" cellspacing="0">
153       <tr>
154          <td><label for="txtfltname">Filter name:</label></td>
155          <td><input type='text' maxlength="15" size="22" name="txtfltname" id="txtfltname"></td>
156       </tr>
157       <tr>
158          <td colspan="2">&nbsp;</td>
159       </tr>
160       <tr>
161          <td><label for="">Protocol:</label></td>
162          <td><select name='protocol' id='protocol'>
163                <option value="0">TCP/UDP</option>
164                <option value="1">TCP</option>
165                <option value="2">UDP</option>
166                                         <option value="3">ICMP</option>
167             </select></td>
168       </tr>
169       <tr>
170          <td><label for="srcaddr">Source IP address:</label></td>
171          <td><input type='text' size="22" name="srcaddr" id="srcaddr"></td>
172       </tr>
173       <tr>
174          <td><label for="srcmask">Source subnet mask:</label></td>
175          <td><input type='text' size="22" name="srcmask" id="srcmask"></td>
176       </tr>
177       <tr>
178          <td><label for="srcport">Source port:</label></td>
179          <td><input type='text' size="22" name="srcport" id="srcport"> (port or port:port)</td>
180       </tr>
181       <tr>
182          <td><label for="dstaddr">Destination IP address:</label></td>
183          <td><input type='text' size="22" name="dstaddr" id="dstaddr"></td>
184       </tr>
185       <tr>
186          <td><label for="dstmask">Destination subnet mask:</label></td>
187          <td><input type='text' size="22" name="dstmask" id="dstmask"></td>
188       </tr>
189       <tr>
190          <td><label for="dstport">Destination port:</label></td>
191          <td><input type='text' size="22" name="dstport" id="dstport"> (port or port:port)</td>
192       </tr>
193    </table>
194         <p><input type='button' onClick='btnApply()' value='Apply'></p>
195 </form>
196
197 <script type="text/javascript">
198         writeFooter();
199 </script>
200
201 </body>
202 </html>