diff options
author | Robert Bays <rbays@moresby.(none)> | 2007-11-09 17:53:47 -0800 |
---|---|---|
committer | Robert Bays <rbays@moresby.(none)> | 2007-11-09 17:53:47 -0800 |
commit | 6c4f2ec235c8c6b4ad821cbf2878bf5f9d9586b5 (patch) | |
tree | c8485a508cbb2074611dcf6fbc60140b0813d9fe /templates/policy/route-map | |
parent | 937ce3b04b0b8295ab5b86f4349bdd7abdbdb1c3 (diff) | |
download | vyatta-cfg-quagga-6c4f2ec235c8c6b4ad821cbf2878bf5f9d9586b5.tar.gz vyatta-cfg-quagga-6c4f2ec235c8c6b4ad821cbf2878bf5f9d9586b5.zip |
template updates
Diffstat (limited to 'templates/policy/route-map')
16 files changed, 77 insertions, 21 deletions
diff --git a/templates/policy/route-map/node.tag/rule/node.tag/call/node.def b/templates/policy/route-map/node.tag/rule/node.tag/call/node.def index 1b9df581..8eaa720a 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/call/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/call/node.def @@ -1,6 +1,6 @@ type: txt help: "Target route-map name" -syntax: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" "; "route-map $(@) doesn't exist" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" "; "route-map $(@) doesn't exist" commit: $(../action/) != ""; "must define an action for route-map $(../../@) rule $(../@)" update: "/usr/bin/vtysh -c \"configure terminal\" -c \"route-map $(../../@) $(../action/@) $(../@)\" \ -c \"call $(@)\" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/continue/node.def b/templates/policy/route-map/node.tag/rule/node.tag/continue/node.def index e26d72c8..f46fd5dd 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/continue/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/continue/node.def @@ -1,3 +1,11 @@ type: u32 help: "Continue on a different entry within the route-map" syntax: $(@) >= 1 && $(@) <= 65535; "continue must be between 1 and 65535" +# TODO - conditional not working +#syntax: $(@) > $(../../@); "you may only continue forward in the route-map" +update: "/usr/bin/vtysh -c \"configure terminal\" + -c \"route-map $(../../@) $(../action/@) $(../@)\" \ + -c \"continue $(@)\" " +delete: "/usr/bin/vtysh -c \"configure terminal\" + -c \"route-map $(../../@) $(../action/@) $(../@)\" \ + -c \"no continue \" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/address/access-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/address/access-list/node.def index 7f803c4a..33c698b1 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/address/access-list/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/address/access-list/node.def @@ -1,4 +1,11 @@ type: u32 help: "access-list number" -commit: $(../prefix-list/) == ""; "You may only specify a prefix-list or access-list" +# TODO - comparison not working +#commit: $(../prefix-list/) == ""; "You may only specify a prefix-list or access-list" commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy access-list $(@)\" "; "access-list $(@) does not exist" +update: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"match ip address $(@)\" " +delete: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"no match ip address $(@)\" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/address/prefix-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/address/prefix-list/node.def index 18c02c7b..b7870eb4 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/address/prefix-list/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/address/prefix-list/node.def @@ -1,4 +1,11 @@ type: txt help: "prefix-list name" -commit: $(../access-list/) == ""; "You can only specify a prefix-list or access-list" +# TODO - comparison not working +#commit: $(../access-list/) == ""; "You can only specify a prefix-list or access-list" commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy prefix-list $(@)\" "; "prefix-list $(@) does not exist" +update: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"match ip address prefix-list $(@)\" " +delete: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"no match ip address prefix-list $(@)\" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/nexthop/access-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/nexthop/access-list/node.def index 7f803c4a..d83479e9 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/nexthop/access-list/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/nexthop/access-list/node.def @@ -1,4 +1,11 @@ type: u32 help: "access-list number" -commit: $(../prefix-list/) == ""; "You may only specify a prefix-list or access-list" +# TODO - comparison not working +#commit: $(../prefix-list/) == ""; "You may only specify a prefix-list or access-list" commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy access-list $(@)\" "; "access-list $(@) does not exist" +update: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"match ip next-hop $(@)\" " +delete: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"no match ip next-hop $(@)\" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/nexthop/prefix-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/nexthop/prefix-list/node.def index 18c02c7b..cf8a0844 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/nexthop/prefix-list/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/nexthop/prefix-list/node.def @@ -1,4 +1,11 @@ type: txt help: "prefix-list name" -commit: $(../access-list/) == ""; "You can only specify a prefix-list or access-list" +# TODO - comparison not working +#commit: $(../access-list/) == ""; "You can only specify a prefix-list or access-list" commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy prefix-list $(@)\" "; "prefix-list $(@) does not exist" +update: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"match ip next-hop prefix-list $(@)\" " +delete: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"no match ip next-hop prefix-list $(@)\" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/route-source/access-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/route-source/access-list/node.def index 7f803c4a..18b46ebb 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/route-source/access-list/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/route-source/access-list/node.def @@ -1,4 +1,11 @@ type: u32 help: "access-list number" -commit: $(../prefix-list/) == ""; "You may only specify a prefix-list or access-list" +# TODO - comparison not working +#commit: $(../prefix-list/) == ""; "You may only specify a prefix-list or access-list" commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy access-list $(@)\" "; "access-list $(@) does not exist" +update: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"match ip route-source $(@)\" " +delete: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"no match ip route-source $(@)\" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/route-source/prefix-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/route-source/prefix-list/node.def index 18c02c7b..c8016bcc 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/match/ip/route-source/prefix-list/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/match/ip/route-source/prefix-list/node.def @@ -1,4 +1,11 @@ type: txt help: "prefix-list name" -commit: $(../access-list/) == ""; "You can only specify a prefix-list or access-list" +# TODO - comparison not working +#commit: $(../access-list/) == ""; "You can only specify a prefix-list or access-list" commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy prefix-list $(@)\" "; "prefix-list $(@) does not exist" +update: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"match ip route-source prefix-list $(@)\" " +delete: "/usr/bin/vtysh -c \"configure terminal\" \ + -c \"route-map $(../../../../../@) $(../../../../action/@) $(../../../../@)\" \ + -c \"no match ip route-source prefix-list $(@)\" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/tag/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/tag/node.def index 4f8aa922..89e352e3 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/match/tag/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/match/tag/node.def @@ -1,7 +1,7 @@ type: u32 help: "Match tag of route" syntax: $(@) >= 1 && $(@) <= 65535; "tag must be between 1 and 65535" -commit: $(../../action/); "You must specify an action for route-map $(../../../@) rule $(../../@)" +commit: $(../../action/) != ""; "You must specify an action for route-map $(../../../@) rule $(../../@)" update: "/usr/bin/vtysh -c \"configure terminal\" \ -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ -c \"match tag $(@)\" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/on-match/goto/node.def b/templates/policy/route-map/node.tag/rule/node.tag/on-match/goto/node.def index 2b8abb2d..deaa79b7 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/on-match/goto/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/on-match/goto/node.def @@ -1,11 +1,12 @@ type: u32 help: "Goto sequence number" -syntax: $(../next/) != ""; "you can set only goto or next" +# TODO - comparison doesn't work +#syntax: $(../next/) == ""; "you can set only goto or next" syntax: $(@) >= 1 && $(@) <= 65535; "tag must be between 1 and 65535" -commit: $(../../action/@); "You must specify an action for route-map $(../../../@) rule $(../../@)" +commit: $(../../action/) != ""; "You must specify an action for route-map $(../../../@) rule $(../../@)" update: "/usr/bin/vtysh -c \"configure terminal\" \ -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ -c \"on-match goto $(@)\" " delete: "/usr/bin/vtysh -c \"configure terminal\" \ -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ - -c \"no on-match goto $(@)\" " + -c \"no on-match goto \" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/on-match/next/node.def b/templates/policy/route-map/node.tag/rule/node.tag/on-match/next/node.def index c8e39ec8..839a5c37 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/on-match/next/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/on-match/next/node.def @@ -1,6 +1,7 @@ help: "Goto next sequence number" -syntax: $(../goto/) != ""; "you can set only goto or next" -commit: $(../../action/@); "You must specify an action for route-map $(../../../@) rule $(../../@)" +# TODO - comparison doesn't work +#syntax: $(../goto/) == ""; "you can set only goto or next" +commit: $(../../action/) != ""; "You must specify an action for route-map $(../../../@) rule $(../../@)" update: "/usr/bin/vtysh -c \"configure terminal\" \ -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ -c \"on-match next \" " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/ip/node.def b/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/ip/node.def index 1bfbe125..5cc75381 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/ip/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/ip/node.def @@ -1,3 +1,2 @@ type: ipv4 help: "IP address of aggregator" -syntax: $(@) >= 1 && $(@) <= 65535; "AS number must be between 1 and 65535" diff --git a/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/node.def b/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/node.def index 28a564a5..e32c3214 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/node.def @@ -1,16 +1,21 @@ help: "BGP aggregator attribute" -delete: "touch /tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID" +delete: "echo $(./as/@) $(./ip/@) > /tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID" end: "if [ -z \"$(./as/)\" ] || [ -z \"$(./ip/)\" ]; then \ echo You must configure as and ip ; \ exit 1 ; \ fi ; \ + if [ -f \"/tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID\" ]; then \ + as=\\$(cat /tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID); \ + else \ + as=\"$(./as/@) $(./ip/@)\"; \ + fi ; \ /usr/bin/vtysh -c \"configure terminal\" \ -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ - -c \"no set aggregator \" ; \ + -c \"no set aggregator as \\$as\" ; \ if [ -f \"/tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID\" ]; then \ rm -rf /tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID; \ else \ /usr/bin/vtysh -c \"configure terminal\" \ -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ - -c \"match community $(./as/@) $(./ip/@)\" ; \ + -c \"set aggregator as \\$as\" ; \ fi; " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/comm-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/comm-list/node.def index 9f61e27d..068c096c 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/comm-list/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/comm-list/node.def @@ -1,3 +1,3 @@ type: txt help: "Set BGP community list" -commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy community-list $(@)\"; "community list $(@) does not exist" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy community-list $(@)\""; "community list $(@) does not exist" diff --git a/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/node.def index a12707d8..c54c7fef 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/node.def @@ -11,9 +11,9 @@ end: "if [ -z \"$(./comm-list/)\" ]; then \ rm -rf /tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-comm-list.\\$PPID; \ else \ if [ -n \"$(./delete/)\" ]; then \ - COND=\"delete\" ; \ + cond=\"delete\" ; \ fi ; \ /usr/bin/vtysh -c \"configure terminal\" \ -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ - -c \"set comm-list $(./comm-list/@) \\$COND\" ; \ + -c \"set comm-list $(./comm-list/@) \\$cond\" ; \ fi; " diff --git a/templates/policy/route-map/node.tag/rule/node.tag/set/metric/node.def b/templates/policy/route-map/node.tag/rule/node.tag/set/metric/node.def index 392027e7..dd661452 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/set/metric/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/set/metric/node.def @@ -1,6 +1,6 @@ type: txt help: "Metric value for destination routing protocol" -syntax: exec "if [ -n `echo $(@) | sed 's/[+0123456789]*-*//g'` ]; then exit 1; fi; "; "metric must be an integer with an optional +/- prepend" +syntax: exec "if [ -n \"\\$(echo $(@) | sed 's/^[+-]*[0123456789]*//')\" ]; then exit 1; fi; "; "metric must be an integer with an optional +/- prepend" commit: $(../../action/) != ""; "You must specify an action for route-map $(../../../@) rule $(../../@)" update: "/usr/bin/vtysh -c \"configure terminal\" \ -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ |