Udpxy v1.0-Chipmunk-build21
[tomato.git] / release / src / router / www / advanced-firewall.asp
blob42c0e4620537834935488f046166dd52d1f4b387
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 Tomato VLAN GUI
8 Copyright (C) 2011 Augusto Bott
9 http://code.google.com/p/tomato-sdhc-vlan/
11 For use with Tomato Firmware only.
12 No part of this file may be used without permission.
13 -->
14 <html>
15 <head>
16 <meta http-equiv='content-type' content='text/html;charset=utf-8'>
17 <meta name='robots' content='noindex,nofollow'>
18 <title>[<% ident(); %>] Advanced: Firewall</title>
19 <link rel='stylesheet' type='text/css' href='tomato.css'>
20 <% css(); %>
21 <script type='text/javascript' src='tomato.js'></script>
23 <!-- / / / -->
25 <script type='text/javascript' src='debug.js'></script>
27 <script type='text/javascript'>
29 // <% nvram("block_wan,nf_loopback,ne_syncookies,multicast_pass,multicast_lan,multicast_lan1,multicast_lan2,multicast_lan3,lan_ifname,lan1_ifname,lan2_ifname,lan3_ifname,udpxy_enable,udpxy_stats,udpxy_clients,udpxy_port"); %>
31 function verifyFields(focused, quiet)
33 /* VLAN-BEGIN */
34 var enable_mcast = E('_f_multicast').checked;
35 E('_f_multicast_lan').disabled = ((!enable_mcast) || (nvram.lan_ifname.length < 1));
36 E('_f_multicast_lan1').disabled = ((!enable_mcast) || (nvram.lan1_ifname.length < 1));
37 E('_f_multicast_lan2').disabled = ((!enable_mcast) || (nvram.lan2_ifname.length < 1));
38 E('_f_multicast_lan3').disabled = ((!enable_mcast) || (nvram.lan3_ifname.length < 1));
39 if(nvram.lan_ifname.length < 1)
40 E('_f_multicast_lan').checked = false;
41 if(nvram.lan1_ifname.length < 1)
42 E('_f_multicast_lan1').checked = false;
43 if(nvram.lan2_ifname.length < 1)
44 E('_f_multicast_lan2').checked = false;
45 if(nvram.lan3_ifname.length < 1)
46 E('_f_multicast_lan3').checked = false;
47 /* VLAN-END */
48 E('_f_udpxy_stats').disabled = !E('_f_udpxy_enable').checked;
49 E('_f_udpxy_clients').disabled = !E('_f_udpxy_enable').checked;
50 E('_f_udpxy_port').disabled = !E('_f_udpxy_enable').checked;
51 return 1;
54 function save()
56 var fom;
58 if (!verifyFields(null, 0)) return;
60 fom = E('_fom');
61 fom.block_wan.value = E('_f_icmp').checked ? 0 : 1;
62 fom.ne_syncookies.value = E('_f_syncookies').checked ? 1 : 0;
63 fom.multicast_pass.value = E('_f_multicast').checked ? 1 : 0;
64 /* VLAN-BEGIN */
65 fom.multicast_lan.value = E('_f_multicast_lan').checked ? 1 : 0;
66 fom.multicast_lan1.value = E('_f_multicast_lan1').checked ? 1 : 0;
67 fom.multicast_lan2.value = E('_f_multicast_lan2').checked ? 1 : 0;
68 fom.multicast_lan3.value = E('_f_multicast_lan3').checked ? 1 : 0;
69 /* VLAN-END */
70 fom.udpxy_enable.value = E('_f_udpxy_enable').checked ? 1 : 0;
71 fom.udpxy_stats.value = E('_f_udpxy_stats').checked ? 1 : 0;
72 fom.udpxy_clients.value = E('_f_udpxy_clients').value;
73 fom.udpxy_port.value = E('_f_udpxy_port').value;
74 form.submit(fom, 1);
76 </script>
78 </head>
79 <body>
80 <form id='_fom' method='post' action='tomato.cgi'>
81 <table id='container' cellspacing=0>
82 <tr><td colspan=2 id='header'>
83 <div class='title'>Tomato</div>
84 <div class='version'>Version <% version(); %></div>
85 </td></tr>
86 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
87 <td id='content'>
88 <div id='ident'><% ident(); %></div>
90 <!-- / / / -->
92 <input type='hidden' name='_nextpage' value='advanced-firewall.asp'>
93 <input type='hidden' name='_service' value='firewall-restart'>
95 <input type='hidden' name='block_wan'>
96 <input type='hidden' name='ne_syncookies'>
97 <input type='hidden' name='multicast_pass'>
98 /* VLAN-BEGIN */
99 <input type='hidden' name='multicast_lan'>
100 <input type='hidden' name='multicast_lan1'>
101 <input type='hidden' name='multicast_lan2'>
102 <input type='hidden' name='multicast_lan3'>
103 /* VLAN-END */
104 <input type='hidden' name='udpxy_enable'>
105 <input type='hidden' name='udpxy_stats'>
106 <input type='hidden' name='udpxy_clients'>
107 <input type='hidden' name='udpxy_port'>
109 <div class='section-title'>Firewall</div>
110 <div class='section'>
111 <script type='text/javascript'>
112 createFieldTable('', [
113 { title: 'Respond to ICMP ping', name: 'f_icmp', type: 'checkbox', value: nvram.block_wan == '0' },
114 { title: 'NAT loopback', name: 'nf_loopback', type: 'select', options: [[0,'All'],[1,'Forwarded Only'],[2,'Disabled']], value: fixInt(nvram.nf_loopback, 0, 2, 1) },
115 { title: 'Enable SYN cookies', name: 'f_syncookies', type: 'checkbox', value: nvram.ne_syncookies != '0' },
116 { title: 'Allow multicast', name: 'f_multicast', type: 'checkbox', suffix: ' <i><small>(Igmpproxy)</small></i>', value: nvram.multicast_pass == '1' },
117 /* VLAN-BEGIN */
118 { title: 'LAN', indent: 2, name: 'f_multicast_lan', type: 'checkbox', value: (nvram.multicast_lan == '1') },
119 { title: 'LAN1', indent: 2, name: 'f_multicast_lan1', type: 'checkbox', value: (nvram.multicast_lan1 == '1') },
120 { title: 'LAN2', indent: 2, name: 'f_multicast_lan2', type: 'checkbox', value: (nvram.multicast_lan2 == '1') },
121 { title: 'LAN3', indent: 2, name: 'f_multicast_lan3', type: 'checkbox', value: (nvram.multicast_lan3 == '1') },
122 /* VLAN-END */
123 { title: 'Enable Udpxy', name: 'f_udpxy_enable', type: 'checkbox', value: (nvram.udpxy_enable == '1') },
124 { title: 'Enable client statistics', indent: 2, name: 'f_udpxy_stats', type: 'checkbox', value: (nvram.udpxy_stats == '1') },
125 { title: 'Max clients', indent: 2, name: 'f_udpxy_clients', type: 'text', maxlen: 4, size: 6, value: fixInt(nvram.udpxy_clients || 3, 1, 5000, 3) },
126 { title: 'Udpxy port', indent: 2, name: 'f_udpxy_port', type: 'text', maxlen: 5, size: 7, value: fixPort(nvram.udpxy_port, 4022) },
128 </script>
129 </div>
131 <!-- / / / -->
133 </td></tr>
134 <tr><td id='footer' colspan=2>
135 <span id='footer-msg'></span>
136 <input type='button' value='Save' id='save-button' onclick='save()'>
137 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'>
138 </td></tr>
139 </table>
140 </form>
141 <script type='text/javascript'>verifyFields(null, 1);</script>
142 </body>
143 </html>