Project

General

Profile

Download (12.8 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 df81417f Matthew Grooms
51
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
52
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
53
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
54 8e9fa41d Scott Ullrich
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
55 09f18f59 jim-p
$pconfig['glxsb_enable'] = isset($config['system']['glxsb_enable']);
56 f204df7d Ermal Lu?i
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
57 df81417f Matthew Grooms
58
if ($_POST) {
59
60
    unset($input_errors);
61
    $pconfig = $_POST;
62
63
	ob_flush();
64
	flush();
65
66
	if (!$input_errors) {
67
68
		if($_POST['harddiskstandby'] <> "") {
69
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
70
			system_set_harddisk_standby();
71
		} else
72
			unset($config['system']['harddiskstandby']);
73
74
		if($_POST['lb_use_sticky'] == "yes")
75
			$config['system']['lb_use_sticky'] = true;
76
		else
77
			unset($config['system']['lb_use_sticky']);
78
79 f204df7d Ermal Lu?i
		if($_POST['preferoldsa_enable'] == "yes")
80
                        $config['system']['preferoldsa'] = true;
81
                else
82
                        unset($config['system']['preferoldsa']);
83
84
		if($_POST['powerd_enable'] == "yes")
85
                        $config['system']['powerd_enable'] = true;
86
                else
87
                        unset($config['system']['powerd_enable']);
88
89
		if($_POST['glxsb_enable'] == "yes")
90
                        $config['system']['glxsb_enable'] = true;
91
                else
92
                        unset($config['system']['glxsb_enable']);
93
94
		if($_POST['schedule_states'] == "yes")
95
                        $config['system']['schedule_states'] = true;
96
                else
97
                        unset($config['system']['schedule_states']);
98 df81417f Matthew Grooms
99
		write_config();
100
101
		$retval = 0;
102
		$retval = filter_configure();
103
		if(stristr($retval, "error") <> true)
104 1eacdc8a Carlos Eduardo Ramos
		    $savemsg = get_std_save_message(gettext($retval));
105 df81417f Matthew Grooms
		else
106 1eacdc8a Carlos Eduardo Ramos
		    $savemsg = gettext($retval);
107 8e9fa41d Scott Ullrich
		
108
		activate_powerd();
109 09f18f59 jim-p
		load_glxsb();
110 df81417f Matthew Grooms
	}
111
}
112
113 e51ed1e9 Vinicius Coque
$pgtitle = array(gettext("System"),gettext("Advanced: Miscellaneous"));
114 df81417f Matthew Grooms
include("head.inc");
115
116
?>
117
118
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
119
<?php
120
	include("fbegin.inc");
121
	if ($input_errors)
122
		print_input_errors($input_errors);
123
	if ($savemsg)
124
		print_info_box($savemsg);
125
?>
126 ab3c8553 Matthew Grooms
	<form action="system_advanced_misc.php" method="post" name="iform" id="iform">
127
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
128
			<tr>
129
				<td>
130
					<?php
131
						$tab_array = array();
132 e51ed1e9 Vinicius Coque
						$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
133
						$tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php");
134
						$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
135
						$tab_array[] = array(gettext("Miscellaneous"), true, "system_advanced_misc.php");
136
						$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
137
						$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
138 ab3c8553 Matthew Grooms
						display_top_tabs($tab_array);
139
					?>
140
				</td>
141
			</tr>
142
			<tr>
143 2ff19bfd Matthew Grooms
				<td id="mainarea">
144
					<div class="tabcont">
145
						<span class="vexpl">
146
							<span class="red">
147 79eaddf4 Renato Botelho
								<strong><?=gettext("NOTE"); ?>:&nbsp</strong>
148 2ff19bfd Matthew Grooms
							</span>
149 1eacdc8a Carlos Eduardo Ramos
							<?=gettext("The options on this page are intended for use by advanced users only."); ?>
150 2ff19bfd Matthew Grooms
							<br/>
151
						</span>
152
						<br/>
153
						<table width="100%" border="0" cellpadding="6" cellspacing="0">
154 ab3c8553 Matthew Grooms
							<tr>
155 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Load Balancing"); ?></td>
156 ab3c8553 Matthew Grooms
							</tr>
157
							<tr>
158 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Load Balancing"); ?></td>
159 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
160
									<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> />
161 1eacdc8a Carlos Eduardo Ramos
									<strong><?=gettext("Use sticky connections"); ?></strong><br/>
162 f0d1af93 Carlos Eduardo Ramos
									<?=gettext("Successive connections will be redirected to the servers " .
163
									"in a round-robin manner with connections from the same " .
164
									"source being sent to the same web server. This 'sticky " .
165
									"connection' will exist as long as there are states that " .
166
									"refer to this connection. Once the states expire, so will " .
167
									"the sticky connection. Further connections from that host " .
168
									"will be redirected to the next web server in the round " .
169
									"robin."); ?>
170 ab3c8553 Matthew Grooms
								</td>
171
							</tr>
172 c912fe28 Scott Ullrich
							<tr>
173
								<td colspan="2" class="list" height="12">&nbsp;</td>
174
							</tr>
175 ab3c8553 Matthew Grooms
							<tr>
176 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Power savings"); ?></td>
177 ab3c8553 Matthew Grooms
							</tr>
178 8e9fa41d Scott Ullrich
							<tr>
179 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("PowerD"); ?></td>
180 8e9fa41d Scott Ullrich
								<td width="78%" class="vtable">
181
									<input name="powerd_enable" type="checkbox" id="powerd_enable" value="yes" <?php if ($pconfig['powerd_enable']) echo "checked"; ?> />
182 1eacdc8a Carlos Eduardo Ramos
									<strong><?=gettext("Use PowerD"); ?></strong><br/>
183 8e9fa41d Scott Ullrich
									<br />
184 f0d1af93 Carlos Eduardo Ramos
								     <?=gettext("The powerd utility monitors the system state and sets various power control " .
185 d0a00ec9 Vinicius Coque
								     "options accordingly. It offers three modes (maximum, minimum, and " .
186 f0d1af93 Carlos Eduardo Ramos
								     "adaptive) that can be individually selected while on AC power or batteries. " . 
187
								     "The modes maximum, minimum, and adaptive may be abbreviated max, " .
188
								     "min, adp.   Maximum mode chooses the highest performance values.  Minimum " .
189
								     "mode selects the lowest performance values to get the most power savings. " .
190
								     "Adaptive mode attempts to strike a balance by degrading performance when " .
191
								     "the system appears idle and increasing it when the system is busy.  It " .
192
								     "offers a good balance between a small performance loss for greatly " .
193
								     "increased power savings.  The default mode for pfSense is adaptive."); ?>
194 8e9fa41d Scott Ullrich
								</td>
195
							</tr>
196
							<tr>
197
								<td colspan="2" class="list" height="12">&nbsp;</td>
198
							</tr>
199 09f18f59 jim-p
							<tr>
200 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("glxsb Crypto Acceleration"); ?></td>
201 09f18f59 jim-p
							</tr>
202
							<tr>
203 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("glxsb"); ?></td>
204 09f18f59 jim-p
								<td width="78%" class="vtable">
205
									<input name="glxsb_enable" type="checkbox" id="glxsb_enable" value="yes" <?php if ($pconfig['glxsb_enable']) echo "checked"; ?> />
206 1eacdc8a Carlos Eduardo Ramos
									<strong><?=gettext("Use glxsb"); ?></strong><br/>
207 09f18f59 jim-p
									<br />
208 f0d1af93 Carlos Eduardo Ramos
								     <?=gettext("The AMD Geode LX Security Block will accelerate some cryptographic functions " .
209
								     "on systems which have the chip. Do not enable this option if you have a " .
210
								     "Hifn cryptographic acceleration card, as this will take precedence and the " .
211
								     "Hifn card will not be used. Acceleration should be automatic for IPsec " .
212
								     "when using Rijndael (AES). OpenVPN should be set for AES-128-CBC."); ?>
213 09f18f59 jim-p
								     <br/><br/>
214 f0d1af93 Carlos Eduardo Ramos
								     <?=gettext("If you do not have a glxsb chip in your system, this option will have no " .
215
								     "effect. To unload the module, uncheck this option and then reboot."); ?>
216 09f18f59 jim-p
								</td>
217
							</tr>
218
							<tr>
219
								<td colspan="2" class="list" height="12">&nbsp;</td>
220
							</tr>
221 ab3c8553 Matthew Grooms
							<tr>
222 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("IP Security"); ?></td>
223 ab3c8553 Matthew Grooms
							</tr>
224
							<tr>
225 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Security Assocications"); ?></td>
226 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
227 1ca3ccd4 jim-p
									<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if (isset($pconfig['preferoldsa_enable'])) echo "checked"; ?> />
228 1eacdc8a Carlos Eduardo Ramos
									<strong><?=gettext("Prefer older IPsec SAs"); ?></strong>
229 ab3c8553 Matthew Grooms
									<br />
230 f0d1af93 Carlos Eduardo Ramos
									<?=gettext("By default, if several SAs match, the newest one is " .
231
									"preferred if it's at least 30 seconds old. Select this " .
232
									"option to always prefer old SAs over new ones."); ?>
233 ab3c8553 Matthew Grooms
								</td>
234
							</tr>
235 f204df7d Ermal Lu?i
                                                        <tr>
236
                                                                <td colspan="2" class="list" height="12">&nbsp;</td>
237
                                                        </tr>
238
                                                        <tr>
239 1eacdc8a Carlos Eduardo Ramos
                                                                <td colspan="2" valign="top" class="listtopic"><?=gettext("Schedules"); ?></td>
240 f204df7d Ermal Lu?i
                                                        </tr>
241
                                                        <tr>
242 1eacdc8a Carlos Eduardo Ramos
                                                                <td width="22%" valign="top" class="vncell"><?=gettext("Schedule States"); ?></td>
243 f204df7d Ermal Lu?i
                                                                <td width="78%" class="vtable">
244
                                                                        <input name="schedule_states" type="checkbox" id="schedule_states" value="yes" <?php if ($pconfig['schedule_states']) echo "checked"; ?> />
245
                                                                        <br />
246 4d473c89 Vinicius Coque
									<?=gettext("By default schedules clear the states of existing connections when expiry time has come. ".
247
									"This option allows to override this setting by not clearing states for existing connections."); ?>
248 f204df7d Ermal Lu?i
                                                                </td>
249
                                                        </tr>
250 ab3c8553 Matthew Grooms
							<tr>
251
								<td colspan="2" class="list" height="12">&nbsp;</td>
252
							</tr>
253
							<?php if($g['platform'] == "pfSenseDISABLED"): ?>
254
							<tr>
255 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Hardware Settings"); ?></td>
256 ab3c8553 Matthew Grooms
							</tr>
257
							<tr>
258 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Hard disk standby time "); ?></td>
259 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
260
									<select name="harddiskstandby" class="formselect">
261
										<?php
262
										 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
263
											$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");
264
										?>
265 1eacdc8a Carlos Eduardo Ramos
										<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>><?=gettext("Always on"); ?></option>
266 ab3c8553 Matthew Grooms
										<?php
267
											foreach ($sbvals as $sbval):
268
												list($min,$val) = explode(",", $sbval);
269
										?>
270 1eacdc8a Carlos Eduardo Ramos
										<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> <?=gettext("minutes"); ?></option>
271 ab3c8553 Matthew Grooms
										<?php endforeach; ?>
272
									</select>
273
									<br/>
274 4d473c89 Vinicius Coque
									<?=gettext("Puts the hard disk into standby mode when the selected amount of time after the last ".
275
									"access has elapsed."); ?> <em><?=gettext("Do not set this for CF cards."); ?></em>
276 ab3c8553 Matthew Grooms
								</td>
277
							</tr>
278
							<tr>
279
								<td colspan="2" class="list" height="12">&nbsp;</td>
280
							</tr>
281
							<?php endif; ?>
282
283
							<tr>
284
								<td width="22%" valign="top">&nbsp;</td>
285
								<td width="78%">
286 267c28ab Vinicius Coque
									<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
287 ab3c8553 Matthew Grooms
								</td>
288
							</tr>
289
						</table>
290
					</div>
291
				</td>
292
			</tr>
293
		</table>
294
	</form>
295 df81417f Matthew Grooms
296
<?php include("fend.inc"); ?>
297
</body>
298
</html>