Project

General

Profile

Download (33.2 KB) Statistics
| Branch: | Tag: | Revision:
1 df81417f Matthew Grooms
<?php
2
/* $Id$ */
3
/*
4
	system_advanced_misc.php
5
	part of pfSense
6
	Copyright (C) 2005-2007 Scott Ullrich
7
8
	Copyright (C) 2008 Shrew Soft Inc
9
10
	originally part of m0n0wall (http://m0n0.ch/wall)
11
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
12
	All rights reserved.
13
14
	Redistribution and use in source and binary forms, with or without
15
	modification, are permitted provided that the following conditions are met:
16
17
	1. Redistributions of source code must retain the above copyright notice,
18
	   this list of conditions and the following disclaimer.
19
20
	2. Redistributions in binary form must reproduce the above copyright
21
	   notice, this list of conditions and the following disclaimer in the
22
	   documentation and/or other materials provided with the distribution.
23
24
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
25
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
	POSSIBILITY OF SUCH DAMAGE.
34
*/
35 1d333258 Scott Ullrich
/*
36
	pfSense_MODULE:	system
37
*/
38 df81417f Matthew Grooms
39
##|+PRIV
40
##|*IDENT=page-system-advanced-misc
41
##|*NAME=System: Advanced: Miscellaneous page
42
##|*DESCR=Allow access to the 'System: Advanced: Miscellaneous' page.
43
##|*MATCH=system_advanced.php*
44
##|-PRIV
45
46
require("guiconfig.inc");
47 7a927e67 Scott Ullrich
require_once("functions.inc");
48
require_once("filter.inc");
49
require_once("shaper.inc");
50 127eb8e0 jim-p
require_once("ipsec.inc");
51 7b2fdac4 jim-p
require_once("vpn.inc");
52 6fbe0168 jim-p
require_once("vslb.inc");
53 df81417f Matthew Grooms
54 42c07003 Ermal
$pconfig['proxyurl'] = $config['system']['proxyurl'];
55
$pconfig['proxyport'] = $config['system']['proxyport'];
56
$pconfig['proxyuser'] = $config['system']['proxyuser'];
57
$pconfig['proxypass'] = $config['system']['proxypass'];
58 df81417f Matthew Grooms
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
59
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
60 45736415 jim-p
$pconfig['srctrack'] = $config['system']['srctrack'];
61 f4645d7f Ermal
$pconfig['gw_switch_default'] = isset($config['system']['gw_switch_default']);
62 df81417f Matthew Grooms
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
63 127eb8e0 jim-p
$pconfig['racoondebug_enable'] = isset($config['ipsec']['racoondebug']);
64 8744a113 jim-p
$pconfig['failoverforcereload'] = isset($config['ipsec']['failoverforcereload']);
65 6441fa9a Ermal
$pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']);
66
$pconfig['maxmss'] = $config['system']['maxmss'];
67 8e9fa41d Scott Ullrich
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
68 7530177c jim-p
$pconfig['crypto_hardware'] = $config['system']['crypto_hardware'];
69 f60156f6 jim-p
$pconfig['thermal_hardware'] = $config['system']['thermal_hardware'];
70 f204df7d Ermal Lu?i
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
71 b0cf10bf Ermal
$pconfig['kill_states'] = isset($config['system']['kill_states']);
72 a1f735b3 Renato Botelho
$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
73 e92e83d4 jim-p
$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
74
$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size'];
75
$pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size'];
76 df81417f Matthew Grooms
77 a358eec2 N0YB
$pconfig['powerd_ac_mode'] = "hadp";
78
if (!empty($config['system']['powerd_ac_mode']))
79
	$pconfig['powerd_ac_mode'] = $config['system']['powerd_ac_mode'];
80
81
$pconfig['powerd_battery_mode'] = "hadp";
82
if (!empty($config['system']['powerd_battery_mode']))
83
	$pconfig['powerd_battery_mode'] = $config['system']['powerd_battery_mode'];
84 53c210dd Cristian Feldman
85 7530177c jim-p
$crypto_modules = array('glxsb' => gettext("AMD Geode LX Security Block"),
86 43669934 Phil Davis
			'aesni' => gettext("AES-NI CPU-based Acceleration"));
87 7530177c jim-p
88 f60156f6 jim-p
$thermal_hardware_modules = array(	'coretemp' => gettext("Intel Core* CPU on-die thermal sensor"),
89
					'amdtemp' => gettext("AMD K8, K10 and K11 CPU on-die thermal sensor"));
90
91 df81417f Matthew Grooms
if ($_POST) {
92
93 4f537e93 Renato Botelho
	unset($input_errors);
94
	$pconfig = $_POST;
95 df81417f Matthew Grooms
96
	ob_flush();
97
	flush();
98
99 7530177c jim-p
	if (!empty($_POST['crypto_hardware']) && !array_key_exists($_POST['crypto_hardware'], $crypto_modules))
100
		$input_errors[] = gettext("Please select a valid Cryptographic Accelerator.");
101
102 f60156f6 jim-p
	if (!empty($_POST['thermal_hardware']) && !array_key_exists($_POST['thermal_hardware'], $thermal_hardware_modules))
103
		$input_errors[] = gettext("Please select a valid Thermal Hardware Sensor.");
104
105 efc0e29a jim-p
	if (!empty($_POST['use_mfs_tmp_size']) && (!is_numeric($_POST['use_mfs_tmp_size']) || ($_POST['use_mfs_tmp_size'] <= 40)))
106
		$input_errors[] = gettext("/tmp Size must be numeric and should not be less than 40MB.");
107 e92e83d4 jim-p
108 efc0e29a jim-p
	if (!empty($_POST['use_mfs_var_size']) && (!is_numeric($_POST['use_mfs_var_size']) || ($_POST['use_mfs_var_size'] <= 60)))
109
		$input_errors[] = gettext("/var Size must be numeric and should not be less than 60MB.");
110 e92e83d4 jim-p
111 df81417f Matthew Grooms
	if (!$input_errors) {
112
113
		if($_POST['harddiskstandby'] <> "") {
114
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
115
			system_set_harddisk_standby();
116
		} else
117
			unset($config['system']['harddiskstandby']);
118
119 42c07003 Ermal
		if($_POST['proxyurl'] <> "")
120
			$config['system']['proxyurl'] = $_POST['proxyurl'];
121
		else
122
			unset($config['system']['proxyurl']);
123
124
		if($_POST['proxyport'] <> "")
125
			$config['system']['proxyport'] = $_POST['proxyport'];
126
		else
127
			unset($config['system']['proxyport']);
128
129
		if($_POST['proxyuser'] <> "")
130
			$config['system']['proxyuser'] = $_POST['proxyuser'];
131
		else
132
			unset($config['system']['proxyuser']);
133
134
		if($_POST['proxypass'] <> "")
135
			$config['system']['proxypass'] = $_POST['proxypass'];
136
		else
137
			unset($config['system']['proxypass']);
138
139 6fbe0168 jim-p
		$need_relayd_restart = false;
140 45736415 jim-p
		if($_POST['lb_use_sticky'] == "yes") {
141 6fbe0168 jim-p
			if (!isset($config['system']['lb_use_sticky'])) {
142
				$config['system']['lb_use_sticky'] = true;
143
				$config['system']['srctrack'] = $_POST['srctrack'];
144
				$need_relayd_restart = true;
145
			}
146
		} else {
147
			if (isset($config['system']['lb_use_sticky'])) {
148
				unset($config['system']['lb_use_sticky']);
149
				$need_relayd_restart = true;
150
			}
151
		}
152 df81417f Matthew Grooms
153 f4645d7f Ermal
		if($_POST['gw_switch_default'] == "yes")
154
			$config['system']['gw_switch_default'] = true;
155
		else
156
			unset($config['system']['gw_switch_default']);
157
158 f204df7d Ermal Lu?i
		if($_POST['preferoldsa_enable'] == "yes")
159 7b2fdac4 jim-p
			$config['ipsec']['preferoldsa'] = true;
160 ae0023be jim-p
		elseif (isset($config['ipsec']['preferoldsa']))
161 7b2fdac4 jim-p
			unset($config['ipsec']['preferoldsa']);
162 f204df7d Ermal Lu?i
163 8744a113 jim-p
		if($_POST['failoverforcereload'] == "yes")
164
			$config['ipsec']['failoverforcereload'] = true;
165
		elseif (isset($config['ipsec']['failoverforcereload']))
166
			unset($config['ipsec']['failoverforcereload']);
167
168 127eb8e0 jim-p
		$need_racoon_restart = false;
169
		if($_POST['racoondebug_enable'] == "yes") {
170
			if (!isset($config['ipsec']['racoondebug'])) {
171
				$config['ipsec']['racoondebug'] = true;
172
				$need_racoon_restart = true;
173
			}
174
		} else {
175
			if (isset($config['ipsec']['racoondebug'])) {
176
				unset($config['ipsec']['racoondebug']);
177
				$need_racoon_restart = true;
178
			}
179
		}
180
181 6441fa9a Ermal
		if($_POST['maxmss_enable'] == "yes") {
182 4f537e93 Renato Botelho
			$config['system']['maxmss_enable'] = true;
183 6441fa9a Ermal
			$config['system']['maxmss'] = $_POST['maxmss'];
184 4f537e93 Renato Botelho
		} else {
185
			unset($config['system']['maxmss_enable']);
186
			unset($config['system']['maxmss']);
187 6441fa9a Ermal
		}
188
189 f204df7d Ermal Lu?i
		if($_POST['powerd_enable'] == "yes")
190 4f537e93 Renato Botelho
			$config['system']['powerd_enable'] = true;
191
		else
192
			unset($config['system']['powerd_enable']);
193 f204df7d Ermal Lu?i
194 a358eec2 N0YB
		$config['system']['powerd_ac_mode'] = $_POST['powerd_ac_mode'];
195
		$config['system']['powerd_battery_mode'] = $_POST['powerd_battery_mode'];
196 7530177c jim-p
197
		if($_POST['crypto_hardware'])
198
			$config['system']['crypto_hardware'] = $_POST['crypto_hardware'];
199
		else
200
			unset($config['system']['crypto_hardware']);
201 f204df7d Ermal Lu?i
202 f60156f6 jim-p
		if($_POST['thermal_hardware'])
203
			$config['system']['thermal_hardware'] = $_POST['thermal_hardware'];
204
		else
205
			unset($config['system']['thermal_hardware']);
206
207 f204df7d Ermal Lu?i
		if($_POST['schedule_states'] == "yes")
208 4f537e93 Renato Botelho
			$config['system']['schedule_states'] = true;
209
		else
210
			unset($config['system']['schedule_states']);
211 df81417f Matthew Grooms
212 b0cf10bf Ermal
		if($_POST['kill_states'] == "yes")
213 4f537e93 Renato Botelho
			$config['system']['kill_states'] = true;
214
		else
215
			unset($config['system']['kill_states']);
216 b0cf10bf Ermal
217 a1f735b3 Renato Botelho
		if($_POST['skip_rules_gw_down'] == "yes")
218
			$config['system']['skip_rules_gw_down'] = true;
219
		else
220
			unset($config['system']['skip_rules_gw_down']);
221
222 e92e83d4 jim-p
		if($_POST['use_mfs_tmpvar'] == "yes")
223
			$config['system']['use_mfs_tmpvar'] = true;
224
		else
225
			unset($config['system']['use_mfs_tmpvar']);
226
227
		$config['system']['use_mfs_tmp_size'] = $_POST['use_mfs_tmp_size'];
228
		$config['system']['use_mfs_var_size'] = $_POST['use_mfs_var_size'];
229
230
		if (isset($_POST['rrdbackup'])) {
231
			$config['system']['rrdbackup'] = $_POST['rrdbackup'];
232
			install_cron_job("/etc/rc.backup_rrd.sh", ($config['system']['rrdbackup'] > 0), $minute="0", "*/{$config['system']['rrdbackup']}");
233
		}
234
		if (isset($_POST['dhcpbackup'])) {
235
			$config['system']['dhcpbackup'] = $_POST['dhcpbackup'];
236
			install_cron_job("/etc/rc.backup_dhcpleases.sh", ($config['system']['dhcpbackup'] > 0), $minute="0", "*/{$config['system']['dhcpbackup']}");
237
		}
238
239 df81417f Matthew Grooms
		write_config();
240
241
		$retval = 0;
242 6c86a39f Ermal
		system_resolvconf_generate(true);
243 df81417f Matthew Grooms
		$retval = filter_configure();
244
		if(stristr($retval, "error") <> true)
245 4f537e93 Renato Botelho
			$savemsg = get_std_save_message(gettext($retval));
246 df81417f Matthew Grooms
		else
247 4f537e93 Renato Botelho
			$savemsg = gettext($retval);
248
249 8e9fa41d Scott Ullrich
		activate_powerd();
250 7530177c jim-p
		load_crypto();
251 f60156f6 jim-p
		load_thermal_hardware();
252 7b2fdac4 jim-p
		vpn_ipsec_configure_preferoldsa();
253 127eb8e0 jim-p
		if ($need_racoon_restart)
254
			vpn_ipsec_force_reload();
255 37129ab8 Pierre POMES
		if ($need_relayd_restart)
256
			relayd_configure();
257 df81417f Matthew Grooms
	}
258
}
259
260 e51ed1e9 Vinicius Coque
$pgtitle = array(gettext("System"),gettext("Advanced: Miscellaneous"));
261 df81417f Matthew Grooms
include("head.inc");
262
263
?>
264
265
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
266
<?php
267
	include("fbegin.inc");
268
	if ($input_errors)
269
		print_input_errors($input_errors);
270
	if ($savemsg)
271
		print_info_box($savemsg);
272
?>
273 481e09b3 Colin Fleming
<script type="text/javascript">
274
//<![CDATA[
275 45736415 jim-p
function sticky_checked(obj) {
276
	if (obj.checked)
277
		jQuery('#srctrack').attr('disabled',false);
278
	else
279
		jQuery('#srctrack').attr('disabled','true');
280
}
281 6441fa9a Ermal
function maxmss_checked(obj) {
282
	if (obj.checked)
283 300e2c0b Vinicius Coque
		jQuery('#maxmss').attr('disabled',false);
284 6441fa9a Ermal
	else
285 300e2c0b Vinicius Coque
		jQuery('#maxmss').attr('disabled','true');
286 6441fa9a Ermal
}
287 e92e83d4 jim-p
function tmpvar_checked(obj) {
288
	if (obj.checked) {
289
		jQuery('#use_mfs_tmp_size').attr('disabled',false);
290
		jQuery('#use_mfs_var_size').attr('disabled',false);
291
		jQuery('#rrdbackup').attr('disabled',false);
292
		jQuery('#dhcpbackup').attr('disabled',false);
293
	} else {
294
		jQuery('#use_mfs_tmp_size').attr('disabled','true');
295
		jQuery('#use_mfs_var_size').attr('disabled','true');
296
		jQuery('#rrdbackup').attr('disabled','true');
297
		jQuery('#dhcpbackup').attr('disabled','true');
298
	}
299
}
300 481e09b3 Colin Fleming
//]]>
301 6441fa9a Ermal
</script>
302 ab3c8553 Matthew Grooms
	<form action="system_advanced_misc.php" method="post" name="iform" id="iform">
303 481e09b3 Colin Fleming
		<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="system advanced misc">
304 ab3c8553 Matthew Grooms
			<tr>
305
				<td>
306
					<?php
307
						$tab_array = array();
308 e51ed1e9 Vinicius Coque
						$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
309
						$tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php");
310
						$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
311
						$tab_array[] = array(gettext("Miscellaneous"), true, "system_advanced_misc.php");
312
						$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
313
						$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
314 ab3c8553 Matthew Grooms
						display_top_tabs($tab_array);
315
					?>
316
				</td>
317
			</tr>
318
			<tr>
319 2ff19bfd Matthew Grooms
				<td id="mainarea">
320
					<div class="tabcont">
321
						<span class="vexpl">
322
							<span class="red">
