diff --git a/scripts/base/utils/site.bro b/scripts/base/utils/site.bro index b8414a7a84..96fc46ec56 100644 --- a/scripts/base/utils/site.bro +++ b/scripts/base/utils/site.bro @@ -16,6 +16,10 @@ export { ## Networks that are considered "local". const local_nets: set[subnet] &redef; + + ## This is used for mapping between local networks and string + ## values for the CIDRs represented. + global local_nets_table: table[subnet] of string = {}; ## Networks that are considered "neighbors". const neighbor_nets: set[subnet] &redef; @@ -138,4 +142,9 @@ event bro_init() &priority=10 # Double backslashes are needed due to string parsing. local_dns_suffix_regex = set_to_regex(local_zones, "(^\\.?|\\.)(~~)$"); local_dns_neighbor_suffix_regex = set_to_regex(neighbor_zones, "(^\\.?|\\.)(~~)$"); + + # Create the local_nets mapping table. + for ( cidr in Site::local_nets ) + local_nets_table[cidr] = fmt("%s", cidr); + }