Add bif that allows searching for all matching subnets in table.

Example:

global test: set[subnet] = {
	10.0.0.0/8,
	10.1.0.0/16,
	10.2.0.0/16,
	10.2.0.2/31
}

print matching_subnets(10.2.0.2/32, test);
->
[10.2.0.2/31, 10.2.0.0/16, 10.0.0.0/8]
This commit is contained in:
Johanna Amann 2016-03-09 12:24:00 -08:00
parent 42e4072673
commit 562e5a9f63
10 changed files with 274 additions and 11 deletions

View file

@ -263,7 +263,7 @@ global plugin_counter: count = 1;
global plugins: vector of PluginState;
global plugin_ids: table[count] of PluginState;
# These tables hold informations about rules _after_ they have been
# These tables hold information about rules _after_ they have been
# succesfully added. Currently no information about the rules is held
# in these tables while they are in the process of being added.
global rules: table[string,count] of Rule; # Rules indexed by id and cid