Project

General

Profile

Download (32.2 KB) Statistics
| Branch: | Tag: | Revision:
1
<?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
/*
36
	pfSense_MODULE:	system
37
*/
38

    
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
require_once("functions.inc");
48
require_once("filter.inc");
49
require_once("shaper.inc");
50
require_once("ipsec.inc");
51
require_once("vpn.inc");
52
require_once("vslb.inc");
53

    
54
$pconfig['proxyurl'] = $config['system']['proxyurl'];
55
$pconfig['proxyport'] = $config['system']['proxyport'];
56
$pconfig['proxyuser'] = $config['system']['proxyuser'];
57
$pconfig['proxypass'] = $config['system']['proxypass'];
58
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
59
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
60
$pconfig['srctrack'] = $config['system']['srctrack'];
61
$pconfig['gw_switch_default'] = isset($config['system']['gw_switch_default']);
62
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
63
$pconfig['racoondebug_enable'] = isset($config['ipsec']['racoondebug']);
64
$pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']);
65
$pconfig['maxmss'] = $config['system']['maxmss'];
66
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
67
$pconfig['crypto_hardware'] = $config['system']['crypto_hardware'];
68
$pconfig['thermal_hardware'] = $config['system']['thermal_hardware'];
69
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
70
$pconfig['kill_states'] = isset($config['system']['kill_states']);
71
$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
72
$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
73
$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size'];
74
$pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size'];
75

    
76
$pconfig['powerd_ac_mode'] = "hadp";
77
if (!empty($config['system']['powerd_ac_mode']))
78
	$pconfig['powerd_ac_mode'] = $config['system']['powerd_ac_mode'];
79

    
80
$pconfig['powerd_battery_mode'] = "hadp";
81
if (!empty($config['system']['powerd_battery_mode']))
82
	$pconfig['powerd_battery_mode'] = $config['system']['powerd_battery_mode'];
83

    
84
$crypto_modules = array('glxsb' => gettext("AMD Geode LX Security Block"),
85
			'aesni' => gettext("AES-NI CPU-based Acceleration"));
86

    
87
$thermal_hardware_modules = array(	'coretemp' => gettext("Intel Core* CPU on-die thermal sensor"),
88
					'amdtemp' => gettext("AMD K8, K10 and K11 CPU on-die thermal sensor"));
89

    
90
if ($_POST) {
91

    
92
	unset($input_errors);
93
	$pconfig = $_POST;
94

    
95
	ob_flush();
96
	flush();
97

    
98
	if (!empty($_POST['crypto_hardware']) && !array_key_exists($_POST['crypto_hardware'], $crypto_modules))
99
		$input_errors[] = gettext("Please select a valid Cryptographic Accelerator.");
100

    
101
	if (!empty($_POST['thermal_hardware']) && !array_key_exists($_POST['thermal_hardware'], $thermal_hardware_modules))
102
		$input_errors[] = gettext("Please select a valid Thermal Hardware Sensor.");
103

    
104
	if (!empty($_POST['use_mfs_tmp_size']) && (!is_numeric($_POST['use_mfs_tmp_size']) || ($_POST['use_mfs_tmp_size'] <= 40)))
105
		$input_errors[] = gettext("/tmp Size must be numeric and should not be less than 40MB.");
106

    
107
	if (!empty($_POST['use_mfs_var_size']) && (!is_numeric($_POST['use_mfs_var_size']) || ($_POST['use_mfs_var_size'] <= 60)))
108
		$input_errors[] = gettext("/var Size must be numeric and should not be less than 60MB.");
109

    
110
	if (!$input_errors) {
111

    
112
		if($_POST['harddiskstandby'] <> "") {
113
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
114
			system_set_harddisk_standby();
115
		} else
116
			unset($config['system']['harddiskstandby']);
117

    
118
		if($_POST['proxyurl'] <> "")
119
			$config['system']['proxyurl'] = $_POST['proxyurl'];
120
		else
121
			unset($config['system']['proxyurl']);
122

    
123
		if($_POST['proxyport'] <> "")
124
			$config['system']['proxyport'] = $_POST['proxyport'];
125
		else
126
			unset($config['system']['proxyport']);
127

    
128
		if($_POST['proxyuser'] <> "")
129
			$config['system']['proxyuser'] = $_POST['proxyuser'];
130
		else
131
			unset($config['system']['proxyuser']);
132

    
133
		if($_POST['proxypass'] <> "")
134
			$config['system']['proxypass'] = $_POST['proxypass'];
135
		else
136
			unset($config['system']['proxypass']);
137

    
138
		$need_relayd_restart = false;
139
		if($_POST['lb_use_sticky'] == "yes") {
140
			if (!isset($config['system']['lb_use_sticky'])) {
141
				$config['system']['lb_use_sticky'] = true;
142
				$config['system']['srctrack'] = $_POST['srctrack'];
143
				$need_relayd_restart = true;
144
			}
145
		} else {
146
			if (isset($config['system']['lb_use_sticky'])) {
147
				unset($config['system']['lb_use_sticky']);
148
				$need_relayd_restart = true;
149
			}
150
		}
151

    
152
		if($_POST['gw_switch_default'] == "yes")
153
			$config['system']['gw_switch_default'] = true;
154
		else
155
			unset($config['system']['gw_switch_default']);
156

    
157
		if($_POST['preferoldsa_enable'] == "yes")
158
			$config['ipsec']['preferoldsa'] = true;
159
		elseif (isset($config['ipsec']['preferoldsa']))
160
			unset($config['ipsec']['preferoldsa']);
161

    
162
		$need_racoon_restart = false;
163
		if($_POST['racoondebug_enable'] == "yes") {
164
			if (!isset($config['ipsec']['racoondebug'])) {
165
				$config['ipsec']['racoondebug'] = true;
166
				$need_racoon_restart = true;
167
			}
168
		} else {
169
			if (isset($config['ipsec']['racoondebug'])) {
170
				unset($config['ipsec']['racoondebug']);
171
				$need_racoon_restart = true;
172
			}
173
		}
174

    
175
		if($_POST['maxmss_enable'] == "yes") {
176
			$config['system']['maxmss_enable'] = true;
177
			$config['system']['maxmss'] = $_POST['maxmss'];
178
		} else {
179
			unset($config['system']['maxmss_enable']);
180
			unset($config['system']['maxmss']);
181
		}
182

    
183
		if($_POST['powerd_enable'] == "yes")
184
			$config['system']['powerd_enable'] = true;
185
		else
186
			unset($config['system']['powerd_enable']);
187

    
188
		$config['system']['powerd_ac_mode'] = $_POST['powerd_ac_mode'];
189
		$config['system']['powerd_battery_mode'] = $_POST['powerd_battery_mode'];
190

    
191
		if($_POST['crypto_hardware'])
192
			$config['system']['crypto_hardware'] = $_POST['crypto_hardware'];
193
		else
194
			unset($config['system']['crypto_hardware']);
195

    
196
		if($_POST['thermal_hardware'])
197
			$config['system']['thermal_hardware'] = $_POST['thermal_hardware'];
198
		else
199
			unset($config['system']['thermal_hardware']);
200

    
201
		if($_POST['schedule_states'] == "yes")
202
			$config['system']['schedule_states'] = true;
203
		else
204
			unset($config['system']['schedule_states']);
205

    
206
		if($_POST['kill_states'] == "yes")
207
			$config['system']['kill_states'] = true;
208
		else
209
			unset($config['system']['kill_states']);
210

    
211
		if($_POST['skip_rules_gw_down'] == "yes")
212
			$config['system']['skip_rules_gw_down'] = true;
213
		else
214
			unset($config['system']['skip_rules_gw_down']);
215

    
216
		if($_POST['use_mfs_tmpvar'] == "yes")
217
			$config['system']['use_mfs_tmpvar'] = true;
218
		else
219
			unset($config['system']['use_mfs_tmpvar']);
220

    
221
		$config['system']['use_mfs_tmp_size'] = $_POST['use_mfs_tmp_size'];
222
		$config['system']['use_mfs_var_size'] = $_POST['use_mfs_var_size'];
223

    
224
		if (isset($_POST['rrdbackup'])) {
225
			$config['system']['rrdbackup'] = $_POST['rrdbackup'];
226
			install_cron_job("/etc/rc.backup_rrd.sh", ($config['system']['rrdbackup'] > 0), $minute="0", "*/{$config['system']['rrdbackup']}");
227
		}
228
		if (isset($_POST['dhcpbackup'])) {
229
			$config['system']['dhcpbackup'] = $_POST['dhcpbackup'];
230
			install_cron_job("/etc/rc.backup_dhcpleases.sh", ($config['system']['dhcpbackup'] > 0), $minute="0", "*/{$config['system']['dhcpbackup']}");
231
		}
232

    
233
		write_config();
234

    
235
		$retval = 0;
236
		system_resolvconf_generate(true);
237
		$retval = filter_configure();
238
		if(stristr($retval, "error") <> true)
239
			$savemsg = get_std_save_message(gettext($retval));
240
		else
241
			$savemsg = gettext($retval);
242

    
243
		activate_powerd();
244
		load_crypto();
245
		load_thermal_hardware();
246
		vpn_ipsec_configure_preferoldsa();
247
		if ($need_racoon_restart)
248
			vpn_ipsec_force_reload();
249
		if ($need_relayd_restart)
250
			relayd_configure();
251
	}
252
}
253

    
254
$pgtitle = array(gettext("System"),gettext("Advanced: Miscellaneous"));
255
include("head.inc");
256

    
257
?>
258

    
259
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
260
<?php
261
	include("fbegin.inc");
