Commit e2174e89 authored by Ad Schellevis's avatar Ad Schellevis

(filter.inc) cleanups, non functional

parent 06e35b0b
...@@ -525,16 +525,11 @@ function filter_generate_aliases(&$FilterIflist, &$after_filter_configure_run) ...@@ -525,16 +525,11 @@ function filter_generate_aliases(&$FilterIflist, &$after_filter_configure_run)
{ {
global $config; global $config;
$alias = "#System aliases\n "; $aliases = "#System aliases\n";
$aliases = "loopback = \"{ lo0 }\"\n"; $aliases .= "loopback = \"{ lo0 }\"\n";
foreach ($FilterIflist as $if => $ifcfg) { foreach ($FilterIflist as $if => $ifcfg) {
if (isset($ifcfg[0]) && is_array($ifcfg[0])) { if (!empty($ifcfg['descr']) && !empty($ifcfg['if'])) {
if ($ifcfg[0]['if'] == 'pppoe') {
$aliases .= "{$ifcfg[0]['descr']} = \"{ {$ifcfg[0]['if']}";
$aliases .= " }\"\n";
}
} elseif (!empty($ifcfg['descr']) && !empty($ifcfg['if'])) {
if (isset($ifcfg['type6']) && $ifcfg['type6'] == '6rd') { if (isset($ifcfg['type6']) && $ifcfg['type6'] == '6rd') {
$aliases .= "{$ifcfg['descr']} = \"{ {$ifcfg['if']} {$if}_stf"; $aliases .= "{$ifcfg['descr']} = \"{ {$ifcfg['if']} {$if}_stf";
} elseif (isset($ifcfg['type6']) && $ifcfg['type6'] == '6to4') { } elseif (isset($ifcfg['type6']) && $ifcfg['type6'] == '6to4') {
...@@ -588,28 +583,6 @@ function filter_generate_aliases(&$FilterIflist, &$after_filter_configure_run) ...@@ -588,28 +583,6 @@ function filter_generate_aliases(&$FilterIflist, &$after_filter_configure_run)
} }
$aliases .= "{$aliased['name']} = \"<{$aliased['name']}>\"\n"; $aliases .= "{$aliased['name']} = \"<{$aliased['name']}>\"\n";
break; break;
case "openvpn":
$openvpncfg = array();
if ($config['openvpn']['user']) {
/* XXX: Check if we have a correct ip? */
foreach ($config['openvpn']['user'] as $openvpn) {
$openvpncfg[$openvpn['name']] = $openvpn['ip'];
}
}
$vpn_lines = explode("\n", $addrlist);
foreach ($vpn_lines as $vpn_line) {
$vpn_address_split = explode(" ", $vpn_line);
foreach($vpn_address_split as $vpnsplit) {
if (isset($openvpncfg[$vpnsplit])) {
$newaddress .= " ";
$newaddress .= $openvpn[$vpnsplit];
break;
}
}
}
$aliases .= "table <{$aliased['name']}> { {$newaddress} } \n";
$aliases .= "{$aliased['name']} = \"<{$aliased['name']}>\"\n";
break;
case "urltable": case "urltable":
case "geoip": case "geoip":
$urlfn = alias_expand_urltable($aliased['name']); $urlfn = alias_expand_urltable($aliased['name']);
...@@ -619,7 +592,6 @@ function filter_generate_aliases(&$FilterIflist, &$after_filter_configure_run) ...@@ -619,7 +592,6 @@ function filter_generate_aliases(&$FilterIflist, &$after_filter_configure_run)
} }
break; break;
case "urltable_ports": case "urltable_ports":
// TODO: Change it when pf supports tables with ports
$urlfn = alias_expand_urltable($aliased['name']); $urlfn = alias_expand_urltable($aliased['name']);
if ($urlfn) { if ($urlfn) {
$aliases .= "{$aliased['name']} = \"{ " . preg_replace("/\n/", " ", file_get_contents($urlfn)) . " }\"\n"; $aliases .= "{$aliased['name']} = \"{ " . preg_replace("/\n/", " ", file_get_contents($urlfn)) . " }\"\n";
...@@ -635,10 +607,8 @@ function filter_generate_aliases(&$FilterIflist, &$after_filter_configure_run) ...@@ -635,10 +607,8 @@ function filter_generate_aliases(&$FilterIflist, &$after_filter_configure_run)
} }
} }
} }
$result = "{$alias} \n";
$result .= "{$aliases}";
return $result; return $aliases;
} }
function filter_generate_gateways() function filter_generate_gateways()
......
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