summaryrefslogtreecommitdiff
path: root/filter/test.conf
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-06-01 19:32:41 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-06-01 19:32:41 +0200
commit92a72a4cbdd010f69e8d054019770e55a47637e0 (patch)
tree75c45f29473f4ad20a3ff7031ad7720273c1e149 /filter/test.conf
parentf429d4348275030a9f488046c4021aa377ad1a79 (diff)
Adds support for dynamic pair and bgp mask expressions.
Diffstat (limited to 'filter/test.conf')
-rw-r--r--filter/test.conf18
1 files changed, 17 insertions, 1 deletions
diff --git a/filter/test.conf b/filter/test.conf
index af889073..7c05af05 100644
--- a/filter/test.conf
+++ b/filter/test.conf
@@ -9,6 +9,17 @@ router id 62.168.0.1;
define xyzzy = (120+10);
+
+function mkpair(int a)
+{
+ return (1, a);
+}
+
+function mkpath(int a; int b)
+{
+ return [= a b 3 2 1 =];
+}
+
function callme(int arg1; int arg2)
int local1;
int local2;
@@ -50,6 +61,7 @@ clist l;
print "Should be false: ", p2 ~ pm1, " ", p2 ~ pm2;
print "Should be true: ", p2 ~ / ? 4 3 2 1 /, " ", p2, " ", / ? 4 3 2 1 /;
print "Should be true: ", p2 ~ [= * 4 3 * 1 =], " ", p2, " ", [= * 4 3 * 1 =];
+ print "Should be true: ", p2 ~ [= (3+2) (2*2) 3 2 1 =], " ", p2 ~ mkpath(5, 4);
print "5 = ", p2.len;
pm1 = [= 1 2 * 3 4 5 =];
@@ -143,11 +155,15 @@ string s;
px = 1.2.0.0/18;
print "Testing prefixes: 1.2.0.0/18 = ", px;
+ print " must be true: ", 192.168.0.0/16 ~ 192.168.0.0/16, " ", 192.168.0.0/17 ~ 192.168.0.0/16, " ", 192.168.254.0/24 ~ 192.168.0.0/16;
+ print " must be false: ", 192.168.0.0/15 ~ 192.168.0.0/16, " ", 192.160.0.0/17 ~ 192.168.0.0/16;
+
p = 127.1.2.3;
print "Testing mask : 127.0.0.0 = ", p.mask(8);
pp = (1, 2);
- print "Testing pairs: (1,2) = ", (1,2), " = ", pp;
+ print "Testing pairs: (1,2) = ", (1,2), " = ", pp, " = ", (1,1+1), " = ", mkpair(2);
+ print " must be true: ", (1,2) = (1,1+1);
print "Testing enums: ", RTS_DUMMY, " ", RTS_STATIC;
s = "Hello";