323 481e09b3 Colin Fleming
								<strong><?=gettext("NOTE:"); ?>&nbsp;</strong>
324 2ff19bfd Matthew Grooms
							</span>
325 1eacdc8a Carlos Eduardo Ramos
							<?=gettext("The options on this page are intended for use by advanced users only."); ?>
326 2ff19bfd Matthew Grooms
							<br/>
327
						</span>
328
						<br/>
329 481e09b3 Colin Fleming
						<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
330 42c07003 Ermal
							<tr>
331
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Proxy support"); ?></td>
332
							</tr>
333
							<tr>
334
								<td width="22%" valign="top" class="vncell"><?=gettext("Proxy URL"); ?></td>
335
								<td width="78%" class="vtable">
336 481e09b3 Colin Fleming
									<input name="proxyurl" id="proxyurl" value="<?php if ($pconfig['proxyurl'] <> "") echo $pconfig['proxyurl']; ?>" class="formfld unknown" />
337 42c07003 Ermal
									<br />
338 d1d0a1ad Vinicius Coque
									<?php printf(gettext("Proxy url for allowing %s to use this proxy to connect outside."),$g['product']); ?>
339 42c07003 Ermal
								</td>
340
							</tr>
341
							<tr>
342
								<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Port"); ?></td>
343
								<td width="78%" class="vtable">
344 481e09b3 Colin Fleming
									<input name="proxyport" id="proxyport" value="<?php if ($pconfig['proxyport'] <> "") echo $pconfig['proxyport']; ?>" class="formfld unknown" />
345 42c07003 Ermal
									<br />
346 f65555eb jim-p
									<?php printf(gettext("Proxy port to use when %s connects to the proxy URL configured above. Default is 8080 for http protocol or 443 for ssl."),$g['product']); ?>
347 42c07003 Ermal
								</td>
348
							</tr>
349
							<tr>
350
								<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Username"); ?></td>
351
								<td width="78%" class="vtable">
352 481e09b3 Colin Fleming
									<input name="proxyuser" id="proxyuser" value="<?php if ($pconfig['proxyuser'] <> "") echo $pconfig['proxyuser']; ?>" class="formfld unknown" />
353 42c07003 Ermal
									<br />
354 d1d0a1ad Vinicius Coque
									<?php printf(gettext("Proxy username for allowing %s to use this proxy to connect outside"),$g['product']); ?>
355 42c07003 Ermal
								</td>
356
							</tr>
357
							<tr>
358 b4eec6e6 jim-p
								<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Pass"); ?></td>
359 42c07003 Ermal
								<td width="78%" class="vtable">
360 481e09b3 Colin Fleming
									<input type="password" name="proxypass" id="proxypass" value="<?php if ($pconfig['proxypass'] <> "") echo $pconfig['proxypass']; ?>" class="formfld unknown" />
361 42c07003 Ermal
									<br />
362 d1d0a1ad Vinicius Coque
									<?php printf(gettext("Proxy password for allowing %s to use this proxy to connect outside"),$g['product']); ?>
363 42c07003 Ermal
								</td>
364
							</tr>
365 ab3c8553 Matthew Grooms
							<tr>
366 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Load Balancing"); ?></td>
367 ab3c8553 Matthew Grooms
							</tr>
368
							<tr>
369 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Load Balancing"); ?></td>
370 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
371 481e09b3 Colin Fleming
									<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> onclick="sticky_checked(this)" />
372 1eacdc8a Carlos Eduardo Ramos
									<strong><?=gettext("Use sticky connections"); ?></strong><br/>
373 f0d1af93 Carlos Eduardo Ramos
									<?=gettext("Successive connections will be redirected to the servers " .
374
									"in a round-robin manner with connections from the same " .
375
									"source being sent to the same web server. This 'sticky " .
376
									"connection' will exist as long as there are states that " .
377
									"refer to this connection. Once the states expire, so will " .
378
									"the sticky connection. Further connections from that host " .
379
									"will be redirected to the next web server in the round " .
380 6fbe0168 jim-p
									"robin. Changing this option will restart the Load Balancing service."); ?>
381 45736415 jim-p
									<br />
382 481e09b3 Colin Fleming
									<input name="srctrack" id="srctrack" value="<?php if ($pconfig['srctrack'] <> "") echo $pconfig['srctrack']; else "1400"; ?>" class="formfld unknown" <?php if ($pconfig['lb_use_sticky'] == false) echo "disabled=\"disabled\""; ?> />
383 45736415 jim-p
									<br />
384
									<?=gettext("Set the source tracking timeout for sticky connections. " .
385
									"By default this is 0, so source tracking is removed as soon as the state expires. " .
386
									"Setting this timeout higher will cause the source/destination relationship to persist for longer periods of time."); ?>
387 ab3c8553 Matthew Grooms
								</td>
388
							</tr>
389 f4645d7f Ermal
							<tr>
390
								<td width="22%" valign="top" class="vncell"><?=gettext("Load Balancing"); ?></td>
391
								<td width="78%" class="vtable">
392 3781d809 Ermal
									<input name="gw_switch_default" type="checkbox" id="gw_switch_default" value="yes" <?php if ($pconfig['gw_switch_default']) echo "checked=\"checked\""; ?> />
393 f4645d7f Ermal
									<strong><?=gettext("Allow default gateway switching"); ?></strong><br/>
394
									<?=gettext("If the link where the default gateway resides fails " .
395
									"switch the default gateway to another available one."); ?>
396
								</td>
397
							</tr>
