RSA Keylength to 1024
[tomato.git] / release / src / router / www / advanced-routing.asp
blob15017cae00fcf12e4427a88dcef62c9afd7918c7
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 For use with Tomato Firmware only.
8 No part of this file may be used without permission.
9 -->
10 <html>
11 <head>
12 <meta http-equiv='content-type' content='text/html;charset=utf-8'>
13 <meta name='robots' content='noindex,nofollow'>
14 <title>[<% ident(); %>] Advanced: Routing</title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'>
16 <% css(); %>
17 <script type='text/javascript' src='tomato.js'></script>
19 <!-- / / / -->
20 <style type='text/css'>
21 #ara-grid .co1, #ara-grid .co2, #ara-grid .co3 {
22 width: 20%;
24 #ara-grid .co4 {
25 width: 6%;
27 #ara-grid .co5 {
28 width: 34%;
31 #ars-grid .co1, #ars-grid .co2, #ars-grid .co3 {
32 width: 20%;
34 #ars-grid .co4 {
35 width: 6%;
37 #ars-grid .co5 {
38 width: 10%;
40 #ars-grid .co6 {
41 width: 24%;
43 </style>
45 <script type='text/javascript' src='debug.js'></script>
47 <script type='text/javascript'>
48 // <% nvram("wk_mode,dr_setting,lan_stp,routes_static,dhcp_routes,lan_ifname,lan1_ifname,lan2_ifname,lan3_ifname,wan_ifname,wan_iface,emf_enable,dr_lan_rx,dr_lan1_rx,dr_lan2_rx,dr_lan3_rx,dr_wan_rx,wan_proto"); %>
49 // <% activeroutes(); %>
51 var ara = new TomatoGrid();
53 ara.setup = function() {
54 var i, a;
56 this.init('ara-grid', 'sort');
57 this.headerSet(['Destination', 'Gateway / Next Hop', 'Subnet Mask', 'Metric', 'Interface']);
58 for (i = 0; i < activeroutes.length; ++i) {
59 a = activeroutes[i];
60 if (a[0] == nvram.lan_ifname) a[0] += ' (LAN)';
61 else if (a[0] == nvram.lan1_ifname) a[0] += ' (LAN1)';
62 else if (a[0] == nvram.lan2_ifname) a[0] += ' (LAN2)';
63 else if (a[0] == nvram.lan3_ifname) a[0] += ' (LAN3)';
64 else if (a[0] == nvram.wan_iface) a[0] += ' (WAN)';
65 else if (a[0] == nvram.wan_ifname) a[0] += ' (MAN)';
66 this.insertData(-1, [a[1],a[2],a[3],a[4],a[0]]);
70 var ars = new TomatoGrid();
72 ars.verifyFields = function(row, quiet) {
73 var f = fields.getAll(row);
74 f[5].value = f[5].value.replace('>', '_');
75 return v_ip(f[0], quiet) && v_ip(f[1], quiet) && v_netmask(f[2], quiet) && v_range(f[3], quiet, 0, 10) && v_nodelim(f[5], quiet, 'Description');
78 ars.setup = function() {
79 this.init('ars-grid', '', 20, [
80 { type: 'text', maxlen: 15 }, { type: 'text', maxlen: 15 }, { type: 'text', maxlen: 15 },
82 /* VLAN-BEGIN */
83 { type: 'text', maxlen: 3 }, { type: 'select', options: [['LAN','LAN'],['LAN1','LAN1'],['LAN2','LAN2'],['LAN3','LAN3'],['WAN','WAN'],['MAN','MAN']] }, { type: 'text', maxlen: 32 }]);
84 /* VLAN-END */
85 /* NOVLAN-BEGIN */
86 { type: 'text', maxlen: 3 }, { type: 'select', options: [['LAN','LAN'],['WAN','WAN'],['MAN','MAN']] }, { type: 'text', maxlen: 32 }]);
87 /* NOVLAN-END */
89 this.headerSet(['Destination', 'Gateway', 'Subnet Mask', 'Metric', 'Interface', 'Description']);
90 var routes = nvram.routes_static.split('>');
91 for (var i = 0; i < routes.length; ++i) {
92 var r;
93 if (r = routes[i].match(/^(.+)<(.+)<(.+)<(\d+)<(LAN|LAN1|LAN2|LAN3|WAN|MAN)<(.*)$/)) {
94 this.insertData(-1, [r[1], r[2], r[3], r[4], r[5],r[6]]);
97 this.showNewEditor();
98 this.resetNewEditor();
101 ars.resetNewEditor = function() {
102 var i, e;
104 e = fields.getAll(this.newEditor);
106 /* VLAN-BEGIN */
107 if(nvram.lan_ifname.length < 1)
108 e[4].options[0].disabled=true;
109 else
110 e[4].options[0].disabled=false;
111 if(nvram.lan1_ifname.length < 1)
112 e[4].options[1].disabled=true;
113 else
114 e[4].options[1].disabled=false;
115 if(nvram.lan2_ifname.length < 1)
116 e[4].options[2].disabled=true;
117 else
118 e[4].options[2].disabled=false;
119 if(nvram.lan3_ifname.length < 1)
120 e[4].options[3].disabled=true;
121 else
122 e[4].options[3].disabled=false;
123 /* VLAN-END */
125 ferror.clearAll(e);
126 for (i = 0; i < e.length; ++i) {
127 var f = e[i];
128 if (f.selectedIndex) f.selectedIndex = 0;
129 else f.value = '';
131 try { if (e.length) e[0].focus(); } catch (er) { }
134 function verifyFields(focused, quiet)
136 /* VLAN-BEGIN */
137 E('_f_dr_lan').disabled = (nvram.lan_ifname.length < 1);
138 if (E('_f_dr_lan').disabled)
139 E('_f_dr_lan').checked = false;
140 E('_f_dr_lan1').disabled = (nvram.lan1_ifname.length < 1);
141 if (E('_f_dr_lan1').disabled)
142 E('_f_dr_lan1').checked = false;
143 E('_f_dr_lan2').disabled = (nvram.lan2_ifname.length < 1);
144 if (E('_f_dr_lan2').disabled)
145 E('_f_dr_lan2').checked = false;
146 E('_f_dr_lan3').disabled = (nvram.lan3_ifname.length < 1);
147 if (E('_f_dr_lan3').disabled)
148 E('_f_dr_lan3').checked = false;
149 E('_f_dr_wan').disabled = (nvram.wan_proto.length == 'disabled');
150 if (E('_f_dr_wan').disabled)
151 E('_f_dr_wan').checked = false;
152 /* VLAN-END */
153 return 1;
156 function save()
158 if (ars.isEditing()) return;
160 var fom = E('_fom');
161 var data = ars.getAllData();
162 var r = [];
163 for (var i = 0; i < data.length; ++i) r.push(data[i].join('<'));
164 fom.routes_static.value = r.join('>');
166 /* ZEBRA-BEGIN */
168 /* NOVLAN-BEGIN */
169 var wan = '0';
170 var lan = '0';
172 switch (E('_dr_setting').value) {
173 case '1':
174 lan = '1 2';
175 break;
176 case '2':
177 wan = '1 2';
178 break;
179 case '3':
180 lan = '1 2';
181 wan = '1 2';
182 break;
184 fom.dr_lan_tx.value = fom.dr_lan_rx.value = lan;
185 fom.dr_wan_tx.value = fom.dr_wan_rx.value = wan;
186 /* NOVLAN-END */
188 /* VLAN-BEGIN */
189 fom.dr_lan_tx.value = fom.dr_lan_rx.value = (E('_f_dr_lan').checked) ? '1 2' : '0';
190 fom.dr_lan1_tx.value = fom.dr_lan1_rx.value = (E('_f_dr_lan1').checked) ? '1 2' : '0';
191 fom.dr_lan2_tx.value = fom.dr_lan2_rx.value = (E('_f_dr_lan2').checked) ? '1 2' : '0';
192 fom.dr_lan3_tx.value = fom.dr_lan3_rx.value = (E('_f_dr_lan3').checked) ? '1 2' : '0';
193 fom.dr_wan_tx.value = fom.dr_wan_rx.value = (E('_f_dr_wan').checked) ? '1 2' : '0';
194 /* ZEBRA-END */
196 /* VLAN-END */
198 /* ZEBRA-END */
200 /* NOVLAN-BEGIN */
201 fom.lan_stp.value = E('_f_stp').checked ? 1 : 0;
202 /* NOVLAN-END */
204 fom.dhcp_routes.value = E('_f_dhcp_routes').checked ? '1' : '0';
205 fom._service.value = (fom.dhcp_routes.value != nvram.dhcp_routes) ? 'wan-restart' : 'routing-restart';
207 /* EMF-BEGIN */
208 fom.emf_enable.value = E('_f_emf').checked ? 1 : 0;
209 if (fom.emf_enable.value != nvram.emf_enable) fom._service.value = '*';
210 /* EMF-END */
212 form.submit(fom, 1);
215 function submit_complete()
217 reloadPage();
220 function earlyInit()
222 ara.setup();
223 ars.setup();
226 function init()
228 ara.recolor();
229 ars.recolor();
231 </script>
232 </head>
233 <body onload='init()'>
234 <form id='_fom' method='post' action='tomato.cgi'>
235 <table id='container' cellspacing=0>
236 <tr><td colspan=2 id='header'>
237 <div class='title'>Tomato</div>
238 <div class='version'>Version <% version(); %></div>
239 </td></tr>
240 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
241 <td id='content'>
242 <div id='ident'><% ident(); %></div>
244 <!-- / / / -->
246 <input type='hidden' name='_nextpage' value='advanced-routing.asp'>
247 <input type='hidden' name='_service' value='routing-restart'>
249 <input type='hidden' name='routes_static'>
250 <input type='hidden' name='dhcp_routes'>
251 <input type='hidden' name='emf_enable'>
252 <!-- NOVLAN-BEGIN -->
253 <input type='hidden' name='lan_stp'>
254 <!-- NOVLAN-END -->
255 <input type='hidden' name='dr_lan_tx'>
256 <input type='hidden' name='dr_lan_rx'>
257 <!-- VLAN-BEGIN -->
258 <input type='hidden' name='dr_lan1_tx'>
259 <input type='hidden' name='dr_lan1_rx'>
260 <input type='hidden' name='dr_lan2_tx'>
261 <input type='hidden' name='dr_lan2_rx'>
262 <input type='hidden' name='dr_lan3_tx'>
263 <input type='hidden' name='dr_lan3_rx'>
264 <!-- VLAN-END -->
265 <input type='hidden' name='dr_wan_tx'>
266 <input type='hidden' name='dr_wan_rx'>
268 <div class='section-title'>Current Routing Table</div>
269 <div class='section'>
270 <table class='tomato-grid' id='ara-grid'></table>
271 </div>
273 <div class='section-title'>Static Routing Table</div>
274 <div class='section'>
275 <table class='tomato-grid' id='ars-grid'></table>
276 </div>
278 <div class='section-title'>Miscellaneous</div>
279 <div class='section'>
280 <script type='text/javascript'>
281 createFieldTable('', [
282 { title: 'Mode', name: 'wk_mode', type: 'select', options: [['gateway','Gateway'],['router','Router']], value: nvram.wk_mode },
283 /* ZEBRA-BEGIN */
284 /* VLAN-BEGIN */
285 { title: 'RIPv1 &amp; v2' },
286 { title: 'LAN', indent: 2, name: 'f_dr_lan', type: 'checkbox', value: ((nvram.dr_lan_rx != '0') && (nvram.dr_lan_rx != '')) },
287 { title: 'LAN1', indent: 2, name: 'f_dr_lan1', type: 'checkbox', value: ((nvram.dr_lan1_rx != '0') && (nvram.dr_lan1_rx != '')) },
288 { title: 'LAN2', indent: 2, name: 'f_dr_lan2', type: 'checkbox', value: ((nvram.dr_lan2_rx != '0') && (nvram.dr_lan2_rx != '')) },
289 { title: 'LAN3', indent: 2, name: 'f_dr_lan3', type: 'checkbox', value: ((nvram.dr_lan3_rx != '0') && (nvram.dr_lan3_rx != '')) },
290 { title: 'WAN', indent: 2, name: 'f_dr_wan', type: 'checkbox', value: ((nvram.dr_wan_rx != '0') && (nvram.dr_wan_rx != '')) },
291 /* VLAN-END */
292 /* NOVLAN-BEGIN */
293 { title: 'RIPv1 &amp; v2', name: 'dr_setting', type: 'select', options: [[0,'Disabled'],[1,'LAN'],[2,'WAN'],[3,'Both']], value: nvram.dr_setting },
294 /* NOVLAN-END */
295 /* ZEBRA-END */
296 /* EMF-BEGIN */
297 { title: 'Efficient Multicast Forwarding', name: 'f_emf', type: 'checkbox', value: nvram.emf_enable != '0' },
298 /* EMF-END */
299 { title: 'DHCP Routes', name: 'f_dhcp_routes', type: 'checkbox', value: nvram.dhcp_routes != '0' },
300 // { title: 'Spanning-Tree Protocol', name: 'f_stp', type: 'checkbox', value: nvram.lan_stp != '0' }
301 /* NOVLAN-BEGIN */
302 { title: 'Spanning-Tree Protocol', name: 'f_stp', type: 'checkbox', value: nvram.lan_stp != '0' }
303 /* NOVLAN-END */
305 </script>
306 </div>
309 <!-- / / / -->
311 </td></tr>
312 <tr><td id='footer' colspan=2>
313 <span id='footer-msg'></span>
314 <input type='button' value='Save' id='save-button' onclick='save()'>
315 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'>
316 </td></tr>
317 </table>
318 </form>
319 <script type='text/javascript'>earlyInit(); verifyFields(null, 1);</script>
320 </body>
321 </html>