http://downloads.netgear.com/files/GPL/DM111PSP_v3.61d_GPL.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / routeadd.html
1 <html>
2    <head>
3       <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
4       <link rel="stylesheet" href='stylemain.css' type='text/css'>
5          <link rel="stylesheet" href='colors.css' type='text/css'>
6             <script language="javascript" src="util.js"></script>
7             <script language="javascript">
8 <!-- hide
9
10 function btnClear() {
11    with ( document.forms[0] ) {
12       dstAddr.value = '';
13       dstMask.value = '';
14       dstGtwy.value = '';
15    }
16 }
17
18 function btnApply() {
19    var loc = 'rtroutecfg.cmd?action=add';
20    with ( document.forms[0] ) {
21       if ( isValidIpAddress(dstAddr.value) == false ) {
22          alert('Destination "' + dstAddr.value + '" has invalid IP address.');
23          return;
24       }
25       if ( isValidIpAddress(dstMask.value) == false &&  dstMask.value != '255.255.255.255') {
26          alert('Subnet mask "' + dstMask.value + '" has invalid IP address.');
27          return;
28       }
29       loc += '&dstAddr=' + dstAddr.value;
30       loc += '&dstMask=' + dstMask.value;
31       if (gwStr.checked == false && ifStr.checked == false) {
32          alert('Need to select "Use Gateway IP Address" and/or "Use Interface".');
33          return;
34       }
35       if (gwStr.checked == true) {         
36          if ( isValidIpAddress(dstGtwy.value) == false ) {
37             alert('Default gateway "' + dstGtwy.value + '" has invalid IP address.');
38             return;
39          }
40          loc += '&dstGtwy=' + dstGtwy.value;
41       } else
42          loc += '&dstGtwy=' + '0.0.0.0';
43       if (ifStr.checked == true) {
44          var idx = dstWanIf.selectedIndex;
45          var ifc = dstWanIf.options[idx].value;
46          // if chosen interface is MER but does not specify static IP address then display error
47          if ( ifc.indexOf('nas_') != -1 && gwStr.checked == false ) {
48             alert('Gateway IP address should be specified since MER interface is selected.');
49             return;
50          }
51          loc += '&dstWanIf=' + ifc;
52       }
53       else
54          loc += '&dstWanIf=' + '';
55    }
56    var code = 'location="' + loc + '"';
57    eval(code);
58 }
59
60 // done hiding -->
61 </script>
62    </head>
63    <body>
64       <blockquote>
65          <form>
66             <b>Routing -- Static Route Add</b><br>
67             <br>
68             Enter the destination network address, subnet mask, gateway AND/OR available 
69             WAN interface then click "Save/Apply" to add the entry to the routing table.<br>
70             <br>
71             <br>
72             <table border="0" cellpadding="0" cellspacing="0">
73                <tr>
74                   <td width="180">Destination Network Address:</td>
75                   <td><input type='text' name='dstAddr'></td>
76                </tr>
77                <tr>
78                   <td>Subnet Mask:</td>
79                   <td><input type='text' name='dstMask'></td>
80                </tr>
81             </table>
82             <br>
83             <table>
84                <tr>
85                   <td><input type="checkbox" name='gwStr'>&nbsp;Use Gateway IP Address&nbsp;&nbsp;</td>
86                   <td><input type='text' name='dstGtwy'></td>
87                </tr>
88                <tr>
89                   <td><input type="checkbox" name='ifStr' checked>&nbsp;Use Interface</td>
90                   <td><select name='dstWanIf'>
91 <script language="javascript">
92 <!-- hide
93 {
94    var i = 0;
95    var interfaceInfo = '<%ejGetOther(wanInterfaceInfo, route)%>';
96    var interfaces = interfaceInfo.split('|');
97
98    for ( i = 0; i < interfaces.length; i++ ) {
99       var names = interfaces[i].split('/');
100       document.write("  <option value='" + names[1] + "'>");
101       document.writeln(interfaces[i]);
102    } 
103    document.writeln("  <option value='br0'> LAN/br0");
104 }
105 // done hiding -->
106 </script>
107                      </select></td>
108                </tr>
109             </table>
110             <br>
111             <center>
112                <input type='button' onClick='btnApply()' value='Save/Apply'>
113             </center>
114          </form>
115       </blockquote>
116    </body>
117 </html>