Project

General

Profile

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

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

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

    
(172-172/218)