From 22299b2731a258e67f25b56adf5df10f94f9b75e Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 12 Mar 2010 18:52:18 +0000 Subject: : --- config/openospfd/openospfd.inc | 20 +++++++++++++++++++- config/openospfd/openospfd_interfaces.xml | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/config/openospfd/openospfd.inc b/config/openospfd/openospfd.inc index e0764031..c131142a 100644 --- a/config/openospfd/openospfd.inc +++ b/config/openospfd/openospfd.inc @@ -27,6 +27,24 @@ POSSIBILITY OF SUCH DAMAGE. */ +function ospfd_display_friendlyiface () { + global $evaledvar, $config, $g; + + if (intval($g['latest_config']) >= 6) + return; + + if ($evaledvar) { + foreach ($evaledvar as $idx => $field) { + if ($field['interface']) { + if (empty($config['interfaces'][$field['interface']]['descr'])) + $evaledvar[$idx]['interface'] = strtoupper($evaledvar[$idx]['interface']); + else + $evaledvar[$idx]['interface'] = $config['interfaces'][$field['interface']]['descr']; + } + } + } +} + function ospfd_install_conf() { global $config, $g, $input_errors; @@ -222,4 +240,4 @@ function is_ospfd_running() { return false; } -?> \ No newline at end of file +?> diff --git a/config/openospfd/openospfd_interfaces.xml b/config/openospfd/openospfd_interfaces.xml index e8b18fcf..445eefea 100644 --- a/config/openospfd/openospfd_interfaces.xml +++ b/config/openospfd/openospfd_interfaces.xml @@ -4,6 +4,7 @@ Services: OpenOSPFd /usr/local/pkg/openospfd.inc pkg.php?xml=openospfd_interfaces.xml + ospfd_display_friendlyiface(); /usr/local/pkg/ 077 -- cgit v1.2.3