From 92a72a4cbdd010f69e8d054019770e55a47637e0 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 1 Jun 2009 19:32:41 +0200 Subject: Adds support for dynamic pair and bgp mask expressions. --- filter/test.conf | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'filter/test.conf') diff --git a/filter/test.conf b/filter/test.conf index af88907..7c05af0 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"; -- cgit v1.2.3