Commit 18101b0f authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) move inline requires

parent 733cf7c8
......@@ -29,6 +29,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("ipsec.inc");
/* holds the items that will be executed *AFTER* the filter is fully loaded */
$after_filter_configure_run = array();
......@@ -700,8 +701,6 @@ function filter_get_vpns_list() {
if (is_array($config['ipsec']['phase2'])) {
foreach ($config['ipsec']['phase2'] as $ph2ent) {
if ((!$ph2ent['mobile']) && ($ph2ent['mode'] != 'transport')) {
if (!function_exists('ipsec_idinfo_to_cidr'))
require_once("ipsec.inc");
if (!is_array($ph2ent['remoteid']))
continue;
$ph2ent['remoteid']['mode'] = $ph2ent['mode'];
......@@ -1642,8 +1641,6 @@ function filter_nat_rules_generate() {
if (is_array($config['ipsec']['phase2'])) {
foreach ($config['ipsec']['phase2'] as $ph2ent) {
if ($ph2ent['mode'] != 'transport' && !empty($ph2ent['natlocalid'])) {
if (!function_exists('ipsec_idinfo_to_cidr'))
require_once("ipsec.inc");
if (!is_array($ph2ent['localid']))
$ph2ent['localid'] = array();
$ph2ent['localid']['mode'] = $ph2ent['mode'];
......@@ -3433,8 +3430,6 @@ function filter_generate_ipsec_rules($log = array())
continue;
/* determine local and remote peer addresses */
if(!isset($ph1ent['mobile'])) {
if (!function_exists('ipsec_get_phase1_dst'))
require_once("ipsec.inc");
$rgip = ipsec_get_phase1_dst($ph1ent);
if(!$rgip) {
$ipfrules .= "# ERROR! Unable to determine remote IPsec peer address for {$ph1ent['remote-gateway']}\n";
......
......@@ -27,6 +27,10 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/* load up the dyndns.class */
require_once("dyndns.class");
require_once('unbound.inc');
require_once('miniupnpd.inc');
function generate_ipv6_from_mac($mac) {
$elements = explode(":", $mac);
......@@ -1700,9 +1704,6 @@ function services_dyndns_configure_client($conf) {
if (!isset($conf['enable']))
return;
/* load up the dyndns.class */
require_once("dyndns.class");
$dns = new updatedns($dnsService = $conf['type'],
$dnsHost = $conf['host'],
$dnsUser = $conf['username'],
......@@ -1944,7 +1945,6 @@ function services_unbound_configure()
else
sleep(1);
require_once('unbound.inc');
sync_unbound_service();
if (file_exists("/var/run/booting"))
echo gettext("done.") . "\n";
......@@ -2372,7 +2372,6 @@ function upnp_start()
if (!empty($config['installedpackages']['miniupnpd']['config'][0]['enable'])) {
echo gettext("Starting UPnP service... ");
require_once('miniupnpd.inc');
sync_package_miniupnpd();
echo "done.\n";
}
......
......@@ -25,6 +25,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("unbound.inc");
function activate_powerd()
{
......@@ -346,7 +347,6 @@ function system_hosts_generate()
fclose($fd);
if (isset($config['unbound']['enable'])) {
require_once("unbound.inc");
unbound_hosts_generate();
}
......
......@@ -28,6 +28,8 @@
*/
require_once('rrd.inc');
require_once("services.inc");
require_once("certs.inc");
function dump_rrd_to_xml($rrddatabase, $xmldumpfile)
{
......@@ -2251,7 +2253,6 @@ function upgrade_058_to_059() {
function upgrade_059_to_060() {
global $config;
require_once("certs.inc");
if (is_array($config['ca'])) {
/* Locate issuer for all CAs */
foreach ($config['ca'] as & $ca) {
......@@ -3156,7 +3157,6 @@ function upgrade_098_to_099() {
}
function upgrade_099_to_100() {
require_once("services.inc");
install_cron_job("newsyslog", false);
}
......
......@@ -25,6 +25,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("interfaces.inc");
function killbyname($procname, $sig = 'TERM')
{
......@@ -758,8 +759,6 @@ function get_configured_interface_with_descr($only_opt = false, $withdisabled =
function get_configured_ip_addresses() {
global $config;
if (!function_exists('get_interface_ip'))
require_once("interfaces.inc");
$ip_array = array();
$interfaces = get_configured_interface_list();
if (is_array($interfaces)) {
......@@ -797,7 +796,6 @@ function get_configured_ip_addresses() {
*/
function get_configured_ipv6_addresses()
{
require_once("interfaces.inc");
$ipv6_array = array();
$interfaces = get_configured_interface_list();
if(is_array($interfaces)) {
......
......@@ -698,8 +698,6 @@ EOD;
if (!empty($ealg_kl) && $ealg_kl == "auto") {
if (empty($p2_ealgos) || !is_array($p2_ealgos))
require_once("ipsec.inc");
$key_hi = $p2_ealgos[$ealg_id]['keysel']['hi'];
$key_lo = $p2_ealgos[$ealg_id]['keysel']['lo'];
$key_step = $p2_ealgos[$ealg_id]['keysel']['step'];
......
......@@ -25,6 +25,8 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("filter.inc");
function subnetv4_expand($subnet) {
$result = array();
list ($ip, $bits) = explode("/", $subnet);
......@@ -128,12 +130,6 @@ class SendMonitor extends Monitor {
function relayd_configure($kill_first=false) {
global $config, $g;
// have to do this until every call to filter.inc is
// require_once() instead of require().
if (!function_exists('filter_expand_alias_array')) {
require_once("filter.inc");
}
if (isset($config['load_balancer']['virtual_server'])) {
$vs_a = $config['load_balancer']['virtual_server'];
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment