From a55e9c701c2fc8914e0aebf12e37038f59b07cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Mon, 30 Mar 2009 00:37:45 +0000 Subject: * Hide interfaces internals to other code and use the propper interfaces. Basically use get_interface*() functions instead of accessing fields like 'ipaddr'/'descr' etc... * Make get_interfaces_with_gateway less heavyweight by getting information from the configuration stored in config.xml * Some other missed custom interface list building and substituing with propper get_configured_interface*() NOTE: This should give indipendce on dynamic interfaces on some services that before could not be used on top of this type of interfaces. --- usr/local/www/services_wol.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usr/local/www/services_wol.php') diff --git a/usr/local/www/services_wol.php b/usr/local/www/services_wol.php index f6a87d9..a04920b 100755 --- a/usr/local/www/services_wol.php +++ b/usr/local/www/services_wol.php @@ -51,8 +51,8 @@ if($_GET['wakeall'] <> "") { foreach ($a_wol as $wolent) { $mac = $wolent['mac']; $if = $wolent['interface']; - $bcip = gen_subnet_max($config['interfaces'][$if]['ipaddr'], - $config['interfaces'][$if]['subnet']); + $bcip = gen_subnet_max($get_interface_ip($if), + get_interface_subnet($if)); mwexec("/usr/local/bin/wol -i {$bcip} {$mac}"); $savemsg .= "Sent magic packet to {$mac}.
"; } @@ -81,8 +81,8 @@ if ($_POST || $_GET['mac']) { if (!$input_errors) { /* determine broadcast address */ - $bcip = gen_subnet_max($config['interfaces'][$if]['ipaddr'], - $config['interfaces'][$if]['subnet']); + $bcip = gen_subnet_max(get_interface_ip($if), + get_interface_subnet($if)); mwexec("/usr/local/bin/wol -i {$bcip} {$mac}"); $savemsg = "Sent magic packet to {$mac}."; -- cgit v1.1