From mboxrd@z Thu Jan  1 00:00:00 1970
From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated.
 1bee37ba2cd744820cc16133e4703b2df3a2892f
Date: Tue, 15 Aug 2017 14:30:05 +0100
Message-ID: <20170815133005.876E51081DE1@git01.ipfire.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8353761771245484428=="
List-Id: <ipfire-scm.lists.ipfire.org>

--===============8353761771245484428==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  1bee37ba2cd744820cc16133e4703b2df3a2892f (commit)
      from  4f4f5bbbfded965d41429d438efba429794aae8a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1bee37ba2cd744820cc16133e4703b2df3a2892f
Author: Stephan Feddersen <sfeddersen(a)ipfire.org>
Date:   Tue Aug 15 15:17:35 2017 +0200

    WIO: wio.cgi edit how to get the ips for the networks
   =20
    Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>

-----------------------------------------------------------------------

Summary of changes:
 lfs/wio                |  2 +-
 src/wio/lang/wio.de.pl |  1 +
 src/wio/lang/wio.en.pl |  1 +
 src/wio/wio.cgi        | 19 +++++--------------
 4 files changed, 8 insertions(+), 15 deletions(-)

Difference in files:
diff --git a/lfs/wio b/lfs/wio
index a3c00d9..25726cd 100644
--- a/lfs/wio
+++ b/lfs/wio
@@ -15,7 +15,7 @@ THISAPP    =3D wio-$(VER)
 DIR_APP    =3D $(DIR_SRC)/$(THISAPP)
 TARGET     =3D $(DIR_INFO)/$(THISAPP)
 PROG       =3D wio
-PAK_VER    =3D 1
+PAK_VER    =3D 2
=20
 ############################################################################=
###
 # Top-level Rules
diff --git a/src/wio/lang/wio.de.pl b/src/wio/lang/wio.de.pl
index 430284e..fd82ff0 100644
--- a/src/wio/lang/wio.de.pl
+++ b/src/wio/lang/wio.de.pl
@@ -97,6 +97,7 @@
 'wio_iface' =3D> 'Schnittstelle',
 'wio_client_enable' =3D> 'Client aktivieren?',
 'wio_ping_send' =3D> '=C3=BCberpr=C3=BCfen per',
+'wio_link_open' =3D> 'Link =C3=B6ffnen per',
 'enable disable client' =3D> 'Client aktivieren oder deaktivieren',
 'wio_client_on' =3D> '=C3=9Cberwachung aktiviert (klicken, um zu deaktiviere=
n)',
 'wio_client_off' =3D> '=C3=9Cberwachung deaktiviert (klicken, um zu aktivier=
en)',
diff --git a/src/wio/lang/wio.en.pl b/src/wio/lang/wio.en.pl
index 17312a7..52793b9 100644
--- a/src/wio/lang/wio.en.pl
+++ b/src/wio/lang/wio.en.pl
@@ -97,6 +97,7 @@
 'wio_iface' =3D> 'Interface',
 'wio_client_enable' =3D> 'enable Host ?',
 'wio_ping_send' =3D> 'send ping to',
+'wio_link_open' =3D> 'open link via',
 'enable disable client' =3D> 'enable or disable client',
 'wio_client_on' =3D> 'Client enabled (click to disable)',
 'wio_client_off' =3D> 'Client disabled (click to enable)',
diff --git a/src/wio/wio.cgi b/src/wio/wio.cgi
index 631e468..aa471e6 100644
--- a/src/wio/wio.cgi
+++ b/src/wio/wio.cgi
@@ -47,6 +47,7 @@ use Fatal qw/ open /;
 use Net::Telnet;
=20
 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"} =3D inet_ntoa pack q/N/, (unpack (q/N/, inet_at=
on ($netsettings{"${_}_NETADDRESS"}))+1);
-		my @addrarr =3D split(/\./,$netsettings{"${_}_ADDRESS"});
-		my $ipaddress =3D unpack( "N", pack( "C4",@addrarr ) );
-
-		my @maskarr =3D split(/\./,$netsettings{"${_}_NETMASK"});
-		my $netmask =3D unpack( "N", pack( "C4",@maskarr ) );
-
-		my $bcast =3D ( $ipaddress & $netmask ) + ( ~ $netmask );
-		my @bcastarr =3D inet_ntoa pack q/N/, (unpack (q/N/, inet_aton ($bcast))-1=
);
-
-		$wiosettings{"${_}_IPHIGH"} =3D join(".",@bcastarr);
+		$wiosettings{"${_}_IPLOW"} =3D &Network::find_next_ip_address($netsettings=
{"${_}_NETADDRESS"}, 1);
+		$wiosettings{"${_}_IPHIGH"} =3D &Network::find_next_ip_address($netsetting=
s{"${_}_BROADCAST"}, -1);
 	}
 }
=20
@@ -712,7 +703,7 @@ else {
 print"
 </tr>
 <tr>
-	<td height=3D'30'>$Lang::tr{'wio_ping_send'}:</td>
+	<td height=3D'30'>$Lang::tr{'wio_link_open'}:</td>
 	<td align=3D'left' colspan=3D'5'>
 		<select size=3D'1' name=3D'WEBINTERFACE$count' width=3D'80' style=3D'width=
: 80px'>
 		<option value=3D'----' $selected{'WEBINTERFACE$count'}{'----'}>----</optio=
n>
@@ -1713,7 +1704,7 @@ else {
 print"
 </tr>
 <tr>
-	<td height=3D'30'>$Lang::tr{'wio_ping_send'}:</td>
+	<td height=3D'30'>$Lang::tr{'wio_link_open'}:</td>
 	<td align=3D'left' colspan=3D'5'>
 		<select size=3D'1' name=3D'WEBINTERFACE' width=3D'80' style=3D'width: 80px=
'>
 		<option value=3D'----' $selected{'WEBINTERFACE'}{'----'}>----</option>


hooks/post-receive
--
IPFire 2.x development tree

--===============8353761771245484428==--