mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
New variable in utils/site for mapping address to defined local subnet.
- Site::local_nets_table[1.2.3.4] might yield "1.2.0.0/16" if that subnet is defined in the Site::local_nets variable.
This commit is contained in:
parent
29425c29e2
commit
5f61c9bde9
1 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,10 @@ export {
|
||||||
## Networks that are considered "local".
|
## Networks that are considered "local".
|
||||||
const local_nets: set[subnet] &redef;
|
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".
|
## Networks that are considered "neighbors".
|
||||||
const neighbor_nets: set[subnet] &redef;
|
const neighbor_nets: set[subnet] &redef;
|
||||||
|
|
||||||
|
@ -138,4 +142,9 @@ event bro_init() &priority=10
|
||||||
# Double backslashes are needed due to string parsing.
|
# Double backslashes are needed due to string parsing.
|
||||||
local_dns_suffix_regex = set_to_regex(local_zones, "(^\\.?|\\.)(~~)$");
|
local_dns_suffix_regex = set_to_regex(local_zones, "(^\\.?|\\.)(~~)$");
|
||||||
local_dns_neighbor_suffix_regex = set_to_regex(neighbor_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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue