www.usr.com/support/gpl/USR9107_release.1.4.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / portmapedit.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="portName.js"></script>
16         <script type="text/javascript">
17 <!-- hide
18 setPageTitle("<%ejGetWlJS(wlInterface)%>");
19
20 var groupName = '<%ejGetOther(getPMapGroupName)%>';
21 var vid0 = '<%ejGetOther(vendorid, 0)%>';
22 var vid1 = '<%ejGetOther(vendorid, 1)%>';
23 var vid2 = '<%ejGetOther(vendorid, 2)%>';
24 var vid3 = '<%ejGetOther(vendorid, 3)%>';
25 var vid4 = '<%ejGetOther(vendorid, 4)%>';
26
27 function frmLoad() {
28    with ( document.choiceForm ) {
29       var gName = '<%ejGetOther(getPMapGroupName)%>';
30       if ( groupName == gName )
31          groupName = '';
32       else
33          txtGroupName.value = groupName;
34       vendorid0.value = vid0;
35       vendorid1.value = vid1;
36       vendorid2.value = vid2;
37       vendorid3.value = vid3;
38       vendorid4.value = vid4;
39    }
40 }
41
42 function btnRemove() {
43    with ( document.choiceForm ) {
44       var arrSelected = new Array();
45       var count = 0;
46       for ( i = 0; i < lstChoice.options.length; i++ ) {
47          if ( lstChoice.options[i].selected == true ) {
48             arrSelected[count] = lstChoice.options[i].value;
49             //varOpt = new Option(lstChoice.options[i].text, lstChoice.options[i].value);
50             //lstAvailable.options[lstAvailable.length] = varOpt;
51             //lstChoice.options[i] = null;
52          }
53          count++;
54       }
55       var x = 0;
56       for (i = 0; i < lstChoice.options.length; i++) {
57          for (x = 0; x < arrSelected.length; x++) {
58             if (lstChoice.options[i].value == arrSelected[x]) {
59                varOpt = new Option(lstChoice.options[i].text, lstChoice.options[i].value);
60                lstAvailable.options[lstAvailable.length] = varOpt;
61                lstChoice.options[i] = null;
62             }
63          }
64       }
65    }
66 }
67
68 function btnAdd() {
69    with ( document.choiceForm ) {
70       var arrSelected = new Array();
71       var count = 0;
72       for ( i = 0; i < lstAvailable.options.length; i++ ) {
73          if ( lstAvailable.options[i].selected == true ) {
74             arrSelected[count] = lstAvailable.options[i].value;
75          }
76          count++;
77       }
78       var x = 0;
79       for (i = 0; i < lstAvailable.options.length; i++) {
80          for (x = 0; x < arrSelected.length; x++) {
81             if (lstAvailable.options[i].value == arrSelected[x]) {
82                varOpt = new Option(lstAvailable.options[i].text, lstAvailable.options[i].value);
83                lstChoice.options[lstChoice.length] = varOpt;
84                lstAvailable.options[i] = null;
85             }
86          }
87       }
88    }
89 }
90
91 function btnApply() {
92    var loc = 'portmapcfg.cmd?action=edit';
93    with ( document.forms[0] ) {
94       var i = 0;
95
96       loc += '&groupName=' + '<%ejGetOther(getPMapGroupName)%>';
97       var ifc = '';
98       var tempList = '';
99       var interfaces = '';
100       var brdId = '<%ejGetJS(boardID)%>';
101       if (lstChoice.length == 0) {
102          alert('Need to provide at least one interface "Select one from the Available list."');
103          return;
104       }
105       for (i = 0; i < lstChoice.length; i++ ) {
106          if (lstChoice.options[i].value == '')
107             continue;
108          tempList += lstChoice.options[i].value + '|';
109       }
110       interfaces = tempList.split('|');
111       interfaces.sort();
112       for (i = 0; i < interfaces.length; i++) {
113          ifc += getLNameByUName(brdId + '|' + interfaces[i]) + '|';
114       }
115       loc += '&choiceBox=' + ifc;
116       if (vendorid0.value != '')
117          loc += '&vendorid0=' + vendorid0.value;
118       if (vendorid1.value != '')
119          loc += '&vendorid1=' + vendorid1.value;
120       if (vendorid2.value != '')
121          loc += '&vendorid2=' + vendorid2.value;
122       if (vendorid3.value != '')
123          loc += '&vendorid3=' + vendorid3.value;
124       if (vendorid4.value != '')
125          loc += '&vendorid4=' + vendorid4.value;
126    }
127    var code = 'location = "' + loc + '"';
128    eval(code);
129 }
130
131         // done hiding -->
132         </script>
133 </head>
134 <body onload="initMenu(); frmLoad();">
135
136 <script type="text/javascript">
137         writeHeader("Port Mapping", "<%ejGetJS(curUserName)%>", "<%ejGetOther(sysInfo, adslStd)%>", "<%ejGetOther(sysInfo, noBrPrtcl)%>", <%ejGetOther(sysInfo, pppIpExtension)%>, <%ejGetOther(sysInfo, enblFirewall)%>, <%ejGetOther(sysInfo, enblNat)%>, "<%ejGetWlJS(wlInterface)%>", <%ejGetJS(enblQos)%>);
138 </script>
139
140 <form name="choiceForm">
141    <h3>Edit</h3>
142
143    <p>To edit the port mapping configuration:</p>
144
145         <ol>
146                 <li>To add interfaces to the grouped list, select the interfaces in the
147                 <b>Available interfaces</b> list.</li>
148                 <li>Use the right arrow button to move the selected interfaces to the grouped list.</li>
149                 <li>To automatically add LAN clients to the specified group PVC, edit the list.
150                 <li>To remove the interfaces, select the interface in the <b>Grouped interfaces</b> list
151                 and press the left arrow button.</li>
152
153                 <li>Press the <b>Save</b> button to make the changes effective.</li>
154         </ol>
155
156    <p><b>Note:</b> The selected interfaces will be removed from their
157    existing groups and added to the new group.</p>
158
159    <p><b>Note:</b> By adding the DHCP vendor ID (OPTION 60) the clients will automatically
160    be denied an IP address by the local DHCP server and may obtain a public IP address.<p>
161
162    <p><label>Group name:</label> <b><%ejGetOther(getPMapGroupName)%></b></p>
163
164    <table border="0" cellpadding="0" cellspacing="0">
165       <tr>
166          <td><label>Available interfaces:</label></td>
167          <td></td>
168          <td><label>Grouped interfaces:</label></td>
169       </tr>
170       <tr>
171                    <td>
172                        <select multiple name="lstAvailable" size="10" style="width: 100">
173 <script type="text/javascript">
174 <!-- hide
175 {
176    var i = 0;
177    var interfaceInfo = '';
178    var dispName = '';
179    var brdId = '<%ejGetJS(boardID)%>';
180    if (groupName == '') {
181       interfaceInfo = '<%ejGetOther(bridgeInterfaceInfo, all)%>';
182    } else {
183       interfaceInfo = '<%ejGetOther(bridgeInterfaceInfo, group)%>';
184    }
185    var interfaces = interfaceInfo.split('|');
186    interfaces.sort();
187    for ( i = 0; i < interfaces.length; i++ ) {
188       if (interfaces[i] != '') {
189          document.write("  <option value='" + interfaces[i] + "'>");
190       }
191       dispName = getUNameByLName(brdId + '|' + interfaces[i]);
192       document.writeln(dispName);
193    }
194 }
195 // done hiding -->
196 </script>
197           </select>
198       </td>
199                    <td>
200                       <table border="0" cellpadding="0" cellspacing="5">
201                          <tr><td>
202                             <input type="button" value="->" onClick="btnAdd()" style="width: 30; height: 30">
203                          </td></tr>
204                          <tr><td>
205                             <input type="button" value="<-" onClick="btnRemove()" style="width: 30; height: 30">
206                          </td></tr>
207                       </table>
208                    </td>
209          <td>
210              <select multiple name="lstChoice" id="lstChoice" size="10">
211 <script type="text/javascript">
212 <!-- hide
213 {
214    if ( groupName != '' ) {
215       var i = 0;
216       var brdId = '<%ejGetJS(boardID)%>';
217       var dispName = '';
218       var grpedIntfInfo = '<%ejGetOther(bridgeGroupInfo, group)%>';
219       var grpedInterfaces = grpedIntfInfo.split('|');
220       grpedInterfaces.sort();
221       for ( i = 0; i < grpedInterfaces.length; i++ ) {
222          if (grpedInterfaces[i] != '') {
223             document.write("  <option value='" + grpedInterfaces[i] + "'>");
224          }
225          dispName = getUNameByLName(brdId + '|' + grpedInterfaces[i]);
226          document.writeln(dispName);
227       }
228    }
229 }
230 // done hiding -->
231 </script>
232              </select>
233            </td>
234    </table>
235
236         <h4>Automatically add clients with the following DHCP vendor IDs:</h4>
237    <table>
238       <tr>
239          <td><input type='text' name='vendorid0' size="32" maxlength="64"></td>
240       </tr>
241       <tr>
242          <td><input type='text' name='vendorid1' size="32" maxlength="64"></td>
243       </tr>
244       <tr>
245          <td><input type='text' name='vendorid2' size="32" maxlength="64"></td>
246       </tr>
247       <tr>
248          <td><input type='text' name='vendorid3' size="32" maxlength="64"></td>
249       </tr>
250       <tr>
251          <td><input type='text' name='vendorid4' size="32" maxlength="64"></td>
252       </tr>
253    </table>
254
255         <p><input type='button' onClick='btnApply()' value="Save"></p>
256 </form>
257
258 <script type="text/javascript">
259         writeFooter();
260 </script>
261
262 </body>
263 </html>