]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
:xMerge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next-switch...
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 3 Jul 2020 16:48:30 +0000 (18:48 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Fri, 3 Jul 2020 16:48:30 +0000 (18:48 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
64 files changed:
config/backup/backup.pl
config/cfgroot/location-functions.pl [moved from config/cfgroot/geoip-functions.pl with 59% similarity]
config/cron/crontab
config/firewall/firewall-lib.pl
config/firewall/geoipblock [deleted file]
config/firewall/locationblock [new file with mode: 0644]
config/firewall/rules.pl
config/menu/50-firewall.menu
config/rootfiles/common/GeoIP [deleted file]
config/rootfiles/common/Locale-Country
config/rootfiles/common/aarch64/initscripts
config/rootfiles/common/aarch64/stage2
config/rootfiles/common/armv5tel/initscripts
config/rootfiles/common/configroot
config/rootfiles/common/geoip-database [deleted file]
config/rootfiles/common/geoip-generator [deleted file]
config/rootfiles/common/i586/initscripts
config/rootfiles/common/libloc [new file with mode: 0644]
config/rootfiles/common/stage2
config/rootfiles/common/web-user-interface
config/rootfiles/common/x86_64/initscripts
config/rootfiles/common/x86_64/stage2
config/rootfiles/common/xtables-addons
doc/language_issues.en
doc/language_issues.es
doc/language_issues.it
doc/language_issues.nl
doc/language_issues.pl
doc/language_issues.ru
html/cgi-bin/connections.cgi
html/cgi-bin/country.cgi
html/cgi-bin/credits.cgi
html/cgi-bin/dns.cgi
html/cgi-bin/firewall.cgi
html/cgi-bin/fwhosts.cgi
html/cgi-bin/ipinfo.cgi
html/cgi-bin/location-block.cgi [moved from html/cgi-bin/geoip-block.cgi with 85% similarity]
html/cgi-bin/logs.cgi/firewalllog.dat
html/cgi-bin/logs.cgi/firewalllogcountry.dat
html/cgi-bin/logs.cgi/firewalllogip.dat
html/cgi-bin/logs.cgi/showrequestfromcountry.dat
html/cgi-bin/netexternal.cgi
html/cgi-bin/ovpnmain.cgi
html/cgi-bin/remote.cgi
html/cgi-bin/tor.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
langs/es/cgi-bin/es.pl
langs/fr/cgi-bin/fr.pl
langs/tr/cgi-bin/tr.pl
lfs/GeoIP [deleted file]
lfs/Locale-Country
lfs/configroot
lfs/geoip-database [deleted file]
lfs/libloc [moved from lfs/geoip-generator with 68% similarity]
lfs/xtables-addons
make.sh
src/initscripts/networking/red.up/99-geoip-database [deleted file]
src/initscripts/system/firewall
src/patches/geoip_1_25_change_database_path.patch [deleted file]
src/patches/xtables-addons-3.2-fix-database-generation.patch [deleted file]
src/scripts/convert-to-location [new file with mode: 0755]
src/scripts/update-location-database [new file with mode: 0644]
src/scripts/xt_geoip_update [deleted file]

index 5b5734044642a70a33c8c226cd96ebbe98c5c717..d2e5312526bfa8f9a18523573b80dc20e9da4e3a 100644 (file)
@@ -139,6 +139,9 @@ restore_backup() {
                rm -rf "/var/ipfire/portfw"
        fi
 
+       # Convert location
+       convert-to-location
+
        # Reload firewall
        firewallctrl
 
similarity index 59%
rename from config/cfgroot/geoip-functions.pl
rename to config/cfgroot/location-functions.pl
index b2319daaaffe7168d04cfafeabb2113af92cd08a..ab99e71d37ba4c6bf61f83a43e285d80e4d888ec 100644 (file)
 # 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 IPFire Team <info@ipfire.org>.                        #
+# Copyright (C) 2015 - 2020 IPFire Team <info@ipfire.org>.                 #
 #                                                                          #
 ############################################################################
 
-package GeoIP;
+package Location::Functions;
 
-use Geo::IP::PurePerl;
+use Location;
 use Locale::Codes::Country;
 
-my $geoip_database_dir = "/var/lib/GeoIP";
-my $location_database = "GeoLite2-Country-Locations-en.csv";
-
-my $database;
+# Hash which contains country codes and their names which are special or not
+# part of ISO 3166-1.
+my %not_iso_3166_location = (
+       "a1" => "Anonymous Proxy",
+       "a2" => "Satellite Provider",
+       "a3" => "Worldwide Anycast Instance",
+       "an" => "Netherlands Antilles",
+       "ap" => "Asia/Pacific Region",
+       "eu" => "Europe",
+       "fx" => "France, Metropolitan"
+);
+
+# Directory where the libloc database and keyfile lives.
+our $location_dir = "/var/lib/location/";
+
+# Libloc database file.
+our $database = "$location_dir/database.db";
+
+# Libloc keyfile to verify the database.
+our $keyfile = "$location_dir/signing-key.pem";
+
+# Directory which contains the exported databases.
+our $xt_geoip_db_directory = "/usr/share/xt_geoip/";
+
+#
+## Tiny function to init the location database.
+#
+sub init () {
+       # Init and open the database.
+       my $db = &Location::init($database);
+
+       # Return the database handle.
+       return $db;
+}
 
-sub lookup($) {
-       my $address = shift;
+#
+## Function to verify the integrity of the location database.
+#
+sub verify ($) {
+       my ($db_handle) = @_;
 
-       # Load the database into memory if not already done
-       if (!$database) {
-               $database = Geo::IP::PurePerl->new(GEOIP_MEMORY_CACHE);
+       # Verify the integrity of the database.
+       if(&Location::verify($db_handle, $keyfile)) {
+               # Success, return "1".
+               return 1;
        }
 
+       # If we got here, return nothing.
+       return;
+}
+
+#
+## Function to the the country code of a given address.
+#
+sub lookup_country_code($$) {
+       my ($db_handle, $address) = @_;
+
+       # Lookup the given address.
+       my $country_code = &Location::lookup_country_code($db_handle, $address);
+
        # Return the name of the country
-       return $database->country_code_by_name($address);
+       return $country_code;
 }
 
 # Function to get the flag icon for a specified country code.
@@ -102,17 +149,15 @@ sub get_full_country_name($) {
        # Remove whitespaces.
        chomp($input);
 
+
        # Convert input into lower case format.
        my $code = lc($input);
 
        # Handle country codes which are not in the list.
-       if ($code eq "a1") { $name = "Anonymous Proxy" }
-       elsif ($code eq "a2") { $name = "Satellite Provider" }
-       elsif ($code eq "o1") { $name = "Other Country" }
-       elsif ($code eq "ap") { $name = "Asia/Pacific Region" }
-       elsif ($code eq "eu") { $name = "Europe" }
-       elsif ($code eq "yu") { $name = "Yugoslavia" }
-       else {
+       if ($not_iso_3166_location{$code}) {
+               # Grab location name from hash.
+               $name = $not_iso_3166_location{$code};
+       } else {
                # Use perl built-in module to get the country code.
                $name = &Locale::Codes::Country::code2country($code);
        }
@@ -120,30 +165,31 @@ sub get_full_country_name($) {
        return $name;
 }
 
-# Function to get all available GeoIP locations.
-sub get_geoip_locations() {
+# Function to get all available locations.
+sub get_locations() {
        my @locations = ();
 
-       # Open the location database.
-       open(LOCATION, "$geoip_database_dir/$location_database") or return @locations;
-
-       # Loop through the file.
-       while(my $line = <LOCATION>) {
-               # Remove newlines.
-               chomp($line);
+       # Get listed country codes from ISO 3166-1.
+       my @locations_lc = &Locale::Codes::Country::all_country_codes();
 
-               # Split the line content.
-               my ($geoname_id, $locale_code, $continent_code, $continent_name, $country_iso_code, $country_name, $is_in_european_union) = split(/\,/, $line);
+       # The Codes::Country module provides the country codes only in lower case.
+       # So we have to loop over the array and convert them into upper case format.
+       foreach my $ccode (@locations_lc) {
+               # Convert the country code to uppercase.
+               my $ccode_uc = uc($ccode);
 
-               # Check if the country_iso_code is upper case.
-               if($country_iso_code =~ /[A-Z]/) {
-                       # Add the current ISO code.
-                       push(@locations, $country_iso_code);
-               }
+               # Add the converted ccode to the locations array.
+               push(@locations, $ccode_uc);
        }
 
-       # Close filehandle.
-       close(LOCATION);
+       # Add locations from not_iso_3166_locations.
+       foreach my $location (keys %not_iso_3166_location) {
+               # Convert the location into uppercase.
+               my $location_uc = uc($location);
+
+               # Add the location to the locations array.
+               push(@locations, $location_uc);
+       }
 
        # Sort locations array in alphabetical order.
        my @sorted_locations = sort(@locations);
@@ -152,5 +198,4 @@ sub get_geoip_locations() {
        return @sorted_locations;
 }
 
-
 1;
index 56801394ece18abd19b2df5c324db30befa64c20..331eaa4a50db1bb962b701a4ab4dbae90c174bd0 100644 (file)
@@ -59,8 +59,8 @@ HOME=/
 00 3 * 3 0          /usr/local/bin/timezone-transition /usr/local/bin/firewallctrl
 00 2 * 10-11 0      /usr/local/bin/timezone-transition /usr/local/bin/firewallctrl
 
-# Update GeoIP database once a month.
-%monthly,random * * * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/xt_geoip_update >/dev/null 2>&1
+# Update location database once a month
+%hourly,random * * * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-location-database >/dev/null 2>&1
 
 # Retry sending spooled mails regularly
 %hourly * /usr/sbin/dma -q
index e76ab24db26a75e575e88d6ae4bcbf68ea400fa2..bc0b30ca5c7b87939721e1dd3bf31f6549541f75 100644 (file)
@@ -29,7 +29,7 @@ package fwlib;
 my %customnetwork=();
 my %customhost=();
 my %customgrp=();
-my %customgeoipgrp=();
+my %customlocationgrp=();
 my %customservice=();
 my %customservicegrp=();
 my %ccdnet=();
@@ -41,12 +41,12 @@ my %ovpnsettings=();
 my %aliases=();
 
 require '/var/ipfire/general-functions.pl';
-require '/var/ipfire/geoip-functions.pl';
+require '/var/ipfire/location-functions.pl';
 
 my $confignet          = "${General::swroot}/fwhosts/customnetworks";
 my $confighost         = "${General::swroot}/fwhosts/customhosts";
 my $configgrp          = "${General::swroot}/fwhosts/customgroups";
-my $configgeoipgrp     = "${General::swroot}/fwhosts/customgeoipgrp";
+my $configlocationgrp  = "${General::swroot}/fwhosts/customlocationgrp";
 my $configsrv          = "${General::swroot}/fwhosts/customservices";
 my $configsrvgrp       = "${General::swroot}/fwhosts/customservicegrp";
 my $configccdnet       = "${General::swroot}/ovpn/ccd.conf";
@@ -64,7 +64,7 @@ my $netsettings               = "${General::swroot}/ethernet/settings";
 &General::readhasharray("$confignet", \%customnetwork);
 &General::readhasharray("$confighost", \%customhost);
 &General::readhasharray("$configgrp", \%customgrp);
-&General::readhasharray("$configgeoipgrp", \%customgeoipgrp);
+&General::readhasharray("$configlocationgrp", \%customlocationgrp);
 &General::readhasharray("$configccdnet", \%ccdnet);
 &General::readhasharray("$configccdhost", \%ccdhost);
 &General::readhasharray("$configipsec", \%ipsecconf);
@@ -72,8 +72,8 @@ my $netsettings               = "${General::swroot}/ethernet/settings";
 &General::readhasharray("$configsrvgrp", \%customservicegrp);
 &General::get_aliases(\%aliases);
 
-# Get all available GeoIP locations.
-my @available_geoip_locations = &get_geoip_locations();
+# Get all available locations.
+my @available_locations = &get_locations();
 
 sub get_srv_prot
 {
@@ -321,11 +321,11 @@ sub get_addresses
                                }
                        }
                }
-       }elsif ($addr_type ~~ ["cust_geoip_src", "cust_geoip_tgt"] && $value =~ "group:") {
+       }elsif ($addr_type ~~ ["cust_location_src", "cust_location_tgt"] && $value =~ "group:") {
                $value=substr($value,6);
-               foreach my $grp (sort {$a <=> $b} keys %customgeoipgrp) {
-                       if ($customgeoipgrp{$grp}[0] eq $value) {
-                               my @address = &get_address($addr_type, $customgeoipgrp{$grp}[2], $type);
+               foreach my $grp (sort {$a <=> $b} keys %customlocationgrp) {
+                       if ($customlocationgrp{$grp}[0] eq $value) {
+                               my @address = &get_address($addr_type, $customlocationgrp{$grp}[2], $type);
 
                                if (@address) {
                                        push(@addresses, @address);
@@ -459,20 +459,20 @@ sub get_address
                        }
                }
 
-       # Handle rule options with GeoIP as source.
-       } elsif ($key eq "cust_geoip_src") {
-               # Check if the given GeoIP location is available.
-               if(&geoip_location_is_available($value)) {
+       # Handle rule options with a location as source.
+       } elsif ($key eq "cust_location_src") {
+               # Check if the given location is available.
+               if(&location_is_available($value)) {
                        # Get external interface.
                        my $external_interface = &get_external_interface();
 
                        push(@ret, ["-m geoip --src-cc $value", "$external_interface"]);
                }
 
-       # Handle rule options with GeoIP as target.
-       } elsif ($key eq "cust_geoip_tgt") {
-               # Check if the given GeoIP location is available.
-               if(&geoip_location_is_available($value)) {
+       # Handle rule options with a location as target.
+       } elsif ($key eq "cust_location_tgt") {
+               # Check if the given location is available.
+               if(&location_is_available($value)) {
                        # Get external interface.
                        my $external_interface = &get_external_interface();
 
@@ -617,19 +617,19 @@ sub get_internal_firewall_ip_address
        return 0;
 }
 
-sub get_geoip_locations() {
-       return &GeoIP::get_geoip_locations();
+sub get_locations() {
+       return &Location::Functions::get_locations();
 }
 
-# Function to check if a database of a given GeoIP location is
+# Function to check if a database of a given location is
 # available.
-sub geoip_location_is_available($) {
-       my ($location) = @_;
+sub location_is_available($) {
+       my ($requested_location) = @_;
 
-       # Loop through the global array of available GeoIP locations.
-       foreach my $geoip_location (@available_geoip_locations) {
+       # Loop through the global array of available locations.
+       foreach my $location (@available_locations) {
                # Check if the current processed location is the searched one.
-               if($location eq $geoip_location) {
+               if($location eq $requested_location) {
                        # If it is part of the array, return "1" - True.
                        return 1;
                }
diff --git a/config/firewall/geoipblock b/config/firewall/geoipblock
deleted file mode 100644 (file)
index 4d483d3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-GEOIPBLOCK_ENABLED=off
diff --git a/config/firewall/locationblock b/config/firewall/locationblock
new file mode 100644 (file)
index 0000000..b933bfc
--- /dev/null
@@ -0,0 +1 @@
+LOCATIONBLOCK_ENABLED=off
index 387a8f92ba232dccf6308ae56badc5717a086ff5..cad53a1d794a751b5f52be5eab8135f7c4dce9b6 100644 (file)
@@ -25,6 +25,7 @@ use experimental 'smartmatch';
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "/usr/lib/firewall/firewall-lib.pl";
+require "${General::swroot}/location-functions.pl";
 
 # Set to one to enable debugging mode.
 my $DEBUG = 0;
@@ -55,13 +56,17 @@ my %customgrp=();
 my %configinputfw=();
 my %configoutgoingfw=();
 my %confignatfw=();
+my %locationsettings = (
+       "LOCATIONBLOCK_ENABLED" => "off"
+);
+
 my @p2ps=();
 
 my $configfwdfw                = "${General::swroot}/firewall/config";
 my $configinput            = "${General::swroot}/firewall/input";
 my $configoutgoing  = "${General::swroot}/firewall/outgoing";
 my $p2pfile                    = "${General::swroot}/firewall/p2protocols";
-my $geoipfile          = "${General::swroot}/firewall/geoipblock";
+my $locationfile               = "${General::swroot}/firewall/locationblock";
 my $configgrp          = "${General::swroot}/fwhosts/customgroups";
 my $netsettings                = "${General::swroot}/ethernet/settings";
 
@@ -73,6 +78,15 @@ my $netsettings              = "${General::swroot}/ethernet/settings";
 &General::readhasharray($configoutgoing, \%configoutgoingfw);
 &General::readhasharray($configgrp, \%customgrp);
 
+# Check if the location settings file exists
+if (-e "$locationfile") {
+       # Read settings file
+       &General::readhash("$locationfile", \%locationsettings);
+}
+
+# Get all available locations.
+my @locations = &Location::Functions::get_locations();
+
 my @log_limit_options = &make_log_limit_options();
 
 my $POLICY_INPUT_ALLOWED   = 0;
@@ -104,8 +118,8 @@ sub main {
        # Load P2P block rules.
        &p2pblock();
 
-       # Load GeoIP block rules.
-       &geoipblock();
+       # Load Location block rules.
+       &locationblock();
 
        # Reload firewall policy.
        run("/usr/sbin/firewall-policy");
@@ -597,34 +611,22 @@ sub p2pblock {
        }
 }
 
-sub geoipblock {
-       my %geoipsettings = ();
-       $geoipsettings{'GEOIPBLOCK_ENABLED'} = "off";
-
+sub locationblock {
        # Flush iptables chain.
-       run("$IPTABLES -F GEOIPBLOCK");
-
-       # Check if the geoip settings file exists
-       if (-e "$geoipfile") {
-               # Read settings file
-               &General::readhash("$geoipfile", \%geoipsettings);
-       }
+       run("$IPTABLES -F LOCATIONBLOCK");
 
-       # If geoip blocking is not enabled, we are finished here.
-       if ($geoipsettings{'GEOIPBLOCK_ENABLED'} ne "on") {
+       # If location blocking is not enabled, we are finished here.
+       if ($locationsettings{'LOCATIONBLOCK_ENABLED'} ne "on") {
                # Exit submodule. Process remaining script.
                return;
        }
 
-       # Get supported locations.
-       my @locations = &fwlib::get_geoip_locations();
-
-       # Loop through all supported geoip locations and
-       # create iptables rules, if blocking this country
+       # Loop through all supported locations and
+       # create iptables rules, if blocking for this country
        # is enabled.
        foreach my $location (@locations) {
-               if(exists $geoipsettings{$location} && $geoipsettings{$location} eq "on") {
-                       run("$IPTABLES -A GEOIPBLOCK -m geoip --src-cc $location -j DROP");
+               if(exists $locationsettings{$location} && $locationsettings{$location} eq "on") {
+                       run("$IPTABLES -A LOCATIONBLOCK -m geoip --src-cc $location -j DROP");
                }
        }
 }
index 5ec1f67fc51c14f841c508b6a0c44f91f7afacfa..7f654785b80f52dd715803d9b0e75693b10428e2 100644 (file)
                                'title' => "P2P-Block",
                                'enabled' => 1,
                                };
-    $subfirewall->{'60.geoipblock'} = {
-                               'caption' => $Lang::tr{'geoipblock'},
-                               'uri' => '/cgi-bin/geoip-block.cgi',
-                               'title' => $Lang::tr{'geoipblock'},
+    $subfirewall->{'60.locationblock'} = {
+                               'caption' => $Lang::tr{'locationblock'},
+                               'uri' => '/cgi-bin/location-block.cgi',
+                               'title' => $Lang::tr{'locationblock'},
                                'enabled' => 1,
                                };
     $subfirewall->{'70.wireless'} = {
diff --git a/config/rootfiles/common/GeoIP b/config/rootfiles/common/GeoIP
deleted file mode 100644 (file)
index a7cd2e3..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#usr/bin/geoip-lookup
-#usr/lib/perl5/site_perl/5.30.0/Geo
-#usr/lib/perl5/site_perl/5.30.0/Geo/IP
-usr/lib/perl5/site_perl/5.30.0/Geo/IP/PurePerl.pm
-#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Geo
-#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Geo/IP
-#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Geo/IP/PurePerl
-#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Geo/IP/PurePerl/.packlist
-#usr/share/GeoIP
-usr/share/GeoIP/GeoIP.dat
-#usr/share/man/man1/geoip-lookup.1
-#usr/share/man/man3/Geo::IP::PurePerl.3
index 07d8144c7de8cb38d81393698f838a496c8503e1..941c18121d84b2163e445e5a9f103cc10ed1865a 100644 (file)
@@ -1,61 +1,59 @@
-#usr/lib/perl5/5.30.0/Locale/Codes
-usr/lib/perl5/5.30.0/Locale/Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes.pod
-usr/lib/perl5/5.30.0/Locale/Codes/API.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Changes.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Constants.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Constants.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Country.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Country.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Country_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Country_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Currency.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Currency.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Currency_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Currency_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangExt.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangExt.pod
-usr/lib/perl5/5.30.0/Locale/Codes/LangExt_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangExt_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangFam.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangFam.pod
-usr/lib/perl5/5.30.0/Locale/Codes/LangFam_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangFam_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangVar.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangVar.pod
-usr/lib/perl5/5.30.0/Locale/Codes/LangVar_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangVar_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Language.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Language.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Language_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Language_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Script.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Script.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Script_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Script_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Country.pm
-#usr/lib/perl5/5.30.0/Locale/Country.pod
-usr/lib/perl5/5.30.0/Locale/Currency.pm
-#usr/lib/perl5/5.30.0/Locale/Currency.pod
-usr/lib/perl5/5.30.0/Locale/Language.pm
-#usr/lib/perl5/5.30.0/Locale/Language.pod
-usr/lib/perl5/5.30.0/Locale/Script.pm
-#usr/lib/perl5/5.30.0/Locale/Script.pod
-#usr/lib/perl5/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale
-#usr/lib/perl5/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale/Codes
-#usr/lib/perl5/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale/Codes/.packlist
+#usr/lib/perl5/site_perl/5.30.0/Locale
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes.pod
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Changes.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Constants.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Country.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Country.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Country_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Country_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Currency.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Currency.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Currency_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Currency_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangExt.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangExt.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangExt_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangExt_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangFam.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangFam.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangFam_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangFam_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangVar.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangVar.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangVar_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangVar_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Language.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Language.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Language_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Language_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Script.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Script.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Script_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Script_Retired.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Types.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Country.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Country.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Currency.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Currency.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Language.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Language.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Script.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Script.pod
+#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale
+#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale/Codes
+#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale/Codes/.packlist
 #usr/share/man/man3/Locale::Codes.3
-#usr/share/man/man3/Locale::Codes::API.3
 #usr/share/man/man3/Locale::Codes::Changes.3
-#usr/share/man/man3/Locale::Codes::Constants.3
 #usr/share/man/man3/Locale::Codes::Country.3
 #usr/share/man/man3/Locale::Codes::Currency.3
 #usr/share/man/man3/Locale::Codes::LangExt.3
 #usr/share/man/man3/Locale::Codes::LangFam.3
-#usr/share/man/man3/Locale::Codes::LangFam_Retired.3
 #usr/share/man/man3/Locale::Codes::LangVar.3
 #usr/share/man/man3/Locale::Codes::Language.3
 #usr/share/man/man3/Locale::Codes::Script.3
+#usr/share/man/man3/Locale::Codes::Types.3
 #usr/share/man/man3/Locale::Country.3
 #usr/share/man/man3/Locale::Currency.3
 #usr/share/man/man3/Locale::Language.3
index 330bb532e01b600e4833ddb1fa837d127c2dcb98..69fef394bf0baeaa1bfabf72734425e7932ed82b 100644 (file)
@@ -66,7 +66,6 @@ etc/rc.d/init.d/networking/red.up/50-ovpn
 etc/rc.d/init.d/networking/red.up/98-leds
 etc/rc.d/init.d/networking/red.up/99-beep
 etc/rc.d/init.d/networking/red.up/99-fireinfo
-etc/rc.d/init.d/networking/red.up/99-geoip-database
 etc/rc.d/init.d/networking/red.up/99-pakfire-update
 etc/rc.d/init.d/networking/wpa_supplicant.exe
 etc/rc.d/init.d/ntp
index 77c8e97b9a44ac139a1811f1bfe053322abcf071..3359632a37d7f3b9cb7b364b79a026b2a5aed036 100644 (file)
@@ -107,8 +107,7 @@ usr/local/bin/settime
 usr/local/bin/timecheck
 usr/local/bin/timezone-transition
 usr/local/bin/update-ids-ruleset
-usr/local/bin/update-lang-cache
-usr/local/bin/xt_geoip_update
+usr/local/bin/update-location-database
 #usr/local/include
 #usr/local/lib
 #usr/local/lib/sse2
index 330bb532e01b600e4833ddb1fa837d127c2dcb98..69fef394bf0baeaa1bfabf72734425e7932ed82b 100644 (file)
@@ -66,7 +66,6 @@ etc/rc.d/init.d/networking/red.up/50-ovpn
 etc/rc.d/init.d/networking/red.up/98-leds
 etc/rc.d/init.d/networking/red.up/99-beep
 etc/rc.d/init.d/networking/red.up/99-fireinfo
-etc/rc.d/init.d/networking/red.up/99-geoip-database
 etc/rc.d/init.d/networking/red.up/99-pakfire-update
 etc/rc.d/init.d/networking/wpa_supplicant.exe
 etc/rc.d/init.d/ntp
index 664247b12c4749133a520a6b5677d28bfc84b68d..1027b5139e952ef8180dbb65dce8414799ac30b2 100644 (file)
@@ -59,15 +59,15 @@ var/ipfire/extrahd
 #var/ipfire/extrahd/settings
 var/ipfire/firewall
 #var/ipfire/firewall/config
-#var/ipfire/firewall/geoipblock
 #var/ipfire/firewall/input
+#var/ipfire/firewall/locationblock
 #var/ipfire/firewall/outgoing
 #var/ipfire/firewall/p2protocols
 #var/ipfire/firewall/settings
 var/ipfire/fwhosts
-#var/ipfire/fwhosts/customgeoipgrp
 #var/ipfire/fwhosts/customgroups
 #var/ipfire/fwhosts/customhosts
+#var/ipfire/fwhosts/customlocationgrp
 #var/ipfire/fwhosts/customnetworks
 #var/ipfire/fwhosts/customservicegrp
 #var/ipfire/fwhosts/customservices
@@ -77,9 +77,9 @@ var/ipfire/fwlogs
 #var/ipfire/fwlogs/ipsettings
 #var/ipfire/fwlogs/portsettings
 var/ipfire/general-functions.pl
-var/ipfire/geoip-functions.pl
 var/ipfire/graphs.pl
 var/ipfire/header.pl
+var/ipfire/location-functions.pl
 var/ipfire/ids-functions.pl
 var/ipfire/isdn
 #var/ipfire/isdn/settings
diff --git a/config/rootfiles/common/geoip-database b/config/rootfiles/common/geoip-database
deleted file mode 100644 (file)
index 6e4bbdb..0000000
+++ /dev/null
@@ -1,523 +0,0 @@
-usr/share/GeoIP/GeoIP.dat
-usr/share/xt_geoip/A1.iv4
-usr/share/xt_geoip/A1.iv6
-usr/share/xt_geoip/A2.iv4
-usr/share/xt_geoip/A2.iv6
-usr/share/xt_geoip/AD.iv4
-usr/share/xt_geoip/AD.iv6
-usr/share/xt_geoip/AE.iv4
-usr/share/xt_geoip/AE.iv6
-usr/share/xt_geoip/AF.iv4
-usr/share/xt_geoip/AF.iv6
-usr/share/xt_geoip/AG.iv4
-usr/share/xt_geoip/AG.iv6
-usr/share/xt_geoip/AI.iv4
-usr/share/xt_geoip/AI.iv6
-usr/share/xt_geoip/AL.iv4
-usr/share/xt_geoip/AL.iv6
-usr/share/xt_geoip/AM.iv4
-usr/share/xt_geoip/AM.iv6
-usr/share/xt_geoip/AO.iv4
-usr/share/xt_geoip/AO.iv6
-usr/share/xt_geoip/AQ.iv4
-usr/share/xt_geoip/AQ.iv6
-usr/share/xt_geoip/AR.iv4
-usr/share/xt_geoip/AR.iv6
-usr/share/xt_geoip/AS.iv4
-usr/share/xt_geoip/AS.iv6
-usr/share/xt_geoip/AT.iv4
-usr/share/xt_geoip/AT.iv6
-usr/share/xt_geoip/AU.iv4
-usr/share/xt_geoip/AU.iv6
-usr/share/xt_geoip/AW.iv4
-usr/share/xt_geoip/AW.iv6
-usr/share/xt_geoip/AX.iv4
-usr/share/xt_geoip/AX.iv6
-usr/share/xt_geoip/AZ.iv4
-usr/share/xt_geoip/AZ.iv6
-usr/share/xt_geoip/BA.iv4
-usr/share/xt_geoip/BA.iv6
-usr/share/xt_geoip/BB.iv4
-usr/share/xt_geoip/BB.iv6
-usr/share/xt_geoip/BD.iv4
-usr/share/xt_geoip/BD.iv6
-usr/share/xt_geoip/BE.iv4
-usr/share/xt_geoip/BE.iv6
-usr/share/xt_geoip/BF.iv4
-usr/share/xt_geoip/BF.iv6
-usr/share/xt_geoip/BG.iv4
-usr/share/xt_geoip/BG.iv6
-usr/share/xt_geoip/BH.iv4
-usr/share/xt_geoip/BH.iv6
-usr/share/xt_geoip/BI.iv4
-usr/share/xt_geoip/BI.iv6
-usr/share/xt_geoip/BJ.iv4
-usr/share/xt_geoip/BJ.iv6
-usr/share/xt_geoip/BL.iv4
-usr/share/xt_geoip/BL.iv6
-usr/share/xt_geoip/BM.iv4
-usr/share/xt_geoip/BM.iv6
-usr/share/xt_geoip/BN.iv4
-usr/share/xt_geoip/BN.iv6
-usr/share/xt_geoip/BO.iv4
-usr/share/xt_geoip/BO.iv6
-usr/share/xt_geoip/BQ.iv4
-usr/share/xt_geoip/BQ.iv6
-usr/share/xt_geoip/BR.iv4
-usr/share/xt_geoip/BR.iv6
-usr/share/xt_geoip/BS.iv4
-usr/share/xt_geoip/BS.iv6
-usr/share/xt_geoip/BT.iv4
-usr/share/xt_geoip/BT.iv6
-usr/share/xt_geoip/BV.iv4
-usr/share/xt_geoip/BV.iv6
-usr/share/xt_geoip/BW.iv4
-usr/share/xt_geoip/BW.iv6
-usr/share/xt_geoip/BY.iv4
-usr/share/xt_geoip/BY.iv6
-usr/share/xt_geoip/BZ.iv4
-usr/share/xt_geoip/BZ.iv6
-usr/share/xt_geoip/CA.iv4
-usr/share/xt_geoip/CA.iv6
-usr/share/xt_geoip/CC.iv4
-usr/share/xt_geoip/CC.iv6
-usr/share/xt_geoip/CD.iv4
-usr/share/xt_geoip/CD.iv6
-usr/share/xt_geoip/CF.iv4
-usr/share/xt_geoip/CF.iv6
-usr/share/xt_geoip/CG.iv4
-usr/share/xt_geoip/CG.iv6
-usr/share/xt_geoip/CH.iv4
-usr/share/xt_geoip/CH.iv6
-usr/share/xt_geoip/CI.iv4
-usr/share/xt_geoip/CI.iv6
-usr/share/xt_geoip/CK.iv4
-usr/share/xt_geoip/CK.iv6
-usr/share/xt_geoip/CL.iv4
-usr/share/xt_geoip/CL.iv6
-usr/share/xt_geoip/CM.iv4
-usr/share/xt_geoip/CM.iv6
-usr/share/xt_geoip/CN.iv4
-usr/share/xt_geoip/CN.iv6
-usr/share/xt_geoip/CO.iv4
-usr/share/xt_geoip/CO.iv6
-usr/share/xt_geoip/CR.iv4
-usr/share/xt_geoip/CR.iv6
-usr/share/xt_geoip/CU.iv4
-usr/share/xt_geoip/CU.iv6
-usr/share/xt_geoip/CV.iv4
-usr/share/xt_geoip/CV.iv6
-usr/share/xt_geoip/CW.iv4
-usr/share/xt_geoip/CW.iv6
-usr/share/xt_geoip/CX.iv4
-usr/share/xt_geoip/CX.iv6
-usr/share/xt_geoip/CY.iv4
-usr/share/xt_geoip/CY.iv6
-usr/share/xt_geoip/CZ.iv4
-usr/share/xt_geoip/CZ.iv6
-usr/share/xt_geoip/DE.iv4
-usr/share/xt_geoip/DE.iv6
-usr/share/xt_geoip/DJ.iv4
-usr/share/xt_geoip/DJ.iv6
-usr/share/xt_geoip/DK.iv4
-usr/share/xt_geoip/DK.iv6
-usr/share/xt_geoip/DM.iv4
-usr/share/xt_geoip/DM.iv6
-usr/share/xt_geoip/DO.iv4
-usr/share/xt_geoip/DO.iv6
-usr/share/xt_geoip/DZ.iv4
-usr/share/xt_geoip/DZ.iv6
-usr/share/xt_geoip/EC.iv4
-usr/share/xt_geoip/EC.iv6
-usr/share/xt_geoip/EE.iv4
-usr/share/xt_geoip/EE.iv6
-usr/share/xt_geoip/EG.iv4
-usr/share/xt_geoip/EG.iv6
-usr/share/xt_geoip/EH.iv4
-usr/share/xt_geoip/EH.iv6
-usr/share/xt_geoip/ER.iv4
-usr/share/xt_geoip/ER.iv6
-usr/share/xt_geoip/ES.iv4
-usr/share/xt_geoip/ES.iv6
-usr/share/xt_geoip/ET.iv4
-usr/share/xt_geoip/ET.iv6
-usr/share/xt_geoip/EU.iv4
-usr/share/xt_geoip/EU.iv6
-usr/share/xt_geoip/FI.iv4
-usr/share/xt_geoip/FI.iv6
-usr/share/xt_geoip/FJ.iv4
-usr/share/xt_geoip/FJ.iv6
-usr/share/xt_geoip/FK.iv4
-usr/share/xt_geoip/FK.iv6
-usr/share/xt_geoip/FM.iv4
-usr/share/xt_geoip/FM.iv6
-usr/share/xt_geoip/FO.iv4
-usr/share/xt_geoip/FO.iv6
-usr/share/xt_geoip/FR.iv4
-usr/share/xt_geoip/FR.iv6
-usr/share/xt_geoip/GA.iv4
-usr/share/xt_geoip/GA.iv6
-usr/share/xt_geoip/GB.iv4
-usr/share/xt_geoip/GB.iv6
-usr/share/xt_geoip/GD.iv4
-usr/share/xt_geoip/GD.iv6
-usr/share/xt_geoip/GE.iv4
-usr/share/xt_geoip/GE.iv6
-usr/share/xt_geoip/GF.iv4
-usr/share/xt_geoip/GF.iv6
-usr/share/xt_geoip/GG.iv4
-usr/share/xt_geoip/GG.iv6
-usr/share/xt_geoip/GH.iv4
-usr/share/xt_geoip/GH.iv6
-usr/share/xt_geoip/GI.iv4
-usr/share/xt_geoip/GI.iv6
-usr/share/xt_geoip/GL.iv4
-usr/share/xt_geoip/GL.iv6
-usr/share/xt_geoip/GM.iv4
-usr/share/xt_geoip/GM.iv6
-usr/share/xt_geoip/GN.iv4
-usr/share/xt_geoip/GN.iv6
-usr/share/xt_geoip/GP.iv4
-usr/share/xt_geoip/GP.iv6
-usr/share/xt_geoip/GQ.iv4
-usr/share/xt_geoip/GQ.iv6
-usr/share/xt_geoip/GR.iv4
-usr/share/xt_geoip/GR.iv6
-usr/share/xt_geoip/GS.iv4
-usr/share/xt_geoip/GS.iv6
-usr/share/xt_geoip/GT.iv4
-usr/share/xt_geoip/GT.iv6
-usr/share/xt_geoip/GU.iv4
-usr/share/xt_geoip/GU.iv6
-usr/share/xt_geoip/GW.iv4
-usr/share/xt_geoip/GW.iv6
-usr/share/xt_geoip/GY.iv4
-usr/share/xt_geoip/GY.iv6
-usr/share/xt_geoip/HK.iv4
-usr/share/xt_geoip/HK.iv6
-usr/share/xt_geoip/HM.iv4
-usr/share/xt_geoip/HM.iv6
-usr/share/xt_geoip/HN.iv4
-usr/share/xt_geoip/HN.iv6
-usr/share/xt_geoip/HR.iv4
-usr/share/xt_geoip/HR.iv6
-usr/share/xt_geoip/HT.iv4
-usr/share/xt_geoip/HT.iv6
-usr/share/xt_geoip/HU.iv4
-usr/share/xt_geoip/HU.iv6
-usr/share/xt_geoip/ID.iv4
-usr/share/xt_geoip/ID.iv6
-usr/share/xt_geoip/IE.iv4
-usr/share/xt_geoip/IE.iv6
-usr/share/xt_geoip/IL.iv4
-usr/share/xt_geoip/IL.iv6
-usr/share/xt_geoip/IM.iv4
-usr/share/xt_geoip/IM.iv6
-usr/share/xt_geoip/IN.iv4
-usr/share/xt_geoip/IN.iv6
-usr/share/xt_geoip/IO.iv4
-usr/share/xt_geoip/IO.iv6
-usr/share/xt_geoip/IQ.iv4
-usr/share/xt_geoip/IQ.iv6
-usr/share/xt_geoip/IR.iv4
-usr/share/xt_geoip/IR.iv6
-usr/share/xt_geoip/IS.iv4
-usr/share/xt_geoip/IS.iv6
-usr/share/xt_geoip/IT.iv4
-usr/share/xt_geoip/IT.iv6
-usr/share/xt_geoip/JE.iv4
-usr/share/xt_geoip/JE.iv6
-usr/share/xt_geoip/JM.iv4
-usr/share/xt_geoip/JM.iv6
-usr/share/xt_geoip/JO.iv4
-usr/share/xt_geoip/JO.iv6
-usr/share/xt_geoip/JP.iv4
-usr/share/xt_geoip/JP.iv6
-usr/share/xt_geoip/KE.iv4
-usr/share/xt_geoip/KE.iv6
-usr/share/xt_geoip/KG.iv4
-usr/share/xt_geoip/KG.iv6
-usr/share/xt_geoip/KH.iv4
-usr/share/xt_geoip/KH.iv6
-usr/share/xt_geoip/KI.iv4
-usr/share/xt_geoip/KI.iv6
-usr/share/xt_geoip/KM.iv4
-usr/share/xt_geoip/KM.iv6
-usr/share/xt_geoip/KN.iv4
-usr/share/xt_geoip/KN.iv6
-usr/share/xt_geoip/KP.iv4
-usr/share/xt_geoip/KP.iv6
-usr/share/xt_geoip/KR.iv4
-usr/share/xt_geoip/KR.iv6
-usr/share/xt_geoip/KW.iv4
-usr/share/xt_geoip/KW.iv6
-usr/share/xt_geoip/KY.iv4
-usr/share/xt_geoip/KY.iv6
-usr/share/xt_geoip/KZ.iv4
-usr/share/xt_geoip/KZ.iv6
-usr/share/xt_geoip/LA.iv4
-usr/share/xt_geoip/LA.iv6
-usr/share/xt_geoip/LB.iv4
-usr/share/xt_geoip/LB.iv6
-usr/share/xt_geoip/LC.iv4
-usr/share/xt_geoip/LC.iv6
-usr/share/xt_geoip/LI.iv4
-usr/share/xt_geoip/LI.iv6
-usr/share/xt_geoip/LK.iv4
-usr/share/xt_geoip/LK.iv6
-usr/share/xt_geoip/LR.iv4
-usr/share/xt_geoip/LR.iv6
-usr/share/xt_geoip/LS.iv4
-usr/share/xt_geoip/LS.iv6
-usr/share/xt_geoip/LT.iv4
-usr/share/xt_geoip/LT.iv6
-usr/share/xt_geoip/LU.iv4
-usr/share/xt_geoip/LU.iv6
-usr/share/xt_geoip/LV.iv4
-usr/share/xt_geoip/LV.iv6
-usr/share/xt_geoip/LY.iv4
-usr/share/xt_geoip/LY.iv6
-usr/share/xt_geoip/MA.iv4
-usr/share/xt_geoip/MA.iv6
-usr/share/xt_geoip/MC.iv4
-usr/share/xt_geoip/MC.iv6
-usr/share/xt_geoip/MD.iv4
-usr/share/xt_geoip/MD.iv6
-usr/share/xt_geoip/ME.iv4
-usr/share/xt_geoip/ME.iv6
-usr/share/xt_geoip/MF.iv4
-usr/share/xt_geoip/MF.iv6
-usr/share/xt_geoip/MG.iv4
-usr/share/xt_geoip/MG.iv6
-usr/share/xt_geoip/MH.iv4
-usr/share/xt_geoip/MH.iv6
-usr/share/xt_geoip/MK.iv4
-usr/share/xt_geoip/MK.iv6
-usr/share/xt_geoip/ML.iv4
-usr/share/xt_geoip/ML.iv6
-usr/share/xt_geoip/MM.iv4
-usr/share/xt_geoip/MM.iv6
-usr/share/xt_geoip/MN.iv4
-usr/share/xt_geoip/MN.iv6
-usr/share/xt_geoip/MO.iv4
-usr/share/xt_geoip/MO.iv6
-usr/share/xt_geoip/MP.iv4
-usr/share/xt_geoip/MP.iv6
-usr/share/xt_geoip/MQ.iv4
-usr/share/xt_geoip/MQ.iv6
-usr/share/xt_geoip/MR.iv4
-usr/share/xt_geoip/MR.iv6
-usr/share/xt_geoip/MS.iv4
-usr/share/xt_geoip/MS.iv6
-usr/share/xt_geoip/MT.iv4
-usr/share/xt_geoip/MT.iv6
-usr/share/xt_geoip/MU.iv4
-usr/share/xt_geoip/MU.iv6
-usr/share/xt_geoip/MV.iv4
-usr/share/xt_geoip/MV.iv6
-usr/share/xt_geoip/MW.iv4
-usr/share/xt_geoip/MW.iv6
-usr/share/xt_geoip/MX.iv4
-usr/share/xt_geoip/MX.iv6
-usr/share/xt_geoip/MY.iv4
-usr/share/xt_geoip/MY.iv6
-usr/share/xt_geoip/MZ.iv4
-usr/share/xt_geoip/MZ.iv6
-usr/share/xt_geoip/NA.iv4
-usr/share/xt_geoip/NA.iv6
-usr/share/xt_geoip/NC.iv4
-usr/share/xt_geoip/NC.iv6
-usr/share/xt_geoip/NE.iv4
-usr/share/xt_geoip/NE.iv6
-usr/share/xt_geoip/NF.iv4
-usr/share/xt_geoip/NF.iv6
-usr/share/xt_geoip/NG.iv4
-usr/share/xt_geoip/NG.iv6
-usr/share/xt_geoip/NI.iv4
-usr/share/xt_geoip/NI.iv6
-usr/share/xt_geoip/NL.iv4
-usr/share/xt_geoip/NL.iv6
-usr/share/xt_geoip/NO.iv4
-usr/share/xt_geoip/NO.iv6
-usr/share/xt_geoip/NP.iv4
-usr/share/xt_geoip/NP.iv6
-usr/share/xt_geoip/NR.iv4
-usr/share/xt_geoip/NR.iv6
-usr/share/xt_geoip/NU.iv4
-usr/share/xt_geoip/NU.iv6
-usr/share/xt_geoip/NZ.iv4
-usr/share/xt_geoip/NZ.iv6
-usr/share/xt_geoip/O1.iv4
-usr/share/xt_geoip/O1.iv6
-usr/share/xt_geoip/OM.iv4
-usr/share/xt_geoip/OM.iv6
-usr/share/xt_geoip/PA.iv4
-usr/share/xt_geoip/PA.iv6
-usr/share/xt_geoip/PE.iv4
-usr/share/xt_geoip/PE.iv6
-usr/share/xt_geoip/PF.iv4
-usr/share/xt_geoip/PF.iv6
-usr/share/xt_geoip/PG.iv4
-usr/share/xt_geoip/PG.iv6
-usr/share/xt_geoip/PH.iv4
-usr/share/xt_geoip/PH.iv6
-usr/share/xt_geoip/PK.iv4
-usr/share/xt_geoip/PK.iv6
-usr/share/xt_geoip/PL.iv4
-usr/share/xt_geoip/PL.iv6
-usr/share/xt_geoip/PM.iv4
-usr/share/xt_geoip/PM.iv6
-usr/share/xt_geoip/PN.iv4
-usr/share/xt_geoip/PN.iv6
-usr/share/xt_geoip/PR.iv4
-usr/share/xt_geoip/PR.iv6
-usr/share/xt_geoip/PS.iv4
-usr/share/xt_geoip/PS.iv6
-usr/share/xt_geoip/PT.iv4
-usr/share/xt_geoip/PT.iv6
-usr/share/xt_geoip/PW.iv4
-usr/share/xt_geoip/PW.iv6
-usr/share/xt_geoip/PY.iv4
-usr/share/xt_geoip/PY.iv6
-usr/share/xt_geoip/QA.iv4
-usr/share/xt_geoip/QA.iv6
-usr/share/xt_geoip/RE.iv4
-usr/share/xt_geoip/RE.iv6
-usr/share/xt_geoip/RO.iv4
-usr/share/xt_geoip/RO.iv6
-usr/share/xt_geoip/RS.iv4
-usr/share/xt_geoip/RS.iv6
-usr/share/xt_geoip/RU.iv4
-usr/share/xt_geoip/RU.iv6
-usr/share/xt_geoip/RW.iv4
-usr/share/xt_geoip/RW.iv6
-usr/share/xt_geoip/SA.iv4
-usr/share/xt_geoip/SA.iv6
-usr/share/xt_geoip/SB.iv4
-usr/share/xt_geoip/SB.iv6
-usr/share/xt_geoip/SC.iv4
-usr/share/xt_geoip/SC.iv6
-usr/share/xt_geoip/SD.iv4
-usr/share/xt_geoip/SD.iv6
-usr/share/xt_geoip/SE.iv4
-usr/share/xt_geoip/SE.iv6
-usr/share/xt_geoip/SG.iv4
-usr/share/xt_geoip/SG.iv6
-usr/share/xt_geoip/SH.iv4
-usr/share/xt_geoip/SH.iv6
-usr/share/xt_geoip/SI.iv4
-usr/share/xt_geoip/SI.iv6
-usr/share/xt_geoip/SJ.iv4
-usr/share/xt_geoip/SJ.iv6
-usr/share/xt_geoip/SK.iv4
-usr/share/xt_geoip/SK.iv6
-usr/share/xt_geoip/SL.iv4
-usr/share/xt_geoip/SL.iv6
-usr/share/xt_geoip/SM.iv4
-usr/share/xt_geoip/SM.iv6
-usr/share/xt_geoip/SN.iv4
-usr/share/xt_geoip/SN.iv6
-usr/share/xt_geoip/SO.iv4
-usr/share/xt_geoip/SO.iv6
-usr/share/xt_geoip/SR.iv4
-usr/share/xt_geoip/SR.iv6
-usr/share/xt_geoip/SS.iv4
-usr/share/xt_geoip/SS.iv6
-usr/share/xt_geoip/ST.iv4
-usr/share/xt_geoip/ST.iv6
-usr/share/xt_geoip/SV.iv4
-usr/share/xt_geoip/SV.iv6
-usr/share/xt_geoip/SX.iv4
-usr/share/xt_geoip/SX.iv6
-usr/share/xt_geoip/SY.iv4
-usr/share/xt_geoip/SY.iv6
-usr/share/xt_geoip/SZ.iv4
-usr/share/xt_geoip/SZ.iv6
-usr/share/xt_geoip/TC.iv4
-usr/share/xt_geoip/TC.iv6
-usr/share/xt_geoip/TD.iv4
-usr/share/xt_geoip/TD.iv6
-usr/share/xt_geoip/TF.iv4
-usr/share/xt_geoip/TF.iv6
-usr/share/xt_geoip/TG.iv4
-usr/share/xt_geoip/TG.iv6
-usr/share/xt_geoip/TH.iv4
-usr/share/xt_geoip/TH.iv6
-usr/share/xt_geoip/TJ.iv4
-usr/share/xt_geoip/TJ.iv6
-usr/share/xt_geoip/TK.iv4
-usr/share/xt_geoip/TK.iv6
-usr/share/xt_geoip/TL.iv4
-usr/share/xt_geoip/TL.iv6
-usr/share/xt_geoip/TM.iv4
-usr/share/xt_geoip/TM.iv6
-usr/share/xt_geoip/TN.iv4
-usr/share/xt_geoip/TN.iv6
-usr/share/xt_geoip/TO.iv4
-usr/share/xt_geoip/TO.iv6
-usr/share/xt_geoip/TR.iv4
-usr/share/xt_geoip/TR.iv6
-usr/share/xt_geoip/TT.iv4
-usr/share/xt_geoip/TT.iv6
-usr/share/xt_geoip/TV.iv4
-usr/share/xt_geoip/TV.iv6
-usr/share/xt_geoip/TW.iv4
-usr/share/xt_geoip/TW.iv6
-usr/share/xt_geoip/TZ.iv4
-usr/share/xt_geoip/TZ.iv6
-usr/share/xt_geoip/UA.iv4
-usr/share/xt_geoip/UA.iv6
-usr/share/xt_geoip/UG.iv4
-usr/share/xt_geoip/UG.iv6
-usr/share/xt_geoip/UM.iv4
-usr/share/xt_geoip/UM.iv6
-usr/share/xt_geoip/US.iv4
-usr/share/xt_geoip/US.iv6
-usr/share/xt_geoip/UY.iv4
-usr/share/xt_geoip/UY.iv6
-usr/share/xt_geoip/UZ.iv4
-usr/share/xt_geoip/UZ.iv6
-usr/share/xt_geoip/VA.iv4
-usr/share/xt_geoip/VA.iv6
-usr/share/xt_geoip/VC.iv4
-usr/share/xt_geoip/VC.iv6
-usr/share/xt_geoip/VE.iv4
-usr/share/xt_geoip/VE.iv6
-usr/share/xt_geoip/VG.iv4
-usr/share/xt_geoip/VG.iv6
-usr/share/xt_geoip/VI.iv4
-usr/share/xt_geoip/VI.iv6
-usr/share/xt_geoip/VN.iv4
-usr/share/xt_geoip/VN.iv6
-usr/share/xt_geoip/VU.iv4
-usr/share/xt_geoip/VU.iv6
-usr/share/xt_geoip/WF.iv4
-usr/share/xt_geoip/WF.iv6
-usr/share/xt_geoip/WS.iv4
-usr/share/xt_geoip/WS.iv6
-usr/share/xt_geoip/XK.iv4
-usr/share/xt_geoip/XK.iv6
-usr/share/xt_geoip/YE.iv4
-usr/share/xt_geoip/YE.iv6
-usr/share/xt_geoip/YT.iv4
-usr/share/xt_geoip/YT.iv6
-usr/share/xt_geoip/ZA.iv4
-usr/share/xt_geoip/ZA.iv6
-usr/share/xt_geoip/ZM.iv4
-usr/share/xt_geoip/ZM.iv6
-usr/share/xt_geoip/ZW.iv4
-usr/share/xt_geoip/ZW.iv6
-#var/lib/GeoIP
-var/lib/GeoIP/COPYRIGHT.txt
-var/lib/GeoIP/GeoLite2-Country-Blocks-IPv4.csv
-var/lib/GeoIP/GeoLite2-Country-Blocks-IPv6.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-de.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-en.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-es.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-fr.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-ja.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-pt-BR.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-ru.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-zh-CN.csv
-var/lib/GeoIP/LICENSE.txt
-var/lib/GeoIP/README.txt
diff --git a/config/rootfiles/common/geoip-generator b/config/rootfiles/common/geoip-generator
deleted file mode 100644 (file)
index 6ff83c0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#usr/bin/geoiplookup
-#usr/bin/geoiplookup6
-#usr/include/GeoIP.h
-#usr/include/GeoIPCity.h
-#usr/lib/libGeoIP.a
-#usr/lib/libGeoIP.la
-usr/lib/libGeoIP.so
-usr/lib/libGeoIP.so.1
-usr/lib/libGeoIP.so.1.6.12
-#usr/lib/pkgconfig/geoip.pc
-#usr/share/GeoIP/bin
-usr/share/GeoIP/bin/countryInfo.txt
-usr/share/GeoIP/bin/geoip-generator
-usr/share/GeoIP/bin/geolite2-to-legacy-csv.sh
-#usr/share/man/man1/geoiplookup.1
-#usr/share/man/man1/geoiplookup6.1
index c0fc18705fb94bbaa13db695eb17fd81ca992f39..b4e944342880e59bb43a0a09cc0262777b3f4fd3 100644 (file)
@@ -66,7 +66,6 @@ etc/rc.d/init.d/networking/red.up/50-ovpn
 etc/rc.d/init.d/networking/red.up/98-leds
 etc/rc.d/init.d/networking/red.up/99-beep
 etc/rc.d/init.d/networking/red.up/99-fireinfo
-etc/rc.d/init.d/networking/red.up/99-geoip-database
 etc/rc.d/init.d/networking/red.up/99-pakfire-update
 etc/rc.d/init.d/networking/wpa_supplicant.exe
 etc/rc.d/init.d/ntp
diff --git a/config/rootfiles/common/libloc b/config/rootfiles/common/libloc
new file mode 100644 (file)
index 0000000..9985b93
--- /dev/null
@@ -0,0 +1,294 @@
+usr/bin/location
+#usr/bin/location-importer
+#usr/include/libloc
+#usr/include/libloc/as.h
+#usr/include/libloc/compat.h
+#usr/include/libloc/country.h
+#usr/include/libloc/database.h
+#usr/include/libloc/format.h
+#usr/include/libloc/libloc.h
+#usr/include/libloc/network.h
+#usr/include/libloc/private.h
+#usr/include/libloc/resolv.h
+#usr/include/libloc/stringpool.h
+#usr/include/libloc/writer.h
+#usr/lib/libloc.la
+#usr/lib/libloc.so
+usr/lib/libloc.so.0
+usr/lib/libloc.so.0.0.0
+usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/Location.pm
+#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Location
+#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Location/.packlist
+usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Location/Location.so
+#usr/lib/pkgconfig/libloc.pc
+#usr/lib/python3.8/site-packages/_location.la
+usr/lib/python3.8/site-packages/_location.so
+#usr/lib/python3.8/site-packages/location
+usr/lib/python3.8/site-packages/location/__init__.py
+#usr/lib/python3.8/site-packages/location/database.py
+usr/lib/python3.8/site-packages/location/downloader.py
+usr/lib/python3.8/site-packages/location/export.py
+usr/lib/python3.8/site-packages/location/i18n.py
+#usr/lib/python3.8/site-packages/location/importer.py
+usr/lib/python3.8/site-packages/location/logger.py
+#usr/share/locale/de/LC_MESSAGES/libloc.mo
+#usr/share/man/man3/Location.3
+usr/share/xt_geoip/A1.iv4
+usr/share/xt_geoip/A2.iv4
+usr/share/xt_geoip/A3.iv4
+usr/share/xt_geoip/AD.iv4
+usr/share/xt_geoip/AE.iv4
+usr/share/xt_geoip/AF.iv4
+usr/share/xt_geoip/AG.iv4
+usr/share/xt_geoip/AI.iv4
+usr/share/xt_geoip/AL.iv4
+usr/share/xt_geoip/AM.iv4
+usr/share/xt_geoip/AN.iv4
+usr/share/xt_geoip/AO.iv4
+usr/share/xt_geoip/AP.iv4
+usr/share/xt_geoip/AQ.iv4
+usr/share/xt_geoip/AR.iv4
+usr/share/xt_geoip/AS.iv4
+usr/share/xt_geoip/AT.iv4
+usr/share/xt_geoip/AU.iv4
+usr/share/xt_geoip/AW.iv4
+usr/share/xt_geoip/AX.iv4
+usr/share/xt_geoip/AZ.iv4
+usr/share/xt_geoip/BA.iv4
+usr/share/xt_geoip/BB.iv4
+usr/share/xt_geoip/BD.iv4
+usr/share/xt_geoip/BE.iv4
+usr/share/xt_geoip/BF.iv4
+usr/share/xt_geoip/BG.iv4
+usr/share/xt_geoip/BH.iv4
+usr/share/xt_geoip/BI.iv4
+usr/share/xt_geoip/BJ.iv4
+usr/share/xt_geoip/BL.iv4
+usr/share/xt_geoip/BM.iv4
+usr/share/xt_geoip/BN.iv4
+usr/share/xt_geoip/BO.iv4
+usr/share/xt_geoip/BQ.iv4
+usr/share/xt_geoip/BR.iv4
+usr/share/xt_geoip/BS.iv4
+usr/share/xt_geoip/BT.iv4
+usr/share/xt_geoip/BV.iv4
+usr/share/xt_geoip/BW.iv4
+usr/share/xt_geoip/BY.iv4
+usr/share/xt_geoip/BZ.iv4
+usr/share/xt_geoip/CA.iv4
+usr/share/xt_geoip/CC.iv4
+usr/share/xt_geoip/CD.iv4
+usr/share/xt_geoip/CF.iv4
+usr/share/xt_geoip/CG.iv4
+usr/share/xt_geoip/CH.iv4
+usr/share/xt_geoip/CI.iv4
+usr/share/xt_geoip/CK.iv4
+usr/share/xt_geoip/CL.iv4
+usr/share/xt_geoip/CM.iv4
+usr/share/xt_geoip/CN.iv4
+usr/share/xt_geoip/CO.iv4
+usr/share/xt_geoip/CR.iv4
+usr/share/xt_geoip/CU.iv4
+usr/share/xt_geoip/CV.iv4
+usr/share/xt_geoip/CW.iv4
+usr/share/xt_geoip/CX.iv4
+usr/share/xt_geoip/CY.iv4
+usr/share/xt_geoip/CZ.iv4
+usr/share/xt_geoip/DE.iv4
+usr/share/xt_geoip/DJ.iv4
+usr/share/xt_geoip/DK.iv4
+usr/share/xt_geoip/DM.iv4
+usr/share/xt_geoip/DO.iv4
+usr/share/xt_geoip/DZ.iv4
+usr/share/xt_geoip/EC.iv4
+usr/share/xt_geoip/EE.iv4
+usr/share/xt_geoip/EG.iv4
+usr/share/xt_geoip/EH.iv4
+usr/share/xt_geoip/ER.iv4
+usr/share/xt_geoip/ES.iv4
+usr/share/xt_geoip/ET.iv4
+usr/share/xt_geoip/EU.iv4
+usr/share/xt_geoip/FI.iv4
+usr/share/xt_geoip/FJ.iv4
+usr/share/xt_geoip/FK.iv4
+usr/share/xt_geoip/FM.iv4
+usr/share/xt_geoip/FO.iv4
+usr/share/xt_geoip/FR.iv4
+usr/share/xt_geoip/FX.iv4
+usr/share/xt_geoip/GA.iv4
+usr/share/xt_geoip/GB.iv4
+usr/share/xt_geoip/GD.iv4
+usr/share/xt_geoip/GE.iv4
+usr/share/xt_geoip/GF.iv4
+usr/share/xt_geoip/GG.iv4
+usr/share/xt_geoip/GH.iv4
+usr/share/xt_geoip/GI.iv4
+usr/share/xt_geoip/GL.iv4
+usr/share/xt_geoip/GM.iv4
+usr/share/xt_geoip/GN.iv4
+usr/share/xt_geoip/GP.iv4
+usr/share/xt_geoip/GQ.iv4
+usr/share/xt_geoip/GR.iv4
+usr/share/xt_geoip/GS.iv4
+usr/share/xt_geoip/GT.iv4
+usr/share/xt_geoip/GU.iv4
+usr/share/xt_geoip/GW.iv4
+usr/share/xt_geoip/GY.iv4
+usr/share/xt_geoip/HK.iv4
+usr/share/xt_geoip/HM.iv4
+usr/share/xt_geoip/HN.iv4
+usr/share/xt_geoip/HR.iv4
+usr/share/xt_geoip/HT.iv4
+usr/share/xt_geoip/HU.iv4
+usr/share/xt_geoip/ID.iv4
+usr/share/xt_geoip/IE.iv4
+usr/share/xt_geoip/IL.iv4
+usr/share/xt_geoip/IM.iv4
+usr/share/xt_geoip/IN.iv4
+usr/share/xt_geoip/IO.iv4
+usr/share/xt_geoip/IQ.iv4
+usr/share/xt_geoip/IR.iv4
+usr/share/xt_geoip/IS.iv4
+usr/share/xt_geoip/IT.iv4
+usr/share/xt_geoip/JE.iv4
+usr/share/xt_geoip/JM.iv4
+usr/share/xt_geoip/JO.iv4
+usr/share/xt_geoip/JP.iv4
+usr/share/xt_geoip/KE.iv4
+usr/share/xt_geoip/KG.iv4
+usr/share/xt_geoip/KH.iv4
+usr/share/xt_geoip/KI.iv4
+usr/share/xt_geoip/KM.iv4
+usr/share/xt_geoip/KN.iv4
+usr/share/xt_geoip/KP.iv4
+usr/share/xt_geoip/KR.iv4
+usr/share/xt_geoip/KW.iv4
+usr/share/xt_geoip/KY.iv4
+usr/share/xt_geoip/KZ.iv4
+usr/share/xt_geoip/LA.iv4
+usr/share/xt_geoip/LB.iv4
+usr/share/xt_geoip/LC.iv4
+usr/share/xt_geoip/LI.iv4
+usr/share/xt_geoip/LK.iv4
+usr/share/xt_geoip/LR.iv4
+usr/share/xt_geoip/LS.iv4
+usr/share/xt_geoip/LT.iv4
+usr/share/xt_geoip/LU.iv4
+usr/share/xt_geoip/LV.iv4
+usr/share/xt_geoip/LY.iv4
+usr/share/xt_geoip/MA.iv4
+usr/share/xt_geoip/MC.iv4
+usr/share/xt_geoip/MD.iv4
+usr/share/xt_geoip/ME.iv4
+usr/share/xt_geoip/MF.iv4
+usr/share/xt_geoip/MG.iv4
+usr/share/xt_geoip/MH.iv4
+usr/share/xt_geoip/MK.iv4
+usr/share/xt_geoip/ML.iv4
+usr/share/xt_geoip/MM.iv4
+usr/share/xt_geoip/MN.iv4
+usr/share/xt_geoip/MO.iv4
+usr/share/xt_geoip/MP.iv4
+usr/share/xt_geoip/MQ.iv4
+usr/share/xt_geoip/MR.iv4
+usr/share/xt_geoip/MS.iv4
+usr/share/xt_geoip/MT.iv4
+usr/share/xt_geoip/MU.iv4
+usr/share/xt_geoip/MV.iv4
+usr/share/xt_geoip/MW.iv4
+usr/share/xt_geoip/MX.iv4
+usr/share/xt_geoip/MY.iv4
+usr/share/xt_geoip/MZ.iv4
+usr/share/xt_geoip/NA.iv4
+usr/share/xt_geoip/NC.iv4
+usr/share/xt_geoip/NE.iv4
+usr/share/xt_geoip/NF.iv4
+usr/share/xt_geoip/NG.iv4
+usr/share/xt_geoip/NI.iv4
+usr/share/xt_geoip/NL.iv4
+usr/share/xt_geoip/NO.iv4
+usr/share/xt_geoip/NP.iv4
+usr/share/xt_geoip/NR.iv4
+usr/share/xt_geoip/NU.iv4
+usr/share/xt_geoip/NZ.iv4
+usr/share/xt_geoip/OM.iv4
+usr/share/xt_geoip/PA.iv4
+usr/share/xt_geoip/PE.iv4
+usr/share/xt_geoip/PF.iv4
+usr/share/xt_geoip/PG.iv4
+usr/share/xt_geoip/PH.iv4
+usr/share/xt_geoip/PK.iv4
+usr/share/xt_geoip/PL.iv4
+usr/share/xt_geoip/PM.iv4
+usr/share/xt_geoip/PN.iv4
+usr/share/xt_geoip/PR.iv4
+usr/share/xt_geoip/PS.iv4
+usr/share/xt_geoip/PT.iv4
+usr/share/xt_geoip/PW.iv4
+usr/share/xt_geoip/PY.iv4
+usr/share/xt_geoip/QA.iv4
+usr/share/xt_geoip/RE.iv4
+usr/share/xt_geoip/RO.iv4
+usr/share/xt_geoip/RS.iv4
+usr/share/xt_geoip/RU.iv4
+usr/share/xt_geoip/RW.iv4
+usr/share/xt_geoip/SA.iv4
+usr/share/xt_geoip/SB.iv4
+usr/share/xt_geoip/SC.iv4
+usr/share/xt_geoip/SD.iv4
+usr/share/xt_geoip/SE.iv4
+usr/share/xt_geoip/SG.iv4
+usr/share/xt_geoip/SH.iv4
+usr/share/xt_geoip/SI.iv4
+usr/share/xt_geoip/SJ.iv4
+usr/share/xt_geoip/SK.iv4
+usr/share/xt_geoip/SL.iv4
+usr/share/xt_geoip/SM.iv4
+usr/share/xt_geoip/SN.iv4
+usr/share/xt_geoip/SO.iv4
+usr/share/xt_geoip/SR.iv4
+usr/share/xt_geoip/SS.iv4
+usr/share/xt_geoip/ST.iv4
+usr/share/xt_geoip/SV.iv4
+usr/share/xt_geoip/SX.iv4
+usr/share/xt_geoip/SY.iv4
+usr/share/xt_geoip/SZ.iv4
+usr/share/xt_geoip/TC.iv4
+usr/share/xt_geoip/TD.iv4
+usr/share/xt_geoip/TF.iv4
+usr/share/xt_geoip/TG.iv4
+usr/share/xt_geoip/TH.iv4
+usr/share/xt_geoip/TJ.iv4
+usr/share/xt_geoip/TK.iv4
+usr/share/xt_geoip/TL.iv4
+usr/share/xt_geoip/TM.iv4
+usr/share/xt_geoip/TN.iv4
+usr/share/xt_geoip/TO.iv4
+usr/share/xt_geoip/TR.iv4
+usr/share/xt_geoip/TT.iv4
+usr/share/xt_geoip/TV.iv4
+usr/share/xt_geoip/TW.iv4
+usr/share/xt_geoip/TZ.iv4
+usr/share/xt_geoip/UA.iv4
+usr/share/xt_geoip/UG.iv4
+usr/share/xt_geoip/UM.iv4
+usr/share/xt_geoip/US.iv4
+usr/share/xt_geoip/UY.iv4
+usr/share/xt_geoip/UZ.iv4
+usr/share/xt_geoip/VA.iv4
+usr/share/xt_geoip/VC.iv4
+usr/share/xt_geoip/VE.iv4
+usr/share/xt_geoip/VG.iv4
+usr/share/xt_geoip/VI.iv4
+usr/share/xt_geoip/VN.iv4
+usr/share/xt_geoip/VU.iv4
+usr/share/xt_geoip/WF.iv4
+usr/share/xt_geoip/WS.iv4
+usr/share/xt_geoip/YE.iv4
+usr/share/xt_geoip/YT.iv4
+usr/share/xt_geoip/ZA.iv4
+usr/share/xt_geoip/ZM.iv4
+usr/share/xt_geoip/ZW.iv4
+#var/lib/location
+var/lib/location/database.db
+var/lib/location/signing-key.pem
index f5643933577ad9af6d0d5755735a4714866ab6d3..2c4f715dd52b5d0cb0c9831255bf3e2db020a5dd 100644 (file)
@@ -93,6 +93,7 @@ usr/local/bin/connscheduler
 usr/local/bin/consort.sh
 usr/local/bin/convert-dns-settings
 usr/local/bin/convert-ovpn
+usr/local/bin/convert-to-location
 usr/local/bin/filesystem-cleanup
 usr/local/bin/hddshutdown
 usr/local/bin/ipsec-interfaces
@@ -107,8 +108,7 @@ usr/local/bin/timecheck
 usr/local/bin/timezone-transition
 usr/local/bin/update-lang-cache
 usr/local/bin/update-ids-ruleset
-usr/local/bin/xt_geoip_build
-usr/local/bin/xt_geoip_update
+usr/local/bin/update-location-database
 #usr/local/include
 #usr/local/lib
 #usr/local/lib/sse2
index 9aaa05631802dab04128ea72a2cde830680f2662..aa32053a2cb931b4ca8870f48f50aa9aaf0154e1 100644 (file)
@@ -26,7 +26,6 @@ srv/web/ipfire/cgi-bin/extrahd.cgi
 srv/web/ipfire/cgi-bin/fireinfo.cgi
 srv/web/ipfire/cgi-bin/firewall.cgi
 srv/web/ipfire/cgi-bin/fwhosts.cgi
-srv/web/ipfire/cgi-bin/geoip-block.cgi
 srv/web/ipfire/cgi-bin/gpl.cgi
 #srv/web/ipfire/cgi-bin/guardian.cgi
 srv/web/ipfire/cgi-bin/gui.cgi
@@ -36,6 +35,7 @@ srv/web/ipfire/cgi-bin/ids.cgi
 srv/web/ipfire/cgi-bin/index.cgi
 srv/web/ipfire/cgi-bin/ipinfo.cgi
 srv/web/ipfire/cgi-bin/iptables.cgi
+srv/web/ipfire/cgi-bin/location-block.cgi
 srv/web/ipfire/cgi-bin/logs.cgi
 srv/web/ipfire/cgi-bin/logs.cgi/calamaris.dat
 srv/web/ipfire/cgi-bin/logs.cgi/config.dat
index c0fc18705fb94bbaa13db695eb17fd81ca992f39..b4e944342880e59bb43a0a09cc0262777b3f4fd3 100644 (file)
@@ -66,7 +66,6 @@ etc/rc.d/init.d/networking/red.up/50-ovpn
 etc/rc.d/init.d/networking/red.up/98-leds
 etc/rc.d/init.d/networking/red.up/99-beep
 etc/rc.d/init.d/networking/red.up/99-fireinfo
-etc/rc.d/init.d/networking/red.up/99-geoip-database
 etc/rc.d/init.d/networking/red.up/99-pakfire-update
 etc/rc.d/init.d/networking/wpa_supplicant.exe
 etc/rc.d/init.d/ntp
index 2197ac4aca5131e6977d3744e662cae14ea54b97..7e2ba5bbb11ab4d7e36d69201e4d1361782cf56d 100644 (file)
@@ -109,8 +109,7 @@ usr/local/bin/timecheck
 usr/local/bin/timezone-transition
 usr/local/bin/update-ids-ruleset
 usr/local/bin/update-lang-cache
-usr/local/bin/xt_geoip_build
-usr/local/bin/xt_geoip_update
+usr/local/bin/update-location-database
 #usr/local/include
 #usr/local/lib
 #usr/local/lib/sse2
index cb958ee7ee6689210889afc92a676ecfa618d2ec..a20047c7df785d52c11f3b55467a1b319252b7c8 100644 (file)
@@ -23,11 +23,11 @@ lib/xtables/libxt_quota2.so
 usr/lib/libxt_ACCOUNT_cl.so.0
 usr/lib/libxt_ACCOUNT_cl.so.0.0.0
 #usr/libexec/xtables-addons
-usr/libexec/xtables-addons/xt_geoip_build
-usr/libexec/xtables-addons/xt_geoip_dl
-usr/local/bin/xt_geoip_build
+#usr/libexec/xtables-addons/xt_geoip_build
+#usr/libexec/xtables-addons/xt_geoip_dl
 usr/sbin/iptaccount
 #usr/share/man/man1/xt_geoip_build.1
 #usr/share/man/man1/xt_geoip_dl.1
 #usr/share/man/man8/iptaccount.8
 #usr/share/man/man8/xtables-addons.8
+/usr/share/xt_geoip/
index f651e76aa292d6a8c1f16e19f29e3304ec7394a5..5a96482c844519eef309e8542fafef575c93c059 100644 (file)
@@ -892,7 +892,7 @@ WARNING: untranslated string: fwdfw wd_thu = Thu
 WARNING: untranslated string: fwdfw wd_tue = Tue
 WARNING: untranslated string: fwdfw wd_wed = Wed
 WARNING: untranslated string: fwhost OpenVPN N-2-N = OpenVPN Net-to-Net
-WARNING: untranslated string: fwhost addgeoipgrp = Add new GeoIP group
+WARNING: untranslated string: fwhost addgeoipgrp = Add new Location group
 WARNING: untranslated string: fwhost addgrp = Add new network/host group
 WARNING: untranslated string: fwhost addgrpname = Group name:
 WARNING: untranslated string: fwhost addhost = Add new host
@@ -905,9 +905,9 @@ WARNING: untranslated string: fwhost ccdhost = OpenVPN clients:
 WARNING: untranslated string: fwhost ccdnet = OpenVPN networks:
 WARNING: untranslated string: fwhost change = Modify
 WARNING: untranslated string: fwhost cust addr = Hosts
-WARNING: untranslated string: fwhost cust geoipgroup = GeoIP Groups
+WARNING: untranslated string: fwhost cust geoipgroup = Location Groups
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
-WARNING: untranslated string: fwhost cust geoiplocation = GeoIP Locations
+WARNING: untranslated string: fwhost cust geoiplocation = Location Locations
 WARNING: untranslated string: fwhost cust grp = Network/Host Groups
 WARNING: untranslated string: fwhost cust net = Networks
 WARNING: untranslated string: fwhost cust service = Services
@@ -947,7 +947,7 @@ WARNING: untranslated string: fwhost ip_mac = IP/MAC address
 WARNING: untranslated string: fwhost ipsec net = IPsec networks:
 WARNING: untranslated string: fwhost menu = Firewall Groups
 WARNING: untranslated string: fwhost netaddress = Network address
-WARNING: untranslated string: fwhost newgeoipgrp = GeoIP Groups
+WARNING: untranslated string: fwhost newgeoipgrp = Location Groups
 WARNING: untranslated string: fwhost newgrp = Network/Host Groups
 WARNING: untranslated string: fwhost newhost = Hosts
 WARNING: untranslated string: fwhost newnet = Networks
@@ -972,13 +972,13 @@ WARNING: untranslated string: generate ptr = Generate PTR
 WARNING: untranslated string: generate root/host certificates = Generate root/host certificates
 WARNING: untranslated string: generating the root and host certificates may take a long time. it can take up to several minutes on older hardware. please be patient = Generating the root and host certificates may take a long time.  It can take up to several minutes on older hardware. Please be patient.
 WARNING: untranslated string: genre = Genre
-WARNING: untranslated string: geoip = GeoIP
-WARNING: untranslated string: geoipblock = GeoIP Block
+WARNING: untranslated string: geoip = Location
+WARNING: untranslated string: geoipblock = Location Block
 WARNING: untranslated string: geoipblock block countries = Block countries
-WARNING: untranslated string: geoipblock configuration = GeoIP Configuration
+WARNING: untranslated string: geoipblock configuration = Location Configuration
 WARNING: untranslated string: geoipblock country is allowed = Incoming traffic from this country is allowed
 WARNING: untranslated string: geoipblock country is blocked = Incoming traffic from this country will be blocked
-WARNING: untranslated string: geoipblock enable feature = Enable GeoIP based blocking:
+WARNING: untranslated string: geoipblock enable feature = Enable Location based blocking:
 WARNING: untranslated string: global settings = Global Settings
 WARNING: untranslated string: gpl i accept these terms and conditions = I accept these terms and conditions
 WARNING: untranslated string: gpl license agreement = License Agreement
index 885b44f6288dc6191f268af43e7763686e39c8d2..cdd11338c53014bf5aad35fea15b9cbbb4157c14 100644 (file)
@@ -1000,7 +1000,7 @@ WARNING: untranslated string: fwdfw wd_thu = Thu
 WARNING: untranslated string: fwdfw wd_tue = Tue
 WARNING: untranslated string: fwdfw wd_wed = Wed
 WARNING: untranslated string: fwhost OpenVPN N-2-N = OpenVPN Net-to-Net
-WARNING: untranslated string: fwhost addgeoipgrp = Add new GeoIP group
+WARNING: untranslated string: fwhost addgeoipgrp = Add new Location group
 WARNING: untranslated string: fwhost addgrp = Add new network/host group
 WARNING: untranslated string: fwhost addgrpname = Group name:
 WARNING: untranslated string: fwhost addhost = Add new host
@@ -1013,9 +1013,9 @@ WARNING: untranslated string: fwhost ccdhost = OpenVPN clients:
 WARNING: untranslated string: fwhost ccdnet = OpenVPN networks:
 WARNING: untranslated string: fwhost change = Modify
 WARNING: untranslated string: fwhost cust addr = Hosts
-WARNING: untranslated string: fwhost cust geoipgroup = GeoIP Groups
+WARNING: untranslated string: fwhost cust geoipgroup = Location Groups
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
-WARNING: untranslated string: fwhost cust geoiplocation = GeoIP Locations
+WARNING: untranslated string: fwhost cust geoiplocation = Location Locations
 WARNING: untranslated string: fwhost cust grp = Network/Host Groups
 WARNING: untranslated string: fwhost cust net = Networks
 WARNING: untranslated string: fwhost cust service = Services
@@ -1055,7 +1055,7 @@ WARNING: untranslated string: fwhost ip_mac = IP/MAC address
 WARNING: untranslated string: fwhost ipsec net = IPsec networks:
 WARNING: untranslated string: fwhost menu = Firewall Groups
 WARNING: untranslated string: fwhost netaddress = Network address
-WARNING: untranslated string: fwhost newgeoipgrp = GeoIP Groups
+WARNING: untranslated string: fwhost newgeoipgrp = Location Groups
 WARNING: untranslated string: fwhost newgrp = Network/Host Groups
 WARNING: untranslated string: fwhost newhost = Hosts
 WARNING: untranslated string: fwhost newnet = Networks
index fa7a842dc0ad87e603613d6a589e51cfeb7fc959..444a2c9c874b81d67336dd802931305f7950aed9 100644 (file)
@@ -903,20 +903,20 @@ WARNING: untranslated string: fwdfw limitconcon = Limit concurrent connections p
 WARNING: untranslated string: fwdfw maxconcon = Max. concurrent connections
 WARNING: untranslated string: fwdfw numcon = Number of connections
 WARNING: untranslated string: fwdfw ratelimit = Rate-limit new connections
-WARNING: untranslated string: fwhost addgeoipgrp = Add new GeoIP group
-WARNING: untranslated string: fwhost cust geoipgroup = GeoIP Groups
+WARNING: untranslated string: fwhost addgeoipgrp = Add new Location group
+WARNING: untranslated string: fwhost cust geoipgroup = Location Groups
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
-WARNING: untranslated string: fwhost cust geoiplocation = GeoIP Locations
+WARNING: untranslated string: fwhost cust geoiplocation = Location Locations
 WARNING: untranslated string: fwhost err hostip = unknown string
-WARNING: untranslated string: fwhost newgeoipgrp = GeoIP Groups
+WARNING: untranslated string: fwhost newgeoipgrp = Location Groups
 WARNING: untranslated string: generate ptr = Generate PTR
-WARNING: untranslated string: geoip = GeoIP
-WARNING: untranslated string: geoipblock = GeoIP Block
+WARNING: untranslated string: geoip = Location
+WARNING: untranslated string: geoipblock = Location Block
 WARNING: untranslated string: geoipblock block countries = Block countries
-WARNING: untranslated string: geoipblock configuration = GeoIP Configuration
+WARNING: untranslated string: geoipblock configuration = Location Configuration
 WARNING: untranslated string: geoipblock country is allowed = Incoming traffic from this country is allowed
 WARNING: untranslated string: geoipblock country is blocked = Incoming traffic from this country will be blocked
-WARNING: untranslated string: geoipblock enable feature = Enable GeoIP based blocking:
+WARNING: untranslated string: geoipblock enable feature = Enable Location based blocking:
 WARNING: untranslated string: guaranteed bandwith = Guaranteed bandwith
 WARNING: untranslated string: guardian = Guardian
 WARNING: untranslated string: guardian block a host = unknown string
index dec6d6a79a8656b5b951ee4efc022ae1a5c0a49c..3d226cd368d5a94db654bae76bfb133a821bbb47 100644 (file)
@@ -909,22 +909,22 @@ WARNING: untranslated string: fwdfw limitconcon = Limit concurrent connections p
 WARNING: untranslated string: fwdfw maxconcon = Max. concurrent connections
 WARNING: untranslated string: fwdfw numcon = Number of connections
 WARNING: untranslated string: fwdfw ratelimit = Rate-limit new connections
-WARNING: untranslated string: fwhost addgeoipgrp = Add new GeoIP group
-WARNING: untranslated string: fwhost cust geoipgroup = GeoIP Groups
+WARNING: untranslated string: fwhost addgeoipgrp = Add new Location group
+WARNING: untranslated string: fwhost cust geoipgroup = Location Groups
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
-WARNING: untranslated string: fwhost cust geoiplocation = GeoIP Locations
+WARNING: untranslated string: fwhost cust geoiplocation = Location Locations
 WARNING: untranslated string: fwhost err hostip = unknown string
-WARNING: untranslated string: fwhost newgeoipgrp = GeoIP Groups
+WARNING: untranslated string: fwhost newgeoipgrp = Location Groups
 WARNING: untranslated string: gen dh = Generate new Diffie-Hellman parameters
 WARNING: untranslated string: generate dh key = Generate Diffie-Hellman parameters
 WARNING: untranslated string: generate ptr = Generate PTR
-WARNING: untranslated string: geoip = GeoIP
-WARNING: untranslated string: geoipblock = GeoIP Block
+WARNING: untranslated string: geoip = Location
+WARNING: untranslated string: geoipblock = Location Block
 WARNING: untranslated string: geoipblock block countries = Block countries
-WARNING: untranslated string: geoipblock configuration = GeoIP Configuration
+WARNING: untranslated string: geoipblock configuration = Location Configuration
 WARNING: untranslated string: geoipblock country is allowed = Incoming traffic from this country is allowed
 WARNING: untranslated string: geoipblock country is blocked = Incoming traffic from this country will be blocked
-WARNING: untranslated string: geoipblock enable feature = Enable GeoIP based blocking:
+WARNING: untranslated string: geoipblock enable feature = Enable Location based blocking:
 WARNING: untranslated string: guardian = Guardian
 WARNING: untranslated string: guardian block a host = unknown string
 WARNING: untranslated string: guardian block httpd brute-force = unknown string
index 885b44f6288dc6191f268af43e7763686e39c8d2..cdd11338c53014bf5aad35fea15b9cbbb4157c14 100644 (file)
@@ -1000,7 +1000,7 @@ WARNING: untranslated string: fwdfw wd_thu = Thu
 WARNING: untranslated string: fwdfw wd_tue = Tue
 WARNING: untranslated string: fwdfw wd_wed = Wed
 WARNING: untranslated string: fwhost OpenVPN N-2-N = OpenVPN Net-to-Net
-WARNING: untranslated string: fwhost addgeoipgrp = Add new GeoIP group
+WARNING: untranslated string: fwhost addgeoipgrp = Add new Location group
 WARNING: untranslated string: fwhost addgrp = Add new network/host group
 WARNING: untranslated string: fwhost addgrpname = Group name:
 WARNING: untranslated string: fwhost addhost = Add new host
@@ -1013,9 +1013,9 @@ WARNING: untranslated string: fwhost ccdhost = OpenVPN clients:
 WARNING: untranslated string: fwhost ccdnet = OpenVPN networks:
 WARNING: untranslated string: fwhost change = Modify
 WARNING: untranslated string: fwhost cust addr = Hosts
-WARNING: untranslated string: fwhost cust geoipgroup = GeoIP Groups
+WARNING: untranslated string: fwhost cust geoipgroup = Location Groups
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
-WARNING: untranslated string: fwhost cust geoiplocation = GeoIP Locations
+WARNING: untranslated string: fwhost cust geoiplocation = Location Locations
 WARNING: untranslated string: fwhost cust grp = Network/Host Groups
 WARNING: untranslated string: fwhost cust net = Networks
 WARNING: untranslated string: fwhost cust service = Services
@@ -1055,7 +1055,7 @@ WARNING: untranslated string: fwhost ip_mac = IP/MAC address
 WARNING: untranslated string: fwhost ipsec net = IPsec networks:
 WARNING: untranslated string: fwhost menu = Firewall Groups
 WARNING: untranslated string: fwhost netaddress = Network address
-WARNING: untranslated string: fwhost newgeoipgrp = GeoIP Groups
+WARNING: untranslated string: fwhost newgeoipgrp = Location Groups
 WARNING: untranslated string: fwhost newgrp = Network/Host Groups
 WARNING: untranslated string: fwhost newhost = Hosts
 WARNING: untranslated string: fwhost newnet = Networks
index d5433b37e26f12d394351d8db6cd478cd28aa548..86d960299bf1fc457dad0d835e78b15e936a402f 100644 (file)
@@ -994,7 +994,7 @@ WARNING: untranslated string: fwdfw wd_thu = Thu
 WARNING: untranslated string: fwdfw wd_tue = Tue
 WARNING: untranslated string: fwdfw wd_wed = Wed
 WARNING: untranslated string: fwhost OpenVPN N-2-N = OpenVPN Net-to-Net
-WARNING: untranslated string: fwhost addgeoipgrp = Add new GeoIP group
+WARNING: untranslated string: fwhost addgeoipgrp = Add new Location group
 WARNING: untranslated string: fwhost addgrp = Add new network/host group
 WARNING: untranslated string: fwhost addgrpname = Group name:
 WARNING: untranslated string: fwhost addhost = Add new host
@@ -1007,9 +1007,9 @@ WARNING: untranslated string: fwhost ccdhost = OpenVPN clients:
 WARNING: untranslated string: fwhost ccdnet = OpenVPN networks:
 WARNING: untranslated string: fwhost change = Modify
 WARNING: untranslated string: fwhost cust addr = Hosts
-WARNING: untranslated string: fwhost cust geoipgroup = GeoIP Groups
+WARNING: untranslated string: fwhost cust geoipgroup = Location Groups
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
-WARNING: untranslated string: fwhost cust geoiplocation = GeoIP Locations
+WARNING: untranslated string: fwhost cust geoiplocation = Location Locations
 WARNING: untranslated string: fwhost cust grp = Network/Host Groups
 WARNING: untranslated string: fwhost cust net = Networks
 WARNING: untranslated string: fwhost cust service = Services
@@ -1049,7 +1049,7 @@ WARNING: untranslated string: fwhost ip_mac = IP/MAC address
 WARNING: untranslated string: fwhost ipsec net = IPsec networks:
 WARNING: untranslated string: fwhost menu = Firewall Groups
 WARNING: untranslated string: fwhost netaddress = Network address
-WARNING: untranslated string: fwhost newgeoipgrp = GeoIP Groups
+WARNING: untranslated string: fwhost newgeoipgrp = Location Groups
 WARNING: untranslated string: fwhost newgrp = Network/Host Groups
 WARNING: untranslated string: fwhost newhost = Hosts
 WARNING: untranslated string: fwhost newnet = Networks
@@ -1067,13 +1067,13 @@ WARNING: untranslated string: fwhost welcome = Over here, you can group single h
 WARNING: untranslated string: gen dh = Generate new Diffie-Hellman parameters
 WARNING: untranslated string: generate dh key = Generate Diffie-Hellman parameters
 WARNING: untranslated string: generate ptr = Generate PTR
-WARNING: untranslated string: geoip = GeoIP
-WARNING: untranslated string: geoipblock = GeoIP Block
+WARNING: untranslated string: geoip = Location
+WARNING: untranslated string: geoipblock = Location Block
 WARNING: untranslated string: geoipblock block countries = Block countries
-WARNING: untranslated string: geoipblock configuration = GeoIP Configuration
+WARNING: untranslated string: geoipblock configuration = Location Configuration
 WARNING: untranslated string: geoipblock country is allowed = Incoming traffic from this country is allowed
 WARNING: untranslated string: geoipblock country is blocked = Incoming traffic from this country will be blocked
-WARNING: untranslated string: geoipblock enable feature = Enable GeoIP based blocking:
+WARNING: untranslated string: geoipblock enable feature = Enable Location based blocking:
 WARNING: untranslated string: grouptype = Grouptype:
 WARNING: untranslated string: guardian = Guardian
 WARNING: untranslated string: guardian block a host = unknown string
index 7399fea3cf395ffb181e849e9cfaff21dcc2ee2e..6c55bd7a061b14d701defda8060f54c795affdf1 100644 (file)
@@ -32,7 +32,7 @@ use Switch;
 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}/location-functions.pl";
 
 my $colour_multicast = "#A0A0A0";
 
@@ -86,6 +86,9 @@ if ( $debug ){
 my @dummy = ( ${Header::table1colour} );
 undef (@dummy);
 
+# Init libloc database connection.
+my $libloc_db_handle = &Location::Functions::init();
+
 # check sorting arguments
 if ( $cgiin{'sort_field'} ~~ [ '1','2','3','4','5','6','7','8','9' ] ) {
        $SORT_FIELD = $cgiin{'sort_field'};
@@ -550,11 +553,11 @@ foreach my $line (@conntrack) {
        my $bytes_in = format_bytes($bytes[0]);
        my $bytes_out = format_bytes($bytes[1]);
 
-       # enumerate GeoIP information
-       my $srcccode = &GeoIP::lookup($sip_ret);
-       my $src_flag_icon = &GeoIP::get_flag_icon($srcccode);
-       my $dstccode = &GeoIP::lookup($dip_ret);
-       my $dst_flag_icon = &GeoIP::get_flag_icon($dstccode);
+       # enumerate location information
+       my $srcccode = &Location::Functions::lookup_country_code($libloc_db_handle, $sip_ret);
+       my $src_flag_icon = &Location::Functions::get_flag_icon($srcccode);
+       my $dstccode = &Location::Functions::lookup_country_code($libloc_db_handle, $dip_ret);
+       my $dst_flag_icon = &Location::Functions::get_flag_icon($dstccode);
 
        # Format TTL
        $ttl = format_time($ttl);
index 8df2427a9eb10d24fd43bd8c5ce1b36cceecb416..a1cf24347396fcdd50a5b75465154ad6a2ea6dac 100644 (file)
@@ -28,7 +28,7 @@ my $lines = '1';
 my $lines2 = '';
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
@@ -63,10 +63,10 @@ foreach my $country (@countries) {
        $country = uc($country);
 
        # Get flag icon for of the country.
-       my $flag_icon = &GeoIP::get_flag_icon($country);
+       my $flag_icon = &Location::Functions::get_flag_icon($country);
 
        # Get country name.
-       my $name = &GeoIP::get_full_country_name($country);
+       my $name = &Location::Functions::get_full_country_name($country);
 
        if ($lines % 2) {
                print "<td $col><a id='$country'><img src='$flag_icon' alt='$country' title='$country'/></a></td>";
index 08d5a98fbffaea29f07e5016e6da3edcf683fd96..2f3ee3b4a31d4c5491805214e60157bacbe8d378 100644 (file)
@@ -147,16 +147,6 @@ END
 ;
 &Header::closebox();
 
-&Header::openbox("100%", "left", $Lang::tr{'other'});
-print <<END
-       <p>
-               This product includes GeoLite data created by MaxMind, available from
-               <a href='http://www.maxmind.com/' target="_blank">http://www.maxmind.com/</a>.
-       </p>
-END
-;
-&Header::closebox();
-
 &Header::closebigbox();
 
 &Header::closepage();
index 676d95f8a6daa199008df6040b3390fe7eb9ffd3..0a097e2c05ee26f00e747694fa01b8660d75dcdd 100755 (executable)
@@ -27,7 +27,7 @@ use IO::Socket;
 #use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/ids-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
@@ -269,6 +269,9 @@ my %dns_servers = ();
 # Read-in config file.
 &General::readhasharray("$servers_file", \%dns_servers);
 
+# Libloc database handle
+my $libloc_db_handle = &Location::Functions::init();
+
 &Header::openpage($Lang::tr{'dns'}, 1, '');
 
 &Header::openbigbox('100%', 'left', '', $errormessage);
@@ -594,9 +597,9 @@ END
                                        $status_colour = ${Header::colourred};
                                }
 
-                               # collect more information about name server (rDNS, GeoIP country code)
-                               my $ccode = &GeoIP::lookup($nameserver);
-                               my $flag_icon = &GeoIP::get_flag_icon($ccode);
+                               # collect more information about name server (rDNS, country code)
+                               my $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, $nameserver);
+                               my $flag_icon = &Location::Functions::get_flag_icon($ccode);
 
                                my $rdns;
 
index f54bf6f6c77a9b02e40a4ade84e33d260513afa6..1483e779ff22ba7b8db2c2309f0dc5788e3b3b53 100644 (file)
@@ -35,7 +35,7 @@ require '/var/ipfire/general-functions.pl';
 require '/var/ipfire/network-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "/usr/lib/firewall/firewall-lib.pl";
 
 unless (-d "${General::swroot}/firewall")                      { system("mkdir ${General::swroot}/firewall"); }
@@ -50,7 +50,7 @@ my %defaultNetworks=();
 my %netsettings=();
 my %customhost=();
 my %customgrp=();
-my %customgeoipgrp=();
+my %customlocationgrp=();
 my %customnetworks=();
 my %customservice=();
 my %customservicegrp=();
@@ -78,7 +78,7 @@ my $color;
 my $confignet          = "${General::swroot}/fwhosts/customnetworks";
 my $confighost         = "${General::swroot}/fwhosts/customhosts";
 my $configgrp          = "${General::swroot}/fwhosts/customgroups";
-my $configgeoipgrp     = "${General::swroot}/fwhosts/customgeoipgrp";
+my $configlocationgrp  = "${General::swroot}/fwhosts/customlocationgrp";
 my $configsrv          = "${General::swroot}/fwhosts/customservices";
 my $configsrvgrp       = "${General::swroot}/fwhosts/customservicegrp";
 my $configccdnet       = "${General::swroot}/ovpn/ccd.conf";
@@ -1071,41 +1071,41 @@ END
                }
                print"</select></td>";
        }
-       # geoip locations / groups.
-       my @geoip_locations = &fwlib::get_geoip_locations();
+       # Locations / groups.
+       my @locations = &fwlib::get_locations();
 
        print "<tr>\n";
-       print "<td valign='top'><input type='radio' name='$grp' id='cust_geoip_$srctgt' value='cust_geoip_$srctgt' $checked{$grp}{'cust_geoip_'.$srctgt}></td>\n";
-       print "<td>$Lang::tr{'geoip'}</td>\n";
-       print "<td align='right'><select name='cust_geoip_$srctgt' style='width:200px;'>\n";
-
-       # Add GeoIP groups to dropdown.
-       if (!-z $configgeoipgrp) {
-               print "<optgroup label='$Lang::tr{'fwhost cust geoipgroup'}'>\n";
-               foreach my $key (sort { ncmp($customgeoipgrp{$a}[0],$customgeoipgrp{$b}[0]) } keys %customgeoipgrp) {
+       print "<td valign='top'><input type='radio' name='$grp' id='cust_location_$srctgt' value='cust_location_$srctgt' $checked{$grp}{'cust_location_'.$srctgt}></td>\n";
+       print "<td>$Lang::tr{'location'}</td>\n";
+       print "<td align='right'><select name='cust_location_$srctgt' style='width:200px;'>\n";
+
+       # Add Location groups to dropdown.
+       if (!-z $configlocationgrp) {
+               print "<optgroup label='$Lang::tr{'fwhost cust locationgroup'}'>\n";
+               foreach my $key (sort { ncmp($customlocationgrp{$a}[0],$customlocationgrp{$b}[0]) } keys %customlocationgrp) {
                        my $selected;
 
                        # Generate stored value for select detection.
-                       my $stored = join(':', "group",$customgeoipgrp{$key}[0]);
+                       my $stored = join(':', "group",$customlocationgrp{$key}[0]);
 
                        # Only show a group once and group with elements.
-                       if($helper ne $customgeoipgrp{$key}[0] && $customgeoipgrp{$key}[2] ne 'none') {
+                       if($helper ne $customlocationgrp{$key}[0] && $customlocationgrp{$key}[2] ne 'none') {
                                # Mark current entry as selected.
                                if ($fwdfwsettings{$fwdfwsettings{$grp}} eq $stored) {
                                        $selected = "selected='selected'";
                                }
-                                print"<option $selected value='group:$customgeoipgrp{$key}[0]'>$customgeoipgrp{$key}[0]</option>\n";
+                                print"<option $selected value='group:$customlocationgrp{$key}[0]'>$customlocationgrp{$key}[0]</option>\n";
                         }
-                        $helper=$customgeoipgrp{$key}[0];
+                        $helper=$customlocationgrp{$key}[0];
                 }
                print "</optgroup>\n";
        }
 
        # Add locations.
-       print "<optgroup label='$Lang::tr{'fwhost cust geoiplocation'}'>\n";
-       foreach my $location (@geoip_locations) {
+       print "<optgroup label='$Lang::tr{'fwhost cust location'}'>\n";
+       foreach my $location (@locations) {
                # Get country name.
-               my $country_name = &GeoIP::get_full_country_name($location);
+               my $country_name = &Location::Functions::get_full_country_name($location);
 
                # Mark current entry as selected.
                my $selected;
@@ -1116,7 +1116,7 @@ END
        }
        print "</optgroup>\n";
 
-       # Close GeoIP dropdown.
+       # Close Locations dropdown.
        print "</select></td>\n";
 
        #End left table. start right table (vpn)
@@ -1476,7 +1476,7 @@ sub newrule
        &General::readhasharray("$confighost", \%customhost);
        &General::readhasharray("$configccdhost", \%ccdhost);
        &General::readhasharray("$configgrp", \%customgrp);
-       &General::readhasharray("$configgeoipgrp", \%customgeoipgrp);
+       &General::readhasharray("$configlocationgrp", \%customlocationgrp);
        &General::readhasharray("$configipsec", \%ipsecconf);
        &General::get_aliases(\%aliases);
        my %checked=();
@@ -2611,12 +2611,12 @@ END
                                }else{
                                        print $$hash{$key}[4];
                                }
-                       }elsif ($$hash{$key}[3] eq 'cust_geoip_src') {
+                       }elsif ($$hash{$key}[3] eq 'cust_location_src') {
                                my ($split1,$split2) = split(":", $$hash{$key}[4]);
                                if ($split2) {
                                        print "$split2\n";
                                }else{
-                                       print "$Lang::tr{'geoip'}: $$hash{$key}[4]\n";
+                                       print "$Lang::tr{'location'}: $$hash{$key}[4]\n";
                                }
                        }elsif ($$hash{$key}[4] eq 'RED1'){
                                print "$ipfireiface $Lang::tr{'fwdfw red'}";
@@ -2699,12 +2699,12 @@ END
                                }else{
                                        print $$hash{$key}[6];
                                }
-                       }elsif ($$hash{$key}[5] eq 'cust_geoip_tgt') {
+                       }elsif ($$hash{$key}[5] eq 'cust_location_tgt') {
                                my ($split1,$split2) = split(":", $$hash{$key}[6]);
                                if ($split2) {
                                        print "$split2\n";
                                }else{
-                                       print "$Lang::tr{'geoip'}: $$hash{$key}[6]\n";
+                                       print "$Lang::tr{'location'}: $$hash{$key}[6]\n";
                                }
                        }elsif ($$hash{$key}[5] eq 'tgt_addr'){
                                my ($split1,$split2) = split("/",$$hash{$key}[6]);
index 7315e79b670eec89c31c91e1fd3e4227e2f66aa2..fe5117ae573dddee5062ec3ac08ea85c19712550 100644 (file)
@@ -28,7 +28,7 @@ use CGI::Carp 'fatalsToBrowser';
 no warnings 'uninitialized';
 require '/var/ipfire/general-functions.pl';
 require '/var/ipfire/network-functions.pl';
-require "/var/ipfire/geoip-functions.pl";
+require "/var/ipfire/location-functions.pl";
 require "/usr/lib/firewall/firewall-lib.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
@@ -39,7 +39,7 @@ my %customhost=();
 my %customgrp=();
 my %customservice=();
 my %customservicegrp=();
-my %customgeoipgrp=();
+my %customlocationgrp=();
 my %ccdnet=();
 my %ccdhost=();
 my %ipsecconf=();
@@ -67,7 +67,7 @@ my $configccdhost     = "${General::swroot}/ovpn/ovpnconfig";
 my $configipsec                = "${General::swroot}/vpn/config";
 my $configsrv          = "${General::swroot}/fwhosts/customservices";
 my $configsrvgrp       = "${General::swroot}/fwhosts/customservicegrp";
-my $configgeoipgrp     = "${General::swroot}/fwhosts/customgeoipgrp";
+my $configlocationgrp  = "${General::swroot}/fwhosts/customlocationgrp";
 my $fwconfigfwd                = "${General::swroot}/firewall/config";
 my $fwconfiginp                = "${General::swroot}/firewall/input";
 my $fwconfigout                = "${General::swroot}/firewall/outgoing";
@@ -80,7 +80,7 @@ unless (-e $confighost)   { system("touch $confighost"); }
 unless (-e $configgrp)    { system("touch $configgrp"); }
 unless (-e $configsrv)    { system("touch $configsrv"); }
 unless (-e $configsrvgrp) { system("touch $configsrvgrp"); }
-unless (-e $configgeoipgrp) { system("touch $configgeoipgrp"); }
+unless (-e $configlocationgrp) { system("touch $configlocationgrp"); }
 
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
 &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
@@ -680,7 +680,7 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp')
                &addgrp;
                &viewtablegrp;
 }
-if ($fwhostsettings{'ACTION'} eq 'savegeoipgrp')
+if ($fwhostsettings{'ACTION'} eq 'savelocationgrp')
 {
        my $grp=$fwhostsettings{'grp_name'};
        my $rem=$fwhostsettings{'remark'};
@@ -688,7 +688,7 @@ if ($fwhostsettings{'ACTION'} eq 'savegeoipgrp')
        my $type;
        my @target;
        my @newgrp;
-       &General::readhasharray("$configgeoipgrp", \%customgeoipgrp);
+       &General::readhasharray("$configlocationgrp", \%customlocationgrp);
        &General::readhasharray("$fwconfigfwd", \%fwfwd);
        &General::readhasharray("$fwconfiginp", \%fwinp);
        &General::readhasharray("$fwconfigout", \%fwout);
@@ -705,12 +705,12 @@ if ($fwhostsettings{'ACTION'} eq 'savegeoipgrp')
 
        if ($fwhostsettings{'update'} eq 'on'){
                @target=$fwhostsettings{'COUNTRY_CODE'};
-               $type='GeoIP Group';
+               $type='Location Group';
 
                #check if host/net exists in grp
                my $test="$grp,$fwhostsettings{'oldremark'},@target";
-               foreach my $key (keys %customgeoipgrp) {
-                       my $test1="$customgeoipgrp{$key}[0],$customgeoipgrp{$key}[1],$customgeoipgrp{$key}[2]";
+               foreach my $key (keys %customlocationgrp) {
+                       my $test1="$customlocationgrp{$key}[0],$customlocationgrp{$key}[1],$customlocationgrp{$key}[2]";
                        if ($test1 eq $test){
                                $errormessage=$Lang::tr{'fwhost err isingrp'};
                                $fwhostsettings{'update'} = 'on';
@@ -725,41 +725,41 @@ if ($fwhostsettings{'ACTION'} eq 'savegeoipgrp')
                        @target="none";
                }
                #on update, we have to delete the dummy entry
-               foreach my $key (keys %customgeoipgrp){
-                       if ($customgeoipgrp{$key}[0] eq $grp && $customgeoipgrp{$key}[2] eq "none"){
-                               delete $customgeoipgrp{$key};
+               foreach my $key (keys %customlocationgrp){
+                       if ($customlocationgrp{$key}[0] eq $grp && $customlocationgrp{$key}[2] eq "none"){
+                               delete $customlocationgrp{$key};
                                last;
                        }
                }
-               &General::writehasharray("$configgeoipgrp", \%customgeoipgrp);
-               &General::readhasharray("$configgeoipgrp", \%customgeoipgrp);
+               &General::writehasharray("$configlocationgrp", \%customlocationgrp);
+               &General::readhasharray("$configlocationgrp", \%customlocationgrp);
                #create array with new lines
                foreach my $line (@target){
                        push (@newgrp,"$grp,$rem,$line");
                }
                #append new entries
-               my $key = &General::findhasharraykey (\%customgeoipgrp);
+               my $key = &General::findhasharraykey (\%customlocationgrp);
                foreach my $line (@newgrp){
-                       foreach my $i (0 .. 3) { $customgeoipgrp{$key}[$i] = "";}
+                       foreach my $i (0 .. 3) { $customlocationgrp{$key}[$i] = "";}
                        my ($a,$b,$c,$d) = split (",",$line);
-                       $customgeoipgrp{$key}[0] = $a;
-                       $customgeoipgrp{$key}[1] = $b;
-                       $customgeoipgrp{$key}[2] = $c;
-                       $customgeoipgrp{$key}[3] = $type;
+                       $customlocationgrp{$key}[0] = $a;
+                       $customlocationgrp{$key}[1] = $b;
+                       $customlocationgrp{$key}[2] = $c;
+                       $customlocationgrp{$key}[3] = $type;
                }
-               &General::writehasharray("$configgeoipgrp", \%customgeoipgrp);
+               &General::writehasharray("$configlocationgrp", \%customlocationgrp);
                #update counter in Host/Net
                $fwhostsettings{'update'}='on';
        }
                #check if ruleupdate is needed
-               my $geoipgrpcount=0;
-               $geoipgrpcount=&getgeoipcount($grp);
-               if($geoipgrpcount > 0 )
+               my $locationgrpcount=0;
+               $locationgrpcount=&getlocationcount($grp);
+               if($locationgrpcount > 0 )
                {
                        &General::firewall_config_changed();
                }
-               &addgeoipgrp;
-               &viewtablegeoipgrp;
+               &addlocationgrp;
+               &viewtablelocationgrp;
 }
 if ($fwhostsettings{'ACTION'} eq 'saveservice')
 {
@@ -888,11 +888,11 @@ if ($fwhostsettings{'ACTION'} eq 'editgrp')
        &addgrp;
        &viewtablegrp;
 }
-if ($fwhostsettings{'ACTION'} eq 'editgeoipgrp')
+if ($fwhostsettings{'ACTION'} eq 'editlocationgrp')
 {
        $fwhostsettings{'update'}='on';
-       &addgeoipgrp;
-       &viewtablegeoipgrp;
+       &addlocationgrp;
+       &viewtablelocationgrp;
 }
 if ($fwhostsettings{'ACTION'} eq 'editservice')
 {
@@ -926,7 +926,7 @@ if ($fwhostsettings{'ACTION'} eq 'resetgrp')
        $fwhostsettings{'remark'}       ="";
        &showmenu;
 }
-if ($fwhostsettings{'ACTION'} eq 'resetgeoipgrp')
+if ($fwhostsettings{'ACTION'} eq 'resetlocationgrp')
 {
        $fwhostsettings{'grp_name'} ="";
        $fwhostsettings{'remark'}       ="";
@@ -989,35 +989,35 @@ if ($fwhostsettings{'ACTION'} eq 'deletegrphost')
        &addgrp;
        &viewtablegrp;
 }
-if ($fwhostsettings{'ACTION'} eq 'deletegeoipgrpentry')
+if ($fwhostsettings{'ACTION'} eq 'deletelocationgrpentry')
 {
         my $grpremark;
         my $grpname;
-        &General::readhasharray("$configgeoipgrp", \%customgeoipgrp);
-        foreach my $key (keys %customgeoipgrp){
-                if($customgeoipgrp{$key}[0].",".$customgeoipgrp{$key}[1].",".$customgeoipgrp{$key}[2].",".$customgeoipgrp{$key}[3] eq $fwhostsettings{'delentry'}){
-                        $grpname=$customgeoipgrp{$key}[0];
-                        $grpremark=$customgeoipgrp{$key}[1];
+        &General::readhasharray("$configlocationgrp", \%customlocationgrp);
+        foreach my $key (keys %customlocationgrp){
+                if($customlocationgrp{$key}[0].",".$customlocationgrp{$key}[1].",".$customlocationgrp{$key}[2].",".$customlocationgrp{$key}[3] eq $fwhostsettings{'delentry'}){
+                        $grpname=$customlocationgrp{$key}[0];
+                        $grpremark=$customlocationgrp{$key}[1];
                         #check if we delete the last entry, then generate dummy
                         if ($fwhostsettings{'last'} eq 'on'){
-                                $customgeoipgrp{$key}[1] = '';
-                                $customgeoipgrp{$key}[2] = 'none';
-                                $customgeoipgrp{$key}[3] = '';
+                                $customlocationgrp{$key}[1] = '';
+                                $customlocationgrp{$key}[2] = 'none';
+                                $customlocationgrp{$key}[3] = '';
                                 $fwhostsettings{'last'}='';
                                 last;
                         }else{
-                                delete $customgeoipgrp{$key};
+                                delete $customlocationgrp{$key};
                         }
                 }
         }
-        &General::writehasharray("$configgeoipgrp", \%customgeoipgrp);
+        &General::writehasharray("$configlocationgrp", \%customlocationgrp);
         &General::firewall_config_changed();
         if ($fwhostsettings{'update'} eq 'on'){
                 $fwhostsettings{'remark'}= $grpremark;
                 $fwhostsettings{'grp_name'}=$grpname;
         }
-        &addgeoipgrp;
-        &viewtablegeoipgrp;
+        &addlocationgrp;
+        &viewtablelocationgrp;
 }
 
 if ($fwhostsettings{'ACTION'} eq 'delgrp')
@@ -1036,21 +1036,21 @@ if ($fwhostsettings{'ACTION'} eq 'delgrp')
        &addgrp;
        &viewtablegrp;
 }
-if ($fwhostsettings{'ACTION'} eq 'delgeoipgrp')
+if ($fwhostsettings{'ACTION'} eq 'dellocationgrp')
 {
-       &General::readhasharray("$configgeoipgrp", \%customgeoipgrp);
+       &General::readhasharray("$configlocationgrp", \%customlocationgrp);
        &decrease($fwhostsettings{'grp_name'});
-       foreach my $key (sort keys %customgeoipgrp)
+       foreach my $key (sort keys %customlocationgrp)
        {
-               if($customgeoipgrp{$key}[0] eq $fwhostsettings{'grp_name'})
+               if($customlocationgrp{$key}[0] eq $fwhostsettings{'grp_name'})
                {
-                       delete $customgeoipgrp{$key};
+                       delete $customlocationgrp{$key};
                }
        }
-       &General::writehasharray("$configgeoipgrp", \%customgeoipgrp);
+       &General::writehasharray("$configlocationgrp", \%customlocationgrp);
        $fwhostsettings{'grp_name'}='';
-       &addgeoipgrp;
-       &viewtablegeoipgrp;
+       &addlocationgrp;
+       &viewtablelocationgrp;
 }
 if ($fwhostsettings{'ACTION'} eq 'delservice')
 {
@@ -1126,10 +1126,10 @@ if ($fwhostsettings{'ACTION'} eq $Lang::tr{'fwhost newgrp'})
        &addgrp;
        &viewtablegrp;
 }
-if ($fwhostsettings{'ACTION'} eq $Lang::tr{'fwhost newgeoipgrp'})
+if ($fwhostsettings{'ACTION'} eq $Lang::tr{'fwhost newlocationgrp'})
 {
-       &addgeoipgrp;
-       &viewtablegeoipgrp;
+       &addlocationgrp;
+       &viewtablelocationgrp;
 }
 if ($fwhostsettings{'ACTION'} eq $Lang::tr{'fwhost newservice'})
 {
@@ -1165,19 +1165,19 @@ if ($fwhostsettings{'ACTION'} eq 'changegrpremark')
        &addgrp;
        &viewtablegrp;
 }
-if ($fwhostsettings{'ACTION'} eq 'changegeoipgrpremark')
+if ($fwhostsettings{'ACTION'} eq 'changelocationgrpremark')
 {
-       &General::readhasharray("$configgeoipgrp", \%customgeoipgrp);
+       &General::readhasharray("$configlocationgrp", \%customlocationgrp);
        if ($fwhostsettings{'oldrem'} ne $fwhostsettings{'newrem'} && (&validremark($fwhostsettings{'newrem'}) || $fwhostsettings{'newrem'} eq '')){
-               foreach my $key (sort keys %customgeoipgrp)
+               foreach my $key (sort keys %customlocationgrp)
                        {
-                               if($customgeoipgrp{$key}[0] eq $fwhostsettings{'grp'} && $customgeoipgrp{$key}[1] eq $fwhostsettings{'oldrem'})
+                               if($customlocationgrp{$key}[0] eq $fwhostsettings{'grp'} && $customlocationgrp{$key}[1] eq $fwhostsettings{'oldrem'})
                                {
-                                       $customgeoipgrp{$key}[1]='';
-                                       $customgeoipgrp{$key}[1]=$fwhostsettings{'newrem'};
+                                       $customlocationgrp{$key}[1]='';
+                                       $customlocationgrp{$key}[1]=$fwhostsettings{'newrem'};
                                }
                        }
-                       &General::writehasharray("$configgeoipgrp", \%customgeoipgrp);
+                       &General::writehasharray("$configlocationgrp", \%customlocationgrp);
                        $fwhostsettings{'update'}='on';
                        $fwhostsettings{'remark'}=$fwhostsettings{'newrem'};
        }else{
@@ -1187,8 +1187,8 @@ if ($fwhostsettings{'ACTION'} eq 'changegeoipgrpremark')
                $fwhostsettings{'update'} = 'on';
        }
        $fwhostsettings{'grp_name'}=$fwhostsettings{'grp'};
-       &addgeoipgrp;
-       &viewtablegeoipgrp;
+       &addlocationgrp;
+       &viewtablelocationgrp;
 }
 if ($fwhostsettings{'ACTION'} eq 'changesrvgrpremark')
 {
@@ -1265,9 +1265,9 @@ if ($fwhostsettings{'ACTION'} eq 'changegrpname')
        &addgrp;
        &viewtablegrp;
 }
-if ($fwhostsettings{'ACTION'} eq 'changegeoipgrpname')
+if ($fwhostsettings{'ACTION'} eq 'changelocationgrpname')
 {
-       &General::readhasharray("$configgeoipgrp", \%customgeoipgrp );
+       &General::readhasharray("$configlocationgrp", \%customlocationgrp );
        if ($fwhostsettings{'oldgrpname'} ne $fwhostsettings{'grp'}){
                #Check new groupname
                if (!&validhostname($fwhostsettings{'grp'})){
@@ -1275,19 +1275,19 @@ if ($fwhostsettings{'ACTION'} eq 'changegeoipgrpname')
                }
                if (!$errormessage){
                        # Rename group.
-                       foreach my $key (keys %customgeoipgrp) {
-                               if($customgeoipgrp{$key}[0] eq $fwhostsettings{'oldgrpname'}){
-                                       $customgeoipgrp{$key}[0]=$fwhostsettings{'grp'};
+                       foreach my $key (keys %customlocationgrp) {
+                               if($customlocationgrp{$key}[0] eq $fwhostsettings{'oldgrpname'}){
+                                       $customlocationgrp{$key}[0]=$fwhostsettings{'grp'};
                                }
                        }
-                       &General::writehasharray("$configgeoipgrp", \%customgeoipgrp );
+                       &General::writehasharray("$configlocationgrp", \%customlocationgrp );
                        #change name in FW Rules
-                       &changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},4,"geoip");
-                       &changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},6,"geoip");
+                       &changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},4,"location");
+                       &changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},6,"location");
                }
        }
-       &addgeoipgrp;
-       &viewtablegeoipgrp;
+       &addlocationgrp;
+       &viewtablelocationgrp;
 }
 ###  VIEW  ###
 if($fwhostsettings{'ACTION'} eq '')
@@ -1300,7 +1300,7 @@ sub showmenu {
        print "$Lang::tr{'fwhost welcome'}";
        print<<END;
        <br><br><table border='0' width='100%'>
-       <tr><td><form method='post'><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newnet'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newhost'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newgrp'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newgeoipgrp'}' ></form></td>
+       <tr><td><form method='post'><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newnet'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newhost'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newgrp'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newlocationgrp'}' ></form></td>
        <td align='right'><form method='post'><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newservice'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newservicegrp'}' ></form></td></tr>
        <tr><td colspan='6'></td></tr></table>
 END
@@ -1588,12 +1588,12 @@ END
                print"<tr><td style='text-align:right;'><input type='submit' value='$Lang::tr{'add'}' style='min-width:100px;' /><input type='hidden' name='oldremark' value='$fwhostsettings{'oldremark'}'><input type='hidden' name='update' value=\"$fwhostsettings{'update'}\"><input type='hidden' name='ACTION' value='savegrp' ></form><form method='post' style='display:inline'><input type='submit' value='$Lang::tr{'fwhost back'}' style='min-width:100px;'><input type='hidden' name='ACTION' value='resetgrp'></form></td></table>";
        &Header::closebox();
 }
-sub addgeoipgrp
+sub addlocationgrp
 {
        &hint;
        &error;
        &showmenu;
-       &Header::openbox('100%', 'left', $Lang::tr{'fwhost addgeoipgrp'});
+       &Header::openbox('100%', 'left', $Lang::tr{'fwhost addlocationgrp'});
 
        my %checked=();
        my $show='';
@@ -1629,7 +1629,7 @@ END
                                        <td>
                                                <input type='submit' value='$Lang::tr{'fwhost change'}'>
                                                <input type='hidden' name='oldgrpname' value='$fwhostsettings{'oldgrpname'}'>
-                                               <input type='hidden' name='ACTION' value='changegeoipgrpname'>
+                                               <input type='hidden' name='ACTION' value='changelocationgrpname'>
                                        </td>
                                        <td></td>
                                </tr></form>
@@ -1642,7 +1642,7 @@ END
                                                <input type='submit' value='$Lang::tr{'fwhost change'}'>
                                                <input type='hidden' name='grp' value='$fwhostsettings{'grp_name'}'>
                                                <input type='hidden' name='oldrem' value='$fwhostsettings{'oldremark'}'>
-                                               <input type='hidden' name='ACTION' value='changegeoipgrpremark'>
+                                               <input type='hidden' name='ACTION' value='changelocationgrpremark'>
                                        </td>
                                </tr></form>
                        </table>
@@ -1650,7 +1650,7 @@ END
 END
                }
                if ($fwhostsettings{'update'} eq 'on') {
-                       my @geoip_locations = &fwlib::get_geoip_locations();
+                       my @location_locations = &fwlib::get_locations();
 
                        print<<END;
                        <form method='post'>
@@ -1662,9 +1662,9 @@ END
                                        <td style='text-align:left;'>
                                                <select name='COUNTRY_CODE' style='width:16em;'>";
 END
-                               foreach my $location (@geoip_locations) {
+                               foreach my $location (@location_locations) {
                                        # Get full country name.
-                                       my $fullname = &GeoIP::get_full_country_name($location);
+                                       my $fullname = &Location::Functions::get_full_country_name($location);
 
                                        print"<option value='$location'>$location - $fullname</option>\n";
                                }
@@ -1682,13 +1682,13 @@ END
                                <input type='submit' value='$Lang::tr{'add'}' style='min-width:100px;' />
                                <input type='hidden' name='oldremark' value='$fwhostsettings{'oldremark'}'>
                                <input type='hidden' name='update' value=\"$fwhostsettings{'update'}\">
-                               <input type='hidden' name='ACTION' value='savegeoipgrp' >
+                               <input type='hidden' name='ACTION' value='savelocationgrp' >
                        </form>
 
                        <form method='post' style='display:inline'>
 
                        <input type='submit' value='$Lang::tr{'fwhost back'}' style='min-width:100px;'>
-                       <input type='hidden' name='ACTION' value='resetgeoipgrp'>
+                       <input type='hidden' name='ACTION' value='resetlocationgrp'>
 
                        </form>
                        </td></tr></table>
@@ -2154,15 +2154,15 @@ sub viewtablegrp
 }
 
 }
-sub viewtablegeoipgrp
+sub viewtablelocationgrp
 {
        # If our filesize is "zero" there is nothing to read-in.
-       if (-z "$configgeoipgrp") {
+       if (-z "$configlocationgrp") {
                return;
        }
 
-       &Header::openbox('100%', 'left', $Lang::tr{'fwhost cust geoipgrp'});
-       &General::readhasharray("$configgeoipgrp", \%customgeoipgrp);
+       &Header::openbox('100%', 'left', $Lang::tr{'fwhost cust locationgrp'});
+       &General::readhasharray("$configlocationgrp", \%customlocationgrp);
        &General::readhasharray("$fwconfigfwd", \%fwfwd);
        &General::readhasharray("$fwconfiginp", \%fwinp);
        &General::readhasharray("$fwconfigout", \%fwout);
@@ -2178,15 +2178,15 @@ sub viewtablegeoipgrp
        my %hash;
 
        # If there are no groups we are finished here.
-       if (!keys %customgeoipgrp) {
+       if (!keys %customlocationgrp) {
                print "<center><b>$Lang::tr{'fwhost err emptytable'}</b>";
                return;
        }
 
        # Put all groups in a hash.
-       foreach my $key (sort { ncmp($customgeoipgrp{$a}[0],$customgeoipgrp{$b}[0]) }
-                        sort { ncmp($customgeoipgrp{$a}[2],$customgeoipgrp{$b}[2]) } keys %customgeoipgrp) {
-                               push (@counter,$customgeoipgrp{$key}[0]);
+       foreach my $key (sort { ncmp($customlocationgrp{$a}[0],$customlocationgrp{$b}[0]) }
+                        sort { ncmp($customlocationgrp{$a}[2],$customlocationgrp{$b}[2]) } keys %customlocationgrp) {
+                               push (@counter,$customlocationgrp{$key}[0]);
        }
 
        # Increase current used key.
@@ -2195,16 +2195,16 @@ sub viewtablegeoipgrp
        }
 
        # Sort hash.
-       foreach my $key (sort { ncmp($customgeoipgrp{$a}[0],$customgeoipgrp{$b}[0]) }
-                        sort { ncmp($customgeoipgrp{$a}[2],$customgeoipgrp{$b}[2]) } keys %customgeoipgrp) {
+       foreach my $key (sort { ncmp($customlocationgrp{$a}[0],$customlocationgrp{$b}[0]) }
+                        sort { ncmp($customlocationgrp{$a}[2],$customlocationgrp{$b}[2]) } keys %customlocationgrp) {
                $count++;
-               if ($helper ne $customgeoipgrp{$key}[0]) {
+               if ($helper ne $customlocationgrp{$key}[0]) {
                        $delflag='0';
 
-                       foreach my $key1 (sort { ncmp($customgeoipgrp{$a}[0],$customgeoipgrp{$b}[0]) }
-                                         sort { ncmp($customgeoipgrp{$a}[2],$customgeoipgrp{$b}[2]) } keys %customgeoipgrp) {
+                       foreach my $key1 (sort { ncmp($customlocationgrp{$a}[0],$customlocationgrp{$b}[0]) }
+                                         sort { ncmp($customlocationgrp{$a}[2],$customlocationgrp{$b}[2]) } keys %customlocationgrp) {
 
-                               if ($customgeoipgrp{$key}[0] eq $customgeoipgrp{$key1}[0])
+                               if ($customlocationgrp{$key}[0] eq $customlocationgrp{$key1}[0])
                                {
                                        $delflag++;
                                }
@@ -2216,13 +2216,13 @@ sub viewtablegeoipgrp
                        $number=1;
 
                        # Groupname.
-                       $grpname=$customgeoipgrp{$key}[0];
+                       $grpname=$customlocationgrp{$key}[0];
 
                        # Group remark.
-                       $remark="$customgeoipgrp{$key}[1]";
+                       $remark="$customlocationgrp{$key}[1]";
 
                        # Country code.
-                       $country_code="$customgeoipgrp{$key}[2]";
+                       $country_code="$customlocationgrp{$key}[2]";
 
                        if ($count gt 1){
                                print"</table>";
@@ -2234,15 +2234,15 @@ sub viewtablegeoipgrp
                        print "<b>$Lang::tr{'remark'}:</b>&nbsp $remark &nbsp\n" if ($remark ne '');
 
                        # Get group count.
-                       my $geoipgrpcount=&getgeoipcount($grpname);
-                       print "<b>$Lang::tr{'used'}:</b> $geoipgrpcount x";
+                       my $locationgrpcount=&getlocationcount($grpname);
+                       print "<b>$Lang::tr{'used'}:</b> $locationgrpcount x";
 
                        # Only display delete icon, if the group is not used by a firewall rule.
-                       if($geoipgrpcount == '0') {
+                       if($locationgrpcount == '0') {
                                print"<form method='post' style='display:inline'>\n";
                                print"<input type='image' src='/images/delete.gif' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' align='right' />\n";
                                print"<input type='hidden' name='grp_name' value='$grpname' >\n";
-                               print"<input type='hidden' name='ACTION' value='delgeoipgrp'>\n";
+                               print"<input type='hidden' name='ACTION' value='dellocationgrp'>\n";
                                print"</form>";
                        }
 
@@ -2252,7 +2252,7 @@ print <<END;
                                <input type='image' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' align='right'/>
                                <input type='hidden' name='grp_name' value='$grpname' >
                                <input type='hidden' name='remark' value='$remark' >
-                               <input type='hidden' name='ACTION' value='editgeoipgrp'>
+                               <input type='hidden' name='ACTION' value='editlocationgrp'>
                        </form>
 
                        <table width='100%' cellspacing='0' class='tbl'>
@@ -2285,8 +2285,8 @@ END
                } else {
                        # Check if we are currently editing a group and assign column backgound colors.
                        my $col='';
-                       if ( ($fwhostsettings{'ACTION'} eq 'editgeoipgrp' || $fwhostsettings{'update'} ne '')
-                               && $fwhostsettings{'grp_name'} eq $customgeoipgrp{$key}[0]) {
+                       if ( ($fwhostsettings{'ACTION'} eq 'editlocationgrp' || $fwhostsettings{'update'} ne '')
+                               && $fwhostsettings{'grp_name'} eq $customlocationgrp{$key}[0]) {
                                $col="bgcolor='${Header::colouryellow}'";
                        } elsif ($count %2 == 0){
                                $col="bgcolor='$color{'color20'}'";
@@ -2295,12 +2295,12 @@ END
                        }
 
                        # Get country flag.
-                       my $icon = &GeoIP::get_flag_icon($customgeoipgrp{$key}[2]);
+                       my $icon = &Location::Functions::get_flag_icon($customlocationgrp{$key}[2]);
 
                        # Print column with flag icon.
                        my $col_content;
                        if ($icon) {
-                               $col_content = "<img src='$icon' alt='$customgeoipgrp{$key}[2]' title='$customgeoipgrp{$key}[2]'>";
+                               $col_content = "<img src='$icon' alt='$customlocationgrp{$key}[2]' title='$customlocationgrp{$key}[2]'>";
                        } else {
                                $col_content = "<b>N/A</b>";
                        }
@@ -2308,10 +2308,10 @@ END
                        print "<td align='center' $col>$col_content</td>\n";
 
                        # Print column with country code.
-                       print "<td align='center' $col>$customgeoipgrp{$key}[2]</td>\n";
+                       print "<td align='center' $col>$customlocationgrp{$key}[2]</td>\n";
 
                        # Print column with full country name.
-                       my $country_name = &GeoIP::get_full_country_name($customgeoipgrp{$key}[2]);
+                       my $country_name = &Location::Functions::get_full_country_name($customlocationgrp{$key}[2]);
                        print "<td align='left' $col>$country_name</td>\n";
 
                        # Generate from for removing entries from a group.
@@ -2322,21 +2322,21 @@ END
 
                                # Check if this group only has a single entry.
                                foreach my $key2 (keys %hash) {
-                                       if ($hash{$key2}<2 && $key2 eq $customgeoipgrp{$key}[0]){
+                                       if ($hash{$key2}<2 && $key2 eq $customlocationgrp{$key}[0]){
                                                print "<input type='hidden' name='last' value='on'>"  ;
                                        }
                                }
                        }
 
-                       print "<input type='hidden' name='ACTION' value='deletegeoipgrpentry'>\n";
+                       print "<input type='hidden' name='ACTION' value='deletelocationgrpentry'>\n";
                        print "<input type='hidden' name='update' value='$fwhostsettings{'update'}'>\n";
-                       print "<input type='hidden' name='delentry' value='$grpname,$remark,$customgeoipgrp{$key}[2],$customgeoipgrp{$key}[3]'>\n";
+                       print "<input type='hidden' name='delentry' value='$grpname,$remark,$customlocationgrp{$key}[2],$customlocationgrp{$key}[3]'>\n";
                        print "</form>\n";
                        print "</td>\n";
                        print "</tr>\n";
                }
 
-               $helper=$customgeoipgrp{$key}[0];
+               $helper=$customlocationgrp{$key}[0];
                $number++;
        }
 
@@ -2688,12 +2688,12 @@ sub gethostcount
        }
        return $srvcounter;
 }
-sub getgeoipcount
+sub getlocationcount
 {
        my $groupname=shift;
        my $counter=0;
 
-       # GeoIP groups are stored as "group:groupname" in the
+       # Location groups are stored as "group:groupname" in the
        # firewall settings files.
        my $searchstring = join(':', "group",$groupname);
 
@@ -3079,7 +3079,7 @@ sub changenameinfw
        my $fld=shift;
        my $type=shift;
 
-       if ($type eq 'geoip'){
+       if ($type eq 'location'){
                $old="group:$old";
                $new="group:$new";
        }
index b756a24d2a5e97e67434ecdeb2acbe11763f1f9b..0bbb96330a5405b77293c9b829c497fa8aea9aa8 100644 (file)
@@ -30,7 +30,7 @@ use strict;
 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}/location-functions.pl";
 
 my %cgiparams=();
 
@@ -41,33 +41,54 @@ my %cgiparams=();
 my @lines=();
 my $extraquery='';
 
+# Hash which contains the whois servers from
+# the responisible RIR of the continent.
+my %whois_servers_by_continent = (
+       "AF" => "whois.afrinic.net",
+       "AS" => "whois.apnic.net",
+       "EU" => "whois.ripe.net",
+       "NA" => "whois.arin.net",
+       "SA" => "whois.lacnic.net"
+);
+
+# Default whois server if no continent could be determined.
+my $whois_server = "whois.arin.net";
+
 my $addr = CGI::param("ip") || "";
 
 if (&General::validip($addr)) {
-       $extraquery='';
-       @lines=();
-       my $whoisname = "whois.arin.net";
        my $iaddr = inet_aton($addr);
        my $hostname = gethostbyaddr($iaddr, AF_INET);
        if (!$hostname) { $hostname = $Lang::tr{'lookup failed'}; }
 
-       # enumerate GeoIP information for IP address...
-       my $ccode = &GeoIP::lookup($addr);
-       my $flag_icon = &GeoIP::get_flag_icon($ccode);
+       # enumerate location information for IP address...
+       my $db_handle = &Location::Functions::init();
+       my $ccode = &Location::Functions::lookup_country_code($db_handle, $addr);
+
+       # Try to get the continent of the country code.
+       my $continent = &Location::Functions::get_continent_code($db_handle, $ccode);
+
+       # Check if a whois server for the continent is known.
+       if($whois_servers_by_continent{$continent}) {
+               # Use it.
+               $whois_server = $whois_servers_by_continent{$continent};
+       }
+
+       my $flag_icon = &Location::Functions::get_flag_icon($ccode);
 
-       my $sock = new IO::Socket::INET ( PeerAddr => $whoisname, PeerPort => 43, Proto => 'tcp');
+       my $sock = new IO::Socket::INET ( PeerAddr => $whois_server, PeerPort => 43, Proto => 'tcp');
        if ($sock)
        {
-               print $sock "$addr\n";
+               print $sock "$addr\n";
                while (<$sock>) {
-                       $extraquery = $1 if (/ReferralServer: whois:\/\/(\S+)\s+/);
+                       $extraquery = $1 if (/ReferralServer:  whois:\/\/(\S+)\s+/);
                        push(@lines,$_);
                }
                close($sock);
                if ($extraquery) {
                        undef (@lines);
-                       $whoisname = $extraquery;
-                       my $sock = new IO::Socket::INET ( PeerAddr => $whoisname, PeerPort => 43, Proto => 'tcp');
+                       $whois_server = $extraquery;
+                       my $sock = new IO::Socket::INET ( PeerAddr => $whois_server, PeerPort => 43, Proto => 'tcp');
                        if ($sock)
                        {
                                print $sock "$addr\n";
@@ -77,16 +98,16 @@ if (&General::validip($addr)) {
                        }
                        else
                        {
-                               @lines = ( "$Lang::tr{'unable to contact'} $whoisname" );
+                               @lines = ( "$Lang::tr{'unable to contact'} $whois_server" );
                        }
                }
        }
        else
        {
-               @lines = ( "$Lang::tr{'unable to contact'} $whoisname" );
+               @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 . ') : '.$whoisname);
+       &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);
        print "<pre>\n";
        foreach my $line (@lines) {
                print &Header::cleanhtml($line,"y");
similarity index 85%
rename from html/cgi-bin/geoip-block.cgi
rename to html/cgi-bin/location-block.cgi
index 056b333e8c955eee667a982c2b227804c75c2d0b..3bc3a1e76432fb17843e68b82dc7f120fe8cfaa3 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2014 IPFire Developemnt Team <info@ipfire.org>                #
+# Copyright (C) 2014 - 2020 IPFire Developemnt 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        #
@@ -25,13 +25,13 @@ use strict;
 #use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 require "/usr/lib/firewall/firewall-lib.pl";
 
 my $notice;
-my $settingsfile = "${General::swroot}/firewall/geoipblock";
+my $settingsfile = "${General::swroot}/firewall/locationblock";
 
 my %color = ();
 my %mainsettings = ();
@@ -50,14 +50,14 @@ my %cgiparams = ();
 &Header::getcgihash(\%cgiparams);
 
 # Call subfunction to get all available locations.
-my @locations = &fwlib::get_geoip_locations();
+my @locations = &Location::Functions::get_locations();
 
 if ($cgiparams{'ACTION'} eq $Lang::tr{'save'}) {
-       # Check if we want to disable geoipblock.
-       if (exists $cgiparams{'GEOIPBLOCK_ENABLED'}) {
-               $settings{'GEOIPBLOCK_ENABLED'} = "on";
+       # Check if we want to disable locationblock.
+       if (exists $cgiparams{'LOCATIONBLOCK_ENABLED'}) {
+               $settings{'LOCATIONBLOCK_ENABLED'} = "on";
        } else {
-               $settings{'GEOIPBLOCK_ENABLED'} = "off";
+               $settings{'LOCATIONBLOCK_ENABLED'} = "off";
        }
 
        # Loop through our locations array to prevent from
@@ -81,7 +81,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'}) {
        $notice = $Lang::tr{'p2p block save notice'};
 }
 
-&Header::openpage($Lang::tr{'geoipblock configuration'}, 1, '');
+&Header::openpage($Lang::tr{'locationblock configuration'}, 1, '');
 
 # Print notice that a firewall reload is required.
 if ($notice) {
@@ -92,19 +92,19 @@ if ($notice) {
 
 # Checkbox pre-selection.
 my $checked;
-if ($settings{'GEOIPBLOCK_ENABLED'} eq "on") {
+if ($settings{'LOCATIONBLOCK_ENABLED'} eq "on") {
        $checked = "checked='checked'";
 }
 
-# Print box to enable/disable geoipblock.
+# Print box to enable/disable locationblock.
 print"<form method='POST' action='$ENV{'SCRIPT_NAME'}'>\n";
 
-&Header::openbox('100%', 'center', $Lang::tr{'geoipblock'});
+&Header::openbox('100%', 'center', $Lang::tr{'locationblock'});
 print <<END;
        <table width='95%'>
                <tr>
-                       <td width='25%' class='base'>$Lang::tr{'geoipblock enable feature'}
-                       <td><input type='checkbox' name='GEOIPBLOCK_ENABLED' $checked></td>
+                       <td width='25%' class='base'>$Lang::tr{'locationblock enable feature'}
+                       <td><input type='checkbox' name='LOCATIONBLOCK_ENABLED' $checked></td>
                </tr>
                <tr>
                        <td colspan='2'><br></td>
@@ -122,7 +122,7 @@ END
 
 &Header::closebox();
 
-&Header::openbox('100%', 'center', $Lang::tr{'geoipblock block countries'});
+&Header::openbox('100%', 'center', $Lang::tr{'locationblock block countries'});
 ### JAVA SCRIPT ###
 print <<END;
 <script>
@@ -175,10 +175,10 @@ foreach my $location (@locations) {
        my $ccode_lc = lc($location);
 
        # Full name of the country based on the country code.
-       my $cname = &GeoIP::get_full_country_name($ccode_lc);
+       my $cname = &Location::Functions::get_full_country_name($ccode_lc);
 
        # Get flag icon for of the country.
-       my $flag_icon = &GeoIP::get_flag_icon($ccode_uc);
+       my $flag_icon = &Location::Functions::get_flag_icon($ccode_uc);
 
        my $flag;
        # Check if a flag for the country is available.
@@ -258,9 +258,9 @@ print <<END;
 <table width='70%'>
        <tr>
                <td width='5%'><img src='/images/on.gif'></td>
-               <td>$Lang::tr{'geoipblock country is blocked'}</td>
+               <td>$Lang::tr{'locationblock country is blocked'}</td>
                <td width='5%'><img src='/images/off.gif'></td>
-               <td>$Lang::tr{'geoipblock country is allowed'}</td>
+               <td>$Lang::tr{'locationblock country is allowed'}</td>
        </tr>
 </table>
 END
index e67a40a9f506d4712c3ac1255c38b4e54f5938aa..2b690e35b723283d47fa2ed5497acff1209af33e 100644 (file)
@@ -20,10 +20,13 @@ use Getopt::Std;
 #use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+# Libloc database handle.
+my $libloc_db_handle = &Location::Functions::init();
+
 my %color = ();
 my %mainsettings = ();
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
@@ -351,7 +354,7 @@ foreach $_ (@log)
        $srcport=$1 if $packet =~ /SPT=(\d+)/;
        $dstport=$1 if $packet =~ /DPT=(\d+)/;
 
-       my $ccode = &GeoIP::lookup($srcaddr);
+       my $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, $srcaddr);
 
        my $servi = uc(getservbyport($srcport, lc($proto)));
        if ($servi ne '' && $srcport < 1024) {
@@ -383,7 +386,7 @@ foreach $_ (@log)
 END
        ;
        # Get flag icon for of the country.
-       my $flag_icon = &GeoIP::get_flag_icon($ccode);
+       my $flag_icon = &Location::Functions::get_flag_icon($ccode);
 
        if ( $flag_icon) {
                print "<td align='center' $col><a href='../country.cgi#$ccode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode'></a></td>";
index 949f2599daade08aa40d9285a3c754bccf419c95..701abab2c84987d65a7f872483c2bdbb5dd49f1f 100644 (file)
@@ -18,10 +18,13 @@ use Getopt::Std;
 #use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+# Libloc database handle.
+my $libloc_db_handle = &Location::Functions::init();
+
 use POSIX();
 
 my %cgiparams=();
@@ -308,7 +311,7 @@ foreach $_ (@log)
                # Traffic from red
                if($srcaddr ne '') {
                        # srcaddr is set
-                       my $ccode = &GeoIP::lookup($srcaddr);
+                       my $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, $srcaddr);
                        if ($ccode eq '') {
                                $ccode = 'unknown';
                        }
@@ -482,7 +485,7 @@ for($s=0;$s<$lines;$s++)
                my $fcode = lc($key[$s]);
 
                # Get flag icon for of the country.
-               my $flag_icon = &GeoIP::get_flag_icon($fcode);
+               my $flag_icon = &Location::Functions::get_flag_icon($fcode);
 
                if($flag_icon) {
                        print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$key[$s]' title='$key[$s]'></a></td>";
index c73d24fd663fee6af86ff0cc31e669f7acf217b0..670d72a526fc848946fd32e990a4b83dc117be86 100644 (file)
@@ -18,10 +18,13 @@ use Getopt::Std;
 #use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+# Libloc database handle.
+my $libloc_db_handle = &Location::Functions::init();
+
 use POSIX();
 
 my %cgiparams=();
@@ -435,14 +438,14 @@ for($s=0;$s<$lines;$s++)
        $col="bgcolor='$color{\"color$colorIndex\"}'";
        print "<tr>";
 
-       my $ccode = &GeoIP::lookup($key[$s]);
+       my $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, $key[$s]);
   
        $color++;
        print "<td align='center' $col><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
        print "<td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></td>";
 
        # Get flag icon for of the country.
-       my $flag_icon = &GeoIP::get_flag_icon($ccode);
+       my $flag_icon = &Location::Functions::get_flag_icon($ccode);
 
        if ( $flag_icon ) {
                print "<td align='center' $col><a href='/cgi-bin/country.cgi#$ccode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode'></a></td>";
index 69835370b154acdaf8676bbd28640726497e70d4..4d80e77a4d68fa2bacba9f275c1df842bd2d9c4c 100644 (file)
 #use strict;
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+# Libloc database handle.
+my $libloc_db_handle = &Location::Functions::init();
+
 use POSIX();
 
 #workaround to suppress a warning when a variable is used only once
@@ -178,7 +181,7 @@ if (!$skip)
                        }
                        elsif($srcaddr ne '') {
                                # or srcaddr matches country code
-                               my $ccode = &GeoIP::lookup($srcaddr);
+                               my $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, $srcaddr);
                                if($ccode eq uc($country)){
                                        $log[$lines] = $_;
                                        $lines++;
@@ -349,7 +352,7 @@ foreach $_ (@slice)
        if($iface eq $country || $srcaddr ne '') {
                my $ccode='';
                if($iface ne $country) {
-                       $ccode = &GeoIP::lookup($srcaddr);
+                       $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, $srcaddr);
                }
                if($iface eq $country || $ccode eq uc($country)) {
                        my $chain = '';
index 98ac4fe128752679c3a1d5d136473060e3c39c6e..781633c1db8bd3b89999e99d912253221bfa81c5 100644 (file)
@@ -31,7 +31,6 @@ use IO::Socket;
 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 = ();
index bcd51df6d0bdac25b59b1092c0f639d0d3baed47..457ebcf1f97d6113f6dddafc4e4bced9e52e5389 100644 (file)
@@ -35,7 +35,7 @@ require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 require "${General::swroot}/countries.pl";
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 
 # enable only the following on debugging purpose
 #use warnings;
@@ -2994,6 +2994,9 @@ END
        &Header::openbigbox('100%', 'LEFT', '', '');
     &Header::openbox('100%', 'LEFT', $Lang::tr{'ovpn con stat'});
 
+    # Libloc database handle.
+    my $libloc_db_handle = &Location::Functions::init();
+
 #
 #      <td><b>$Lang::tr{'protocol'}</b></td>
 # protocol temp removed 
@@ -3044,8 +3047,8 @@ END
                    $users[$uid]{'Proto'} = $proto;
 
                    # get country code for "RealAddress"...
-                   my $ccode = &GeoIP::lookup((split ':', $users[$uid]{'RealAddress'})[0]);
-                   my $flag_icon = &GeoIP::get_flag_icon($ccode);
+                   my $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, (split ':', $users[$uid]{'RealAddress'})[0]);
+                   my $flag_icon = &Location::Functions::get_flag_icon($ccode);
                    $users[$uid]{'Country'} = "<a href='country.cgi#$ccode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode' /></a>";
                    $uid++;
                }    
index 8beb84efa736aac3af9a4b6574f8adfe029e52bb..9c742669bc7266cccc1f58aeb4d5538960f94b15 100644 (file)
@@ -28,7 +28,7 @@ use strict;
 use IO::Socket;
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
@@ -278,6 +278,9 @@ sub printactivelogins()
        } else {
                # list active logins...
 
+               # Libloc database handle.
+               my $libloc_db_handle = &Location::Functions::init();
+
                foreach my $line (@output)
                {
                        my @arry = split(/\ +/, $line);
@@ -288,8 +291,8 @@ sub printactivelogins()
                        $remoteip =~ s/[()]//g;
 
                        # display more information about that IP adress...
-                       my $ccode = &GeoIP::lookup($remoteip);
-                       my $flag_icon = &GeoIP::get_flag_icon($ccode);
+                       my $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, $remoteip);
+                       my $flag_icon = &Location::Functions::get_flag_icon($ccode);
 
                        # get rDNS...
                        my $iaddr = inet_aton($remoteip);
index d31eb10862e129b3bbad2f3aa72f540a2128ec11..c9416be011bbdb76fbb3370aa618e3beed68667e 100644 (file)
@@ -27,7 +27,7 @@ use Locale::Codes::Country;
 #use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
@@ -618,7 +618,7 @@ END
 
                                if (exists($node->{'country_code'})) {
                                        # Get the flag icon of the country.
-                                       my $flag_icon = &GeoIP::get_flag_icon($node->{'country_code'});
+                                       my $flag_icon = &Location::Functions::get_flag_icon($node->{'country_code'});
 
                                        # Check if a flag for the given country is available.
                                        if ($flag_icon) {
index 26ad2ab1e95ddf1fc1f09584ea4731a95abb2b6a..93fbc2d18855dbe8b38d8b261091fa866cb6a1ee 100644 (file)
 'fwhost OpenVPN static host' => 'OpenVPN statischer Host',
 'fwhost OpenVPN static network' => 'OpenVPN statisches Netzwerk',
 'fwhost Standard Network' => 'Standard-Netzwerk',
-'fwhost addgeoipgrp' => 'Neue GeoIP-Gruppe hinzufügen',
+'fwhost addlocationgrp' => 'Neue Location-Gruppe hinzufügen',
 'fwhost addgrp' => 'Neue Gruppe hinzufügen',
 'fwhost addgrpname' => 'Gruppenname:',
 'fwhost addhost' => 'Neuen Host hinzufügen',
 'fwhost change' => 'Ändern',
 'fwhost changeremark' => 'Es wurde nur die Bemerkung angepasst.',
 'fwhost cust addr' => 'Hosts',
-'fwhost cust geoip' => 'GeoIP-Gruppen',
-'fwhost cust geoipgroup' => 'GeoIP-Gruppen',
-'fwhost cust geoiplocation' => 'GeoIP-Ländercodes',
+'fwhost cust location' => 'Location-Gruppen',
+'fwhost cust locationgroup' => 'Location-Gruppen',
+'fwhost cust locationlocation' => 'Location-Ländercodes',
 'fwhost cust grp' => 'Gruppen',
 'fwhost cust net' => 'Netzwerke',
 'fwhost cust service' => 'Dienste',
 'fwhost ipsec net' => 'IPsec-Netzwerke:',
 'fwhost menu' => 'Firewallgruppen',
 'fwhost netaddress' => 'Netzwerkadresse',
-'fwhost newgeoipgrp' => 'GeoIP-Gruppen',
+'fwhost newlocationgrp' => 'Location-Gruppen',
 'fwhost newgrp' => 'Netzwerk-/Hostgruppen',
 'fwhost newhost' => 'Hosts',
 'fwhost newnet' => 'Netzwerke',
 'generating the root and host certificates may take a long time. it can take up to several minutes on older hardware. please be patient' => 'Die Erzeugung der Root- und Host-Zertifikate kann eine Weile dauern.  Auf älterer Hardware kann dies mehrere Minuten in Anspruch nehmen. Bitte haben Sie etwas Geduld.',
 'genkey' => 'PSK erzeugen',
 'genre' => 'Genre',
-'geoip' => 'Länderfilter konfigurieren',
-'geoipblock' => 'GeoIP-Filter',
-'geoipblock block countries' => 'Länderfilter',
-'geoipblock configuration' => 'GeoIP-Konfiguration',
-'geoipblock country code' => 'Ländercode',
-'geoipblock country is allowed' => 'Eingehende Verbindungen aus diesem Land sind erlaubt.',
-'geoipblock country is blocked' => 'Eingehende Verbindungen aus diesem Land werden blockiert.',
-'geoipblock country name' => 'Ländername',
-'geoipblock enable feature' => 'GeoIP-basierte Filterung aktivieren:',
-'geoipblock flag' => 'Flagge',
+'location' => 'Länderfilter konfigurieren',
+'locationblock' => 'Location-Filter',
+'locationblock block countries' => 'Länderfilter',
+'locationblock configuration' => 'Location-Konfiguration',
+'locationblock country code' => 'Ländercode',
+'locationblock country is allowed' => 'Eingehende Verbindungen aus diesem Land sind erlaubt.',
+'locationblock country is blocked' => 'Eingehende Verbindungen aus diesem Land werden blockiert.',
+'locationblock country name' => 'Ländername',
+'locationblock enable feature' => 'Location-basierte Filterung aktivieren:',
+'locationblock flag' => 'Flagge',
 'global settings' => 'Globale Einstellungen',
 'gpl i accept these terms and conditions' => 'Ich akzeptiere diese Bedingungen und Konditionen',
 'gpl license agreement' => 'Lizenzvereinbarung',
index 51483530bf599566991c34d0a48f9952dc198206..3fcd3691e078337a6ffc5b68d7d7158d717aedbf 100644 (file)
 'fwhost OpenVPN static host' => 'OpenVPN static host',
 'fwhost OpenVPN static network' => 'OpenVPN static network',
 'fwhost Standard Network' => 'Standard network',
-'fwhost addgeoipgrp' => 'Add new GeoIP group',
+'fwhost addlocationgrp' => 'Add new Location group',
 'fwhost addgrp' => 'Add new network/host group',
 'fwhost addgrpname' => 'Group name:',
 'fwhost addhost' => 'Add new host',
 'fwhost change' => 'Modify',
 'fwhost changeremark' => 'You modified just the remark',
 'fwhost cust addr' => 'Hosts',
-'fwhost cust geoip' => 'GeoIP Groups',
-'fwhost cust geoipgroup' => 'GeoIP Groups',
-'fwhost cust geoiplocation' => 'GeoIP Locations',
+'fwhost cust location' => 'Location Groups',
+'fwhost cust locationgroup' => 'Location Groups',
+'fwhost cust locationlocation' => 'Location Locations',
 'fwhost cust grp' => 'Network/Host Groups',
 'fwhost cust net' => 'Networks',
 'fwhost cust service' => 'Services',
 'fwhost ipsec net' => 'IPsec networks:',
 'fwhost menu' => 'Firewall Groups',
 'fwhost netaddress' => 'Network address',
-'fwhost newgeoipgrp' => 'GeoIP Groups',
+'fwhost newlocationgrp' => 'Location Groups',
 'fwhost newgrp' => 'Network/Host Groups',
 'fwhost newhost' => 'Hosts',
 'fwhost newnet' => 'Networks',
 'generating the root and host certificates may take a long time. it can take up to several minutes on older hardware. please be patient' => 'Generating the root and host certificates may take a long time.  It can take up to several minutes on older hardware. Please be patient.',
 'genkey' => 'Generate PSK',
 'genre' => 'Genre',
-'geoip' => 'GeoIP',
-'geoipblock' => 'GeoIP Block',
-'geoipblock block countries' => 'Block countries',
-'geoipblock configuration' => 'GeoIP Configuration',
-'geoipblock country code' => 'Country Code',
-'geoipblock country is allowed' => 'Incoming traffic from this country is allowed',
-'geoipblock country is blocked' => 'Incoming traffic from this country will be blocked',
-'geoipblock country name' => 'Country Name',
-'geoipblock enable feature' => 'Enable GeoIP based blocking:',
-'geoipblock flag' => 'Flag',
+'location' => 'Location',
+'locationblock' => 'Location Block',
+'locationblock block countries' => 'Block countries',
+'locationblock configuration' => 'Location Configuration',
+'locationblock country code' => 'Country Code',
+'locationblock country is allowed' => 'Incoming traffic from this country is allowed',
+'locationblock country is blocked' => 'Incoming traffic from this country will be blocked',
+'locationblock country name' => 'Country Name',
+'locationblock enable feature' => 'Enable Location based blocking:',
+'locationblock flag' => 'Flag',
 'global settings' => 'Global Settings',
 'gpl i accept these terms and conditions' => 'I accept these terms and conditions',
 'gpl license agreement' => 'License Agreement',
index 23bc20727a4f90c1a7201ca1e074ab374c24c1d0..0a757602a45c8fb086a19dde410de37d0c840db5 100644 (file)
 'generating the root and host certificates may take a long time. it can take up to several minutes on older hardware. please be patient' => 'Generar los certificador root y host puede tomar mucho tiempo. Puede durar varios minutos en equipos antiguos. Por favor sea paciente.',
 'genkey' => 'Generar PSK',
 'genre' => 'Género',
-'geoip' => 'GeoIP',
-'geoipblock' => 'GeoIP Block',
-'geoipblock block countries' => 'Países bloqueados',
-'geoipblock configuration' => 'Configuración GeoIP',
-'geoipblock country code' => 'Código del País',
-'geoipblock country is allowed' => 'Se permite el tráfico procedente de este País',
-'geoipblock country is blocked' => 'Se deniega el tráfico procedente de este País',
-'geoipblock country name' => 'Nombre del País',
-'geoipblock enable feature' => 'Habilitar bloqueo basado GeoIP:',
-'geoipblock flag' => 'Bandera',
+'location' => 'Location',
+'locationblock' => 'Location Block',
+'locationblock block countries' => 'Países bloqueados',
+'locationblock configuration' => 'Configuración Location',
+'locationblock country code' => 'Código del País',
+'locationblock country is allowed' => 'Se permite el tráfico procedente de este País',
+'locationblock country is blocked' => 'Se deniega el tráfico procedente de este País',
+'locationblock country name' => 'Nombre del País',
+'locationblock enable feature' => 'Habilitar bloqueo basado Location:',
+'locationblock flag' => 'Bandera',
 'global settings' => 'Configuraciones globales',
 'gpl i accept these terms and conditions' => 'I accept these terms and conditions',
 'gpl license agreement' => 'License Agreement',
index dc7b00fd02495c49375c6fe791b3b18d41594817..a566afacb68b75547867eee43916f3ffe8577a73 100644 (file)
 'fwhost OpenVPN static host' => 'Hôte statique OpenVPN',
 'fwhost OpenVPN static network' => 'Réseau statique OpenVPN',
 'fwhost Standard Network' => 'Réseau standard',
-'fwhost addgeoipgrp' => 'Ajouter un groupe GeoIP',
+'fwhost addlocationgrp' => 'Ajouter un groupe Location',
 'fwhost addgrp' => 'Ajouter un réseau / groupe d\'hôtes',
 'fwhost addgrpname' => 'Nom du groupe :',
 'fwhost addhost' => 'Ajouter un hôte',
 'fwhost change' => 'Modifier',
 'fwhost changeremark' => 'Vous avez juste modifié la remarque',
 'fwhost cust addr' => 'Hôtes',
-'fwhost cust geoip' => 'Groupes GeoIP',
-'fwhost cust geoipgroup' => 'Groupes GeoIP',
-'fwhost cust geoiplocation' => 'Emplacements GeoIP',
+'fwhost cust location' => 'Groupes Location',
+'fwhost cust locationgroup' => 'Groupes Location',
+'fwhost cust locationlocation' => 'Emplacements Location',
 'fwhost cust grp' => 'Réseau / groupes hôte',
 'fwhost cust net' => 'Réseaux',
 'fwhost cust service' => 'Services',
 'fwhost ipsec net' => 'Réseaux IPsec :',
 'fwhost menu' => 'Groupes de pare-feu',
 'fwhost netaddress' => 'Adresse réseau ',
-'fwhost newgeoipgrp' => 'Groupes GeoIP',
+'fwhost newlocationgrp' => 'Groupes Location',
 'fwhost newgrp' => 'Réseau / groupes hôtes',
 'fwhost newhost' => 'Hôtes',
 'fwhost newnet' => 'Réseaux',
 'generating the root and host certificates may take a long time. it can take up to several minutes on older hardware. please be patient' => 'Générer le certificat root et le certificat hôte peut prendre du temps. Cela peut prendre plusieurs minutes sur du matériel ancien, veuillez patienter.',
 'genkey' => 'Générer PSK',
 'genre' => 'Genre',
-'geoip' => 'GeoIP',
-'geoipblock' => 'Blocage GeoIP',
-'geoipblock block countries' => 'Blocage des pays',
-'geoipblock configuration' => 'Configuration GeoIP',
-'geoipblock country code' => 'Code pays',
-'geoipblock country is allowed' => 'Le trafic entrant de ce pays sera autorisé',
-'geoipblock country is blocked' => 'Le trafic entrant de ce pays sera bloqué',
-'geoipblock country name' => 'Nom de pays',
-'geoipblock enable feature' => 'Activer le blocage GeoIP :',
-'geoipblock flag' => 'Drap.',
+'location' => 'Location',
+'locationblock' => 'Blocage Location',
+'locationblock block countries' => 'Blocage des pays',
+'locationblock configuration' => 'Configuration Location',
+'locationblock country code' => 'Code pays',
+'locationblock country is allowed' => 'Le trafic entrant de ce pays sera autorisé',
+'locationblock country is blocked' => 'Le trafic entrant de ce pays sera bloqué',
+'locationblock country name' => 'Nom de pays',
+'locationblock enable feature' => 'Activer le blocage Location :',
+'locationblock flag' => 'Drap.',
 'global settings' => 'Configuration générale',
 'gpl i accept these terms and conditions' => 'J\'accepte les termes et les conditions',
 'gpl license agreement' => 'Accord de licence',
index 1917b82416172db29b9ba030dab66ad10451f28b..9829b40766c51506b650aa7c84877aae97c26f87 100644 (file)
 'fwhost OpenVPN static host' => 'OpenVPN statik ana bilgisayar',
 'fwhost OpenVPN static network' => 'OpenVPN statik ağ',
 'fwhost Standard Network' => 'Standart ağ',
-'fwhost addgeoipgrp' => 'Yeni GeoIP grubu ekle',
+'fwhost addlocationgrp' => 'Yeni Location grubu ekle',
 'fwhost addgrp' => 'Yeni ağ/ana bilgisayar grubu ekle:',
 'fwhost addgrpname' => 'Grup adı:',
 'fwhost addhost' => 'Yeni bir ana bilgisayar ekle:',
 'fwhost change' => 'Değiştir',
 'fwhost changeremark' => 'Sadece açıklamalar değiştirilmiş',
 'fwhost cust addr' => 'Ana bilgisayarlar',
-'fwhost cust geoip' => 'GeoIP Grupları',
-'fwhost cust geoipgroup' => 'GeoIP Grupları',
-'fwhost cust geoiplocation' => 'GeoIP Konumları',
+'fwhost cust location' => 'Location Grupları',
+'fwhost cust locationgroup' => 'Location Grupları',
+'fwhost cust locationlocation' => 'Location Konumları',
 'fwhost cust grp' => 'Ağ/Ana Bilgisayar Grupları:',
 'fwhost cust net' => 'Ağlar',
 'fwhost cust service' => 'Hizmetler:',
 'fwhost ipsec net' => 'IPsec ağları:',
 'fwhost menu' => 'Güvenlik Duvarı Grupları',
 'fwhost netaddress' => 'Ağ adresi',
-'fwhost newgeoipgrp' => 'GeoIP Grupları',
+'fwhost newlocationgrp' => 'Location Grupları',
 'fwhost newgrp' => 'Ağ/Ana Bilgisayar Grupları',
 'fwhost newhost' => 'Ana Bilgisayarlar',
 'fwhost newnet' => 'Ağlar',
 'generating the root and host certificates may take a long time. it can take up to several minutes on older hardware. please be patient' => 'Yönetici ve sunucu sertifikalarının oluşturulması biraz zaman alır. Eski donanımlarda bu süre birkaç dakikayı bulabilir. Lütfen bekleyin.',
 'genkey' => 'PSK oluştur',
 'genre' => 'Tür',
-'geoip' => 'GeoIP',
-'geoipblock' => 'GeoIP Engelleme',
-'geoipblock block countries' => 'Engellenen ülkeler',
-'geoipblock configuration' => 'GeoIP Yapılandırması',
-'geoipblock country code' => 'Ülke Kodu',
-'geoipblock country is allowed' => 'Bu ülkeden gelen trafiğe izin ver',
-'geoipblock country is blocked' => 'Bu ülkeden gelen trafiği engelle',
-'geoipblock country name' => 'Ülke Adı',
-'geoipblock enable feature' => 'GeoIP tabanlı engellemeyi aktifleştir:',
-'geoipblock flag' => 'Bayrak',
+'location' => 'Location',
+'locationblock' => 'Location Engelleme',
+'locationblock block countries' => 'Engellenen ülkeler',
+'locationblock configuration' => 'Location Yapılandırması',
+'locationblock country code' => 'Ülke Kodu',
+'locationblock country is allowed' => 'Bu ülkeden gelen trafiğe izin ver',
+'locationblock country is blocked' => 'Bu ülkeden gelen trafiği engelle',
+'locationblock country name' => 'Ülke Adı',
+'locationblock enable feature' => 'Location tabanlı engellemeyi aktifleştir:',
+'locationblock flag' => 'Bayrak',
 'global settings' => 'Genel ayarlar',
 'gpl i accept these terms and conditions' => 'Bu şartları kabul ediyorum',
 'gpl license agreement' => 'Lisans Sözleşmesi',
diff --git a/lfs/GeoIP b/lfs/GeoIP
deleted file mode 100644 (file)
index ce758d8..0000000
--- a/lfs/GeoIP
+++ /dev/null
@@ -1,84 +0,0 @@
-###############################################################################
-#                                                                             #
-# IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2018  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/>.       #
-#                                                                             #
-###############################################################################
-
-###############################################################################
-# Definitions
-###############################################################################
-
-include Config
-
-VER        = 1.25
-DATVER     = 30062018
-
-THISAPP    = Geo-IP-PurePerl-$(VER)
-DL_FILE    = $(THISAPP).tar.gz
-DL_FROM    = $(URL_IPFIRE)
-DIR_APP    = $(DIR_SRC)/$(THISAPP)
-TARGET     = $(DIR_INFO)/$(THISAPP)
-
-###############################################################################
-# Top-level Rules
-###############################################################################
-
-objects = $(DL_FILE) GeoIP.dat-$(DATVER).gz
-
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-GeoIP.dat-$(DATVER).gz = $(DL_FROM)/GeoIP.dat-$(DATVER).gz
-
-$(DL_FILE)_MD5 = a47a1b71f7cd7c46cca9efcc448e0726
-GeoIP.dat-$(DATVER).gz_MD5 = d538e57ad9268fdc7955c6cf9a37c4a9
-
-install : $(TARGET)
-
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
-download :$(patsubst %,$(DIR_DL)/%,$(objects))
-
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
-       @$(CHECK)
-
-$(patsubst %,$(DIR_DL)/%,$(objects)) :
-       @$(LOAD)
-
-$(subst %,%_MD5,$(objects)) :
-       @$(MD5)
-
-###############################################################################
-# Installation Details
-###############################################################################
-
-$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
-       @$(PREBUILD)
-       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/geoip_1_25_change_database_path.patch
-       cd $(DIR_APP) && perl Makefile.PL
-       cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE)
-       cd $(DIR_APP) && make install
-       cd $(DIR_APP) && mkdir -p /usr/share/GeoIP && \
-               zcat $(DIR_DL)/GeoIP.dat-$(DATVER).gz > /usr/share/GeoIP/GeoIP.dat
-       cd $(DIR_APP) && chmod 777 /srv/web/ipfire/html/images/flags
-       @rm -rf $(DIR_APP)
-       @$(POSTBUILD)
index 55482a980a2addb25d9ea43c273ada04ef5f2bd4..1f9323ee03ab9f9d6b805c7ec2ddeaf6a3a0e683 100644 (file)
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 3.33
+VER        = 3.62
 
 THISAPP    = Locale-Codes-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = bc7496f97889de8504e80addaa0ee40c
+$(DL_FILE)_MD5 = d4ee6fb8b5483c54abde1aa2b94e555a
 
 install : $(TARGET)
 
index ee320d8cf2ab365b88ea9ede8bb3fbd2eb56c3eb..0afacebaf731cdef244d476a0e3f67741829bcc6 100644 (file)
@@ -64,8 +64,8 @@ $(TARGET) :
        for i in auth/users backup/include.user backup/exclude.user \
            captive/settings captive/agb.txt captive/clients captive/voucher_out certs/index.txt certs/index.txt.attr ddns/config ddns/settings ddns/ipcache dhcp/settings \
            dhcp/fixleases dhcp/advoptions dhcp/dhcpd.conf.local dns/settings dns/servers dnsforward/config ethernet/aliases ethernet/settings ethernet/known_nics ethernet/scanned_nics \
-           ethernet/wireless extrahd/scan extrahd/devices extrahd/partitions extrahd/settings firewall/settings firewall/config firewall/geoipblock firewall/input firewall/outgoing \
-           fwhosts/customnetworks fwhosts/customhosts fwhosts/customgroups fwhosts/customservicegrp fwhosts/customgeoipgrp fwlogs/ipsettings fwlogs/portsettings \
+           ethernet/wireless extrahd/scan extrahd/devices extrahd/partitions extrahd/settings firewall/settings firewall/config firewall/locationblock firewall/input firewall/outgoing \
+           fwhosts/customnetworks fwhosts/customhosts fwhosts/customgroups fwhosts/customservicegrp fwhosts/customlocationgrp fwlogs/ipsettings fwlogs/portsettings \
            isdn/settings mac/settings main/hosts main/routing main/security main/settings optionsfw/settings \
            ovpn/ccd.conf ovpn/ccdroute ovpn/ccdroute2 pakfire/settings portfw/config ppp/settings-1 ppp/settings-2 ppp/settings-3 ppp/settings-4 \
            ppp/settings-5 ppp/settings proxy/settings proxy/squid.conf proxy/advanced/settings proxy/advanced/cre/enable remote/settings qos/settings qos/classes qos/subclasses qos/level7config qos/portconfig \
@@ -78,7 +78,7 @@ $(TARGET) :
        cp $(DIR_SRC)/config/cfgroot/header.pl                  $(CONFIG_ROOT)/
        cp $(DIR_SRC)/config/cfgroot/general-functions.pl       $(CONFIG_ROOT)/
        cp $(DIR_SRC)/config/cfgroot/network-functions.pl       $(CONFIG_ROOT)/
-       cp $(DIR_SRC)/config/cfgroot/geoip-functions.pl         $(CONFIG_ROOT)/
+       cp $(DIR_SRC)/config/cfgroot/location-functions.pl              $(CONFIG_ROOT)/
        cp $(DIR_SRC)/config/cfgroot/ids-functions.pl           $(CONFIG_ROOT)/
        cp $(DIR_SRC)/config/cfgroot/lang.pl                    $(CONFIG_ROOT)/
        cp $(DIR_SRC)/config/cfgroot/countries.pl               $(CONFIG_ROOT)/
diff --git a/lfs/geoip-database b/lfs/geoip-database
deleted file mode 100644 (file)
index fbaa211..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-###############################################################################
-#                                                                             #
-# 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/>.       #
-#                                                                             #
-###############################################################################
-
-###############################################################################
-# Definitions
-###############################################################################
-
-include Config
-
-VER        = 20191217
-
-THISAPP    = GeoIP-LiteCity-1-2csv-xtables-$(VER)
-DL_FILE    = $(THISAPP).tar.xz
-DL_FROM    = $(URL_IPFIRE)
-DIR_APP    = $(DIR_SRC)/$(THISAPP)
-TARGET     = $(DIR_INFO)/$(THISAPP)
-
-###############################################################################
-# Top-level Rules
-###############################################################################
-
-objects = $(DL_FILE)
-
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5                  = 6265289716880fd8e8a6061fef8d5747
-
-install : $(TARGET)
-
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
-download :$(patsubst %,$(DIR_DL)/%,$(objects))
-
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
-       @$(CHECK)
-
-$(patsubst %,$(DIR_DL)/%,$(objects)) :
-       @$(LOAD)
-
-$(subst %,%_MD5,$(objects)) :
-       @$(MD5)
-
-###############################################################################
-# Installation Details
-###############################################################################
-
-$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
-       @$(PREBUILD)
-       @cd / && tar axf $(DIR_DL)/$(DL_FILE)
-       @$(POSTBUILD)
similarity index 68%
rename from lfs/geoip-generator
rename to lfs/libloc
index 3091d32c7293bbaa68def6117085b70625d1f98c..c4e409fa52ef19bab045beddad7c3729b247f7ba 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2018  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2019  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        #
 
 include Config
 
-VER        = 1.6.12
-DVER       = 1.6.12-3
+VER        = 0.9.2
+DB_DATE    = 2020-06-10
 
-THISAPP    = geoip-api-c-$(VER)
+THISAPP    = libloc-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
 DL_FROM    = $(URL_IPFIRE)
-DIR_APP    = $(DIR_SRC)/$(THISAPP)
+DIR_APP    = $(DIR_SRC)/libloc-$(VER)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 
 ###############################################################################
 # Top-level Rules
 ###############################################################################
 
-objects = $(DL_FILE) geoip_$(DVER).debian.tar.xz
+objects = $(DL_FILE) \
+       location-$(DB_DATE).db.xz
 
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE) 
-geoip_$(DVER).debian.tar.xz = $(DL_FROM)/geoip_$(DVER).debian.tar.xz
+$(DL_FILE)                    = https://source.ipfire.org/releases/libloc//$(DL_FILE)
+location-$(DB_DATE).db.xz     = https://location.ipfire.org/databases/1/archive/location-$(DB_DATE).db.xz
 
-$(DL_FILE)_MD5                  = 727e5d6df9e9fc039dbc3a323cc56d2e
-geoip_$(DVER).debian.tar.xz_MD5 = 64fb561362dc456b45b799da20d47dd4
+$(DL_FILE)_MD5                = c6ed4fcbdb2ce4ca7e6df8abbd985411
+location-$(DB_DATE).db.xz_MD5 = 268b6d58a26c6d36081ed1e899b89020
 
 install : $(TARGET)
 
@@ -53,6 +54,9 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
 
 md5 : $(subst %,%_MD5,$(objects))
 
+dist:
+       @$(PAK)
+
 ###############################################################################
 # Downloading, checking, md5sum
 ###############################################################################
@@ -72,18 +76,31 @@ $(subst %,%_MD5,$(objects)) :
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
-       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && ./bootstrap
-       cd $(DIR_APP) && ./configure --prefix=/usr
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xvf $(DIR_DL)/$(DL_FILE)
+
+       cd $(DIR_APP) && ./autogen.sh
+       cd $(DIR_APP) && ./configure \
+               --prefix=/usr \
+               --sysconfdir=/etc \
+               --localstatedir=/var \
+               --disable-manpages
        cd $(DIR_APP) && make $(MAKETUNING)
        cd $(DIR_APP) && make install
-       cd $(DIR_APP) && tar axf $(DIR_DL)/geoip_$(DVER).debian.tar.xz
-       cd $(DIR_APP) && sed -i "s/use diagnostics;//g" debian/src/geolite2-to-legacy-csv.sh
-       cd $(DIR_APP) && g++ -std=gnu++11 -g debian/src/geoip-csv-to-dat.cpp \
-                               -o geoip-generator -lGeoIP
-       -mkdir -p /usr/share/GeoIP/bin
-       cd $(DIR_APP) && install -m 755 geoip-generator /usr/share/GeoIP/bin
-       cd $(DIR_APP) && install -m 755 debian/src/geolite2-to-legacy-csv.sh /usr/share/GeoIP/bin
-       cd $(DIR_APP) && install -m 644 debian/src/countryInfo.txt /usr/share/GeoIP/bin
+
+       # Copy database to correct location.
+       cd $(DIR_APP) && cp -avf $(DIR_DL)/location-$(DB_DATE).db.xz /var/lib/location/database.db.xz
+
+       # Uncompress database.
+       cd $(DIR_APP) && xz -d /var/lib/location/database.db.xz
+
+       # Launch location util and export all locations in xt_geoip format.
+       cd $(DIR_APP) && /usr/bin/location export \
+               --directory=/usr/share/xt_geoip \
+               --family=ipv4 \
+               --format=xt_geoip
+
+       # Remove exported IPv6 zones.
+       cd $(DIR_APP) && rm -rvf /usr/share/xt_geoip/*.iv6
+
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index 651a13f9c511eca117e5e5783b185419d80b6edf..08b1e070f8075a7a351223941c18a0b65365e30f 100644 (file)
@@ -27,7 +27,7 @@ include Config
 VERSUFIX = ipfire$(KCFG)
 MODPATH = /lib/modules/$(KVER)-$(VERSUFIX)/extra/
 
-VER        = 3.2
+VER        = 3.7
 
 THISAPP    = xtables-addons-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -48,7 +48,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 80ea89ba8d5a001a8d71c7f05b2f0141
+$(DL_FILE)_MD5 = d81776d6320ebd741042bf8eb7e13d1d
 
 install : $(TARGET)
 
@@ -82,8 +82,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
 
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/xtables-addons-3.2-fix-database-generation.patch
-
        # Only build the specified modules.
        cp -avf $(DIR_SRC)/config/xtables-addons/mconfig \
                $(DIR_APP)/mconfig
@@ -96,10 +94,6 @@ ifeq "$(USPACE)" "1"
 
        cd $(DIR_APP) && make $(MAKETUNING)
        cd $(DIR_APP) && make install
-
-       # Install xt_geoip_build.
-       cd $(DIR_APP) && install -m 755 geoip/xt_geoip_build \
-               /usr/local/bin/
 else
        cd $(DIR_APP) && ./configure \
                --with-kbuild=/lib/modules/$$(uname -r)$(KCFG)/build
@@ -117,5 +111,8 @@ else
        done
 endif
 
+       # Create directory for the databases.
+       mkdir -pv /usr/share/xt_geoip/
+
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --git a/make.sh b/make.sh
index 2e54cec28af4687f682abad5ac1c627fc767c772..21e84400bc4aca5f17a53df92b9d363e5b753c83 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1346,8 +1346,6 @@ buildipfire() {
   lfsmake2 python-daemon
   lfsmake2 python-ipaddress
   lfsmake2 glib
-  lfsmake2 GeoIP
-  lfsmake2 geoip-database
   lfsmake2 ntp
   lfsmake2 openssh
   lfsmake2 fontconfig
@@ -1634,10 +1632,10 @@ buildipfire() {
   lfsmake2 flashrom
   lfsmake2 firmware-update
   lfsmake2 tshark
-  lfsmake2 geoip-generator
   lfsmake2 speedtest-cli
   lfsmake2 rfkill
   lfsmake2 amazon-ssm-agent
+  lfsmake2 libloc
 }
 
 buildinstaller() {
@@ -1990,3 +1988,4 @@ find-dependencies)
        cat doc/make.sh-usage
        ;;
 esac
+
diff --git a/src/initscripts/networking/red.up/99-geoip-database b/src/initscripts/networking/red.up/99-geoip-database
deleted file mode 100644 (file)
index 9b024a8..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-# Get the GeoIP database if no one exists yet
-
-database_exists() {
-       local file
-       for file in /usr/share/xt_geoip/*.iv4; do
-               [ -e "${file}" ] && return 0
-       done
-
-       # Does not exist
-       return 1
-}
-
-# Download ruleset if none has been found.
-if ! database_exists; then
-       /usr/local/bin/xt_geoip_update >/dev/null 2>&1 &
-fi
-
-exit 0
index ab3a0bbf9c9a6151b89686c2308dac5b8be11944..65f1c979bb4007f1987fbfe897b5e1d91ed30f23 100644 (file)
@@ -276,10 +276,10 @@ iptables_init() {
                iptables -A OUTPUT -o "${BLUE_DEV}" -j DHCPBLUEOUTPUT
        fi
 
-       # GeoIP block
-       iptables -N GEOIPBLOCK
-       iptables -A INPUT -j GEOIPBLOCK
-       iptables -A FORWARD -j GEOIPBLOCK
+       # Location Block
+       iptables -N LOCATIONBLOCK
+       iptables -A INPUT -j LOCATIONBLOCK
+       iptables -A FORWARD -j LOCATIONBLOCK
 
        # trafic from ipsecX/TUN/TAP interfaces, before "-i GREEN_DEV" accept everything
        iptables -N IPSECINPUT
diff --git a/src/patches/geoip_1_25_change_database_path.patch b/src/patches/geoip_1_25_change_database_path.patch
deleted file mode 100644 (file)
index 933e93d..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
---- lib/Geo/IP/PurePerl.pm     Tue Mar 30 15:41:34 2010
-+++ lib/Geo/IP/PurePerl.pm     Mon Jan 09 18:58:11 2017
-@@ -129,7 +129,7 @@
- # --- unfortunately we do not know the path so we assume the 
--# default path /usr/local/share/GeoIP
-+# default path /usr/share/GeoIP
- # if thats not true, you can set $Geo::IP::PurePerl::OPEN_TYPE_PATH
- #
- sub open_type {
-@@ -210,7 +210,7 @@
-   # this will be less messy once deprecated new( $path, [$flags] )
-   # is no longer supported (that's what open() is for)
--  my $def_db_file = '/usr/local/share/GeoIP/GeoIP.dat';
-+  my $def_db_file = '/usr/share/GeoIP/GeoIP.dat';
-     if ($^O eq 'NetWare') {
-     $def_db_file = 'sys:/etc/GeoIP/GeoIP.dat';
-   } elsif ($^O eq 'MSWin32') {
-@@ -758,7 +758,7 @@
- =item $gi = Geo::IP->new( [$flags] );
- Constructs a new Geo::IP object with the default database located inside your system's
--I<datadir>, typically I</usr/local/share/GeoIP/GeoIP.dat>.
-+I<datadir>, typically I</usr/share/GeoIP/GeoIP.dat>.
- Flags can be set to either GEOIP_STANDARD, or for faster performance
- (at a cost of using more memory), GEOIP_MEMORY_CACHE.
---- t/1_lookup.t       Tue Mar 30 15:13:37 2010
-+++ t/1_lookup.t       Mon Jan 09 18:58:13 2017
-@@ -2,7 +2,7 @@
- use vars qw($dat);
- BEGIN {
--  foreach my $file ("GeoIP.dat",'/usr/local/share/GeoIP/GeoIP.dat') {
-+  foreach my $file ("GeoIP.dat",'/usr/share/GeoIP/GeoIP.dat') {
-     if (-f $file) {
-       $dat = $file;
-       last;
---- t/2_namelookup.t   Tue Mar 30 15:21:37 2010
-+++ t/2_namelookup.t   Mon Jan 09 18:58:21 2017
-@@ -2,7 +2,7 @@
- use vars qw($dat);
- BEGIN {
--  foreach my $file ("GeoIP.dat",'/usr/local/share/GeoIP/GeoIP.dat') {
-+  foreach my $file ("GeoIP.dat",'/usr/share/GeoIP/GeoIP.dat') {
-     if (-f $file) {
-       $dat = $file;
-       last;
---- Changes    Tue Mar 30 15:26:38 2010
-+++ Changes    Mon Jan 09 18:57:37 2017
-@@ -35,7 +35,7 @@
-       Country, City and Org requests benefit from GEOIP_MEMORY_CACHE and GEOIP_MMAP_CACHE
-       Add GEOIP_MMAP_CACHE support ( Peter Shipley ) 
-       Now works with new format of GeoIP ISP
--      Corrected path to /usr/local/share/GeoIP/GeoIP.dat in geoip-lookup program.
-+      Corrected path to /usr/share/GeoIP/GeoIP.dat in geoip-lookup program.
- 1.18  January 8th 2007
-       Replaced CS/Serbia and Montenegro with RS/Serbia, removed ZR/Zaire, added ME/Montenegro
---- geoip-lookup       Tue Mar 30 15:13:36 2010
-+++ geoip-lookup       Mon Jan 09 18:57:44 2017
-@@ -15,7 +15,7 @@
- The I<geoip-lookup> program will return the country for the IP address or
- hostname given as the first command line argument.
--It queries the GeoIP Country database in C</usr/local/share/GeoIP/GeoIP.dat>.
-+It queries the GeoIP Country database in C</usr/share/GeoIP/GeoIP.dat>.
- By default it prints the ISO 3166 country code.  Use the C<-l> option
- to print the country name.
---- geoip-lookup-city  Tue Mar 30 15:13:36 2010
-+++ geoip-lookup-city  Mon Jan 09 18:57:48 2017
-@@ -6,7 +6,7 @@
- my $addr = shift;
--my $gi = Geo::IP::PurePerl->new( "/usr/local/share/GeoIP/GeoIPCity.dat",
-+my $gi = Geo::IP::PurePerl->new( "/usr/share/GeoIP/GeoIPCity.dat",
-                                  GEOIP_STANDARD );
- if ($addr) {
---- geoip-lookup-isp   Tue Mar 30 15:13:36 2010
-+++ geoip-lookup-isp   Mon Jan 09 18:57:50 2017
-@@ -7,7 +7,7 @@
- my $addr = shift;
--my $gi = Geo::IP::PurePerl->new("/usr/local/share/GeoIP/GeoIPISP.dat",GEOIP_STANDARD);
-+my $gi = Geo::IP::PurePerl->new("/usr/share/GeoIP/GeoIPISP.dat",GEOIP_STANDARD);
- my $isp = $gi->org_by_name($addr);
---- geoip-lookup-netspeed      Tue Mar 30 15:13:36 2010
-+++ geoip-lookup-netspeed      Mon Jan 09 18:57:53 2017
-@@ -6,7 +6,7 @@
- my $addr = $ARGV[0];
--my $gi = Geo::IP::PurePerl->new("/usr/local/share/GeoIP/GeoIPNetSpeed.dat",GEOIP_STANDARD);
-+my $gi = Geo::IP::PurePerl->new("/usr/share/GeoIP/GeoIPNetSpeed.dat",GEOIP_STANDARD);
- my $netspeed = $gi->id_by_addr($addr);
---- geoip-lookup-org   Tue Mar 30 15:13:36 2010
-+++ geoip-lookup-org   Mon Jan 09 18:57:59 2017
-@@ -7,7 +7,7 @@
- my $addr = shift;
--my $gi = Geo::IP::PurePerl->new("/usr/local/share/GeoIP/GeoIPOrg.dat",GEOIP_STANDARD);
-+my $gi = Geo::IP::PurePerl->new("/usr/share/GeoIP/GeoIPOrg.dat",GEOIP_STANDARD);
- my $org = $gi->org_by_name($addr);
---- geoip-lookup-region        Tue Mar 30 15:13:36 2010
-+++ geoip-lookup-region        Mon Jan 09 18:58:01 2017
-@@ -10,7 +10,7 @@
- my $addr = $ARGV[0];
--my $gi = Geo::IP::PurePerl->new("/usr/local/share/GeoIP/GeoIPRegion.dat",GEOIP_STANDARD);
-+my $gi = Geo::IP::PurePerl->new("/usr/share/GeoIP/GeoIPRegion.dat",GEOIP_STANDARD);
- my ($country,$region) = $gi->region_by_name($addr);
---- INSTALL    Tue Mar 30 15:13:36 2010
-+++ INSTALL    Mon Jan 09 18:58:05 2017
-@@ -3,7 +3,7 @@
- # fetch latest GeoIP database, updated monthly
- wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
- gunzip GeoIP.dat.gz
--mv GeoIP.dat /usr/local/share/GeoIP/GeoIP.dat
-+mv GeoIP.dat /usr/share/GeoIP/GeoIP.dat
- perl Makefile.PL
- make
diff --git a/src/patches/xtables-addons-3.2-fix-database-generation.patch b/src/patches/xtables-addons-3.2-fix-database-generation.patch
deleted file mode 100644 (file)
index 5574e20..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/geoip/xt_geoip_build b/geoip/xt_geoip_build
-index 3b15875..7bc42f3 100755
---- a/geoip/xt_geoip_build
-+++ b/geoip/xt_geoip_build
-@@ -259,7 +259,12 @@ sub writeCountry
-               my ($start, $end) = split('-', $range);
-               $start = inet_pton($family, $start);
-               $end = inet_pton($family, $end);
--              print $fh $start, $end;
-+
-+              if ($family == AF_INET) {
-+                      print $fh substr($start, 0, 4), substr($end, 0, 4);
-+              } else {
-+                      print $fh $start, $end;
-+              }
-       }
-       close $fh;
- }
diff --git a/src/scripts/convert-to-location b/src/scripts/convert-to-location
new file mode 100755 (executable)
index 0000000..2d83007
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2020 IPFire Development 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/>.       #
+#                                                                             #
+###############################################################################
+
+CONF_DIR="/var/ipfire"
+FW_CONF_DIR="$CONF_DIR/firewall"
+HOSTS_CONF_DIR="$CONF_DIR/fwhosts"
+
+# Check if the old blocking configuration file exists.
+if [ -f "$FW_CONF_DIR/geoipblock" ]; then
+       # Convert variable, if blocking is enabled or not.
+       sed -i 's/GEOIPBLOCK/LOCATIONBLOCK/g' "$FW_CONF_DIR/geoipblock"
+
+       # Rename file to the new name.
+       mv "$FW_CONF_DIR/geoipblock" "$FW_CONF_DIR/locationblock"
+
+       # Loop through the firewall config directory.
+       for file in "$FW_CONF_DIR/config" "$FW_CONF_DIR/input" "$FW_CONF_DIR/outgoing"; do
+               # Convert pattern which indicates location based rules to the new
+               # ones.
+               sed -i 's/cust_geoip/cust_location/g' "$FW_CONF_DIR/$file"
+       done
+
+       # Rename indicator for location based groups to the new one.
+       sed -i 's/GeoIP Group/Location Group/g' "$HOSTS_CONF_DIR/customgeoipgrp"
+
+       # Rename file to the new name.
+       mv "$HOSTS_CONF_DIR/customgeoipgrp" "$HOSTS_CONF_DIR/customlocationgrp"
+fi
+
+# Finished.
+exit 0
diff --git a/src/scripts/update-location-database b/src/scripts/update-location-database
new file mode 100644 (file)
index 0000000..d830286
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/bash
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2019 IPFire Development 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/>.       #
+#                                                                             #
+###############################################################################
+
+eval $(/usr/local/bin/readhash /var/ipfire/proxy/settings)
+
+# Proxy settings.
+# Check if a proxy should be used.
+if [[ $UPSTREAM_PROXY ]]; then
+       PROXYSETTINGS="https_proxy=http://"
+
+       # Check if authentication against the proxy is configured.
+       if [[ $UPSTREAM_USER && $UPSTREAM_PASSWORD ]]; then
+               PROXYSETTINGS="$PROXYSETTINGS$UPSTREAM_USER:$UPSTREAM_PASSWORD@"
+       fi
+
+       # Add proxy server.
+       PROXYSETTINGS="$PROXYSETTINGS$UPSTREAM_PROXY"
+
+       # Export proxy settings.
+       export HTTPS_PROXY="$PROXYSETTINGS"
+fi
+
+# Get the latest location database from server.
+if /usr/bin/location update; then
+       # Call location and export all countries in xt_geoip compatible format.
+       if /usr/bin/location export --directory=/usr/share/xt_geoip --family=ipv4 --format=xt_geoip; then
+
+               # Call initscript to reload the firewall.
+               /etc/init.d/firewall reload
+       fi
+fi
diff --git a/src/scripts/xt_geoip_update b/src/scripts/xt_geoip_update
deleted file mode 100644 (file)
index ebd2665..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-#!/bin/bash
-###############################################################################
-#                                                                             #
-# IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2019 IPFire Development 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/>.       #
-#                                                                             #
-###############################################################################
-
-TMP_PATH=$(mktemp -dp /var/tmp)
-TMP_FILE=$(mktemp -p $TMP_PATH)
-
-SCRIPT_PATH=/usr/local/bin
-DEST_PATH=/usr/share/xt_geoip
-DB_PATH=/var/lib/GeoIP
-DB1_PATH=/usr/share/GeoIP
-
-DL_URL=https://geolite.maxmind.com/download/geoip/database
-DL_FILE=GeoLite2-Country-CSV.zip
-
-eval $(/usr/local/bin/readhash /var/ipfire/proxy/settings)
-
-function download() {
-       echo "Downloading latest GeoIP ruleset..."
-
-       # Proxy settings.
-       # Check if a proxy should be used.
-       if [[ $UPSTREAM_PROXY ]]; then
-               PROXYSETTINGS="-e https_proxy=http://"
-
-               # Check if authentication against the proxy is configured.
-               if [[ $UPSTREAM_USER && $UPSTREAM_PASSWORD ]]; then
-                       PROXYSETTINGS="$PROXYSETTINGS$UPSTREAM_USER:$UPSTREAM_PASSWORD@"
-               fi
-
-               # Add proxy server.
-               PROXYSETTINGS="$PROXYSETTINGS$UPSTREAM_PROXY"
-       fi
-
-       # Get the latest GeoIP database from server.
-       wget $DL_URL/$DL_FILE $PROXYSETTINGS -O $TMP_FILE
-
-       # Extract files to database path.
-       unzip $TMP_FILE -d $TMP_PATH
-
-       return 0
-}
-
-function install() {
-       echo "Install CSV database..."
-
-       # Check if the database dir exists.
-       if [ ! -e "$DB_PATH" ]; then
-               mkdir -p $DB_PATH &>/dev/null
-       fi
-
-       # Check if the directory for binary databases exists.
-        if [ ! -e "$DEST_PATH" ]; then
-                mkdir -p $DEST_PATH &>/dev/null
-        fi
-
-       # Install CSV databases.
-       if ! cp -af $TMP_PATH/*/* $DB_PATH &>/dev/null; then
-               echo "Could not copy files. Aborting." >&2
-               return 1
-       fi
-
-       return 0
-}
-
-function build_legacy() {
-       echo "Convert database to legacy GeoIP.dat ..."
-       cat $DB_PATH/GeoLite2-Country-Blocks-IPv4.csv | \
-           $DB1_PATH/bin/geolite2-to-legacy-csv.sh $DB1_PATH/bin/countryInfo.txt > \
-           $TMP_FILE
-       $DB1_PATH/bin/geoip-generator -v -4 --info="$(date -u +'GEO-106FREE %Y%m%d Build -IPFire-' \
-           -r $DB_PATH/GeoLite2-Country-Blocks-IPv4.csv) $(<$DB_PATH/COPYRIGHT.txt)" -o \
-           $DB1_PATH/GeoIP.dat $TMP_FILE
-
-       return 0
-}
-
-
-function build() {
-       echo "Convert database..."
-
-       # Run script to convert the CSV file into several xtables
-       # compatible binary files.
-       if ! $SCRIPT_PATH/xt_geoip_build -S $DB_PATH -D $DEST_PATH; then
-               echo "Could not convert ruleset. Aborting." >&2
-               return 1
-       fi
-
-       return 0
-}
-
-function cleanup() {
-       echo "Cleaning up temporary files..."
-       if ! rm -rf $TMP_PATH &>/dev/null; then
-               echo "Could not remove files. Aborting." >&2
-               return 1
-       fi
-
-       return 0
-}
-
-function main() {
-       local func
-       for func in download install build build_legacy; do
-               if ! ${func}; then
-                       # Cleanup any temporary data
-                       cleanup
-
-                       return 1
-               fi
-       done
-
-       # Cleanup
-       cleanup || return $?
-
-       # All done
-       return 0
-}
-
-# Run the main function.
-main || exit $?