From: Stefan Schantl Date: Fri, 19 Mar 2021 20:27:23 +0000 (+0100) Subject: ids-functions.pl: Add get_ruleset_providers() function. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa5aa95d2165a210a64e9ac4bae32468ed92b888;p=people%2Fstevee%2Fipfire-2.x.git ids-functions.pl: Add get_ruleset_providers() function. Signed-off-by: Stefan Schantl --- diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index e9298ac4b6..dd5257a455 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -112,6 +112,24 @@ sub check_and_create_filelayout() { unless (-f "$whitelist_file" ) { &create_empty_file($whitelist_file); } } +# +## Function to get a list of all available ruleset providers. +## +## They will be returned as a sorted array. +# +sub get_ruleset_providers() { + my @providers; + + # Loop through the hash of providers. + foreach my $provider ( keys %IDS::Ruleset::Providers ) { + # Add the provider to the array. + push(@providers, $provider); + } + + # Sort and return the array. + return sort(@providers); +} + # ## Function for checking if at least 300MB of free disk space are available ## on the "/var" partition.