From 569a97fc0e9fd4a729cca5a36cc2bdba066d7356 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 21 Oct 2018 22:06:29 +0200 Subject: T64: fix and revamp the broken extcommunity-list commands. --- templates/policy/extcommunity-list/expanded/description/node.def | 2 -- templates/policy/extcommunity-list/expanded/node.def | 8 -------- templates/policy/extcommunity-list/expanded/rule/node.def | 6 ------ .../extcommunity-list/expanded/rule/node.tag/action/node.def | 6 ------ .../expanded/rule/node.tag/description/node.def | 2 -- .../extcommunity-list/expanded/rule/node.tag/regex/node.def | 5 ----- templates/policy/extcommunity-list/node.def | 9 +++++---- templates/policy/extcommunity-list/node.tag/description/node.def | 2 ++ templates/policy/extcommunity-list/node.tag/rule/node.def | 6 ++++++ .../extcommunity-list/node.tag/rule/node.tag/action/node.def | 6 ++++++ .../node.tag/rule/node.tag/description/node.def | 2 ++ .../extcommunity-list/node.tag/rule/node.tag/regex/node.def | 5 +++++ templates/policy/extcommunity-list/standard/description/node.def | 2 -- templates/policy/extcommunity-list/standard/node.def | 8 -------- templates/policy/extcommunity-list/standard/rule/node.def | 6 ------ .../extcommunity-list/standard/rule/node.tag/action/node.def | 6 ------ .../standard/rule/node.tag/description/node.def | 2 -- .../extcommunity-list/standard/rule/node.tag/regex/node.def | 7 ------- 18 files changed, 26 insertions(+), 64 deletions(-) delete mode 100644 templates/policy/extcommunity-list/expanded/description/node.def delete mode 100644 templates/policy/extcommunity-list/expanded/node.def delete mode 100644 templates/policy/extcommunity-list/expanded/rule/node.def delete mode 100644 templates/policy/extcommunity-list/expanded/rule/node.tag/action/node.def delete mode 100644 templates/policy/extcommunity-list/expanded/rule/node.tag/description/node.def delete mode 100644 templates/policy/extcommunity-list/expanded/rule/node.tag/regex/node.def create mode 100644 templates/policy/extcommunity-list/node.tag/description/node.def create mode 100644 templates/policy/extcommunity-list/node.tag/rule/node.def create mode 100644 templates/policy/extcommunity-list/node.tag/rule/node.tag/action/node.def create mode 100644 templates/policy/extcommunity-list/node.tag/rule/node.tag/description/node.def create mode 100644 templates/policy/extcommunity-list/node.tag/rule/node.tag/regex/node.def delete mode 100644 templates/policy/extcommunity-list/standard/description/node.def delete mode 100644 templates/policy/extcommunity-list/standard/node.def delete mode 100644 templates/policy/extcommunity-list/standard/rule/node.def delete mode 100644 templates/policy/extcommunity-list/standard/rule/node.tag/action/node.def delete mode 100644 templates/policy/extcommunity-list/standard/rule/node.tag/description/node.def delete mode 100644 templates/policy/extcommunity-list/standard/rule/node.tag/regex/node.def (limited to 'templates') diff --git a/templates/policy/extcommunity-list/expanded/description/node.def b/templates/policy/extcommunity-list/expanded/description/node.def deleted file mode 100644 index 7a660be4..00000000 --- a/templates/policy/extcommunity-list/expanded/description/node.def +++ /dev/null @@ -1,2 +0,0 @@ -type: txt -help: Description for this community list diff --git a/templates/policy/extcommunity-list/expanded/node.def b/templates/policy/extcommunity-list/expanded/node.def deleted file mode 100644 index 95f6f003..00000000 --- a/templates/policy/extcommunity-list/expanded/node.def +++ /dev/null @@ -1,8 +0,0 @@ -tag: -priority: 490 -type: txt -help: Border Gateway Protocol (BGP) extended community-list filter - -syntax:expression: pattern $VAR(@) "^[a-zA-Z0-9]+$" ; "Should be alphanumeric name" - -end: /opt/vyatta/sbin/vyatta-policy.pl --update-community-list expanded $VAR(@) diff --git a/templates/policy/extcommunity-list/expanded/rule/node.def b/templates/policy/extcommunity-list/expanded/rule/node.def deleted file mode 100644 index 7826f33d..00000000 --- a/templates/policy/extcommunity-list/expanded/rule/node.def +++ /dev/null @@ -1,6 +0,0 @@ -tag: -type: u32 -help: create a rule for this BGP extended community list -val_help: u32:1-65535; Extended community-list rule number - -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "rule number must be between 1 and 65535" diff --git a/templates/policy/extcommunity-list/expanded/rule/node.tag/action/node.def b/templates/policy/extcommunity-list/expanded/rule/node.tag/action/node.def deleted file mode 100644 index db4bdbc6..00000000 --- a/templates/policy/extcommunity-list/expanded/rule/node.tag/action/node.def +++ /dev/null @@ -1,6 +0,0 @@ -type: txt -help: Action to take on routes matching this rule [REQUIRED] -val_help: permit; Permit matching routes -val_help: deny; Deny matching routes - -syntax:expression: $VAR(@) in "permit", "deny"; "action must be permit or deny" diff --git a/templates/policy/extcommunity-list/expanded/rule/node.tag/description/node.def b/templates/policy/extcommunity-list/expanded/rule/node.tag/description/node.def deleted file mode 100644 index b8e3095b..00000000 --- a/templates/policy/extcommunity-list/expanded/rule/node.tag/description/node.def +++ /dev/null @@ -1,2 +0,0 @@ -type: txt -help: Description for this rule diff --git a/templates/policy/extcommunity-list/expanded/rule/node.tag/regex/node.def b/templates/policy/extcommunity-list/expanded/rule/node.tag/regex/node.def deleted file mode 100644 index fae3784c..00000000 --- a/templates/policy/extcommunity-list/expanded/rule/node.tag/regex/node.def +++ /dev/null @@ -1,5 +0,0 @@ -type: txt -help: Extended community regexp. -val_help: Extended community list regular expression - -commit:expression: $VAR(../action/@) != ""; "You must specify an action" diff --git a/templates/policy/extcommunity-list/node.def b/templates/policy/extcommunity-list/node.def index 9676146c..fee4c402 100644 --- a/templates/policy/extcommunity-list/node.def +++ b/templates/policy/extcommunity-list/node.def @@ -1,7 +1,8 @@ tag: -priority: 480 +priority: 490 type: txt -help: Border Gateway Protocol (BGP) extended communities attribute. Usefull for implementing network policy for MPLS VPN/BGP by restricting routes according to their Route Target or Site of Origin. -val_help: Type of extended community. standard or expanded. +help: Border Gateway Protocol (BGP) extended community-list filter -syntax:expression: pattern $VAR(@) "^standard|expanded$" ; "Should be either standard or expanded" +syntax:expression: pattern $VAR(@) "^[a-zA-Z0-9]+$" ; "Should be alphanumeric name" + +end: /opt/vyatta/sbin/vyatta-policy.pl --update-extcommunity-list $VAR(@) diff --git a/templates/policy/extcommunity-list/node.tag/description/node.def b/templates/policy/extcommunity-list/node.tag/description/node.def new file mode 100644 index 00000000..7a660be4 --- /dev/null +++ b/templates/policy/extcommunity-list/node.tag/description/node.def @@ -0,0 +1,2 @@ +type: txt +help: Description for this community list diff --git a/templates/policy/extcommunity-list/node.tag/rule/node.def b/templates/policy/extcommunity-list/node.tag/rule/node.def new file mode 100644 index 00000000..7826f33d --- /dev/null +++ b/templates/policy/extcommunity-list/node.tag/rule/node.def @@ -0,0 +1,6 @@ +tag: +type: u32 +help: create a rule for this BGP extended community list +val_help: u32:1-65535; Extended community-list rule number + +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "rule number must be between 1 and 65535" diff --git a/templates/policy/extcommunity-list/node.tag/rule/node.tag/action/node.def b/templates/policy/extcommunity-list/node.tag/rule/node.tag/action/node.def new file mode 100644 index 00000000..db4bdbc6 --- /dev/null +++ b/templates/policy/extcommunity-list/node.tag/rule/node.tag/action/node.def @@ -0,0 +1,6 @@ +type: txt +help: Action to take on routes matching this rule [REQUIRED] +val_help: permit; Permit matching routes +val_help: deny; Deny matching routes + +syntax:expression: $VAR(@) in "permit", "deny"; "action must be permit or deny" diff --git a/templates/policy/extcommunity-list/node.tag/rule/node.tag/description/node.def b/templates/policy/extcommunity-list/node.tag/rule/node.tag/description/node.def new file mode 100644 index 00000000..b8e3095b --- /dev/null +++ b/templates/policy/extcommunity-list/node.tag/rule/node.tag/description/node.def @@ -0,0 +1,2 @@ +type: txt +help: Description for this rule diff --git a/templates/policy/extcommunity-list/node.tag/rule/node.tag/regex/node.def b/templates/policy/extcommunity-list/node.tag/rule/node.tag/regex/node.def new file mode 100644 index 00000000..fae3784c --- /dev/null +++ b/templates/policy/extcommunity-list/node.tag/rule/node.tag/regex/node.def @@ -0,0 +1,5 @@ +type: txt +help: Extended community regexp. +val_help: Extended community list regular expression + +commit:expression: $VAR(../action/@) != ""; "You must specify an action" diff --git a/templates/policy/extcommunity-list/standard/description/node.def b/templates/policy/extcommunity-list/standard/description/node.def deleted file mode 100644 index 7a660be4..00000000 --- a/templates/policy/extcommunity-list/standard/description/node.def +++ /dev/null @@ -1,2 +0,0 @@ -type: txt -help: Description for this community list diff --git a/templates/policy/extcommunity-list/standard/node.def b/templates/policy/extcommunity-list/standard/node.def deleted file mode 100644 index aec1edcd..00000000 --- a/templates/policy/extcommunity-list/standard/node.def +++ /dev/null @@ -1,8 +0,0 @@ -tag: -priority: 485 -type: txt -help: Border Gateway Protocol (BGP) extended community-list filter - -syntax:expression: pattern $VAR(@) "^[a-zA-Z0-9]+$" ; "Should be alphanumeric name" - -end: /opt/vyatta/sbin/vyatta-policy.pl --update-community-list standard $VAR(@) diff --git a/templates/policy/extcommunity-list/standard/rule/node.def b/templates/policy/extcommunity-list/standard/rule/node.def deleted file mode 100644 index 7826f33d..00000000 --- a/templates/policy/extcommunity-list/standard/rule/node.def +++ /dev/null @@ -1,6 +0,0 @@ -tag: -type: u32 -help: create a rule for this BGP extended community list -val_help: u32:1-65535; Extended community-list rule number - -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "rule number must be between 1 and 65535" diff --git a/templates/policy/extcommunity-list/standard/rule/node.tag/action/node.def b/templates/policy/extcommunity-list/standard/rule/node.tag/action/node.def deleted file mode 100644 index db4bdbc6..00000000 --- a/templates/policy/extcommunity-list/standard/rule/node.tag/action/node.def +++ /dev/null @@ -1,6 +0,0 @@ -type: txt -help: Action to take on routes matching this rule [REQUIRED] -val_help: permit; Permit matching routes -val_help: deny; Deny matching routes - -syntax:expression: $VAR(@) in "permit", "deny"; "action must be permit or deny" diff --git a/templates/policy/extcommunity-list/standard/rule/node.tag/description/node.def b/templates/policy/extcommunity-list/standard/rule/node.tag/description/node.def deleted file mode 100644 index b8e3095b..00000000 --- a/templates/policy/extcommunity-list/standard/rule/node.tag/description/node.def +++ /dev/null @@ -1,2 +0,0 @@ -type: txt -help: Description for this rule diff --git a/templates/policy/extcommunity-list/standard/rule/node.tag/regex/node.def b/templates/policy/extcommunity-list/standard/rule/node.tag/regex/node.def deleted file mode 100644 index 36dd9954..00000000 --- a/templates/policy/extcommunity-list/standard/rule/node.tag/regex/node.def +++ /dev/null @@ -1,7 +0,0 @@ -type: txt -help: Extended community value. Should be either AS:VAL or IP-Address:VAL -val_help: Community list regular expression - -syntax:expression: pattern $VAR(@) "^([0-9]*)|([0-9]{1-3}\.[0-9]{1-3}\.[0-9]{1-3}\.[0-9]{1-3}):[0-9]*$" - -commit:expression: $VAR(../action/@) != ""; "You must specify an action" -- cgit v1.2.3