]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
WIO: wio.cgi edit how to get the ips for the networks
authorStephan Feddersen <sfeddersen@ipfire.org>
Tue, 15 Aug 2017 13:17:35 +0000 (15:17 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 15 Aug 2017 13:24:34 +0000 (14:24 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/wio
src/wio/lang/wio.de.pl
src/wio/lang/wio.en.pl
src/wio/wio.cgi

diff --git a/lfs/wio b/lfs/wio
index a3c00d9f2d917ff558d6852ee85332d30f0f61ac..25726cd934a46028f69be993b8b49490887e350d 100644 (file)
--- a/lfs/wio
+++ b/lfs/wio
@@ -15,7 +15,7 @@ THISAPP    = wio-$(VER)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = wio
-PAK_VER    = 1
+PAK_VER    = 2
 
 ###############################################################################
 # Top-level Rules
index 430284e522d69a9e6bf9eed600f20aac4bb9da58..fd82ff00d10292c77d7045789a5a315c4df6132b 100644 (file)
@@ -97,6 +97,7 @@
 'wio_iface' => 'Schnittstelle',
 'wio_client_enable' => 'Client aktivieren?',
 'wio_ping_send' => 'überprüfen per',
+'wio_link_open' => 'Link öffnen per',
 'enable disable client' => 'Client aktivieren oder deaktivieren',
 'wio_client_on' => 'Überwachung aktiviert (klicken, um zu deaktivieren)',
 'wio_client_off' => 'Überwachung deaktiviert (klicken, um zu aktivieren)',
index 17312a7594fd943f0851f0b99cfe14c9ea9e1638..52793b90818c96c4b18e6ebde27c627f0b65cafd 100644 (file)
@@ -97,6 +97,7 @@
 'wio_iface' => 'Interface',
 'wio_client_enable' => 'enable Host ?',
 'wio_ping_send' => 'send ping to',
+'wio_link_open' => 'open link via',
 'enable disable client' => 'enable or disable client',
 'wio_client_on' => 'Client enabled (click to disable)',
 'wio_client_off' => 'Client disabled (click to enable)',
index 631e468f102c8e1bcfd5250f7e82d3287cafa274..aa471e621a4ccbb2f15e0f3257c9aa9ee7852b38 100644 (file)
@@ -47,6 +47,7 @@ use Fatal qw/ open /;
 use Net::Telnet;
 
 require '/var/ipfire/general-functions.pl';
+require '/var/ipfire/network-functions.pl';
 require '/var/ipfire/lang.pl';
 require '/var/ipfire/header.pl';
 require '/usr/lib/wio/wio-lib.pl';
@@ -166,18 +167,8 @@ if ( -e $wiofile ) { goto WIOSCAN; }
 ## get network ips
 foreach (@devs_color) {
        if ( $netsettings{"${_}_DEV"} ne '' ) {
-
-               $wiosettings{"${_}_IPLOW"} = inet_ntoa pack q/N/, (unpack (q/N/, inet_aton ($netsettings{"${_}_NETADDRESS"}))+1);
-               my @addrarr = split(/\./,$netsettings{"${_}_ADDRESS"});
-               my $ipaddress = unpack( "N", pack( "C4",@addrarr ) );
-
-               my @maskarr = split(/\./,$netsettings{"${_}_NETMASK"});
-               my $netmask = unpack( "N", pack( "C4",@maskarr ) );
-
-               my $bcast = ( $ipaddress & $netmask ) + ( ~ $netmask );
-               my @bcastarr = inet_ntoa pack q/N/, (unpack (q/N/, inet_aton ($bcast))-1);
-
-               $wiosettings{"${_}_IPHIGH"} = join(".",@bcastarr);
+               $wiosettings{"${_}_IPLOW"} = &Network::find_next_ip_address($netsettings{"${_}_NETADDRESS"}, 1);
+               $wiosettings{"${_}_IPHIGH"} = &Network::find_next_ip_address($netsettings{"${_}_BROADCAST"}, -1);
        }
 }
 
@@ -712,7 +703,7 @@ else {
 print"
 </tr>
 <tr>
-       <td height='30'>$Lang::tr{'wio_ping_send'}:</td>
+       <td height='30'>$Lang::tr{'wio_link_open'}:</td>
        <td align='left' colspan='5'>
                <select size='1' name='WEBINTERFACE$count' width='80' style='width: 80px'>
                <option value='----' $selected{'WEBINTERFACE$count'}{'----'}>----</option>
@@ -1713,7 +1704,7 @@ else {
 print"
 </tr>
 <tr>
-       <td height='30'>$Lang::tr{'wio_ping_send'}:</td>
+       <td height='30'>$Lang::tr{'wio_link_open'}:</td>
        <td align='left' colspan='5'>
                <select size='1' name='WEBINTERFACE' width='80' style='width: 80px'>
                <option value='----' $selected{'WEBINTERFACE'}{'----'}>----</option>