398 c912fe28 Scott Ullrich
							<tr>
399
								<td colspan="2" class="list" height="12">&nbsp;</td>
400
							</tr>
401 ab3c8553 Matthew Grooms
							<tr>
402 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Power savings"); ?></td>
403 ab3c8553 Matthew Grooms
							</tr>
404 8e9fa41d Scott Ullrich
							<tr>
405 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("PowerD"); ?></td>
406 8e9fa41d Scott Ullrich
								<td width="78%" class="vtable">
407 481e09b3 Colin Fleming
									<input name="powerd_enable" type="checkbox" id="powerd_enable" value="yes" <?php if ($pconfig['powerd_enable']) echo "checked=\"checked\""; ?> />
408 1eacdc8a Carlos Eduardo Ramos
									<strong><?=gettext("Use PowerD"); ?></strong><br/>
409 53c210dd Cristian Feldman
									<br/>
410 a358eec2 N0YB
									<?=gettext("On AC Power Mode"); ?>&nbsp;:&nbsp;
411
									<select name="powerd_ac_mode" id="powerd_ac_mode">
412 481e09b3 Colin Fleming
										<option value="hadp"<?php if($pconfig['powerd_ac_mode']=="hadp") echo " selected=\"selected\""; ?>><?=gettext("Hiadaptive");?></option>
413
										<option value="adp"<?php if($pconfig['powerd_ac_mode']=="adp") echo " selected=\"selected\""; ?>><?=gettext("Adaptive");?></option>
414
										<option value="min"<?php if($pconfig['powerd_ac_mode']=="min") echo " selected=\"selected\""; ?>><?=gettext("Minimum");?></option>
415
										<option value="max"<?php if($pconfig['powerd_ac_mode']=="max") echo " selected=\"selected\""; ?>><?=gettext("Maximum");?></option>
416 a358eec2 N0YB
									</select>
417
									&nbsp;&nbsp;
418
									<?=gettext("On Battery Power Mode"); ?>&nbsp;:&nbsp;
419
									<select name="powerd_battery_mode" id="powerd_battery_mode">
420 481e09b3 Colin Fleming
										<option value="hadp"<?php if($pconfig['powerd_battery_mode']=="hadp") echo " selected=\"selected\""; ?>><?=gettext("Hiadaptive");?></option>
421
										<option value="adp"<?php if($pconfig['powerd_battery_mode']=="adp") echo " selected=\"selected\""; ?>><?=gettext("Adaptive");?></option>
422
										<option value="min"<?php if($pconfig['powerd_battery_mode']=="min") echo " selected=\"selected\""; ?>><?=gettext("Minimum");?></option>
423
										<option value="max"<?php if($pconfig['powerd_battery_mode']=="max") echo " selected=\"selected\""; ?>><?=gettext("Maximum");?></option>
424 53c210dd Cristian Feldman
									</select>
425
									<br/><br/>
426 4f537e93 Renato Botelho
									<?=gettext("The powerd utility monitors the system state and sets various power control " .
427
									"options accordingly.  It offers four modes (maximum, minimum, adaptive " .
428
									"and hiadaptive) that can be individually selected while on AC power or batteries. " .
429
									"The modes maximum, minimum, adaptive and hiadaptive may be abbreviated max, " .
430
									"min, adp, hadp.  Maximum mode chooses the highest performance values.  Minimum " .
431
									"mode selects the lowest performance values to get the most power savings. " .
432
									"Adaptive mode attempts to strike a balance by degrading performance when " .
433
									"the system appears idle and increasing it when the system is busy.  It " .
434
									"offers a good balance between a small performance loss for greatly " .
435
									"increased power savings.  Hiadaptive mode is alike adaptive mode, but " .
436 a7b49540 Renato Botelho
									"tuned for systems where performance and interactivity are more important " .
437
									"than power consumption.  It raises frequency faster, drops slower and " .
438 4f537e93 Renato Botelho
									"keeps twice lower CPU load."); ?>
439 8e9fa41d Scott Ullrich
								</td>
440
							</tr>
441
							<tr>
442
								<td colspan="2" class="list" height="12">&nbsp;</td>
443
							</tr>
444 09f18f59 jim-p
							<tr>
445 7530177c jim-p
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Cryptographic Hardware Acceleration"); ?></td>
446 09f18f59 jim-p
							</tr>
447
							<tr>
448 7530177c jim-p
								<td width="22%" valign="top" class="vncell"><?=gettext("Cryptographic Hardware"); ?></td>
449 09f18f59 jim-p
								<td width="78%" class="vtable">
450 7530177c jim-p
									<select name="crypto_hardware" id="crypto_hardware">
451
										<option value=""><?php echo gettext("None"); ?></option>
452
										<?php foreach ($crypto_modules as $cryptomod_name => $cryptomod_descr): ?>
453 481e09b3 Colin Fleming
											<option value="<?php echo $cryptomod_name; ?>" <?php if ($pconfig['crypto_hardware'] == $cryptomod_name) echo " selected=\"selected\""; ?>><?php echo "{$cryptomod_descr} ({$cryptomod_name})"; ?></option>
454 7530177c jim-p
										<?php endforeach; ?>
455
									</select>
456 09f18f59 jim-p
									<br />
