]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
ids-functions.pl: Add get_ruleset_providers() function.
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 19 Mar 2021 20:27:23 +0000 (21:27 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Wed, 8 Sep 2021 17:37:22 +0000 (19:37 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/cfgroot/ids-functions.pl

index e9298ac4b6f989fdc252836e5a773223b0ed6b0c..dd5257a45586f7e18814e9de9025fec229aa80bd 100644 (file)
@@ -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.