Signed-off-by: Peter Müller peter.mueller@ipfire.org --- config/cfgroot/location-functions.pl | 68 +++++++++++++++++++--------- 1 file changed, 46 insertions(+), 22 deletions(-)
diff --git a/config/cfgroot/location-functions.pl b/config/cfgroot/location-functions.pl index 2cfe7f908..ee03a6611 100644 --- a/config/cfgroot/location-functions.pl +++ b/config/cfgroot/location-functions.pl @@ -1,25 +1,23 @@ #!/usr/bin/perl -w -############################################################################ -# # -# This file is part of the IPFire Firewall. # -# # -# IPFire is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# IPFire is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with IPFire; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -# Copyright (C) 2015 - 2020 IPFire Team info@ipfire.org. # -# # -############################################################################ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2020 IPFire Team info@ipfire.org # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +###############################################################################
package Location::Functions;
@@ -83,7 +81,7 @@ sub verify ($) { }
# -## Function to the the country code of a given address. +## Function to get the country code of a given address. # sub lookup_country_code($$) { my ($db_handle, $address) = @_; @@ -221,4 +219,30 @@ sub address_has_flags($) { return @flags; }
+# +## Function to get the Autonomous System Number of a given address. +# +sub lookup_asn($$) { + my ($db_handle, $address) = @_; + + # Lookup the given address. + my $asn = &Location::lookup_asn($db_handle, $address); + + # Return the number of the Autonomous System + return $asn; +} + +# +## Function to get the name of an Autonomous System. +# +sub get_as_name($$) { + my ($db_handle, $asn) = @_; + + # Fetch the name of this AS... + my $as_name = &Location::get_as_name($db_handle, $asn); + + # Return the name of the Autonomous System + return $as_name; +} + 1;
Signed-off-by: Peter Müller peter.mueller@ipfire.org --- html/cgi-bin/ipinfo.cgi | 143 +++++++++++++++++++++++++--------------- 1 file changed, 91 insertions(+), 52 deletions(-)
diff --git a/html/cgi-bin/ipinfo.cgi b/html/cgi-bin/ipinfo.cgi index d8cb6c6b7..1b56e08f9 100644 --- a/html/cgi-bin/ipinfo.cgi +++ b/html/cgi-bin/ipinfo.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2010 IPFire Team info@ipfire.org # +# Copyright (C) 2007-2020 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -32,12 +32,16 @@ require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; require "${General::swroot}/location-functions.pl";
+# Load colours for current theme... +my %color = (); +my %mainsettings = (); +&General::readhash("${General::swroot}/main/settings", %mainsettings); +&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", %color); + my %cgiparams=();
&Header::showhttpheaders();
-&Header::openpage($Lang::tr{'ip info'}, 1, ''); -&Header::openbigbox('100%', 'left'); my @lines=(); my $extraquery='';
@@ -57,18 +61,38 @@ my $whois_server = "whois.arin.net"; my $addr = CGI::param("ip") || "";
if (&General::validip($addr)) { + # Write HTML page header... + &Header::openpage($Lang::tr{'ip info for'} . ' ' . $addr, 1, ''); + &Header::openbigbox('100%', 'left'); + my $iaddr = inet_aton($addr); my $hostname = gethostbyaddr($iaddr, AF_INET); - if (!$hostname) { $hostname = $Lang::tr{'lookup failed'}; } + if (!$hostname) { $hostname = $Lang::tr{'ptr lookup failed'}; }
- # enumerate location information for IP address... + # Enumerate location information for IP address... my $db_handle = &Location::Functions::init(); my $ccode = &Location::Functions::lookup_country_code($db_handle, $addr); + my $cname = &Location::Functions::get_full_country_name($ccode); my @network_flags = &Location::Functions::address_has_flags($addr);
# Try to get the continent of the country code. my $continent = &Location::get_continent_code($db_handle, $ccode);
+ # Enumerate Autonomous System details for IP address... + my $asn = &Location::Functions::lookup_asn($db_handle, $addr); + my $as_name; + if ($asn) { + $as_name = &Location::Functions::get_as_name($db_handle, $asn); + + # In case we have found an AS name, make output more readable... + if ($as_name) { + $as_name = "- " . $as_name; + } + $asn = "AS" . $asn; + } else { + $asn = $Lang::tr{'asn lookup failed'}; + } + # Check if a whois server for the continent is known. if($whois_servers_by_continent{$continent}) { # Use it. @@ -77,6 +101,63 @@ if (&General::validip($addr)) {
my $flag_icon = &Location::Functions::get_flag_icon($ccode);
+ &Header::openbox('100%', 'left', $Lang::tr{'ip basic info'}); + + print <<END; + <center> + <table class="tbl" width='100%'> + <tr> + <td bgcolor='$color{'color22'}'><strong>$Lang::tr{'country'}</strong></td> + <td bgcolor='$color{'color22'}'>$cname <a href='country.cgi#$ccode'><img src="$flag_icon" border="0" alt="$cname" title="$cname" /></td> + </tr> + <tr> + <td bgcolor='$color{'color20'}'><strong>$Lang::tr{'ptr'}</strong></td> + <td bgcolor='$color{'color20'}'>$hostname</td> + </tr> + <tr> + <td bgcolor='$color{'color22'}'><strong>$Lang::tr{'autonomous system'}</strong></td> + <td bgcolor='$color{'color22'}'>$asn $as_name</td> + </tr> +END + + # Check if the address has a flag. + if (@network_flags) { + # Get amount of flags for this network. + my $flags_amount = @network_flags; + my $processed_flags; + + # Loop through the array of network_flags. + foreach my $network_flag (@network_flags) { + # Increment value of processed flags. + $processed_flags++; + + # Get the network flag name. + my $network_flag_name = &Location::Functions::get_full_country_name($network_flag); + + # Colorize columns. + my $col; + if ($processed_flags % 2) { + $col = "bgcolor='$color{'color20'}'"; } + else { + $col = "bgcolor='$color{'color22'}'"; + } + + # Write table row... + print <<END; + <tr> + <td $col><strong>$network_flag_name</strong></td> + <td $col>$Lang::tr{'yes'}</td> + </tr> +END + } + } + + + print " </table>\n"; + print " </center>\n"; + + &Header::closebox(); + my $sock = new IO::Socket::INET ( PeerAddr => $whois_server, PeerPort => 43, Proto => 'tcp'); if ($sock) { @@ -108,53 +189,7 @@ if (&General::validip($addr)) { @lines = ( "$Lang::tr{'unable to contact'} $whois_server" ); }
- &Header::openbox('100%', 'left', $addr . " <a href='country.cgi#$ccode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode' /></a> (" . $hostname . ') : '.$whois_server); - - # Check if the address has a flag. - if (@network_flags) { - # Get amount of flags for this network. - my $flags_amount = @network_flags; - my $processed_flags; - - # The message string which will be displayed. - my $message_string = "This address is marked as"; - - # Loop through the array of network_flags. - foreach my $network_flag (@network_flags) { - # Increment value of processed flags. - $processed_flags++; - - # Get the network flag name. - my $network_flag_name = &Location::Functions::get_full_country_name($network_flag); - - # Add the flag name to the message string. - $message_string = "$message_string" . " $network_flag_name"; - - # Check if multiple flags are set for this network. - if ($flags_amount gt "1") { - # Check if the the current flag is the next-to-last one. - if ($processed_flags eq $flags_amount - 1) { - $message_string = "$message_string" . " and "; - - # Check if the current flag it the last one. - } elsif ($processed_flags eq $flags_amount) { - # The message is finished add a dot for ending the sentence. - $message_string = "$message_string" . "."; - - # Otherwise add a simple comma to the message string. - } else { - $message_string = "$message_string" . ", "; - } - } else { - # Nothing special to do, simple add a dot to finish the sentence. - $message_string = "$message_string" . "."; - } - } - - # Display the generated notice. - print "<h3>$message_string</h3>\n"; - print "<br>\n"; - } + &Header::openbox('100%', 'left', $Lang::tr{'whois results from'} . " " . $whois_server);
print "<pre>\n"; foreach my $line (@lines) { @@ -163,6 +198,10 @@ if (&General::validip($addr)) { print "</pre>\n"; &Header::closebox(); } else { + # Open HTML page header in case of invalid IP addresses + &Header::openpage($Lang::tr{'ip info'}, 1, ''); + &Header::openbigbox('100%', 'left'); + &Header::openbox('100%', 'left', $Lang::tr{'invalid ip'}); print <<EOF; <p style="text-align: center;">
Signed-off-by: Peter Müller peter.mueller@ipfire.org --- html/cgi-bin/dns.cgi | 2 +- html/cgi-bin/remote.cgi | 4 ++-- langs/de/cgi-bin/de.pl | 8 ++++++-- langs/en/cgi-bin/en.pl | 8 ++++++-- langs/es/cgi-bin/es.pl | 2 +- langs/fr/cgi-bin/fr.pl | 2 +- langs/it/cgi-bin/it.pl | 2 +- langs/nl/cgi-bin/nl.pl | 2 +- langs/pl/cgi-bin/pl.pl | 2 +- langs/ru/cgi-bin/ru.pl | 2 +- langs/tr/cgi-bin/tr.pl | 2 +- 11 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi index 0a097e2c0..fc8d65308 100755 --- a/html/cgi-bin/dns.cgi +++ b/html/cgi-bin/dns.cgi @@ -609,7 +609,7 @@ END $rdns = gethostbyaddr($iaddr, AF_INET); }
- if (!$rdns) { $rdns = $Lang::tr{'lookup failed'}; } + if (!$rdns) { $rdns = $Lang::tr{'ptr lookup failed'}; }
# Mark ISP name servers as disabled if ($id <= 2 && $enabled eq "disabled") { diff --git a/html/cgi-bin/remote.cgi b/html/cgi-bin/remote.cgi index 9c742669b..a99628aec 100644 --- a/html/cgi-bin/remote.cgi +++ b/html/cgi-bin/remote.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2019 IPFire Team info@ipfire.org # +# Copyright (C) 2007-2020 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -297,7 +297,7 @@ sub printactivelogins() # get rDNS... my $iaddr = inet_aton($remoteip); my $rdns = gethostbyaddr($iaddr, AF_INET); - if (!$rdns) { $rdns = $Lang::tr{'lookup failed'}; }; + if (!$rdns) { $rdns = $Lang::tr{'ptr lookup failed'}; };
my $table_colour = ($id++ % 2) ? $color{'color22'} : $color{'color20'};
diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 6ad0e02c5..63b2844ec 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -444,12 +444,14 @@ 'are you sure' => 'Sind Sie sicher?', 'arp table entries' => 'Einträge der ARP-Tabelle', 'artist' => 'Künstler', +'asn lookup failed' => 'AS-Auflösung gescheitert', 'atm device' => 'Device:', 'atm settings' => 'ATM-Einstellungen', 'attemps' => 'Versuche', 'attention' => 'ACHTUNG', 'august' => 'August', 'authentication' => 'Authentifizierung:', +'autonomous system' => 'Autonomes System', 'automatic' => 'Automatisch', 'available updates' => 'Verfügbare Updates:', 'average' => 'Durchschnitt', @@ -1504,7 +1506,8 @@ 'ip alias added' => 'Externer IP-Alias hinzugefügt', 'ip alias changed' => 'Externer IP-Alias geändert', 'ip alias removed' => 'Externer IP-Alias entfernt', -'ip info' => 'IP-Information', +'ip info' => 'IP-Informationen', +'ip info for' => 'IP-Informationen für', 'ipfire has now rebooted' => 'IPFire wird neu gestartet.', 'ipfire has now shutdown' => 'IPFire wird heruntergefahren.', 'ipfire side' => 'IPFire Seite:', @@ -1596,7 +1599,6 @@ 'logging server' => 'Protokollierungsserver', 'loginlogout' => 'Login/Logout', 'logs' => 'Protokolldateien', -'lookup failed' => 'Reverse Lookup gescheitert', 'loosedirectorychecking' => 'Loose directorychecking', 'low' => 'Niedrig', 'ls_dhcpd' => 'DHCP-Server:', @@ -2069,6 +2071,7 @@ 'proxy reports weekly' => 'Wöchentliche Berichte', 'psk' => 'PSK', 'ptr' => 'PTR', +'ptr lookup failed' => 'Reverse Lookup gescheitert', 'pulse' => 'Puls', 'pulse dial' => 'Pulswahl:', 'qos add subclass' => 'Unterklasse hinzufügen', @@ -2864,6 +2867,7 @@ 'week-graph' => 'Woche', 'weekly firewallhits' => 'wöchentliche Firewalltreffer', 'weeks' => 'Wochen', +'whois results from' => 'WHOIS-Ergebnisse von', 'wildcards' => 'Wildcards', 'wins server' => 'WINS-Server', 'wins support' => 'WINS-Support', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index d00de3d03..1cdfe2bfd 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -443,12 +443,14 @@ 'are you sure' => 'Are you sure?', 'arp table entries' => 'ARP Table Entries', 'artist' => 'Artist', +'asn lookup failed' => 'AS lookup failed', 'atm device' => 'Device:', 'atm settings' => 'ATM settings', 'attemps' => 'Attempts', 'attention' => 'ATTENTION', 'august' => 'August', 'authentication' => 'Authentication:', +'autonomous system' => 'Autonomous System', 'automatic' => 'Automatic', 'available updates' => 'Available updates:', 'average' => 'Average', @@ -1531,7 +1533,8 @@ 'ip alias added' => 'External IP alias added', 'ip alias changed' => 'External IP alias changed', 'ip alias removed' => 'External IP alias removed', -'ip info' => 'IP Information', +'ip info' => 'IP information', +'ip info' => 'IP information for', 'ipfire has now rebooted' => 'IPFire is rebooting now.', 'ipfire has now shutdown' => 'IPFire is shutting down now.', 'ipfire side' => 'IPFire side:', @@ -1623,7 +1626,6 @@ 'logging server' => 'Logging Server', 'loginlogout' => 'Login/Logout', 'logs' => 'logs', -'lookup failed' => 'Reverse lookup failed', 'loosedirectorychecking' => 'Loosedirectorychecking', 'low' => 'Low', 'ls_dhcpd' => 'DHCP Server:', @@ -2099,6 +2101,7 @@ 'proxy reports weekly' => 'Weekly reports', 'psk' => 'PSK', 'ptr' => 'PTR', +'ptr lookup failed' => 'Reverse lookup failed', 'pulse' => 'Pulse', 'pulse dial' => 'Pulse dial:', 'qos add subclass' => 'Add subclass', @@ -2907,6 +2910,7 @@ 'week-graph' => 'Week', 'weekly firewallhits' => 'weekly firewallhits', 'weeks' => 'Weeks', +'whois results from' => 'WHOIS results from', 'wildcards' => 'Wildcards', 'winbind daemon' => 'Winbind Daemon', 'wins server' => 'Wins Server', diff --git a/langs/es/cgi-bin/es.pl b/langs/es/cgi-bin/es.pl index ae155d26b..0e9b13787 100644 --- a/langs/es/cgi-bin/es.pl +++ b/langs/es/cgi-bin/es.pl @@ -1096,7 +1096,7 @@ 'logging server' => 'Servidor de conexión', 'loginlogout' => 'Login/Logout', 'logs' => 'registros', -'lookup failed' => 'Falló la búsqueda reversiva', +'ptr lookup failed' => 'Falló la búsqueda reversiva', 'loosedirectorychecking' => 'Chequeo de loosedirectory', 'low' => 'Bajo', 'ls_dhcpd' => 'Servidor DHCP:', diff --git a/langs/fr/cgi-bin/fr.pl b/langs/fr/cgi-bin/fr.pl index 00328440d..9cc4be695 100644 --- a/langs/fr/cgi-bin/fr.pl +++ b/langs/fr/cgi-bin/fr.pl @@ -1629,7 +1629,7 @@ 'logging server' => 'Serveur de connexion', 'loginlogout' => 'Connexion/Quitter', 'logs' => 'Journaux', -'lookup failed' => 'La recherche inversée a échouée', +'ptr lookup failed' => 'La recherche inversée a échouée', 'loosedirectorychecking' => 'Echec de la vérification du répertoire', 'low' => 'Bas', 'ls_dhcpd' => 'Serveur DHCP :', diff --git a/langs/it/cgi-bin/it.pl b/langs/it/cgi-bin/it.pl index d0e9dc4c9..b45be4207 100644 --- a/langs/it/cgi-bin/it.pl +++ b/langs/it/cgi-bin/it.pl @@ -1410,7 +1410,7 @@ 'logging server' => 'Logging Server', 'loginlogout' => 'Login/Logout', 'logs' => 'Gestione Log', -'lookup failed' => 'Reverse lookup failed', +'ptr lookup failed' => 'Reverse lookup failed', 'loosedirectorychecking' => 'Loosedirectorychecking', 'low' => 'Basso', 'ls_dhcpd' => 'DHCP Server:', diff --git a/langs/nl/cgi-bin/nl.pl b/langs/nl/cgi-bin/nl.pl index f67eb0383..4e471a597 100644 --- a/langs/nl/cgi-bin/nl.pl +++ b/langs/nl/cgi-bin/nl.pl @@ -1389,7 +1389,7 @@ 'logging server' => 'Loggingserver', 'loginlogout' => 'Login/Logout', 'logs' => 'logs', -'lookup failed' => 'Reverse lookup mislukt', +'ptr lookup failed' => 'Reverse lookup mislukt', 'loosedirectorychecking' => 'Loosedirectorychecking', 'low' => 'Laag', 'ls_dhcpd' => 'DHCP Server:', diff --git a/langs/pl/cgi-bin/pl.pl b/langs/pl/cgi-bin/pl.pl index 3f4fc0143..fb2b40787 100644 --- a/langs/pl/cgi-bin/pl.pl +++ b/langs/pl/cgi-bin/pl.pl @@ -1095,7 +1095,7 @@ 'logging server' => 'Serwer logowania', 'loginlogout' => 'Zalogowanie/wylogowanie', 'logs' => 'logi', -'lookup failed' => 'Reverse lookup failed', +'ptr lookup failed' => 'Reverse lookup failed', 'loosedirectorychecking' => 'Loosedirectorychecking', 'low' => 'Niski', 'ls_dhcpd' => 'Serwer DHCP:', diff --git a/langs/ru/cgi-bin/ru.pl b/langs/ru/cgi-bin/ru.pl index 2c91a3fee..074f0cb2f 100644 --- a/langs/ru/cgi-bin/ru.pl +++ b/langs/ru/cgi-bin/ru.pl @@ -1088,7 +1088,7 @@ 'logging server' => 'Сервер Логов', 'loginlogout' => 'Login/Logout', 'logs' => 'Логи', -'lookup failed' => 'Reverse lookup failed', +'ptr lookup failed' => 'Reverse lookup failed', 'loosedirectorychecking' => 'Loosedirectorychecking', 'low' => 'Low', 'ls_dhcpd' => 'DHCP сервер:', diff --git a/langs/tr/cgi-bin/tr.pl b/langs/tr/cgi-bin/tr.pl index b958d63fe..eeb1e13ce 100644 --- a/langs/tr/cgi-bin/tr.pl +++ b/langs/tr/cgi-bin/tr.pl @@ -1540,7 +1540,7 @@ 'logging server' => 'Günlük Sunucusu', 'loginlogout' => 'Giriş/Çıkış', 'logs' => 'Günlükler', -'lookup failed' => 'Ters arama başarısız', +'ptr lookup failed' => 'Ters arama başarısız', 'loosedirectorychecking' => 'Serbest Dizin Denetimi', 'low' => 'Düşük', 'ls_dhcpd' => 'DHCP Sunucusu:',
Signed-off-by: Peter Müller peter.mueller@ipfire.org --- html/cgi-bin/ipinfo.cgi | 1 - langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 1 + 3 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/html/cgi-bin/ipinfo.cgi b/html/cgi-bin/ipinfo.cgi index 1b56e08f9..4d0e1f63a 100644 --- a/html/cgi-bin/ipinfo.cgi +++ b/html/cgi-bin/ipinfo.cgi @@ -152,7 +152,6 @@ END } }
- print " </table>\n"; print " </center>\n";
diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 63b2844ec..c2c527851 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1506,6 +1506,7 @@ 'ip alias added' => 'Externer IP-Alias hinzugefügt', 'ip alias changed' => 'Externer IP-Alias geändert', 'ip alias removed' => 'Externer IP-Alias entfernt', +'ip basic info' => 'Grundlegende IP-Informationen', 'ip info' => 'IP-Informationen', 'ip info for' => 'IP-Informationen für', 'ipfire has now rebooted' => 'IPFire wird neu gestartet.', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 1cdfe2bfd..29a72a377 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1533,6 +1533,7 @@ 'ip alias added' => 'External IP alias added', 'ip alias changed' => 'External IP alias changed', 'ip alias removed' => 'External IP alias removed', +'ip basic info' => 'Basic IP information', 'ip info' => 'IP information', 'ip info' => 'IP information for', 'ipfire has now rebooted' => 'IPFire is rebooting now.',
Hello,
On 3 Nov 2020, at 14:28, Peter Müller peter.mueller@ipfire.org wrote:
Signed-off-by: Peter Müller peter.mueller@ipfire.org
config/cfgroot/location-functions.pl | 68 +++++++++++++++++++--------- 1 file changed, 46 insertions(+), 22 deletions(-)
diff --git a/config/cfgroot/location-functions.pl b/config/cfgroot/location-functions.pl index 2cfe7f908..ee03a6611 100644 --- a/config/cfgroot/location-functions.pl +++ b/config/cfgroot/location-functions.pl @@ -1,25 +1,23 @@ #!/usr/bin/perl -w -############################################################################ -# # -# This file is part of the IPFire Firewall. # -# # -# IPFire is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# IPFire is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with IPFire; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -# Copyright (C) 2015 - 2020 IPFire Team info@ipfire.org. # -# # -############################################################################ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2020 IPFire Team info@ipfire.org # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +###############################################################################
What is the reason for upgrading the license of this file to GPLv3?
package Location::Functions;
@@ -83,7 +81,7 @@ sub verify ($) { }
# -## Function to the the country code of a given address. +## Function to get the country code of a given address. # sub lookup_country_code($$) { my ($db_handle, $address) = @_; @@ -221,4 +219,30 @@ sub address_has_flags($) { return @flags; }
+# +## Function to get the Autonomous System Number of a given address. +# +sub lookup_asn($$) {
- my ($db_handle, $address) = @_;
- # Lookup the given address.
- my $asn = &Location::lookup_asn($db_handle, $address);
- # Return the number of the Autonomous System
- return $asn;
+}
+# +## Function to get the name of an Autonomous System. +# +sub get_as_name($$) {
- my ($db_handle, $asn) = @_;
- # Fetch the name of this AS...
- my $as_name = &Location::get_as_name($db_handle, $asn);
- # Return the name of the Autonomous System
- return $as_name;
+}
1;
2.26.2
Hello Michael,
What is the reason for upgrading the license of this file to GPLv3?
actually, there is none. Whenever I edit a file containing license information, I try to update outdated information ("Michael Tremer & Christian Schmidt" et al.) in order to tidy things up.
It completely slipped my mind that we have a mixture of GPLv3 (some LFS files) and GPLv2 here... Do you want me to send in an updated patchset?
Thanks, and best regards, Peter Müller
Hello,
On 3 Nov 2020, at 14:28, Peter Müller peter.mueller@ipfire.org wrote:
Signed-off-by: Peter Müller peter.mueller@ipfire.org
config/cfgroot/location-functions.pl | 68 +++++++++++++++++++--------- 1 file changed, 46 insertions(+), 22 deletions(-)
diff --git a/config/cfgroot/location-functions.pl b/config/cfgroot/location-functions.pl index 2cfe7f908..ee03a6611 100644 --- a/config/cfgroot/location-functions.pl +++ b/config/cfgroot/location-functions.pl @@ -1,25 +1,23 @@ #!/usr/bin/perl -w -############################################################################ -# # -# This file is part of the IPFire Firewall. # -# # -# IPFire is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# IPFire is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with IPFire; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -# Copyright (C) 2015 - 2020 IPFire Team info@ipfire.org. # -# # -############################################################################ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2020 IPFire Team info@ipfire.org # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +###############################################################################
What is the reason for upgrading the license of this file to GPLv3?
package Location::Functions;
@@ -83,7 +81,7 @@ sub verify ($) { }
# -## Function to the the country code of a given address. +## Function to get the country code of a given address. # sub lookup_country_code($$) { my ($db_handle, $address) = @_; @@ -221,4 +219,30 @@ sub address_has_flags($) { return @flags; }
+# +## Function to get the Autonomous System Number of a given address. +# +sub lookup_asn($$) {
- my ($db_handle, $address) = @_;
- # Lookup the given address.
- my $asn = &Location::lookup_asn($db_handle, $address);
- # Return the number of the Autonomous System
- return $asn;
+}
+# +## Function to get the name of an Autonomous System. +# +sub get_as_name($$) {
- my ($db_handle, $asn) = @_;
- # Fetch the name of this AS...
- my $as_name = &Location::get_as_name($db_handle, $asn);
- # Return the name of the Autonomous System
- return $as_name;
+}
1;
2.26.2
Hi,
On 6 Nov 2020, at 13:57, Peter Müller peter.mueller@ipfire.org wrote:
Hello Michael,
What is the reason for upgrading the license of this file to GPLv3?
actually, there is none. Whenever I edit a file containing license information, I try to update outdated information ("Michael Tremer & Christian Schmidt" et al.) in order to tidy things up.
Yes, that is indeed a bit outdated by now.
Should we not have one big patch fixing that in the whole repository?
It completely slipped my mind that we have a mixture of GPLv3 (some LFS files) and GPLv2 here... Do you want me to send in an updated patchset?
Yes, I think we should keep things under the licenses that they are under.
Otherwise we might need to collect people’s consent and there might be other implications too.
Best, -Michael
Thanks, and best regards, Peter Müller
Hello,
On 3 Nov 2020, at 14:28, Peter Müller peter.mueller@ipfire.org wrote:
Signed-off-by: Peter Müller peter.mueller@ipfire.org
config/cfgroot/location-functions.pl | 68 +++++++++++++++++++--------- 1 file changed, 46 insertions(+), 22 deletions(-)
diff --git a/config/cfgroot/location-functions.pl b/config/cfgroot/location-functions.pl index 2cfe7f908..ee03a6611 100644 --- a/config/cfgroot/location-functions.pl +++ b/config/cfgroot/location-functions.pl @@ -1,25 +1,23 @@ #!/usr/bin/perl -w -############################################################################ -# # -# This file is part of the IPFire Firewall. # -# # -# IPFire is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# IPFire is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with IPFire; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -# Copyright (C) 2015 - 2020 IPFire Team info@ipfire.org. # -# # -############################################################################ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2020 IPFire Team info@ipfire.org # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +###############################################################################
What is the reason for upgrading the license of this file to GPLv3?
package Location::Functions;
@@ -83,7 +81,7 @@ sub verify ($) { }
# -## Function to the the country code of a given address. +## Function to get the country code of a given address. # sub lookup_country_code($$) { my ($db_handle, $address) = @_; @@ -221,4 +219,30 @@ sub address_has_flags($) { return @flags; }
+# +## Function to get the Autonomous System Number of a given address. +# +sub lookup_asn($$) {
- my ($db_handle, $address) = @_;
- # Lookup the given address.
- my $asn = &Location::lookup_asn($db_handle, $address);
- # Return the number of the Autonomous System
- return $asn;
+}
+# +## Function to get the name of an Autonomous System. +# +sub get_as_name($$) {
- my ($db_handle, $asn) = @_;
- # Fetch the name of this AS...
- my $as_name = &Location::get_as_name($db_handle, $asn);
- # Return the name of the Autonomous System
- return $as_name;
+}
1;
2.26.2
Hello Michael,
sorry for replying late on this.
Yes, that is indeed a bit outdated by now.
Should we not have one big patch fixing that in the whole repository?
Yes, that would probably be the better way of doing this. I will take care of it...
Yes, I think we should keep things under the licenses that they are under.
Otherwise we might need to collect people’s consent and there might be other implications too.
All right, second version of the patchset is en route... :-)
Thanks, and best regards, Peter Müller
Hi,
On 6 Nov 2020, at 13:57, Peter Müller peter.mueller@ipfire.org wrote:
Hello Michael,
What is the reason for upgrading the license of this file to GPLv3?
actually, there is none. Whenever I edit a file containing license information, I try to update outdated information ("Michael Tremer & Christian Schmidt" et al.) in order to tidy things up.
Yes, that is indeed a bit outdated by now.
Should we not have one big patch fixing that in the whole repository?
It completely slipped my mind that we have a mixture of GPLv3 (some LFS files) and GPLv2 here... Do you want me to send in an updated patchset?
Yes, I think we should keep things under the licenses that they are under.
Otherwise we might need to collect people’s consent and there might be other implications too.
Best, -Michael
Thanks, and best regards, Peter Müller
Hello,
On 3 Nov 2020, at 14:28, Peter Müller peter.mueller@ipfire.org wrote:
Signed-off-by: Peter Müller peter.mueller@ipfire.org
config/cfgroot/location-functions.pl | 68 +++++++++++++++++++--------- 1 file changed, 46 insertions(+), 22 deletions(-)
diff --git a/config/cfgroot/location-functions.pl b/config/cfgroot/location-functions.pl index 2cfe7f908..ee03a6611 100644 --- a/config/cfgroot/location-functions.pl +++ b/config/cfgroot/location-functions.pl @@ -1,25 +1,23 @@ #!/usr/bin/perl -w -############################################################################ -# # -# This file is part of the IPFire Firewall. # -# # -# IPFire is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# IPFire is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with IPFire; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -# Copyright (C) 2015 - 2020 IPFire Team info@ipfire.org. # -# # -############################################################################ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2020 IPFire Team info@ipfire.org # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +###############################################################################
What is the reason for upgrading the license of this file to GPLv3?
package Location::Functions;
@@ -83,7 +81,7 @@ sub verify ($) { }
# -## Function to the the country code of a given address. +## Function to get the country code of a given address. # sub lookup_country_code($$) { my ($db_handle, $address) = @_; @@ -221,4 +219,30 @@ sub address_has_flags($) { return @flags; }
+# +## Function to get the Autonomous System Number of a given address. +# +sub lookup_asn($$) {
- my ($db_handle, $address) = @_;
- # Lookup the given address.
- my $asn = &Location::lookup_asn($db_handle, $address);
- # Return the number of the Autonomous System
- return $asn;
+}
+# +## Function to get the name of an Autonomous System. +# +sub get_as_name($$) {
- my ($db_handle, $asn) = @_;
- # Fetch the name of this AS...
- my $as_name = &Location::get_as_name($db_handle, $asn);
- # Return the name of the Autonomous System
- return $as_name;
+}
1;
2.26.2
Hello Michael, hello *,
All right, second version of the patchset is en route...
here you are: https://patchwork.ipfire.org/project/ipfire/list/?series=1600 :-)
Thanks, and best regards, Peter Müller