457 4f537e93 Renato Botelho
									<?=gettext("A cryptographic accelerator module will use hardware support to speed up some " .
458 7530177c jim-p
										"cryptographic functions on systems which have the chip. Do not enable this " .
459
										"option if you have a Hifn cryptographic acceleration card, as this will take " .
460
										"precedence and the Hifn card will not be used. Acceleration should be automatic " .
461
										"for IPsec when using a cipher supported by your chip, such as AES-128. OpenVPN " .
462
										"should be set for AES-128-CBC and have cryptodev enabled for hardware " .
463
										"acceleration."); ?>
464 4f537e93 Renato Botelho
									<br/><br/>
465
									<?=gettext("If you do not have a crypto chip in your system, this option will have no " .
466
									"effect. To unload the selected module, set this option to 'none' and then reboot."); ?>
467 09f18f59 jim-p
								</td>
468
							</tr>
469
							<tr>
470
								<td colspan="2" class="list" height="12">&nbsp;</td>
471
							</tr>
472 f60156f6 jim-p
							<tr>
473
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Thermal Sensors"); ?></td>
474
							</tr>
475
							<tr>
476
								<td width="22%" valign="top" class="vncell"><?=gettext("Thermal Sensors"); ?></td>
477
								<td width="78%" class="vtable">
478
								<select name="thermal_hardware" id="thermal_hardware">
479
									<option value=""><?php echo gettext("None/ACPI"); ?></option>
480
									<?php foreach ($thermal_hardware_modules as $themalmod_name => $themalmod_descr): ?>
481 481e09b3 Colin Fleming
										<option value="<?php echo $themalmod_name; ?>" <?php if ($pconfig['thermal_hardware'] == $themalmod_name) echo " selected=\"selected\""; ?>><?php echo "{$themalmod_descr} ({$themalmod_name})"; ?></option>
482 f60156f6 jim-p
									<?php endforeach; ?>
483
								</select>
484
								<br />
485 9f223740 jim-p
								<?=gettext("If you have a supported CPU, selecting a themal sensor will load the appropriate " .
486 f60156f6 jim-p
										"driver to read its temperature. Setting this to 'None' will attempt to read the " .
487
										"temperature from an ACPI-compliant motherboard sensor instead, if one is present."); ?>
488
								<br/><br/>
489
								<?=gettext("If you do not have a supported thermal sensor chip in your system, this option will have no " .
490
									"effect. To unload the selected module, set this option to 'none' and then reboot."); ?>
491
								</td>
492
							</tr>
493
							<tr>
494
								<td colspan="2" class="list" height="12">&nbsp;</td>
495
							</tr>
496 ab3c8553 Matthew Grooms
							<tr>
497 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("IP Security"); ?></td>
498 ab3c8553 Matthew Grooms
							</tr>
499
							<tr>
500 e8c8891d jim-p
								<td width="22%" valign="top" class="vncell"><?=gettext("Security Associations"); ?></td>
501 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
502 481e09b3 Colin Fleming
									<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked=\"checked\""; ?> />
503 1eacdc8a Carlos Eduardo Ramos
									<strong><?=gettext("Prefer older IPsec SAs"); ?></strong>
504 ab3c8553 Matthew Grooms
									<br />
505 f0d1af93 Carlos Eduardo Ramos
									<?=gettext("By default, if several SAs match, the newest one is " .
506
									"preferred if it's at least 30 seconds old. Select this " .
507
									"option to always prefer old SAs over new ones."); ?>
508 ab3c8553 Matthew Grooms
								</td>
509
							</tr>
510 127eb8e0 jim-p
							<tr>
511
								<td width="22%" valign="top" class="vncell"><?=gettext("IPsec Debug"); ?></td>
512
								<td width="78%" class="vtable">
513 481e09b3 Colin Fleming
									<input name="racoondebug_enable" type="checkbox" id="racoondebug_enable" value="yes" <?php if ($pconfig['racoondebug_enable']) echo "checked=\"checked\""; ?> />
514 127eb8e0 jim-p
									<strong><?=gettext("Start racoon in debug mode"); ?></strong>
515
									<br />
516
									<?=gettext("Launches racoon in debug mode so that more verbose logs " .
517
									"will be generated to aid in troubleshooting."); ?><br/>
518
									<?=gettext("NOTE: Changing this setting will restart racoon."); ?>
519
								</td>
520
							</tr>
521 8744a113 jim-p
							<tr>
522
								<td width="22%" valign="top" class="vncell"><?=gettext("IPsec Reload on Failover"); ?></td>
523
								<td width="78%" class="vtable">
524
									<input name="failoverforcereload" type="checkbox" id="failoverforcereload" value="yes" <?php if ($pconfig['failoverforcereload']) echo "checked=\"checked\""; ?> />
525
									<strong><?=gettext("Force IPsec Reload on Failover"); ?></strong>
526
									<br />
527
									<?=gettext("In some circumstances using a gateway group as the interface for " .
528
									"an IPsec tunnel does not function properly, and IPsec must be forcefully reloaded " .
529
									"when a failover occurs. Because this will disrupt all IPsec tunnels, this behavior" .
530
									" is disabled by default. Check this box to force IPsec to fully reload on failover."); ?>
531
								</td>
532
							</tr>
533 6441fa9a Ermal
							<tr>
534
								<td width="22%" valign="top" class="vncell"><?=gettext("Maximum MSS"); ?></td>
535
								<td width="78%" class="vtable">
536 481e09b3 Colin Fleming
									<input name="maxmss_enable" type="checkbox" id="maxmss_enable" value="yes" <?php if ($pconfig['maxmss_enable'] == true) echo "checked=\"checked\""; ?> onclick="maxmss_checked(this)" />
