Project

General

Profile

Download (12 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

    
48
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
49
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
50
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
51
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
52
$pconfig['glxsb_enable'] = isset($config['system']['glxsb_enable']);
53
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
54

    
55
if ($_POST) {
56

    
57
    unset($input_errors);
58
    $pconfig = $_POST;
59

    
60
	ob_flush();
61
	flush();
62

    
63
	if (!$input_errors) {
64

    
65
		if($_POST['harddiskstandby'] <> "") {
66
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
67
			system_set_harddisk_standby();
68
		} else
69
			unset($config['system']['harddiskstandby']);
70

    
71
		if($_POST['lb_use_sticky'] == "yes")
72
			$config['system']['lb_use_sticky'] = true;
73
		else
74
			unset($config['system']['lb_use_sticky']);
75

    
76
		if($_POST['preferoldsa_enable'] == "yes")
77
                        $config['system']['preferoldsa'] = true;
78
                else
79
                        unset($config['system']['preferoldsa']);
80

    
81
		if($_POST['powerd_enable'] == "yes")
82
                        $config['system']['powerd_enable'] = true;
83
                else
84
                        unset($config['system']['powerd_enable']);
85

    
86
		if($_POST['glxsb_enable'] == "yes")
87
                        $config['system']['glxsb_enable'] = true;
88
                else
89
                        unset($config['system']['glxsb_enable']);
90

    
91
		if($_POST['schedule_states'] == "yes")
92
                        $config['system']['schedule_states'] = true;
93
                else
94
                        unset($config['system']['schedule_states']);
95

    
96
		write_config();
97

    
98
		$retval = 0;
99
		$retval = filter_configure();
100
		if(stristr($retval, "error") <> true)
101
		    $savemsg = get_std_save_message($retval);
102
		else
103
		    $savemsg = $retval;
104
		
105
		activate_powerd();
106
		load_glxsb();
107
	}
108
}
109

    
110
$pgtitle = array("System","Advanced: Miscellaneous");
111
include("head.inc");
112

    
113
?>
114

    
115
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
116
<?php
117
	include("fbegin.inc");
118
	if ($input_errors)
119
		print_input_errors($input_errors);
120
	if ($savemsg)
121
		print_info_box($savemsg);
122
?>
123
	<form action="system_advanced_misc.php" method="post" name="iform" id="iform">
124
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
125
			<tr>
126
				<td>
127
					<?php
128
						$tab_array = array();
129
						$tab_array[] = array("Admin Access", false, "system_advanced_admin.php");
130
						$tab_array[] = array("Firewall / NAT", false, "system_advanced_firewall.php");
131
						$tab_array[] = array("Networking", false, "system_advanced_network.php");
132
						$tab_array[] = array("Miscellaneous", true, "system_advanced_misc.php");
133
						$tab_array[] = array("System Tunables", false, "system_advanced_sysctl.php");
134
						$tab_array[] = array("Notifications", false, "system_advanced_notifications.php");
135
						display_top_tabs($tab_array);
136
					?>
137
				</td>
138
			</tr>
139
			<tr>
140
				<td id="mainarea">
141
					<div class="tabcont">
142
						<span class="vexpl">
143
							<span class="red">
144
								<strong>NOTE:&nbsp</strong>
145
							</span>
146
							The options on this page are intended for use by advanced users only.
147
							<br/>
148
						</span>
149
						<br/>
150
						<table width="100%" border="0" cellpadding="6" cellspacing="0">
151
							<tr>
152
								<td colspan="2" valign="top" class="listtopic">Load Balancing</td>
153
							</tr>
154
							<tr>
155
								<td width="22%" valign="top" class="vncell">Load Balancing</td>
156
								<td width="78%" class="vtable">
157
									<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> />
158
									<strong>Use sticky connections</strong><br/>
159
									Successive connections will be redirected to the servers
160
									in a round-robin manner with connections from the same
161
									source being sent to the same web server. This "sticky
162
									connection" will exist as long as there are states that
163
									refer to this connection. Once the states expire, so will
164
									the sticky connection. Further connections from that host
165
									will be redirected to the next web server in the round
166
									robin.
167
								</td>
168
							</tr>
169
							<tr>
170
								<td colspan="2" class="list" height="12">&nbsp;</td>
171
							</tr>
172
							<tr>
173
								<td colspan="2" valign="top" class="listtopic">Power savings</td>
174
							</tr>
175
							<tr>
176
								<td width="22%" valign="top" class="vncell">PowerD</td>
177
								<td width="78%" class="vtable">
178
									<input name="powerd_enable" type="checkbox" id="powerd_enable" value="yes" <?php if ($pconfig['powerd_enable']) echo "checked"; ?> />
179
									<strong>Use PowerD</strong><br/>
180
									<br />
181
								     The powerd utility monitors the system state and sets various power control 
182
								     options accordingly.	It offers three modes (maximum, minimum, and
183
								     adaptive) that can be individually selected while on AC power or batteries.  
184
								     The modes maximum, minimum, and adaptive may be abbreviated max,
185
								     min, adp.   Maximum mode chooses the highest performance values.  Minimum 
186
								     mode selects the lowest performance values to get the most power savings.
187
								     Adaptive mode attempts to strike a balance by degrading performance when
188
								     the system appears idle and increasing it when the system is busy.  It
189
								     offers a good balance between a small performance loss for greatly
190
								     increased power savings.  The default mode for pfSense is adaptive.
191
								</td>
192
							</tr>
193
							<tr>
194
								<td colspan="2" class="list" height="12">&nbsp;</td>
195
							</tr>
196
							<tr>
197
								<td colspan="2" valign="top" class="listtopic">glxsb Crypto Acceleration</td>
198
							</tr>
199
							<tr>
200
								<td width="22%" valign="top" class="vncell">glxsb</td>
201
								<td width="78%" class="vtable">
202
									<input name="glxsb_enable" type="checkbox" id="glxsb_enable" value="yes" <?php if ($pconfig['glxsb_enable']) echo "checked"; ?> />
203
									<strong>Use glxsb</strong><br/>
204
									<br />
205
								     The AMD Geode LX Security Block will accelerate some cryptographic functions
206
								     on systems which have the chip. Do not enable this option if you have a
207
								     Hifn cryptographic acceleration card, as this will take precedence and the
208
								     Hifn card will not be used. Acceleration should be automatic for IPsec 
209
								     when using Rijndael (AES). OpenVPN should be set for AES-128-CBC.
210
								     <br/><br/>
211
								     If you do not have a glxsb chip in your system, this option will have no 
212
								     effect. To unload the module, uncheck this option and then reboot.
213
								</td>
214
							</tr>
215
							<tr>
216
								<td colspan="2" class="list" height="12">&nbsp;</td>
217
							</tr>
218
							<tr>
219
								<td colspan="2" valign="top" class="listtopic">IP Security</td>
220
							</tr>
221
							<tr>
222
								<td width="22%" valign="top" class="vncell">Security Assocications</td>
223
								<td width="78%" class="vtable">
224
									<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?> />
225
									<strong>Prefer older IPsec SAs</strong>
226
									<br />
227
									By default, if several SAs match, the newest one is
228
									preferred if it's at least 30 seconds old. Select this
229
									option to always prefer old SAs over new ones.
230
								</td>
231
							</tr>
232
                                                        <tr>
233
                                                                <td colspan="2" class="list" height="12">&nbsp;</td>
234
                                                        </tr>
235
                                                        <tr>
236
                                                                <td colspan="2" valign="top" class="listtopic">Schedules</td>
237
                                                        </tr>
238
                                                        <tr>
239
                                                                <td width="22%" valign="top" class="vncell">Schedule States</td>
240
                                                                <td width="78%" class="vtable">
241
                                                                        <input name="schedule_states" type="checkbox" id="schedule_states" value="yes" <?php if ($pconfig['schedule_states']) echo "checked"; ?> />
242
                                                                        <br />
243
									By default schedules clear the states of existing connections when expiry time has come.
244
									This option allows to override this setting by not clearing states for existing connections.
245
                                                                </td>
246
                                                        </tr>
247
							<tr>
248
								<td colspan="2" class="list" height="12">&nbsp;</td>
249
							</tr>
250
							<?php if($g['platform'] == "pfSenseDISABLED"): ?>
251
							<tr>
252
								<td colspan="2" valign="top" class="listtopic">Hardware Settings</td>
253
							</tr>
254
							<tr>
255
								<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
256
								<td width="78%" class="vtable">
257
									<select name="harddiskstandby" class="formselect">
258
										<?php
259
										 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
260
											$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");
261
										?>
262
										<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
263
										<?php
264
											foreach ($sbvals as $sbval):
265
												list($min,$val) = explode(",", $sbval);
266
										?>
267
										<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
268
										<?php endforeach; ?>
269
									</select>
270
									<br/>
271
									Puts the hard disk into standby mode when the selected amount of time after the last
272
									access has elapsed. <em>Do not set this for CF cards.</em>
273
								</td>
274
							</tr>
275
							<tr>
276
								<td colspan="2" class="list" height="12">&nbsp;</td>
277
							</tr>
278
							<?php endif; ?>
279

    
280
							<tr>
281
								<td width="22%" valign="top">&nbsp;</td>
282
								<td width="78%">
283
									<input name="Submit" type="submit" class="formbtn" value="Save" />
284
								</td>
285
							</tr>
286
						</table>
287
					</div>
288
				</td>
289
			</tr>
290
		</table>
291
	</form>
292

    
293
<?php include("fend.inc"); ?>
294
</body>
295
</html>
296

    
(171-171/217)