Project

General

Profile

Download (6.02 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
<?php
2 307cd525 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
    globals.inc
5 ee11cc6e Scott Ullrich
    part of pfSense (www.pfsense.com)
6 0e16b9ca Scott Ullrich
    Copyright (C) 2004-2006 Scott Ullrich
7 ee11cc6e Scott Ullrich
8
    Originally Part of m0n0wall
9 5b237745 Scott Ullrich
    Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
    All rights reserved.
11 ee11cc6e Scott Ullrich
12 5b237745 Scott Ullrich
    Redistribution and use in source and binary forms, with or without
13
    modification, are permitted provided that the following conditions are met:
14 ee11cc6e Scott Ullrich
15 5b237745 Scott Ullrich
    1. Redistributions of source code must retain the above copyright notice,
16
       this list of conditions and the following disclaimer.
17 ee11cc6e Scott Ullrich
18 5b237745 Scott Ullrich
    2. Redistributions in binary form must reproduce the above copyright
19
       notice, this list of conditions and the following disclaimer in the
20
       documentation and/or other materials provided with the distribution.
21 ee11cc6e Scott Ullrich
22 5b237745 Scott Ullrich
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
    POSSIBILITY OF SUCH DAMAGE.
32 523855b0 Scott Ullrich
33
	pfSense_MODULE:	utils
34
35 5b237745 Scott Ullrich
*/
36
37 3f9a98c1 Scott Ullrich
function remove_numbers($string) {
38
	$nums = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " ");
39
	$string = str_replace($nums, '', $string);
40
	return $string;
41
}
42
43
function get_nics_with_capabilities($CAPABILITIES) {
44 14578e35 Scott Ullrich
	$ifs = `ifconfig -l`;
45
	$if_list = split(" ", $ifs);
46 3f9a98c1 Scott Ullrich
	$vlan_native_supp = array();
47
	foreach($if_list as $if => $iface) {
48 eca4bfbc jim-p
		$iface = trim($iface);
49 575a279a Ermal Lu?i
		$capable = pfSense_get_interface_addresses($iface);
50
		if(isset($capable['caps'][$CAPABILITIES])) {
51 eca4bfbc jim-p
			$interfacenonum = remove_numbers($iface);
52 3f9a98c1 Scott Ullrich
			if(!in_array($interfacenonum, $vlan_native_supp))
53
				$vlan_native_supp[] = $interfacenonum;
54
		}
55
	}
56
	return $vlan_native_supp;
57
}
58
59 5b237745 Scott Ullrich
$g = array(
60 4a8bc5a2 Scott Ullrich
	"base_packages" => "siproxd", 
61 4b96b367 mgrooms
	"factory_shipped_username" => "admin",
62 46974905 Chris Buechler
	"factory_shipped_password" => "pfsense",
63 1ef7b568 Scott Ullrich
	"upload_path" => "/root",
64 e9e7d501 Matthew Grooms
	"dhcpd_chroot_path" => "/var/dhcpd",
65
	"varrun_path" => "/var/run",
66
	"varetc_path" => "/var/etc",
67
	"vardb_path" => "/var/db",
68
	"varlog_path" => "/var/log",
69
	"etc_path" => "/etc",
70
	"tmp_path" => "/tmp",
71
	"conf_path" => "/conf",
72
	"ftmp_path" => "/ftmp",
73
	"conf_default_path" => "/conf.default",
74
	"cf_path" => "/cf",
75
	"cf_conf_path" => "/cf/conf",
76
	"www_path" => "/usr/local/www",
77
	"xml_rootobj" => "pfsense",
78
	"admin_group" => "admins",
79 36d0358b Scott Ullrich
	"product_name" => "pfSense",
80 c57e9f90 Chris Buechler
	"product_copyright" => "BSD Perimeter LLC",
81 3d7639eb Scott Ullrich
	"product_copyright_url" => "http://www.bsdperimeter.com",
82 ceccec87 Chris Buechler
	"product_copyright_years" => "2004 - 2010",
83 73113ce9 Ermal Luci
	"product_website" => "www.pfsense.org",
84 3d7639eb Scott Ullrich
	"product_website_footer" => "http://www.pfsense.org/?gui20",
85 c57e9f90 Chris Buechler
	"product_email" => "coreteam@pfsense.org",
86 3d7639eb Scott Ullrich
	"hideplatform" => false,
87 8b289232 Chris Buechler
	"disablethemeselection" => false,
88 3b29612f Chris Buechler
	"disablehelpmenu" => false,
89 28181237 Renato Botelho
	"disablehelpicon" => false,
90 e9e7d501 Matthew Grooms
	"debug" => false,
91 c2b2b571 gnhb
	"latest_config" => "6.4",
92 e9e7d501 Matthew Grooms
	"nopkg_platforms" => array("cdrom"),
93 f333e853 Chris Buechler
	"minimum_ram_warning" => "105",
94 9f274393 Chris Buechler
	"minimum_ram_warning_text" => "128 MB",
95 73d0efb9 Chris Buechler
	"minimum_nic_count" => "1",
96
	"minimum_nic_count_text" => "*AT LEAST* 1",	
97 954d8f12 Scott Ullrich
	"wan_interface_name" => "wan", 
98 e9e7d501 Matthew Grooms
	"nopccard_platforms" => array("wrap", "net48xx"),
99
	"xmlrpcbaseurl" => "www.pfsense.com",
100
	"captiveportal_path" => "/usr/local/captiveportal",
101
	"captiveportal_element_path" => "/var/db/cpelements",
102 c2d0699f Scott Ullrich
	"captiveportal_element_sizelimit" => 1048576,
103 e9e7d501 Matthew Grooms
	"xmlrpcpath" => "/pfSense/xmlrpc.php",
104
	"embeddedbootupslice" => "/dev/ad0a",
105 e3a13b00 Scott Ullrich
	"services_dhcp_server_enable" => true,
106 8c62fa48 jim-p
	"wireless_regex" => "/^(ndis|wi|ath|an|ral|ural|iwi|wlan|rum|run|bwn|zyd|mwl|bwi|ipw|iwn|malo|uath|upgt|urtw|wpi)/",
107 462c4a27 jim-p
	"help_base_url" => "/help.php"
108 5b237745 Scott Ullrich
);
109
110 3f9a98c1 Scott Ullrich
// Loop through and set vlan_long_frame VLAN_MTU
111 575a279a Ermal Lu?i
$vlan_native_supp = get_nics_with_capabilities("vlanmtu");
112 3f9a98c1 Scott Ullrich
if(count($vlan_native_supp) > 0)
113
	$g['vlan_long_frame'] = $vlan_native_supp;