262
	if ($input_errors)
263
		print_input_errors($input_errors);
264
	if ($savemsg)
265
		print_info_box($savemsg);
266
?>
267
<script type="text/javascript">
268
//<![CDATA[
269
function sticky_checked(obj) {
270
	if (obj.checked)
271
		jQuery('#srctrack').attr('disabled',false);
272
	else
273
		jQuery('#srctrack').attr('disabled','true');
274
}
275
function maxmss_checked(obj) {
276
	if (obj.checked)
277
		jQuery('#maxmss').attr('disabled',false);
278
	else
279
		jQuery('#maxmss').attr('disabled','true');
280
}
281
function tmpvar_checked(obj) {
282
	if (obj.checked) {
283
		jQuery('#use_mfs_tmp_size').attr('disabled',false);
284
		jQuery('#use_mfs_var_size').attr('disabled',false);
285
		jQuery('#rrdbackup').attr('disabled',false);
286
		jQuery('#dhcpbackup').attr('disabled',false);
287
	} else {
288
		jQuery('#use_mfs_tmp_size').attr('disabled','true');
289
		jQuery('#use_mfs_var_size').attr('disabled','true');
290
		jQuery('#rrdbackup').attr('disabled','true');
291
		jQuery('#dhcpbackup').attr('disabled','true');
292
	}
293
}
294
//]]>
295
</script>
296
	<form action="system_advanced_misc.php" method="post" name="iform" id="iform">
297
		<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="system advanced misc">
298
			<tr>
299
				<td>
300
					<?php
301
						$tab_array = array();
302
						$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
303
						$tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php");
304
						$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
305
						$tab_array[] = array(gettext("Miscellaneous"), true, "system_advanced_misc.php");
306
						$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
307
						$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
308
						display_top_tabs($tab_array);
309
					?>
310
				</td>
311
			</tr>
312
			<tr>
313
				<td id="mainarea">
314
					<div class="tabcont">
315
						<span class="vexpl">
316
							<span class="red">
317
								<strong><?=gettext("NOTE:"); ?>&nbsp;</strong>
318
							</span>
319
							<?=gettext("The options on this page are intended for use by advanced users only."); ?>
320
							<br/>
321
						</span>
322
						<br/>
323
						<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
324
							<tr>
325
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Proxy support"); ?></td>
326
							</tr>
327
							<tr>
328
								<td width="22%" valign="top" class="vncell"><?=gettext("Proxy URL"); ?></td>
329
								<td width="78%" class="vtable">
330
									<input name="proxyurl" id="proxyurl" value="<?php if ($pconfig['proxyurl'] <> "") echo $pconfig['proxyurl']; ?>" class="formfld unknown" />
331
									<br />
332
									<?php printf(gettext("Proxy url for allowing %s to use this proxy to connect outside."),$g['product']); ?>
333
								</td>
334
							</tr>
335
							<tr>
336
								<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Port"); ?></td>
337
								<td width="78%" class="vtable">
338
									<input name="proxyport" id="proxyport" value="<?php if ($pconfig['proxyport'] <> "") echo $pconfig['proxyport']; ?>" class="formfld unknown" />
339
									<br />
340
									<?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']); ?>
341
								</td>
342
							</tr>
343
							<tr>
344
								<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Username"); ?></td>
345
								<td width="78%" class="vtable">
346
									<input name="proxyuser" id="proxyuser" value="<?php if ($pconfig['proxyuser'] <> "") echo $pconfig['proxyuser']; ?>" class="formfld unknown" />
347
									<br />
348
									<?php printf(gettext("Proxy username for allowing %s to use this proxy to connect outside"),$g['product']); ?>
349
								</td>
350
							</tr>
351
							<tr>
352
								<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Pass"); ?></td>
353
								<td width="78%" class="vtable">
354
									<input type="password" name="proxypass" id="proxypass" value="<?php if ($pconfig['proxypass'] <> "") echo $pconfig['proxypass']; ?>" class="formfld unknown" />
355
									<br />
356
									<?php printf(gettext("Proxy password for allowing %s to use this proxy to connect outside"),$g['product']); ?>
357
								</td>
358
							</tr>
359
							<tr>
360
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Load Balancing"); ?></td>
361
							</tr>
362
							<tr>
363
								<td width="22%" valign="top" class="vncell"><?=gettext("Load Balancing"); ?></td>
364
								<td width="78%" class="vtable">
365
									<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)" />
366
									<strong><?=gettext("Use sticky connections"); ?></strong><br/>
367
									<?=gettext("Successive connections will be redirected to the servers " .
368
									"in a round-robin manner with connections from the same " .
369
									"source being sent to the same web server. This 'sticky " .
370
									"connection' will exist as long as there are states that " .
371
									"refer to this connection. Once the states expire, so will " .
372
									"the sticky connection. Further connections from that host " .
373
									"will be redirected to the next web server in the round " .
374
									"robin. Changing this option will restart the Load Balancing service."); ?>
375
									<br />
376
									<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\""; ?> />
377
									<br />
378
									<?=gettext("Set the source tracking timeout for sticky connections. " .
379
									"By default this is 0, so source tracking is removed as soon as the state expires. " .
380
									"Setting this timeout higher will cause the source/destination relationship to persist for longer periods of time."); ?>
381
								</td>
382
							</tr>
383
							<tr>
384
								<td width="22%" valign="top" class="vncell"><?=gettext("Load Balancing"); ?></td>
385
								<td width="78%" class="vtable">
386
									<input name="gw_switch_default" type="checkbox" id="gw_switch_default" value="yes" <?php if ($pconfig['gw_switch_default']) echo "checked=\"checked\""; ?> />
387
									<strong><?=gettext("Allow default gateway switching"); ?></strong><br/>
388
									<?=gettext("If the link where the default gateway resides fails " .
389
									"switch the default gateway to another available one."); ?>
390
								</td>
391
							</tr>
392
							<tr>
393
								<td colspan="2" class="list" height="12">&nbsp;</td>
394
							</tr>
395
							<tr>
396
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Power savings"); ?></td>
397
							</tr>
398
							<tr>
399
								<td width="22%" valign="top" class="vncell"><?=gettext("PowerD"); ?></td>
400
								<td width="78%" class="vtable">
