mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Refactoring various usages of new IPAddr class.
Reducing number of places that internal representation was exposed via GetBytes/CopyIPv6. Also fixed a bug in remask_addr bif.
This commit is contained in:
parent
d887eb3178
commit
d7dafe2fe2
24 changed files with 301 additions and 267 deletions
32
testing/btest/Baseline/bifs.remask_addr/output
Normal file
32
testing/btest/Baseline/bifs.remask_addr/output
Normal file
|
@ -0,0 +1,32 @@
|
|||
1: 127.255.0.0
|
||||
2: 63.255.0.0
|
||||
3: 31.255.0.0
|
||||
4: 15.255.0.0
|
||||
5: 7.255.0.0
|
||||
6: 3.255.0.0
|
||||
7: 1.255.0.0
|
||||
8: 0.255.0.0
|
||||
9: 0.127.0.0
|
||||
10: 0.63.0.0
|
||||
11: 0.31.0.0
|
||||
12: 0.15.0.0
|
||||
13: 0.7.0.0
|
||||
14: 0.3.0.0
|
||||
15: 0.1.0.0
|
||||
16: 0.0.0.0
|
||||
17: 0.0.128.0
|
||||
18: 0.0.192.0
|
||||
19: 0.0.224.0
|
||||
20: 0.0.240.0
|
||||
21: 0.0.248.0
|
||||
22: 0.0.252.0
|
||||
23: 0.0.254.0
|
||||
24: 0.0.255.0
|
||||
25: 0.0.255.128
|
||||
26: 0.0.255.192
|
||||
27: 0.0.255.224
|
||||
28: 0.0.255.240
|
||||
29: 0.0.255.248
|
||||
30: 0.0.255.252
|
||||
31: 0.0.255.254
|
||||
32: 0.0.255.255
|
10
testing/btest/bifs/remask_addr.bro
Normal file
10
testing/btest/bifs/remask_addr.bro
Normal file
|
@ -0,0 +1,10 @@
|
|||
# @TEST-EXEC: bro %INPUT >output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
const one_to_32: vector of count = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32};
|
||||
|
||||
for ( i in one_to_32 )
|
||||
{
|
||||
print fmt("%s: %s", one_to_32[i],
|
||||
remask_addr(0.0.255.255, 255.255.0.0, 96+one_to_32[i]));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue