Project

General

Profile

Download (34.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_misc.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['failoverforcereload'] = isset($config['ipsec']['failoverforcereload']);
65
$pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']);
66
$pconfig['maxmss'] = $config['system']['maxmss'];
67
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
68
$pconfig['crypto_hardware'] = $config['system']['crypto_hardware'];
69
$pconfig['thermal_hardware'] = $config['system']['thermal_hardware'];
70
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
71
$pconfig['kill_states'] = isset($config['system']['kill_states']);
72
$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
73
$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
$pconfig['noinstalllanspd'] = $config['system']['noinstalllanspd'];
77

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

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

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

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

    
92
if ($_POST) {
93

    
94
	unset($input_errors);
95
	$pconfig = $_POST;
96

    
97
	ob_flush();
98
	flush();
99

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

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

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

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

    
112
	if (!$input_errors) {
113

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

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

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

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

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

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

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

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

    
164
		if($_POST['failoverforcereload'] == "yes")
165
			$config['ipsec']['failoverforcereload'] = true;
166
		elseif (isset($config['ipsec']['failoverforcereload']))
167
			unset($config['ipsec']['failoverforcereload']);
168

    
169
		$need_racoon_restart = false;
170
		if($_POST['racoondebug_enable'] == "yes") {
171
			if (!isset($config['ipsec']['racoondebug'])) {
172
				$config['ipsec']['racoondebug'] = true;
173
				$need_racoon_restart = true;
174
			}
175
		} else {
176
			if (isset($config['ipsec']['racoondebug'])) {
177
				unset($config['ipsec']['racoondebug']);
178
				$need_racoon_restart = true;
179
			}
180
		}
181
		if($_POST['noinstalllanspd'] == "yes") {
182
			if (!isset($pconfig['noinstalllanspd']))
183
				$need_racoon_restart = true;
184
			$config['system']['noinstalllanspd'] = true;
185
		} else {
186
			if (isset($config['system']['noinstalllanspd']))
187
				$need_racoon_restart = true;
188
			unset($config['system']['noinstalllanspd']);
189
		}
190

    
191
		if($_POST['maxmss_enable'] == "yes") {
192
			$config['system']['maxmss_enable'] = true;
193
			$config['system']['maxmss'] = $_POST['maxmss'];
194
		} else {
195
			unset($config['system']['maxmss_enable']);
196
			unset($config['system']['maxmss']);
197
		}
198

    
199
		if($_POST['powerd_enable'] == "yes")
200
			$config['system']['powerd_enable'] = true;
201
		else
202
			unset($config['system']['powerd_enable']);
203

    
204
		$config['system']['powerd_ac_mode'] = $_POST['powerd_ac_mode'];
205
		$config['system']['powerd_battery_mode'] = $_POST['powerd_battery_mode'];
206

    
207
		if($_POST['crypto_hardware'])
208
			$config['system']['crypto_hardware'] = $_POST['crypto_hardware'];
209
		else
210
			unset($config['system']['crypto_hardware']);
211

    
212
		if($_POST['thermal_hardware'])
213
			$config['system']['thermal_hardware'] = $_POST['thermal_hardware'];
214
		else
215
			unset($config['system']['thermal_hardware']);
216

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

    
222
		if($_POST['kill_states'] == "yes")
223
			$config['system']['kill_states'] = true;
224
		else
225
			unset($config['system']['kill_states']);
226

    
227
		if($_POST['skip_rules_gw_down'] == "yes")
228
			$config['system']['skip_rules_gw_down'] = true;
229
		else
230
			unset($config['system']['skip_rules_gw_down']);
231

    
232
		if($_POST['use_mfs_tmpvar'] == "yes")
233
			$config['system']['use_mfs_tmpvar'] = true;
234
		else
235
			unset($config['system']['use_mfs_tmpvar']);
236

    
237
		$config['system']['use_mfs_tmp_size'] = $_POST['use_mfs_tmp_size'];
238
		$config['system']['use_mfs_var_size'] = $_POST['use_mfs_var_size'];
239

    
240
		if (isset($_POST['rrdbackup'])) {
241
			$config['system']['rrdbackup'] = $_POST['rrdbackup'];
242
			install_cron_job("/etc/rc.backup_rrd.sh", ($config['system']['rrdbackup'] > 0), $minute="0", "*/{$config['system']['rrdbackup']}");
243
		}
244
		if (isset($_POST['dhcpbackup'])) {
245
			$config['system']['dhcpbackup'] = $_POST['dhcpbackup'];
246
			install_cron_job("/etc/rc.backup_dhcpleases.sh", ($config['system']['dhcpbackup'] > 0), $minute="0", "*/{$config['system']['dhcpbackup']}");
247
		}
248

    
249
		write_config();
250

    
251
		$retval = 0;
252
		system_resolvconf_generate(true);
253
		$retval = filter_configure();
254
		if(stristr($retval, "error") <> true)
255
			$savemsg = get_std_save_message(gettext($retval));
256
		else
257
			$savemsg = gettext($retval);
258

    
259
		activate_powerd();
260
		load_crypto();
261
		load_thermal_hardware();
262
		vpn_ipsec_configure_preferoldsa();
263
		if ($need_racoon_restart)
264
			vpn_ipsec_force_reload();
265
		if ($need_relayd_restart)
266
			relayd_configure();
267
	}
268
}
269

    
270
$pgtitle = array(gettext("System"),gettext("Advanced: Miscellaneous"));
271
include("head.inc");
272

    
273
?>
274

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

    
701
							<tr>
702
								<td width="22%" valign="top">&nbsp;</td>
703
								<td width="78%">
704
									<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
705
								</td>
706
							</tr>
707
						</table>
708
					</div>
709
				</td>
710
			</tr>
711
		</table>
712
	</form>
713

    
714
<?php include("fend.inc"); ?>
715
</body>
716
</html>
(201-201/249)