diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2013-07-09 23:27:10 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2013-07-09 23:27:10 +0200 |
commit | cc31b75a8fd7949533c12db2c3e9d67eeaf46d10 (patch) | |
tree | 33ce8dbfd3279b121cd70cca13b315d9ecc07a57 /filter | |
parent | c01a94663cc18f53fd741c5d44387eead9ca88af (diff) |
Implements 'bgppath ~ int set' filter op.
Diffstat (limited to 'filter')
-rw-r--r-- | filter/filter.c | 3 | ||||
-rw-r--r-- | filter/test.conf | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/filter/filter.c b/filter/filter.c index c35d0425..432fa122 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -418,6 +418,9 @@ val_in_range(struct f_val v1, struct f_val v2) if ((v1.type == T_ECLIST) && (v2.type == T_SET)) return eclist_match_set(v1.val.ad, v2.val.t); + if ((v1.type == T_PATH) && (v2.type == T_SET)) + return as_path_match_set(v1.val.ad, v2.val.t); + if (v2.type == T_SET) switch (v1.type) { case T_ENUM: diff --git a/filter/test.conf b/filter/test.conf index 64e6d91b..3b29232a 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -95,10 +95,10 @@ eclist el2; p2 = prepend( p2, 3 ); p2 = prepend( p2, 4 ); print "Testing paths: ", p2; - print "Should be true: ", p2 ~ pm1, " ", p2 ~ pm2, " ", 3 ~ p2; + print "Should be true: ", p2 ~ pm1, " ", p2 ~ pm2, " ", 3 ~ p2, " ", p2 ~ [2, 10..20], " ", p2 ~ [4, 10..20]; print "4 = ", p2.len; p2 = prepend( p2, 5 ); - print "Should be false: ", p2 ~ pm1, " ", p2 ~ pm2, " ", 10 ~ p2; + print "Should be false: ", p2 ~ pm1, " ", p2 ~ pm2, " ", 10 ~ p2, " ", p2 ~ [8, 10..20],; 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); |