401
									<input name="powerd_enable" type="checkbox" id="powerd_enable" value="yes" <?php if ($pconfig['powerd_enable']) echo "checked=\"checked\""; ?> />
402
									<strong><?=gettext("Use PowerD"); ?></strong><br/>
403
									<br/>
404
									<?=gettext("On AC Power Mode"); ?>&nbsp;:&nbsp;
405
									<select name="powerd_ac_mode" id="powerd_ac_mode">
406
										<option value="hadp"<?php if($pconfig['powerd_ac_mode']=="hadp") echo " selected=\"selected\""; ?>><?=gettext("Hiadaptive");?></option>
407
										<option value="adp"<?php if($pconfig['powerd_ac_mode']=="adp") echo " selected=\"selected\""; ?>><?=gettext("Adaptive");?></option>
408
										<option value="min"<?php if($pconfig['powerd_ac_mode']=="min") echo " selected=\"selected\""; ?>><?=gettext("Minimum");?></option>
409
										<option value="max"<?php if($pconfig['powerd_ac_mode']=="max") echo " selected=\"selected\""; ?>><?=gettext("Maximum");?></option>
410
									</select>
411
									&nbsp;&nbsp;
412
									<?=gettext("On Battery Power Mode"); ?>&nbsp;:&nbsp;
413
									<select name="powerd_battery_mode" id="powerd_battery_mode">
414
										<option value="hadp"<?php if($pconfig['powerd_battery_mode']=="hadp") echo " selected=\"selected\""; ?>><?=gettext("Hiadaptive");?></option>
415
										<option value="adp"<?php if($pconfig['powerd_battery_mode']=="adp") echo " selected=\"selected\""; ?>><?=gettext("Adaptive");?></option>
416
										<option value="min"<?php if($pconfig['powerd_battery_mode']=="min") echo " selected=\"selected\""; ?>><?=gettext("Minimum");?></option>
417
										<option value="max"<?php if($pconfig['powerd_battery_mode']=="max") echo " selected=\"selected\""; ?>><?=gettext("Maximum");?></option>
418
									</select>
419
									<br/><br/>
420
									<?=gettext("The powerd utility monitors the system state and sets various power control " .
421
									"options accordingly.  It offers four modes (maximum, minimum, adaptive " .
422
									"and hiadaptive) that can be individually selected while on AC power or batteries. " .
423
									"The modes maximum, minimum, adaptive and hiadaptive may be abbreviated max, " .
424
									"min, adp, hadp.  Maximum mode chooses the highest performance values.  Minimum " .
425
									"mode selects the lowest performance values to get the most power savings. " .
426
									"Adaptive mode attempts to strike a balance by degrading performance when " .
427
									"the system appears idle and increasing it when the system is busy.  It " .
428
									"offers a good balance between a small performance loss for greatly " .
429
									"increased power savings.  Hiadaptive mode is alike adaptive mode, but " .
430
									"tuned for systems where performance and interactivity are more important" .
431
									"than power consumption.  It rises frequency faster, drops slower and" .
432
									"keeps twice lower CPU load."); ?>
433
								</td>
434
							</tr>
435
							<tr>
436
								<td colspan="2" class="list" height="12">&nbsp;</td>
437
							</tr>
438
							<tr>
439
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Cryptographic Hardware Acceleration"); ?></td>
440
							</tr>
441
							<tr>
442
								<td width="22%" valign="top" class="vncell"><?=gettext("Cryptographic Hardware"); ?></td>
443
								<td width="78%" class="vtable">
444
									<select name="crypto_hardware" id="crypto_hardware">
445
										<option value=""><?php echo gettext("None"); ?></option>
446
										<?php foreach ($crypto_modules as $cryptomod_name => $cryptomod_descr): ?>
447
											<option value="<?php echo $cryptomod_name; ?>" <?php if ($pconfig['crypto_hardware'] == $cryptomod_name) echo " selected=\"selected\""; ?>><?php echo "{$cryptomod_descr} ({$cryptomod_name})"; ?></option>
448
										<?php endforeach; ?>
449
									</select>
450
									<br />
451
									<?=gettext("A cryptographic accelerator module will use hardware support to speed up some " .
452
										"cryptographic functions on systems which have the chip. Do not enable this " .
453
										"option if you have a Hifn cryptographic acceleration card, as this will take " .
454
										"precedence and the Hifn card will not be used. Acceleration should be automatic " .
455
										"for IPsec when using a cipher supported by your chip, such as AES-128. OpenVPN " .
456
										"should be set for AES-128-CBC and have cryptodev enabled for hardware " .
457
										"acceleration."); ?>
458
									<br/><br/>
459
									<?=gettext("If you do not have a crypto chip in your system, this option will have no " .
460
									"effect. To unload the selected module, set this option to 'none' and then reboot."); ?>
461
								</td>
462
							</tr>
463
							<tr>
464
								<td colspan="2" class="list" height="12">&nbsp;</td>
465
							</tr>
466
							<tr>
467
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Thermal Sensors"); ?></td>
468
							</tr>
469
							<tr>
470
								<td width="22%" valign="top" class="vncell"><?=gettext("Thermal Sensors"); ?></td>
471
								<td width="78%" class="vtable">
472
								<select name="thermal_hardware" id="thermal_hardware">
473
									<option value=""><?php echo gettext("None/ACPI"); ?></option>
474
									<?php foreach ($thermal_hardware_modules as $themalmod_name => $themalmod_descr): ?>
475
										<option value="<?php echo $themalmod_name; ?>" <?php if ($pconfig['thermal_hardware'] == $themalmod_name) echo " selected=\"selected\""; ?>><?php echo "{$themalmod_descr} ({$themalmod_name})"; ?></option>
476
									<?php endforeach; ?>
477
								</select>
478
								<br />
479
								<?=gettext("If you have a supported CPU, selecting a themal sensor will load the appropriate " .
480
										"driver to read its temperature. Setting this to 'None' will attempt to read the " .
481
										"temperature from an ACPI-compliant motherboard sensor instead, if one is present."); ?>
482
								<br/><br/>
483
								<?=gettext("If you do not have a supported thermal sensor chip in your system, this option will have no " .
484
									"effect. To unload the selected module, set this option to 'none' and then reboot."); ?>
485
								</td>
486
							</tr>
487
							<tr>
488
								<td colspan="2" class="list" height="12">&nbsp;</td>
489
							</tr>
490
							<tr>
491
								<td colspan="2" valign="top" class="listtopic"><?=gettext("IP Security"); ?></td>
492
							</tr>
493
							<tr>
494
								<td width="22%" valign="top" class="vncell"><?=gettext("Security Associations"); ?></td>
495
								<td width="78%" class="vtable">
496
									<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked=\"checked\""; ?> />
497
									<strong><?=gettext("Prefer older IPsec SAs"); ?></strong>
498
									<br />
499
									<?=gettext("By default, if several SAs match, the newest one is " .
500
									"preferred if it's at least 30 seconds old. Select this " .
501
									"option to always prefer old SAs over new ones."); ?>
502
								</td>
503
							</tr>
504
							<tr>
505
								<td width="22%" valign="top" class="vncell"><?=gettext("IPsec Debug"); ?></td>
506
								<td width="78%" class="vtable">
507
									<input name="racoondebug_enable" type="checkbox" id="racoondebug_enable" value="yes" <?php if ($pconfig['racoondebug_enable']) echo "checked=\"checked\""; ?> />
508
									<strong><?=gettext("Start racoon in debug mode"); ?></strong>
509
									<br />
510
									<?=gettext("Launches racoon in debug mode so that more verbose logs " .
511
									"will be generated to aid in troubleshooting."); ?><br/>
512
									<?=gettext("NOTE: Changing this setting will restart racoon."); ?>
513
								</td>
514
							</tr>
515
							<tr>
516
								<td width="22%" valign="top" class="vncell"><?=gettext("Maximum MSS"); ?></td>
517
								<td width="78%" class="vtable">
