From ec1c52633ed8fbc86b6661e9e03e4fc578ac0da4 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Thu, 12 Dec 2019 12:07:34 +0100 Subject: [PATCH] geoip-functions.pl: Add get_continent_code() This function allows to recieve the continent code of a given country (code). Signed-off-by: Stefan Schantl --- config/cfgroot/geoip-functions.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/cfgroot/geoip-functions.pl b/config/cfgroot/geoip-functions.pl index 9bfa3b4601..aaabd6f069 100644 --- a/config/cfgroot/geoip-functions.pl +++ b/config/cfgroot/geoip-functions.pl @@ -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. -- 2.39.5