mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
ids-functions.pl: Add private function to obtain the sid and rev of a
rule. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -926,6 +926,27 @@ sub _get_dl_rulesfile($) {
|
|||||||
return $rulesfile;
|
return $rulesfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
## Private function to obtain the sid and rev of a rule.
|
||||||
|
#
|
||||||
|
## Returns an array with the sid as first and the rev as second value.
|
||||||
|
#
|
||||||
|
sub _get_sid_and_rev ($) {
|
||||||
|
my ($line) = @_;
|
||||||
|
|
||||||
|
my @ret;
|
||||||
|
|
||||||
|
# Use regex to obtain the sid and rev.
|
||||||
|
if ($line =~ m/.*sid:\s*(.*?);.*rev:\s*(.*?);/) {
|
||||||
|
# Add the sid and rev to the array.
|
||||||
|
push(@ret, $1);
|
||||||
|
push(@ret, $2);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Return the array.
|
||||||
|
return @ret;
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
## Tiny function to delete the stored ruleset file or tarball for a given provider.
|
## Tiny function to delete the stored ruleset file or tarball for a given provider.
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user