518
									<input name="maxmss_enable" type="checkbox" id="maxmss_enable" value="yes" <?php if ($pconfig['maxmss_enable'] == true) echo "checked=\"checked\""; ?> onclick="maxmss_checked(this)" />
519
									<strong><?=gettext("Enable MSS clamping on VPN traffic"); ?></strong>
520
									<br />
521
									<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\""; ?> />
522
									<br />
523
									<?=gettext("Enable MSS clamping on TCP flows over VPN. " .
524
									"This helps overcome problems with PMTUD on IPsec VPN links. If left blank, the default value is 1400 bytes. "); ?>
525
								</td>
526
							</tr>
527
							<tr>
528
								<td colspan="2" class="list" height="12">&nbsp;</td>
529
							</tr>
530
							<tr>
531
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Schedules"); ?></td>
532
							</tr>
533
							<tr>
534
								<td width="22%" valign="top" class="vncell"><?=gettext("Schedule States"); ?></td>
535
								<td width="78%" class="vtable">
536
									<input name="schedule_states" type="checkbox" id="schedule_states" value="yes" <?php if ($pconfig['schedule_states']) echo "checked=\"checked\""; ?> />
537
									<br />
538
									<?=gettext("By default schedules clear the states of existing connections when the expiration time has come. ".
539
									"This option overrides that behavior by not clearing states for existing connections."); ?>
540
								</td>
541
							</tr>
542
							<tr>
543
								<td colspan="2" class="list" height="12">&nbsp;</td>
544
							</tr>
545
							<tr>
546
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Gateway Monitoring"); ?></td>
547
							</tr>
548
							<tr>
549
								<td width="22%" valign="top" class="vncell"><?=gettext("States"); ?></td>
550
								<td width="78%" class="vtable">
551
									<input name="kill_states" type="checkbox" id="kill_states" value="yes" <?php if ($pconfig['kill_states']) echo "checked=\"checked\""; ?> />
552
									<br />
553
									<?=gettext("By default the monitoring process will flush states for a gateway that goes down. ".
554
									"This option overrides that behavior by not clearing states for existing connections."); ?>
555
								</td>
556
							</tr>
557
							<tr>
558
								<td width="22%" valign="top" class="vncell"><?=gettext("Skip rules when gateway is down"); ?></td>
559
								<td width="78%" class="vtable">
560
									<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\""; ?> />
561
									<br />
562
									<?=gettext("By default, when a rule has a specific gateway set, and this gateway is down, ".
563
									"rule is created and traffic is sent to default gateway.This option overrides that behavior ".
564
									"and the rule is not created when gateway is down"); ?>
565
								</td>
566
							</tr>
567
							<tr>
568
								<td colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></td>
569
							</tr>
570
							<?php if ($g['platform'] == "pfSense"): ?>
571
							<tr>
572
								<td width="22%" valign="top" class="vncell"><?=gettext("Use RAM Disks"); ?></td>
573
								<td width="78%" class="vtable">
574
									<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)" />
575
									<strong><?=gettext("Use memory file system for /tmp and /var"); ?></strong><br/>
576
									<?=gettext("Set this if you wish to use /tmp and /var as RAM disks (memory file system disks) on a full install " .
577
									"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."); ?>
578
								</td>
579
							</tr>
580
							<?php endif; ?>
581
							<tr>
582
								<td width="22%" valign="top" class="vncell"><?=gettext("/tmp RAM Disk Size"); ?></td>
583
								<td width="78%" class="vtable">
584
									<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
585
									<br />
586
									<?=gettext("Set the size, in MB, for the /tmp RAM disk. " .
587
									"Leave blank for 40MB. Do not set lower than 40."); ?>
588
								</td>
589
							</tr>
590
							<tr>
591
								<td width="22%" valign="top" class="vncell"><?=gettext("/var RAM Disk Size"); ?></td>
592
								<td width="78%" class="vtable">
593
									<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
594
									<br />
595
									<?=gettext("Set the size, in MB, for the /var RAM disk. " .
596
									"Leave blank for 60MB. Do not set lower than 60."); ?>
597
								</td>
598
							</tr>
