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
##|+PRIV
37
##|*IDENT=page-system-advanced-misc
38
##|*NAME=System: Advanced: Miscellaneous page
39
##|*DESCR=Allow access to the 'System: Advanced: Miscellaneous' page.
40
##|*MATCH=system_advanced.php*
41
##|-PRIV
42

    
43

    
44
require("guiconfig.inc");
45

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

    
53
if ($_POST) {
54

    
55
    unset($input_errors);
56
    $pconfig = $_POST;
57

    
58
	ob_flush();
59
	flush();
60

    
61
	if (!$input_errors) {
62

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

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

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

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

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

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

    
94
		write_config();
95

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

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

    
111
?>
112

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

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

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

    
(171-171/217)