add added files
[bcm963xx.git] / userapps / broadcom / cfm / html / ntwkprtcl.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         <script src="usr_menus.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("<%ejGetWl(wlInterface)%>");
19
20 var qs = '<%ejGet(quickSetup)%>';
21 var prtcl = '<%ejGetOther(memInfo, ntwkPrtcl)%>';
22 var eMode = '<%ejGet(encapMode)%>';
23 var srvname = '<%ejGet(serviceName)%>';
24 var vpi = '<%ejGet(atmVpi)%>';
25 var vci = '<%ejGet(atmVci)%>';
26 var existedProtocol = '<%ejGet(existedProtocol)%>';
27 var enblEnetWan = '<%ejGet(enblEnetWan)%>';
28
29 function frmLoad() {
30    with ( document.forms[0] ) {
31       if ( enblEnetWan == 1 ) {
32             document.getElementById('enetWan').style.visibility = 'hidden';
33             eMode = 2;
34             if (prtcl == 'PPPoE')
35                ntwkPrtcl[0].checked = true;
36             else
37                ntwkPrtcl[1].checked = true;
38       } else if ( existedProtocol == 'MER' ) {
39          // if MER is existed in this PVC and MER is editting then 
40          // allow PPPoE or MER to be added
41          if ( prtcl == 'MER' )
42             ntwkPrtcl[1].checked = true;
43          else
44          // if MER is existed and PPPoE is editting then only allow PPPoE to be added
45             ntwkPrtcl.checked = true;
46       } else if ( existedProtocol == 'PPPoE' ) {
47          // if (PPPoE is existed then only allow PPPoE or MER to be added
48          if ( prtcl == 'MER' )
49             ntwkPrtcl[1].checked = true;
50          else
51             ntwkPrtcl[0].checked = true;
52       } else {
53          // otherwise no restriction
54          if ( prtcl == 'PPPoA' )
55             ntwkPrtcl[0].checked = true;
56          else if ( prtcl == 'PPPoE' )
57             ntwkPrtcl[1].checked = true;
58          else if ( prtcl == 'MER' )
59             ntwkPrtcl[2].checked = true;
60          else if ( prtcl == 'IPoA' )
61             ntwkPrtcl[3].checked = true;
62          else
63             ntwkPrtcl[4].checked = true;
64       }
65       encDisplay(eMode);
66    }
67 }
68
69 function btnNext() {
70    var loc = '', service = '';
71    var conId = '<%ejGetOther(wanInterfaceInfo, conId)%>';
72
73    with ( document.forms[0] ) {
74       if ( enblEnetWan == 1 ) {
75          if ( ntwkPrtcl[0].checked == true ) {
76                loc = 'pppoe.cgi?ntwkPrtcl=0';
77                service = 'pppoe_' + 'eth' + '_' + vpi + '_' + conId;
78          } else {
79                loc = 'wancfg.cgi?ntwkPrtcl=6';
80                service = 'eth_' + vpi;
81          }
82       } else if ( existedProtocol == 'MER' ) {
83          // if MER is existed in this PVC and MER is editting then 
84          // allow PPPoE or MER to be added
85          if ( prtcl == 'MER' ) {
86             if ( ntwkPrtcl[1].checked == true ) {
87                loc = 'wancfg.cgi?ntwkPrtcl=2';
88                service = 'mer_' + vpi + '_' + vci;
89             } else {
90                loc = 'pppoe.cgi?ntwkPrtcl=0';
91                service = 'pppoe_' + vpi + '_' + vci + '_' + conId;
92             }
93          } else {
94          // if MER is existed in this PVC and PPPoE is editting then 
95          // only allow PPPoE or MER to be added
96             loc = 'pppoe.cgi?ntwkPrtcl=0';
97             service = 'pppoe_' + vpi + '_' + vci + '_' + conId;
98          }
99       } else if ( existedProtocol == 'PPPoE' ) {
100          // if PPPoE is existed then only allow PPPoE or MER to be added
101          if ( ntwkPrtcl[0].checked == true ) {
102             loc = 'pppoe.cgi?ntwkPrtcl=0';
103             service = 'pppoe_' + vpi + '_' + vci + '_' + conId;
104          }
105          else if ( ntwkPrtcl[1].checked == true ) {
106             loc = 'wancfg.cgi?ntwkPrtcl=2';
107             service = 'mer_' + vpi + '_' + vci;
108          }
109       } else {
110          // otherwise no restriction
111          if ( ntwkPrtcl[0].checked == true ) {
112             loc = 'pppoe.cgi?ntwkPrtcl=1';
113             service = 'pppoa_' + vpi + '_' + vci + '_' + conId;
114          }
115          else if ( ntwkPrtcl[1].checked == true ) {
116             loc = 'pppoe.cgi?ntwkPrtcl=0';
117             service = 'pppoe_' + vpi + '_' + vci + '_' + conId;
118          }
119          else if ( ntwkPrtcl[2].checked == true ) {
120             loc = 'wancfg.cgi?ntwkPrtcl=2';
121             service = 'mer_' + vpi + '_' + vci;
122          }
123          else if ( ntwkPrtcl[3].checked == true ) {
124             loc = 'ipoacfg.cgi?ntwkPrtcl=5';
125             service = 'ipoa_' + vpi + '_' + vci;
126          }
127          else {
128             loc = 'enblbridge.cgi?ntwkPrtcl=3';
129             service = 'br_' + vpi + '_' + vci;
130          }
131       }
132       loc += '&encapMode=' + encSel.options[encSel.selectedIndex].value;
133    }
134    if ( srvname == '' || qs == '1' )
135       loc += '&serviceName=' + encodeUrl(service);
136    else
137       loc += '&serviceName=' + encodeUrl(srvname);
138
139    var code = 'location.assign("' + loc + '")';
140    eval(code);
141 }
142
143 function btnBack() {
144    if (qs == 0)
145       var code = 'location.assign("' + 'pvccfg.html' + '")';
146    else
147       var code = 'location.assign("' + 'vpivci.html' + '")';
148
149    eval(code);
150 }
151
152 function encDisplay(mode)
153 {
154    with ( document.forms[0] ) {
155       if ( enblEnetWan == 2 || enblEnetWan == 0 ) {   // ethernet WAN feature is disabled
156          encSel.selectedIndex = 0;
157          if (mode == 1)
158             encSel.selectedIndex = 1;
159          // if MER or PPPoE is existed in this PVC
160          if ( existedProtocol == 'MER' || existedProtocol == 'PPPoE' ) {
161             encSel.options[0].text = "LLC/SNAP-BRIDGING";
162             encSel.options[1].text = "VC/MUX";
163          } else {
164          // otherwise no restriction
165             if ( ntwkPrtcl[0].checked == true ) {
166                encSel.options[0].text = "VC/MUX";
167                encSel.options[1].text = "LLC/ENCAPSULATION";
168             }
169             else if ( ntwkPrtcl[3].checked == true ) {
170                encSel.options[0].text = "LLC/SNAP-ROUTING";
171                encSel.options[1].text = "VC/MUX";
172             }
173             else {
174                encSel.options[0].text = "LLC/SNAP-BRIDGING";
175                encSel.options[1].text = "VC/MUX";
176             }
177          }
178       }
179    }
180 }
181
182 function prtClick() {
183    encDisplay(0);
184 }
185
186 // done hiding -->
187 </script>
188             <base target="_self">
189 </head>
190 <body onload="initMenu('idMenu'); frmLoad();">
191
192 <script type="text/javascript">
193         writeHeader("Connection Type", "<%ejGet(curUserName)%>", "<%ejGetOther(sysInfo, adslStd)%>", "<%ejGetOther(sysInfo, noBrPrtcl)%>", <%ejGetOther(sysInfo, pppIpExtension)%>, <%ejGetOther(sysInfo, enblFirewall)%>, <%ejGetOther(sysInfo, enblNat)%>, "<%ejGetWl(wlInterface)%>", <%ejGet(enblQos)%>);
194 </script>
195
196 <p>Select the type of network protocol and encapsulation mode over the ATM PVC
197    that your ISP has instructed you to use.</p>
198
199 <form>
200 <script type="text/javascript">
201 <!-- hide
202 if ( enblEnetWan == 1 )
203 {
204    document.writeln("<input type='radio' name='ntwkPrtcl' id='idPPPoE' onClick='prtClick()'> <label for='idPPPoE'>PPP over Ethernet (PPPoE)</label><br/>");
205    document.writeln("<input type='radio' name='ntwkPrtcl' id='idIPcxn' onClick='prtClick()'> <label for='idIPcxn'>IP Connection</label><br/>");
206 }
207 else if ( existedProtocol == 'MER' )
208 {
209    // if MER is existed in this PVC and MER is editing then allow PPPoE or MER to be added
210    if ( prtcl == 'MER' )
211    {
212       document.writeln("<input type='radio' name='ntwkPrtcl' id='idPPPoE' onClick='prtClick()'> <label for='idPPPoE'>PPP over Ethernet (PPPoE)</label><br/>");
213       document.writeln("<input type='radio' name='ntwkPrtcl' id='idMER' onClick='prtClick()'> <label for='idMER'>MAC Encapsulation Routing (MER)</label><br/>");
214    }
215    else // if MER is existed in this PVC and PPPoE is editting then only allow PPPoE to be added
216       document.writeln("<input type='radio' name='ntwkPrtcl' id='idPPPoE' onClick='prtClick()'> <label for='idPPPoE'>PPP over Ethernet (PPPoE)</label><br/>");
217 }
218 else if ( existedProtocol == 'PPPoE' )
219 {
220         // if PPPoE is existed in this PVC then only allow PPPoE or MER to be added
221    document.writeln("<input type='radio' name='ntwkPrtcl' id='idPPPoE' onClick='prtClick()'> <label for='idPPPoE'>PPP over Ethernet (PPPoE)</label><br/>");
222    document.writeln("<input type='radio' name='ntwkPrtcl' id='idMER' onClick='prtClick()'> <label for='idMER'>MAC Encapsulation Routing (MER)</label><br/>");
223 }
224 else    // otherwise no restriction
225 {
226    document.writeln("<input type='radio' name='ntwkPrtcl' id='idPPPoA' onClick='prtClick()'> <label for='idPPPoA'>PPP over ATM (PPPoA)</label><br/>");
227    document.writeln("<input type='radio' name='ntwkPrtcl' id='idPPPoE' onClick='prtClick()'> <label for='idPPPoE'>PPP over Ethernet (PPPoE)</label><br/>");
228    document.writeln("<input type='radio' name='ntwkPrtcl' id='idMER' onClick='prtClick()'> <label for='idMER'>MAC Encapsulation Routing (MER)</label><br/>");
229    document.writeln("<input type='radio' name='ntwkPrtcl' id='idIPoA' onClick='prtClick()'> <label for='idIPoA'>IP over ATM (IPoA)</label><br/>");
230    document.writeln("<input type='radio' name='ntwkPrtcl' id='idBridging' onClick='prtClick()'> <label for='idBridging'>Bridging</label><br/>");
231 }
232 // done hiding -->
233 </script>
234 </table>
235
236 <div id='enetWan'>
237         <p><label for="encSel">Encapsulation mode:</label>
238         <select name='encSel' id='encSel'>
239                 <option value="0">LLC/SNAP-Bridging</option>
240                 <option value="1">VC/MUX</option>
241         </select></p>
242 </div>
243
244 <p><input type='button' onClick='btnBack()' value='Back'> <input type='button' onClick='btnNext()' value='Next'></p>
245 </form>
246
247
248 <script type="text/javascript">
249         writeFooter();
250 </script>
251
252 </body>
253 </html>