537 f7ec62f8 Chris Buechler
									<strong><?=gettext("Enable MSS clamping on VPN traffic"); ?></strong>
538 6441fa9a Ermal
									<br />
539 481e09b3 Colin Fleming
									<input name="maxmss" id="maxmss" value="<?php if ($pconfig['maxmss'] <> "") echo $pconfig['maxmss']; else "1400"; ?>" class="formfld unknown" <?php if ($pconfig['maxmss_enable'] == false) echo "disabled=\"disabled\""; ?> />
540 6441fa9a Ermal
									<br />
541 f7ec62f8 Chris Buechler
									<?=gettext("Enable MSS clamping on TCP flows over VPN. " .
542
									"This helps overcome problems with PMTUD on IPsec VPN links. If left blank, the default value is 1400 bytes. "); ?>
543 6441fa9a Ermal
								</td>
544
							</tr>
545 4f537e93 Renato Botelho
							<tr>
546
								<td colspan="2" class="list" height="12">&nbsp;</td>
547
							</tr>
548
							<tr>
549
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Schedules"); ?></td>
550
							</tr>
551
							<tr>
552
								<td width="22%" valign="top" class="vncell"><?=gettext("Schedule States"); ?></td>
553
								<td width="78%" class="vtable">
554
									<input name="schedule_states" type="checkbox" id="schedule_states" value="yes" <?php if ($pconfig['schedule_states']) echo "checked=\"checked\""; ?> />
555
									<br />
556 f65555eb jim-p
									<?=gettext("By default schedules clear the states of existing connections when the expiration time has come. ".
557
									"This option overrides that behavior by not clearing states for existing connections."); ?>
558 4f537e93 Renato Botelho
								</td>
559
							</tr>
560
							<tr>
561
								<td colspan="2" class="list" height="12">&nbsp;</td>
562
							</tr>
563
							<tr>
564
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Gateway Monitoring"); ?></td>
565
							</tr>
566
							<tr>
567 7050776a Chris Buechler
								<td width="22%" valign="top" class="vncell"><?=gettext("State Killing on Gateway Failure"); ?></td>
568 4f537e93 Renato Botelho
								<td width="78%" class="vtable">
569
									<input name="kill_states" type="checkbox" id="kill_states" value="yes" <?php if ($pconfig['kill_states']) echo "checked=\"checked\""; ?> />
570
									<br />
571 7050776a Chris Buechler
									<?=gettext("The monitoring process will flush states for a gateway that goes down if this box is not checked. Check this box to disable this behavior."); ?>
572 4f537e93 Renato Botelho
								</td>
573
							</tr>
574 a1f735b3 Renato Botelho
							<tr>
575
								<td width="22%" valign="top" class="vncell"><?=gettext("Skip rules when gateway is down"); ?></td>
576
								<td width="78%" class="vtable">
577
									<input name="skip_rules_gw_down" type="checkbox" id="skip_rules_gw_down" value="yes" <?php if ($pconfig['skip_rules_gw_down']) echo "checked=\"checked\""; ?> />
578
									<br />
579
									<?=gettext("By default, when a rule has a specific gateway set, and this gateway is down, ".
580
									"rule is created and traffic is sent to default gateway.This option overrides that behavior ".
581
									"and the rule is not created when gateway is down"); ?>
582
								</td>
583
							</tr>
584 e92e83d4 jim-p
							<tr>
585 efc0e29a jim-p
								<td colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></td>
586 e92e83d4 jim-p
							</tr>
587
							<?php if ($g['platform'] == "pfSense"): ?>
588
							<tr>
589
								<td width="22%" valign="top" class="vncell"><?=gettext("Use RAM Disks"); ?></td>
590
								<td width="78%" class="vtable">
591
									<input name="use_mfs_tmpvar" type="checkbox" id="use_mfs_tmpvar" value="yes" <?php if ($pconfig['use_mfs_tmpvar']) echo "checked=\"checked\""; ?> onclick="tmpvar_checked(this)" />
592
									<strong><?=gettext("Use memory file system for /tmp and /var"); ?></strong><br/>
593
									<?=gettext("Set this if you wish to use /tmp and /var as RAM disks (memory file system disks) on a full install " .
594
									"rather than use the hard disk. Setting this will cause the data in /tmp and /var to be lost at reboot, including log data. RRD and DHCP Leases will be retained."); ?>
595
								</td>
596
							</tr>
597
							<?php endif; ?>
598
							<tr>
599
								<td width="22%" valign="top" class="vncell"><?=gettext("/tmp RAM Disk Size"); ?></td>
600
								<td width="78%" class="vtable">
601
									<input name="use_mfs_tmp_size" id="use_mfs_tmp_size" value="<?php if ($pconfig['use_mfs_tmp_size'] <> "") echo $pconfig['use_mfs_tmp_size']; ?>" class="formfld unknown" <?php if (($g['platform'] == "pfSense") && ($pconfig['use_mfs_tmpvar'] == false)) echo "disabled=\"disabled\""; ?> /> MB
602
									<br />
603
									<?=gettext("Set the size, in MB, for the /tmp RAM disk. " .
604
									"Leave blank for 40MB. Do not set lower than 40."); ?>
605
								</td>
606
							</tr>
607
							<tr>
608
								<td width="22%" valign="top" class="vncell"><?=gettext("/var RAM Disk Size"); ?></td>
609
								<td width="78%" class="vtable">
