Commit c461c641 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: port the last php module function, remove module

While this is a neat milestone, it becomes apparent how convuluted
the code path and interface info polling is.  Looking at it, the
whole interface layer can probably make performance jumps to at least
twice the read or reconfigure speed...

(cherry picked from commit 3f8c0fea)
parent 3be0ab21
......@@ -98,7 +98,6 @@ CORE_DEPENDS?= apinger \
pecl-radius \
pftop \
phalcon \
php-pfSense \
php-suhosin \
php56 \
php56-ctype \
......
......@@ -4620,7 +4620,7 @@ function find_interface_ip($interface)
{
$interface = trim($interface);
if (does_interface_exist($interface)) {
$ifinfo = pfSense_get_interface_addresses($interface);
$ifinfo = legacy_get_interface_addresses($interface);
if (isset($ifinfo['ipaddr'])) {
return $ifinfo['ipaddr'];
}
......@@ -4636,7 +4636,7 @@ function find_interface_ipv6($interface)
// a bit obscure, why should this be different then find_interface_ip?
$interface = get_real_interface(trim($interface));
if (does_interface_exist($interface)) {
$ifinfo = pfSense_get_interface_addresses($interface);
$ifinfo = legacy_get_interface_addresses($interface);
if (isset($ifinfo['ipaddr6'])) {
return $ifinfo['ipaddr6'];
}
......@@ -4668,7 +4668,7 @@ function find_interface_subnet($interface)
{
$interface = trim($interface);
if (does_interface_exist($interface)) {
$ifinfo = pfSense_get_interface_addresses($interface);
$ifinfo = legacy_get_interface_addresses($interface);
if (isset($ifinfo['subnetbits'])) {
return $ifinfo['subnetbits'];
}
......@@ -4680,7 +4680,7 @@ function find_interface_subnetv6($interface)
{
$interface = trim($interface);
if (does_interface_exist($interface)) {
$ifinfo = pfSense_get_interface_addresses($interface);
$ifinfo = legacy_get_interface_addresses($interface);
if (isset($ifinfo['subnetbits6'])) {
return $ifinfo['subnetbits6'];
}
......@@ -4933,10 +4933,10 @@ function is_interface_wireless($interface)
return true;
}
function get_interface_mac($interface)
{
$macinfo = pfSense_get_interface_addresses($interface);
$macinfo = legacy_get_interface_addresses($interface);
return $macinfo["macaddr"];
}
......@@ -5085,13 +5085,10 @@ function get_interface_info($ifdescr)
$ifinfo['if'] = get_real_interface($ifdescr);
$chkif = $ifinfo['if'];
$ifinfotmp = pfSense_get_interface_addresses($chkif);
$ifinfotmp = legacy_get_interface_addresses($chkif);
$ifinfo['macaddr'] = $ifinfotmp['macaddr'];
$ifinfo['ipaddr'] = $ifinfotmp['ipaddr'];
$ifinfo['subnet'] = $ifinfotmp['subnet'];
if (isset($ifinfotmp['link0'])) {
$link0 = 'down';
}
$ifup = legacy_interface_listget('up');
$ifinfo['status'] = in_array($chkif, $ifup) ? 'up' : 'down';
......@@ -5165,8 +5162,8 @@ function get_interface_info($ifdescr)
case "pppoe":
case "pptp":
case "l2tp":
if ($ifinfo['status'] == "up" && !isset($link0)) {
/* get PPPoE link status for dial on demand */
if ($ifinfo['status'] == "up") {
/* XXX get PPPoE link status for dial on demand */
$ifinfo["{$link_type}link"] = "up";
} else {
$ifinfo["{$link_type}link"] = "down";
......
......@@ -916,7 +916,7 @@ function get_interface_list($only_active = false)
continue;
}
$ifdata = pfSense_get_interface_addresses($ifname);
$ifdata = legacy_get_interface_addresses($ifname);
$toput = array(
'up' => in_array($ifname, $ifnames_up),
......
......@@ -62,8 +62,6 @@ PHPMODULES="$PHPMODULES zlib"
PHPMODULES="$PHPMODULES sqlite3"
# RADIUS
PHPMODULES="$PHPMODULES radius"
# pfSense extensions
PHPMODULES="$PHPMODULES pfSense"
# json
PHPMODULES="$PHPMODULES json"
# filter
......
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