Merge branch 'master' into topic/jsiwek/ipv6-ext-headers

This commit is contained in:
Jon Siwek 2012-03-19 14:26:59 -05:00
commit f11fca588e
17 changed files with 99 additions and 19 deletions

View file

@ -0,0 +1,22 @@
::1
::ffff
::255.255.255.255
::10.10.255.255
1::1
1::a
1::1:1
1::1:a
a::a
a::1
a::a:a
a::a:1
a:a::a
aaaa::ffff
192.168.1.100
ffff::c0a8:164
::192.168.1.100
805b:2d9d:dc28::fc57:d4c8:1fff
aaaa::bbbb
aaaa:bbbb:cccc:dddd:eeee:ffff:1111:2222
aaaa:bbbb:cccc:dddd:eeee:ffff:1:2222
aaaa:bbbb:cccc:dddd:eeee:ffff:0:2222

View file

@ -3,7 +3,7 @@
global v: index_vec;
v = addr_to_counts(2001:0db8:85a3:0000:0000:8a2e:0370:7334);
v = addr_to_counts([2001:0db8:85a3:0000:0000:8a2e:0370:7334]);
print v;
print counts_to_addr(v);
v = addr_to_counts(1.2.3.4);

View file

@ -1,6 +1,6 @@
# @TEST-EXEC: bro %INPUT >output
# @TEST-EXEC: btest-diff output
print addr_to_ptr_name(2607:f8b0:4009:802::1012);
print addr_to_ptr_name([2607:f8b0:4009:802::1012]);
print addr_to_ptr_name(74.125.225.52);

View file

@ -2,6 +2,6 @@
# @TEST-EXEC: btest-diff out
print is_v4_addr(1.2.3.4);
print is_v4_addr(::1);
print is_v4_addr([::1]);
print is_v6_addr(1.2.3.4);
print is_v6_addr(::1);
print is_v6_addr([::1]);

View file

@ -17,4 +17,4 @@ test_to_addr("10.20.30.40", 10.20.30.40);
test_to_addr("100.200.30.40", 100.200.30.40);
test_to_addr("10.0.0.0", 10.0.0.0);
test_to_addr("10.00.00.000", 10.0.0.0);
test_to_addr("not an IP", ::);
test_to_addr("not an IP", [::]);

View file

@ -6,6 +6,6 @@ global sn: subnet;
sn = to_subnet("10.0.0.0/8");
print sn, sn == 10.0.0.0/8;
sn = to_subnet("2607:f8b0::/32");
print sn, sn == 2607:f8b0::/32;
print sn, sn == [2607:f8b0::]/32;
sn = to_subnet("10.0.0.0");
print sn, sn == ::/0;
print sn, sn == [::]/0;

View file

@ -0,0 +1,30 @@
# @TEST-EXEC: bro -b %INPUT >output
# @TEST-EXEC: btest-diff output
local v: vector of addr = vector();
v[|v|] = [::1];
v[|v|] = [::ffff];
v[|v|] = [::ffff:ffff];
v[|v|] = [::0a0a:ffff];
v[|v|] = [1::1];
v[|v|] = [1::a];
v[|v|] = [1::1:1];
v[|v|] = [1::1:a];
v[|v|] = [a::a];
v[|v|] = [a::1];
v[|v|] = [a::a:a];
v[|v|] = [a::a:1];
v[|v|] = [a:a::a];
v[|v|] = [aaaa:0::ffff];
v[|v|] = [::ffff:192.168.1.100];
v[|v|] = [ffff::192.168.1.100];
v[|v|] = [::192.168.1.100];
v[|v|] = [805B:2D9D:DC28::FC57:212.200.31.255];
v[|v|] = [0xaaaa::bbbb];
v[|v|] = [aaaa:bbbb:cccc:dddd:eeee:ffff:1111:2222];
v[|v|] = [aaaa:bbbb:cccc:dddd:eeee:ffff:1:2222];
v[|v|] = [aaaa:bbbb:cccc:dddd:eeee:ffff:0:2222];
for (i in v)
print v[i];

View file

@ -20,7 +20,7 @@ type example_record: record {
};
global a: addr = 1.2.3.4;
global a6: addr = ::1;
global a6: addr = [::1];
global b: bool = T;
global c: count = 10;
global d: double = -1.23;