Project

General

Profile

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

    
52
if ($_POST) {
53

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

    
57
	ob_flush();
58
	flush();
59

    
60
	if (!$input_errors) {
61

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

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

    
73
		$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
74
		$config['system']['powerd_enable'] = $_POST['powerd_enable'] ? true : false;
75
		$config['system']['glxsb_enable'] = $_POST['glxsb_enable'] ? true : false;
76

    
77
		write_config();
78

    
79
		$retval = 0;
80
		$retval = filter_configure();
81
		if(stristr($retval, "error") <> true)
82
		    $savemsg = get_std_save_message($retval);
83
		else
84
		    $savemsg = $retval;
85
		
86
		activate_powerd();
87
		load_glxsb();
88
	}
89
}
90

    
91
$pgtitle = array("System","Advanced: Miscellaneous");
92
include("head.inc");
93

    
94
?>
95

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

    
245
							<tr>
246
								<td width="22%" valign="top">&nbsp;</td>
247
								<td width="78%">
248
									<input name="Submit" type="submit" class="formbtn" value="Save" />
249
								</td>
250
							</tr>
251
						</table>
252
					</div>
253
				</td>
254
			</tr>
255
		</table>
256
	</form>
257

    
258
<?php include("fend.inc"); ?>
259
</body>
260
</html>
261

    
(171-171/216)