Project

General

Profile

Download (6.56 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	globals.inc
4
	part of pfSense (https://www.pfsense.org)
5
	Copyright (C) 2004-2010 Scott Ullrich
6

    
7
	Originally Part of m0n0wall
8
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
9
	All rights reserved.
10

    
11
	Redistribution and use in source and binary forms, with or without
12
	modification, are permitted provided that the following conditions are met:
13

    
14
	1. Redistributions of source code must retain the above copyright notice,
15
	   this list of conditions and the following disclaimer.
16

    
17
	2. Redistributions in binary form must reproduce the above copyright
18
	   notice, this list of conditions and the following disclaimer in the
19
	   documentation and/or other materials provided with the distribution.
20

    
21
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
	POSSIBILITY OF SUCH DAMAGE.
31

    
32
	pfSense_MODULE:	utils
33

    
34
*/
35

    
36
global $g;
37
$g = array(
38
	"base_packages" => "siproxd",
39
	"event_address" => "unix:///var/run/check_reload_status",
40
	"factory_shipped_username" => "admin",
41
	"factory_shipped_password" => "pfsense",
42
	"upload_path" => "/root",
43
	"dhcpd_chroot_path" => "/var/dhcpd",
44
	"unbound_chroot_path" => "/var/unbound",
45
	"var_path" => "/var",
46
	"varrun_path" => "/var/run",
47
	"varetc_path" => "/var/etc",
48
	"vardb_path" => "/var/db",
49
	"varlog_path" => "/var/log",
50
	"etc_path" => "/etc",
51
	"tmp_path" => "/tmp",
52
	"conf_path" => "/conf",
53
	"conf_default_path" => "/conf.default",
54
	"cf_path" => "/cf",
55
	"cf_conf_path" => "/cf/conf",
56
	"www_path" => "/usr/local/www",
57
	"xml_rootobj" => "pfsense",
58
	"admin_group" => "admins",
59
	"product_name" => "pfSense",
60
	"product_version" => trim(file_get_contents("/etc/version"), " \n"),
61
	"product_copyright" => "Electric Sheep Fencing LLC",
62
	"product_copyright_url" => "https://pfsense.org/license",
63
	"product_copyright_years" => "2004 - ".date("Y"),
64
	"product_website" => "www.pfsense.org",
65
	"product_website_footer" => "https://www.pfsense.org/?gui=bootstrap",
66
	"product_email" => "coreteam@pfsense.org",
67
	"hideplatform" => false,
68
	"hidebackupbeforeupgrade" => false,
69
	"disablehelpmenu" => false,
70
	"disablehelpicon" => false,
71
	"disablecrashreporter" => false,
72
	"crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php",
73
	"debug" => false,
74
	"latest_config" => "13.1",
75
	"nopkg_platforms" => array("cdrom"),
76
	"minimum_ram_warning" => "101",
77
	"minimum_ram_warning_text" => "128 MB",
78
	"wan_interface_name" => "wan",
79
	"captiveportal_path" => "/usr/local/captiveportal",
80
	"captiveportal_element_path" => "/var/db/cpelements",
81
	"captiveportal_element_sizelimit" => 1048576,
82
	"services_dhcp_server_enable" => true,
83
	"wireless_regex" => "/^(ndis|wi|ath|an|ral|ural|iwi|wlan|rum|run|bwn|zyd|mwl|bwi|ipw|iwn|malo|uath|upgt|urtw|wpi)/",
84
	"help_base_url" => "/help.php",
85
	"pkg_prefix" => "pfSense-pkg-",
86
	"default_timezone" => "Etc/UTC"
87
);
88

    
89
/* IP TOS flags */
90
$iptos = array("lowdelay", "throughput", "reliability");
91

    
92
/* TCP flags */
93
$tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg", "ece", "cwr");
94

    
95
if (file_exists("/etc/platform")) {
96
	$arch = php_uname("m");
97

    
98
	if (strstr($g['product_version'], "-RELEASE")) {
99
		/* This is only necessary for RELEASE */
100
		$arch = ($arch == "i386") ? "" : '/' . $arch;
101
		/* Full installs and NanoBSD use the same update directory and manifest in 2.x */
102
		$g['update_url']="https://updates.pfsense.org/_updaters{$arch}";
103
		$g['update_manifest']="https://updates.pfsense.org/manifest";
104
	} else {
105
		/* Full installs and NanoBSD use the same update directory and manifest in 2.x */
106
		$g['update_url']="https://snapshots.pfsense.org/FreeBSD_releng/10.1/{$arch}/pfSense_HEAD/.updaters/";
107
		$g['update_manifest']="https://updates.pfSense.org/manifest";
108
	}
109

    
110
	$g['platform'] = trim(file_get_contents("/etc/platform"));
111
	if ($g['platform'] == "nanobsd") {
112
		$g['firmware_update_text']="pfSense-*.img.gz";
113
		$g['hidebackupbeforeupgrade'] = true;
114

    
115
	} else {
116
		$g['firmware_update_text']="pfSense-*.tgz";
117
	}
118
}
119

    
120
/* Default sysctls */
121
$sysctls = array("net.inet.ip.portrange.first" => "1024",
122
	"net.inet.tcp.blackhole" => "2",
123
	"net.inet.udp.blackhole" => "1",
124
	"net.inet.ip.random_id" => "1",
125
	"net.inet.tcp.drop_synfin" => "1",
126
	"net.inet.ip.redirect" => "1",
127
	"net.inet6.ip6.redirect" => "1",
128
	"net.inet6.ip6.use_tempaddr" => "0",
129
	"net.inet6.ip6.prefer_tempaddr" => "0",
130
	"net.inet.tcp.syncookies" => "1",
131
	"net.inet.tcp.recvspace" => "65228",
132
	"net.inet.tcp.sendspace" => "65228",
133
	"net.inet.tcp.delayed_ack" => "0",
134
	"net.inet.udp.maxdgram" => "57344",
135
	"net.link.bridge.pfil_onlyip" => "0",
136
	"net.link.bridge.pfil_member" => "1",
137
	"net.link.bridge.pfil_bridge" => "0",
138
	"net.link.tap.user_open" => "1",
139
	"kern.randompid" => "347",
140
	"net.inet.ip.intr_queue_maxlen" => "1000",
141
	"hw.syscons.kbd_reboot" => "0",
142
	"net.inet.tcp.log_debug" => "0",
143
	"net.inet.tcp.tso" => "1",
144
	"net.inet.icmp.icmplim" => "0",
145
	"vfs.read_max" => "32",
146
	"kern.ipc.maxsockbuf" => "4262144",
147
	"net.inet.ip.process_options" => 0,
148
	"kern.random.sys.harvest.interrupt" => 0,
149
	"kern.random.sys.harvest.point_to_point" => 0,
150
	"kern.random.sys.harvest.ethernet" => 0,
151
	"net.route.netisr_maxqlen" => 1024,
152
	"net.inet.udp.checksum" => 1,
153
	"net.inet.icmp.reply_from_interface" => 1,
154
	"net.inet6.ip6.rfc6204w3" => 1,
155
	"net.enc.out.ipsec_bpf_mask" => "0x0001",
156
	"net.enc.out.ipsec_filter_mask" => "0x0001",
157
	"net.enc.in.ipsec_bpf_mask" => "0x0002",
158
	"net.enc.in.ipsec_filter_mask" => "0x0002",
159
	"net.key.preferred_oldsa" => "0",
160
	"net.inet.carp.senderr_demotion_factor" => 0, /* Do not demote CARP for interface send errors */
161
	"net.pfsync.carp_demotion_factor" => 0 /* Do not demote CARP for pfsync errors */
162
);
163

    
164
/* Include override values for the above if needed. If the file doesn't exist, don't try to load it. */
165
if (file_exists("/etc/inc/globals_override.inc")) {
166
	@include("globals_override.inc");
167
}
168

    
169
function platform_booting($on_console = false) {
170
	global $g;
171

    
172
	if ($g['booting'] || file_exists("{$g['varrun_path']}/booting")) {
173
		if ($on_console == false || php_sapi_name() != 'fpm-fcgi') {
174
			return true;
175
		}
176
	}
177

    
178
	return false;
179
}
180

    
181
if (file_exists("{$g['cf_conf_path']}/enableserial_force")) {
182
	$g['enableserial_force'] = true;
183
}
184

    
185
$config_parsed = false;
186

    
187
?>
(21-21/65)