summaryrefslogtreecommitdiff
path: root/filter/test.conf
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2017-03-13 13:50:32 +0100
committerJan Moskyto Matejka <mq@ucw.cz>2017-03-13 13:51:20 +0100
commit8c9986d310c58b26c000375be00be0deb9c2e360 (patch)
tree9e3dba54bc82bb2bb9e0b6a25591eb471b107550 /filter/test.conf
parent54334b5667158d4b0af55201f327faeb80c05e0e (diff)
Filters: VPN Route Distinguishers, Prefix Type, Docs Update
Diffstat (limited to 'filter/test.conf')
-rw-r--r--filter/test.conf36
1 files changed, 33 insertions, 3 deletions
diff --git a/filter/test.conf b/filter/test.conf
index dc94f817..89c882ae 100644
--- a/filter/test.conf
+++ b/filter/test.conf
@@ -1167,9 +1167,7 @@ int j;
filter roa_filter
{
- print(net);
if net ~ [ 10.0.0.0/8{16,24}, 2000::/3{16,96} ] then {
- print("accepted");
accept;
}
reject;
@@ -1263,7 +1261,6 @@ prefix set pxs;
prefix set pxt;
{
pxs = [ 98.45.0.0/16, 128.128.0.0/12+, 2200::/42-, ::ffff:d000:0/100{98,102}];
- print format(pxs);
bt_assert(format(pxs) = "[::/0, ::/2{c000::}, 98.45.0.0/112{::0.1.0.0}, 128.128.0.0/108{::0.31.255.255}, 208.0.0.0/100{::124.0.0.0}, 2200::/42{ffff:ffff:ffc0::}]");
bt_assert(::fe00:0:0/88 !~ pxs);
bt_assert(::fffe:0:0/95 !~ pxs);
@@ -1275,6 +1272,39 @@ prefix set pxt;
bt_assert(::/0 ~ pxs);
bt_assert(0.0.0.0/0 !~ pxs);
bt_assert(128.135.64.17/32 ~ pxs);
+
+# pxt = [ 0:1:2 10.1.10.0/24, 0:5:10000 10.1.10.0/24 ];
+# print pxt;
+
+ bt_assert(format(NET_IP4) = "(enum 36)1"); ## if (net.type = NET_IP4) ...
+ bt_assert(format(NET_VPN6) = "(enum 36)4");
+ bt_assert(format(0:1:2) = "0:1:2");
}
bt_test_suite(t_mixed_prefix, "Testing mixed net types");
+
+
+filter vpn_filter
+{
+ bt_assert(format(net) = "0:1:2 10.1.10.0/24");
+ bt_assert(net.type = NET_VPN4);
+ bt_assert(net.type != NET_IP4);
+ bt_assert(net.type != NET_IP6);
+ bt_assert(net.rd = 0:1:2);
+
+ case (net.type) {
+ NET_IP4: print "IPV4";
+ NET_IP6: print "IPV6";
+ }
+
+ accept;
+}
+
+vpn4 table v4;
+vpn4 table v6;
+
+protocol static
+{
+ vpn4 { table v4; import filter vpn_filter; };
+ route 0:1:2 10.1.10.0/24 unreachable;
+}