summaryrefslogtreecommitdiff
path: root/templates/policy/route-map
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-10-14 22:19:59 +0200
committerDaniil Baturin <daniil@baturin.org>2018-10-14 22:19:59 +0200
commit230041a139f64c3d3f7e949e9c0e453bde7c590a (patch)
tree114ab7ad8687f5b73473ba72f547d0e4861d59e8 /templates/policy/route-map
parent13605fb2b2af49edd8b9fd68a14c26c8f44b09bf (diff)
downloadvyatta-cfg-quagga-230041a139f64c3d3f7e949e9c0e453bde7c590a.tar.gz
vyatta-cfg-quagga-230041a139f64c3d3f7e949e9c0e453bde7c590a.zip
T143: add CLI for BGP large communities.
Diffstat (limited to 'templates/policy/route-map')
-rw-r--r--templates/policy/route-map/node.tag/rule/node.tag/match/large-community/large-community-list/node.def5
-rw-r--r--templates/policy/route-map/node.tag/rule/node.tag/match/large-community/node.def22
2 files changed, 27 insertions, 0 deletions
diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/large-community/large-community-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/large-community/large-community-list/node.def
new file mode 100644
index 00000000..5e35214d
--- /dev/null
+++ b/templates/policy/route-map/node.tag/rule/node.tag/match/large-community/large-community-list/node.def
@@ -0,0 +1,5 @@
+type: txt
+help: BGP large-community-list to match
+allowed: cli-shell-api listNodes policy large-community-list
+
+commit:expression: exec "cli-shell-api exists policy large-community-list $VAR(./@)"; "Large community list $VAR(./@) does not exist"
diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/large-community/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/large-community/node.def
new file mode 100644
index 00000000..609f8d76
--- /dev/null
+++ b/templates/policy/route-map/node.tag/rule/node.tag/match/large-community/node.def
@@ -0,0 +1,22 @@
+help: Match BGP large communities
+delete: echo route-map $VAR(../../../@) $VAR(../../action/@) $VAR(../../@) >> /tmp/delete-policy-route-map-$VAR(../../../@)-$VAR(../../@)-match-large-community.$PPID
+end: if [ -f /tmp/delete-policy-route-map-$VAR(../../../@)-$VAR(../../@)-match-large-community.$PPID ]; then
+ routemap=`cat /tmp/delete-policy-route-map-$VAR(../../../@)-$VAR(../../@)-match-large-community.$PPID`
+ rm -f /tmp/delete-policy-route-map-$VAR(../../../@)-$VAR(../../@)-match-large-community.$PPID;
+ vtysh --noerror -c "configure terminal" -c "$routemap " -c "no match large-community";
+ exit 0;
+ else
+ if [ -z "$VAR(./large-community-list/@)" ]; then
+ echo route-map $VAR(../../../@) rule $VAR(../../@) match large-community: you must configure a community-list;
+ exit 1 ;
+ fi ;
+ if [ -z "$VAR(../../action/@)" ]; then
+ echo route-map $VAR(../../../@) rule $VAR(../../@): you must configure an action;
+ exit 1 ;
+ fi ;
+ routemap='route-map $VAR(../../../@) $VAR(../../action/@) $VAR(../../@)';
+
+ vtysh --noerror -c "configure terminal" -c "$routemap " -c "no match large-community";
+ vtysh -c "configure terminal" -c "$routemap " -c "match large-community $VAR(./large-community-list/@)";
+ fi
+