www.usr.com/support/gpl/USR9108_release1.5.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / scmacflt.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></title>
8
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
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 setPageTitle("<%ejGetWlJS(wlInterface)%>");
19
20 var ifCount = 0;
21
22 function btnApply() {
23     var loc = 'scmacflt.cmd?action=add';
24     var okChk = 0;
25     
26     with ( document.forms[0] ) {
27        loc += '&protocol=' + protocol.value;
28        if (destMac.value != '') {
29           if (isValidMacAddress(destMac.value) == false ) {
30              alert('MAC address "' + destMac.value + '" is invalid. Eg. 11:22:33:AA:BB:CC');
31              return;
32           }
33           loc += '&destMac=' + destMac.value;
34        }
35        if (srcMac.value != '') {
36           if (isValidMacAddress(srcMac.value) == false ) {
37              alert('MAC address "' + srcMac.value + '" is invalid. Eg. 11:22:33:AA:BB:CC');
38              return;
39           }
40           loc += '&srcMac=' + srcMac.value;
41        }
42        if (protocol.value == 0 && destMac.value == '' && srcMac.value == '') {
43           alert('At least one condition must be specified.');
44          return;
45        }
46        if (ifCount == 1) {
47           if (ifChk.checked)
48              okChk = 1;
49        }
50        else {
51           for (i = 0; i < ifCount; i++) 
52              if (ifChk[i].checked)
53                 okChk++;
54        }
55        if (!okChk) {
56           alert('At least one configured Bridge interface must be selected.');
57          return;
58       }    
59       loc += '&wanIf=';
60       if (chkAll.checked)
61          loc += 'ALL';
62       else {
63          var first = true;
64          if (ifCount == 1)
65             loc += ifChk.value
66          else {
67            for (i = 0; i < ifCount; i++)
68             if (ifChk[i].checked) {
69                if (!first)
70                   loc += '|';
71                loc += ifChk[i].value;
72                first = false;
73             }
74          }   
75       }
76       loc += '&direction=' + direction.value;
77    }
78    var code = 'location = "' + loc + '"';
79    eval(code);
80 }
81
82 function toggle(cb) {
83    var chkCount = 0;
84    with ( document.forms[0] ) {
85       if (ifCount == 1)
86          chkAll.checked = cb.checked;
87       else {      
88          for (i = 0; i < ifCount; i++)
89             if (ifChk[i].checked)
90                chkCount++;
91          if (chkCount == ifCount)
92             chkAll.checked = true;
93          else
94             chkAll.checked = false;
95       }
96    }
97 }
98
99 function toggleIfs(cb) {
100    var chkStatus = false;
101    with ( document.forms[0] ) {
102       if (chkAll.checked)
103          chkStatus = true;
104       if (ifCount == 1)
105          ifChk.checked = chkStatus;
106       else
107          for (i = 0; i < ifCount; i++)
108             ifChk[i].checked = chkStatus;
109    }
110 }
111
112 function addIf(pr, ifName, sn)
113 {
114    if (pr == 'Bridge' && pr != '&nbsp;') {
115       document.writeln("<tr> <input type='checkbox' name='ifChk' id='ifChk' checked value=" + 
116                         ifName + '>' + '&nbsp;&nbsp;' + sn + '/' + ifName+ "</tr>");
117       ifCount++;
118    }
119 }
120
121
122 // done hiding -->
123 </script>
124     </head>
125     <body onload="initMenu();">
126
127 <script type="text/javascript">
128         writeHeader("Add MAC Filtering Rule Entry");
129 </script>
130
131 <form>
132         <p>Select protocol and/or destination MAC addresses and/or source MAC address. 
133         Press <b>Apply</b> to save.</P>
134
135         <table border="0" cellpadding="0" cellspacing="0">
136                 <tr>
137                  <td></td>
138                  <td><b>MAC Filtering Rule</b></td>
139                 </tr>
140                 <tr>
141                  <td><label for="">Protocol type:</label></td>
142                  <td><select name='protocol' id='protocol'>
143                        <option value="0" selected></option>
144                        <option value="1">PPPoE</option>
145                        <option value="2">IPv4</option>
146                        <option value="3">IPv6</option>
147                        <option value="4">AppleTalk</option>
148                        <option value="5">IPX</option>
149                        <option value="6">NetBEUI</option>
150                        <option value="7">IGMP</option>
151                    </select></td>
152                 </tr>
153                 <tr>
154                 <td><label for="destMac">Destination MAC address:</label></td>
155                 <td><input type='text' name="destMac" id="destMac"></td>
156                 </tr>
157                 <tr>
158                 <td><label for="srcMac">Source MAC address:</label></td>
159                 <td><input type='text' name="srcMac" id="srcMac"></td>
160                 </tr>
161                 <tr>
162                 <td></td>
163                 </tr>
164                 <tr>
165                 <td><label for="">Frame direction:</label></td>
166                 <td><select name='direction' id='direction'>
167                       <option value="2" selected>LAN &lt;=&gt; WAN</option>
168                       <option value="1">LAN &lt;= WAN</option>
169                       <option value="0">LAN =&gt; WAN</option>
170                     </select></td>
171                 </tr>
172  </table>
173
174  <table>
175     <tr>
176        <td><b>WAN Interfaces:</b> (Bridges only)</td>
177     </tr>
178     <tr>
179        <td>
180         <input type='checkbox' name='chkAll' id='chkAll' checked onclick='toggleIfs(this)'> <label for="chkAll">Select all</label>
181        </td>
182     </tr>
183     <tr>
184        <script type="text/javascript">
185 <!-- hide 
186 {
187    var ifName = '<%ejGetOther(wanInfo, deviceName, 1)%>';
188    var pr =  '<%ejGetOther(wanInfo, ntwkPrtcl, 1)%>';
189    var sn = '<%ejGetOther(wanInfo, serviceName, 1)%>';
190
191    addIf(pr, ifName, sn);
192    ifName = '<%ejGetOther(wanInfo, deviceName, 2)%>';
193    pr =  '<%ejGetOther(wanInfo, ntwkPrtcl, 2)%>';
194    sn = '<%ejGetOther(wanInfo, serviceName, 2)%>';
195    addIf(pr, ifName, sn);
196    ifName = '<%ejGetOther(wanInfo, deviceName, 3)%>';
197    pr =  '<%ejGetOther(wanInfo, ntwkPrtcl, 3)%>';
198    sn = '<%ejGetOther(wanInfo, serviceName, 3)%>';
199    addIf(pr, ifName, sn);
200    ifName = '<%ejGetOther(wanInfo, deviceName, 4)%>';
201    pr =  '<%ejGetOther(wanInfo, ntwkPrtcl, 4)%>';
202    sn = '<%ejGetOther(wanInfo, serviceName, 4)%>';
203    addIf(pr, ifName, sn);
204    ifName = '<%ejGetOther(wanInfo, deviceName, 5)%>';
205    pr =  '<%ejGetOther(wanInfo, ntwkPrtcl, 5)%>';
206    sn = '<%ejGetOther(wanInfo, serviceName, 5)%>';
207    addIf(pr, ifName, sn);
208    ifName = '<%ejGetOther(wanInfo, deviceName, 6)%>';
209    pr =  '<%ejGetOther(wanInfo, ntwkPrtcl, 6)%>';
210    sn = '<%ejGetOther(wanInfo, serviceName, 6)%>';
211    addIf(pr, ifName, sn);
212    ifName = '<%ejGetOther(wanInfo, deviceName, 7)%>';
213    pr =  '<%ejGetOther(wanInfo, ntwkPrtcl, 7)%>';
214    sn = '<%ejGetOther(wanInfo, serviceName, 7)%>';
215    addIf(pr, ifName, sn);
216    ifName = '<%ejGetOther(wanInfo, deviceName, 8)%>';
217    pr =  '<%ejGetOther(wanInfo, ntwkPrtcl, 8)%>';
218    sn = '<%ejGetOther(wanInfo, serviceName, 8)%>';
219    addIf(pr, ifName, sn);
220 }
221 // done hiding -->
222 </script>
223     </tr>
224  </table>
225
226  <p><input type='button' onClick='btnApply()' value='Apply'></p>
227 </form>
228
229 <script type="text/javascript">
230         writeFooter();
231 </script>
232
233 </body>
234 </html>