610
									<input name="use_mfs_var_size" id="use_mfs_var_size" value="<?php if ($pconfig['use_mfs_var_size'] <> "") echo $pconfig['use_mfs_var_size']; ?>" class="formfld unknown" <?php if (($g['platform'] == "pfSense") && ($pconfig['use_mfs_tmpvar'] == false)) echo "disabled=\"disabled\""; ?> /> MB
611
									<br />
612
									<?=gettext("Set the size, in MB, for the /var RAM disk. " .
613
									"Leave blank for 60MB. Do not set lower than 60."); ?>
614
								</td>
615
							</tr>
616
							<tr>
617
								<td width="22%" valign="top" class="vncell"><?=gettext("Periodic RRD Backup");?></td>
618
								<td width="78%" class="vtable">
619
									<?=gettext("Frequency:");?>
620
									<select name="rrdbackup" id="rrdbackup" <?php if (($g['platform'] == "pfSense") && ($pconfig['use_mfs_tmpvar'] == false)) echo "disabled=\"disabled\""; ?> >
621 779c00dd Colin Fleming
										<option value='0' <?php if (!isset($config['system']['rrdbackup']) || ($config['system']['rrdbackup'] == 0)) echo "selected='selected'"; ?>><?=gettext("Disable"); ?></option>
622 e92e83d4 jim-p
									<?php for ($x=1; $x<=24; $x++) { ?>
623 779c00dd Colin Fleming
										<option value='<?= $x ?>' <?php if ($config['system']['rrdbackup'] == $x) echo "selected='selected'"; ?>><?= $x ?> <?=gettext("hour"); ?><?php if ($x>1) echo "s"; ?></option>
624 e92e83d4 jim-p
									<?php } ?>
625
									</select>
626
									<br/>
627
									<?=gettext("This will periodically backup the RRD data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.");?>
628
									<br/>
629
									<br/>
630
								</td>
631
							</tr>
632
							<tr>
633
								<td width="22%" valign="top" class="vncell"><?=gettext("Periodic DHCP Leases Backup");?></td>
634
								<td width="78%" class="vtable">
635
									<?=gettext("Frequency:");?>
636
									<select name="dhcpbackup" id="dhcpbackup" <?php if (($g['platform'] == "pfSense") && ($pconfig['use_mfs_tmpvar'] == false)) echo "disabled=\"disabled\""; ?> >
637 779c00dd Colin Fleming
										<option value='0' <?php if (!isset($config['system']['dhcpbackup']) || ($config['system']['dhcpbackup'] == 0)) echo "selected='selected'"; ?>><?=gettext("Disable"); ?></option>
638 e92e83d4 jim-p
									<?php for ($x=1; $x<=24; $x++) { ?>
639 779c00dd Colin Fleming
										<option value='<?= $x ?>' <?php if ($config['system']['dhcpbackup'] == $x) echo "selected='selected'"; ?>><?= $x ?> <?=gettext("hour"); ?><?php if ($x>1) echo "s"; ?></option>
640 e92e83d4 jim-p
									<?php } ?>
641
									</select>
642
									<br/>
643
									<?=gettext("This will periodically backup the DHCP leases data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.");?>
644
									<br/>
645
									<br/>
646
								</td>
647
							</tr>
648 ab3c8553 Matthew Grooms
							<tr>
649
								<td colspan="2" class="list" height="12">&nbsp;</td>
650
							</tr>
651
							<?php if($g['platform'] == "pfSenseDISABLED"): ?>
652
							<tr>
653 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Hardware Settings"); ?></td>
654 ab3c8553 Matthew Grooms
							</tr>
655
							<tr>
656 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Hard disk standby time "); ?></td>
657 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
658
									<select name="harddiskstandby" class="formselect">
659
										<?php
660 4f537e93 Renato Botelho
											## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
661 ab3c8553 Matthew Grooms
											$sbvals = explode(" ", "0.5,6 1,12 2,24 3,36 4,48 5,60 7.5,90 10,120 15,180 20,240 30,241 60,242");
662
										?>
663 481e09b3 Colin Fleming
										<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected="selected"');?>><?=gettext("Always on"); ?></option>
664 ab3c8553 Matthew Grooms
										<?php
665
											foreach ($sbvals as $sbval):
666
												list($min,$val) = explode(",", $sbval);
667
										?>
668 481e09b3 Colin Fleming
										<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected="selected"');?>><?=$min;?> <?=gettext("minutes"); ?></option>
669 ab3c8553 Matthew Grooms
										<?php endforeach; ?>
670
									</select>
671
									<br/>
672 4d473c89 Vinicius Coque
									<?=gettext("Puts the hard disk into standby mode when the selected amount of time after the last ".
673
									"access has elapsed."); ?> <em><?=gettext("Do not set this for CF cards."); ?></em>
674 ab3c8553 Matthew Grooms
								</td>
675
							</tr>
676
							<tr>
677
								<td colspan="2" class="list" height="12">&nbsp;</td>
678
							</tr>
679
							<?php endif; ?>
680
681
							<tr>
682
								<td width="22%" valign="top">&nbsp;</td>
683
								<td width="78%">
684 267c28ab Vinicius Coque
									<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
685 ab3c8553 Matthew Grooms
								</td>
686
							</tr>
687
						</table>
688
					</div>
689
				</td>
690
			</tr>
691
		</table>
692
	</form>
693 df81417f Matthew Grooms
694
<?php include("fend.inc"); ?>
695
</body>
696
</html>