114
else 
115
	$g['vlan_long_frame'] = array("vge", "bfe",  "bge",  "dc",  "em",  "fxp",  "gem",  "hme",  "ixgb",  "le",  "nge",  "re",  "rl",  "sis",  "sk",  "ste",  "ti",  "tl",  "tx",  "txp",  "vr", "xl", "lagg");
116
117 a03e3c1f Bill Marquette
/* IP TOS flags */
118 ec6adc21 Bill Marquette
$iptos = array("lowdelay", "throughput", "reliability");
119 a03e3c1f Bill Marquette
120
/* TCP flags */
121
$tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg");
122
123 b24a7390 Scott Ullrich
if(file_exists("/etc/platform")) {
124 8395832c Scott Ullrich
	$arch = trim(`uname -m`);
125 03cc2016 Erik
	$g['platform'] = trim(file_get_contents("/etc/platform"));
126 aadf2c9f Scott Ullrich
	if($g['platform'] == "nanobsd") {
127 e5d8408b jim-p
		$g['update_url']="http://snapshots.pfsense.org/FreeBSD_RELENG_8_1/{$arch}/pfSense_HEAD/.updaters/";
128 aadf2c9f Scott Ullrich
		$g['update_manifest']="http://updates.pfSense.com/nanobsd/manifest";
129 b4a9785a jim-p
		$g['firmware_update_text']="pfSense-*.img.gz";
130 fdcd8ac7 jim-p
131 aadf2c9f Scott Ullrich
	} else {
132 40b0b541 Ermal Lu?i
		$g['update_url']="http://snapshots.pfsense.org/FreeBSD_RELENG_8_1/{$arch}/pfSense_HEAD/.updaters/";
133 aadf2c9f Scott Ullrich
		$g['update_manifest']="http://updates.pfSense.com/manifest";
134 b4a9785a jim-p
		$g['firmware_update_text']="pfSense-*.tgz";
135 aadf2c9f Scott Ullrich
	}
136 b24a7390 Scott Ullrich
}
137
138 3a35f55f Scott Ullrich
/* Default sysctls */
139
$sysctls = array("net.inet.ip.portrange.first" => "1024", 
140 575a279a Ermal Lu?i
		 "net.inet.tcp.blackhole" => "2", 
141
		 "net.inet.udp.blackhole" => "1", 
142
		 "net.inet.ip.random_id" => "1", 
143
		 "net.inet.tcp.drop_synfin" => "1", 
144
		 "net.inet.ip.redirect" => "1", 
145
		 "net.inet6.ip6.redirect" => "1", 
146
		 "net.inet.tcp.syncookies" => "1", 
147
		 "net.inet.tcp.recvspace" => "65228", 
148
		 "net.inet.tcp.sendspace" => "65228", 
149
		 "net.inet.ip.fastforwarding" => "1", 
150
		 "net.inet.tcp.delayed_ack" => "0", 
151
		 "net.inet.udp.maxdgram" => "57344", 
152
		 "net.link.bridge.pfil_onlyip" => "0", 
153
		 "net.link.bridge.pfil_member" => "1", 
154
		 "net.link.bridge.pfil_bridge" => "0", 
155
		 "net.link.tap.user_open" => "1", 
156
		 "kern.rndtest.verbose" => "0", 
157
		 "kern.randompid" => "347", 
158
		 "net.inet.ip.intr_queue_maxlen" => "1000", 
159
		 "hw.syscons.kbd_reboot" => "0", 
160
		 "net.inet.tcp.inflight.enable" => "1", 
161
		 "net.inet.tcp.log_debug" => "0", 
162 e2bee3fe Ermal
		 "net.inet.tcp.tso" => "1", 
163 3816479c Ermal
		 "net.inet.icmp.icmplim" => "0"
164 575a279a Ermal Lu?i
		  );
165 3a35f55f Scott Ullrich
166 06f61915 Ermal Lu?i
$config_inc_loaded = false;
167 094dfa16 Ermal Lu?i
?>