From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH v2] add GeoIP and rDNS information to used nameservers Date: Thu, 16 Nov 2017 12:52:26 +0000 Message-ID: <1510836746.4838.466.camel@ipfire.org> In-Reply-To: <20171115224900.2422e927.peter.mueller@link38.eu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5503467063330659854==" List-Id: --===============5503467063330659854== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hi, On Wed, 2017-11-15 at 22:49 +0100, Peter Müller wrote: > Add GeoIP and rDNS information to DNS nameserver list at netexternal.cgi > > Use newly implemented GeoIP function in /var/ipfire/geoip-functions.pl > > Signed-off-by: Peter Müller > --- > html/cgi-bin/netexternal.cgi | 27 ++++++++++++++++++++++++++- > langs/de/cgi-bin/de.pl | 1 + > langs/en/cgi-bin/en.pl | 1 + > 3 files changed, 28 insertions(+), 1 deletion(-) > > diff --git a/html/cgi-bin/netexternal.cgi b/html/cgi-bin/netexternal.cgi > index 299612d4c..4393393e0 100644 > --- a/html/cgi-bin/netexternal.cgi > +++ b/html/cgi-bin/netexternal.cgi > @@ -25,9 +25,12 @@ use strict; > #use warnings; > #use CGI::Carp 'fatalsToBrowser'; > > +use IO::Socket; > + For what is this module being loaded? > require '/var/ipfire/general-functions.pl'; > require "${General::swroot}/lang.pl"; > require "${General::swroot}/header.pl"; > +require "${General::swroot}/geoip-functions.pl"; > require "${General::swroot}/graphs.pl"; > > my %color = (); > @@ -99,6 +102,12 @@ if ( $querry[0] ne~ ""){ > $Lang::tr{'nameserver > '} > > > + $Lang::tr{'country'}< > /strong> > + > + > + $Lang::tr{'rdns'} rong> > + > + > $Lang::tr{'status'} strong> > > > @@ -139,9 +148,25 @@ END > > my $table_colour = ($id++ % 2) ? $color{'color22'} : > $color{'color20'}; > > + # collect more information about name server (rDNS, GeoIP > country code) > + my $ccode = &GeoIP::lookup($nameserver); > + my $flag_icon = &GeoIP::get_flag_icon($ccode); > + > + my $iaddr = inet_aton($nameserver); > + my $rdns = gethostbyaddr($iaddr, AF_INET); > + if (!$rdns) { $rdns = $Lang::tr{'lookup failed'}; } > + > print < > - $nameserver > + > + $nameserver > + > + > + src="$flag_icon" border="0" alt="$ccode" title="$ccode" /> > + > + > + $rdns > + > > color="$colour">$message > > diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl > index 6dff5d781..ae87464d2 100644 > --- a/langs/de/cgi-bin/de.pl > +++ b/langs/de/cgi-bin/de.pl > @@ -1962,6 +1962,7 @@ > 'read bytes' => 'Gelesene Bytes', > 'read list' => 'Liste der Leseberechtigten', > 'real address' => 'Reale Addresse', > +'rdns' => 'rDNS', > 'reboot' => 'Neustart', > 'reboot ask' => 'Neustart?', > 'reboot question' => 'Extra Abfrage bei neustart und herunterfahren > einschalten', > diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl > index 4efff6e65..3af17d5dc 100644 > --- a/langs/en/cgi-bin/en.pl > +++ b/langs/en/cgi-bin/en.pl > @@ -1997,6 +1997,7 @@ > 'quick playlist' => 'Quick Playlist', > 'ram' => 'RAM', > 'random number generator daemon' => 'Random Number Generator Daemon', > +'rdns' => 'rDNS', > 'read bytes' => 'Read Bytes', > 'read list' => 'list with readonly hosts', > 'real address' => 'Real Address', --===============5503467063330659854== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUFCQ2dBZEZpRUU1L3JXNWwzR0dl Mnlwa3R4Z0hudy8yK1FDUWNGQWxvTmlnb0FDZ2tRZ0hudy8yK1EKQ1FmRVpRLy9jaGxJNWFDdnpC NEpSNTl3blhNZmNNN09VNXgzbVNFaDhmSm9wa0NvY0grVVFjY1lUNEsrUHhmWApJZzNGbmVZdWdk dHpvczYyZERlUnhzTFBjV2Z3OG9KelpoaWVtVGR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