]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
geoip-functions.pl: Add get_continent_code()
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 12 Dec 2019 11:07:34 +0000 (12:07 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 12 Dec 2019 11:07:34 +0000 (12:07 +0100)
This function allows to recieve the continent code of a given
country (code).

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/cfgroot/geoip-functions.pl

index 9bfa3b460124462e803fab20a37e9c1ddf1921d3..aaabd6f069eaf0155e75248649016964d7d7771c 100644 (file)
@@ -186,6 +186,16 @@ sub get_geoip_locations() {
        return @sorted_locations;
 }
 
+# Function to get the continent code of a given country code.
+sub get_continent_code($$) {
+       my ($db_handle, $ccode) = @_;
+
+       # Omit the continent code.
+       my $continent_code = &Location::get_continent_code($db_handle, $ccode);
+
+       return $continent_code;
+}
+
 # Function to flush all exported GeoIP locations.
 sub flush_exported_locations () {
        # Check if the xt_geoip_db_directory exists.