599
							<tr>
600
								<td width="22%" valign="top" class="vncell"><?=gettext("Periodic RRD Backup");?></td>
601
								<td width="78%" class="vtable">
602
									<?=gettext("Frequency:");?>
603
									<select name="rrdbackup" id="rrdbackup" <?php if (($g['platform'] == "pfSense") && ($pconfig['use_mfs_tmpvar'] == false)) echo "disabled=\"disabled\""; ?> >
604
										<option value='0' <?php if (!isset($config['system']['rrdbackup']) || ($config['system']['rrdbackup'] == 0)) echo "selected='selected'"; ?>><?=gettext("Disable"); ?></option>
605
									<?php for ($x=1; $x<=24; $x++) { ?>
606
										<option value='<?= $x ?>' <?php if ($config['system']['rrdbackup'] == $x) echo "selected='selected'"; ?>><?= $x ?> <?=gettext("hour"); ?><?php if ($x>1) echo "s"; ?></option>
607
									<?php } ?>
608
									</select>
609
									<br/>
610
									<?=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.");?>
611
									<br/>
612
									<br/>
613
								</td>
614
							</tr>
615
							<tr>
616
								<td width="22%" valign="top" class="vncell"><?=gettext("Periodic DHCP Leases Backup");?></td>
617
								<td width="78%" class="vtable">
618
									<?=gettext("Frequency:");?>
619
									<select name="dhcpbackup" id="dhcpbackup" <?php if (($g['platform'] == "pfSense") && ($pconfig['use_mfs_tmpvar'] == false)) echo "disabled=\"disabled\""; ?> >
620
										<option value='0' <?php if (!isset($config['system']['dhcpbackup']) || ($config['system']['dhcpbackup'] == 0)) echo "selected='selected'"; ?>><?=gettext("Disable"); ?></option>
621
									<?php for ($x=1; $x<=24; $x++) { ?>
622
										<option value='<?= $x ?>' <?php if ($config['system']['dhcpbackup'] == $x) echo "selected='selected'"; ?>><?= $x ?> <?=gettext("hour"); ?><?php if ($x>1) echo "s"; ?></option>
623
									<?php } ?>
624
									</select>
625
									<br/>
626
									<?=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.");?>
627
									<br/>
628
									<br/>
629
								</td>
630
							</tr>
631
							<tr>
632
								<td colspan="2" class="list" height="12">&nbsp;</td>
633
							</tr>
634
							<?php if($g['platform'] == "pfSenseDISABLED"): ?>
635
							<tr>
636
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Hardware Settings"); ?></td>
637
							</tr>
638
							<tr>
639
								<td width="22%" valign="top" class="vncell"><?=gettext("Hard disk standby time "); ?></td>
640
								<td width="78%" class="vtable">
641
									<select name="harddiskstandby" class="formselect">
642
										<?php
643
											## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
644
											$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");
645
										?>
646
										<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected="selected"');?>><?=gettext("Always on"); ?></option>
647
										<?php
648
											foreach ($sbvals as $sbval):
649
												list($min,$val) = explode(",", $sbval);
650
										?>
651
										<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected="selected"');?>><?=$min;?> <?=gettext("minutes"); ?></option>
652
										<?php endforeach; ?>
653
									</select>
654
									<br/>
655
									<?=gettext("Puts the hard disk into standby mode when the selected amount of time after the last ".
656
									"access has elapsed."); ?> <em><?=gettext("Do not set this for CF cards."); ?></em>
657
								</td>
658
							</tr>
659
							<tr>
660
								<td colspan="2" class="list" height="12">&nbsp;</td>
661
							</tr>
662
							<?php endif; ?>
663

    
664
							<tr>
665
								<td width="22%" valign="top">&nbsp;</td>
666
								<td width="78%">
667
									<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
668
								</td>
669
							</tr>
670
						</table>
671
					</div>
672
				</td>
673
			</tr>
674
		</table>
675
	</form>
676

    
677
<?php include("fend.inc"); ?>
678
</body>
679
</html>
(198-198/246)