diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2013-07-25 22:33:57 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2013-07-25 22:33:57 +0200 |
commit | 1103b32e830fbf98d9b3e32c0425b9a589773bf8 (patch) | |
tree | 9d3577cf205e74002ea43e7754f3391cc1e4992d /filter/test.conf | |
parent | ac5745134847c044b21c311e5ab11d92d05bacc1 (diff) |
Allows to define constants of all filter types.
Diffstat (limited to 'filter/test.conf')
-rw-r--r-- | filter/test.conf | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/filter/test.conf b/filter/test.conf index 3b29232a..4f40abff 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -240,6 +240,15 @@ int b; print "Defined: ", a, " ", b, " ", defined(b); } +define is1 = [ one, (2+1), (6-one), 8, 11, 15, 17, 19]; +define is2 = [(17+2), 17, 15, 11, 8, 5, 3, 2]; +define is3 = [5, 17, 2, 11, 8, 15, 3, 19]; + +define pxs2 = [ 10.0.0.0/16{8,12}, 20.0.0.0/16{24,28} ]; + +define ecs2 = [(rt, ten, (one+onef(0))*10), (ro, 100000, 100..200), (rt, 12345, *)]; + + function __startup() int i; bool b; @@ -249,9 +258,6 @@ pair pp; quad qq; ec cc; int set is; -int set is1; -int set is2; -int set is3; pair set ps; ec set ecs; prefix set pxs; @@ -279,11 +285,6 @@ string s; print " must be true: ", defined(1), ",", defined(1.2.3.4), ",", 1 != 2, ",", 1 <= 2; print " data types: must be false: ", 1 ~ [ 2, 3, 4 ], ",", 5 ~ is, ",", 1.2.3.4 ~ [ 1.2.3.3, 1.2.3.5 ], ",", (1,2) > (2,2), ",", (1,1) > (1,1), ",", 1.0.0.0/9 ~ [ 1.0.0.0/8- ], ",", 1.2.0.0/17 ~ [ 1.0.0.0/8{ 15 , 16 } ], ",", true && false; - is1 = [ 1, 5, 8, 11, 15, 17, 19]; - - is1 = [ one, (2+1), (6-one), 8, 11, 15, 17, 19]; - is2 = [(17+2), 17, 15, 11, 8, 5, 3, 2]; - is3 = [5, 17, 2, 11, 8, 15, 3, 19]; print " must be true: ", 1 ~ is1, " ", 3 ~ is1, " ", 5 ~ is1; print " must be true: ", (one+2) ~ is1, " ", 2 ~ is2, " ", 2 ~ is3; @@ -333,6 +334,7 @@ string s; ecs = [(rt, ten, (one+onef(0))*10), (ro, 100000, 100..200), (rt, 12345, *)]; print "EC set: ", ecs; + print "EC set: ", ecs2; print "Testing EC set, true: ", (rt, 10, 20) ~ ecs, " ", (ro, 100000, 100) ~ ecs, " ", (ro, 100000, 200) ~ ecs, " ", (rt, 12345, 0) ~ ecs, " ", cc ~ ecs, " ", (rt, 12345, 4000000) ~ ecs; print "Testing EC set, false: ", (ro, 10, 20) ~ ecs, " ", (rt, 10, 21) ~ ecs, " ", (ro, 100000, 99) ~ ecs, @@ -354,6 +356,7 @@ string s; print " must be false: ", 1.1.0.0/16 ~ pxs, ",", 1.3.0.0/16 ~ pxs, ",", 1.2.0.0/15 ~ pxs, ",", 1.2.0.0/17 ~ pxs, ",", 1.2.0.0/32 ~ pxs, ",", 1.4.0.0/15 ~ pxs; + test_pxset(pxs2); test_pxset([ 10.0.0.0/16{8,12}, 20.0.0.0/16{24,28} ]); print "What will this do? ", [ 1, 2, 1, 1, 1, 3, 4, 1, 1, 1, 5 ]; |