From ebece7a4cdb942ea1ff7582ceda0f8765c329c9b Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 15 Apr 2021 09:02:23 +0200 Subject: policy: T2425: re-implement "policy" tree from vyatta-cfg-quagga in XML/Python --- .../include/policy-list-action.xml.i | 21 --- .../include/policy-list-description.xml.i | 11 -- .../include/policy-list-rule-description.xml.i | 11 -- interface-definitions/include/policy/action.xml.i | 21 +++ .../include/policy/description.xml.i | 11 ++ interface-definitions/include/policy/host.xml.i | 14 ++ .../include/policy/inverse-mask.xml.i | 14 ++ interface-definitions/include/policy/network.xml.i | 14 ++ interface-definitions/policy.xml.in | 162 ++++++--------------- 9 files changed, 121 insertions(+), 158 deletions(-) delete mode 100644 interface-definitions/include/policy-list-action.xml.i delete mode 100644 interface-definitions/include/policy-list-description.xml.i delete mode 100644 interface-definitions/include/policy-list-rule-description.xml.i create mode 100644 interface-definitions/include/policy/action.xml.i create mode 100644 interface-definitions/include/policy/description.xml.i create mode 100644 interface-definitions/include/policy/host.xml.i create mode 100644 interface-definitions/include/policy/inverse-mask.xml.i create mode 100644 interface-definitions/include/policy/network.xml.i (limited to 'interface-definitions') diff --git a/interface-definitions/include/policy-list-action.xml.i b/interface-definitions/include/policy-list-action.xml.i deleted file mode 100644 index fddbd5a98..000000000 --- a/interface-definitions/include/policy-list-action.xml.i +++ /dev/null @@ -1,21 +0,0 @@ - - - - Action to take on entries matching this rule [REQUIRED] - - permit deny - - - permit - Permit matching entries - - - deny - Deny matching entries - - - ^(permit|deny)$ - - - - diff --git a/interface-definitions/include/policy-list-description.xml.i b/interface-definitions/include/policy-list-description.xml.i deleted file mode 100644 index a50278729..000000000 --- a/interface-definitions/include/policy-list-description.xml.i +++ /dev/null @@ -1,11 +0,0 @@ - - - - Description for this policy - - txt - Description for this policy - - - - diff --git a/interface-definitions/include/policy-list-rule-description.xml.i b/interface-definitions/include/policy-list-rule-description.xml.i deleted file mode 100644 index e22fb7c28..000000000 --- a/interface-definitions/include/policy-list-rule-description.xml.i +++ /dev/null @@ -1,11 +0,0 @@ - - - - Description for this rule - - txt - Description for this rule - - - - diff --git a/interface-definitions/include/policy/action.xml.i b/interface-definitions/include/policy/action.xml.i new file mode 100644 index 000000000..fddbd5a98 --- /dev/null +++ b/interface-definitions/include/policy/action.xml.i @@ -0,0 +1,21 @@ + + + + Action to take on entries matching this rule [REQUIRED] + + permit deny + + + permit + Permit matching entries + + + deny + Deny matching entries + + + ^(permit|deny)$ + + + + diff --git a/interface-definitions/include/policy/description.xml.i b/interface-definitions/include/policy/description.xml.i new file mode 100644 index 000000000..15a77cd66 --- /dev/null +++ b/interface-definitions/include/policy/description.xml.i @@ -0,0 +1,11 @@ + + + + Description + + txt + Description + + + + diff --git a/interface-definitions/include/policy/host.xml.i b/interface-definitions/include/policy/host.xml.i new file mode 100644 index 000000000..ac017c630 --- /dev/null +++ b/interface-definitions/include/policy/host.xml.i @@ -0,0 +1,14 @@ + + + + Single host IP address to match + + ipv4 + Host address to match + + + + + + + diff --git a/interface-definitions/include/policy/inverse-mask.xml.i b/interface-definitions/include/policy/inverse-mask.xml.i new file mode 100644 index 000000000..cec69a81b --- /dev/null +++ b/interface-definitions/include/policy/inverse-mask.xml.i @@ -0,0 +1,14 @@ + + + + Network/netmask to match (requires network be defined) + + ipv4 + Inverse-mask to match + + + + + + + diff --git a/interface-definitions/include/policy/network.xml.i b/interface-definitions/include/policy/network.xml.i new file mode 100644 index 000000000..f2aea6be8 --- /dev/null +++ b/interface-definitions/include/policy/network.xml.i @@ -0,0 +1,14 @@ + + + + Network/netmask to match (requires inverse-mask be defined) + + ipv4net + Inverse-mask to match + + + + + + + diff --git a/interface-definitions/policy.xml.in b/interface-definitions/policy.xml.in index 7cf20d3de..3a769dea1 100644 --- a/interface-definitions/policy.xml.in +++ b/interface-definitions/policy.xml.in @@ -1,15 +1,15 @@ - - + + 470 Routing policy IP access-list filter - 470 + u32:1-99 IP standard access list @@ -28,7 +28,7 @@ - #include + #include Rule for this access-list @@ -41,8 +41,8 @@ - #include - #include + #include + #include Destination network or address @@ -54,42 +54,9 @@ - - - Single host IP address to match - - ipv4 - Host address to match - - - - - - - - - Network/netmask to match (requires network be defined) - - ipv4 - Inverse-mask to match - - - - - - - - - Network/netmask to match (requires inverse-mask be defined) - - ipv4net - Inverse-mask to match - - - - - - + #include + #include + #include @@ -103,42 +70,9 @@ - - - Single host IP address to match - - ipv4 - Host address to match - - - - - - - - - Network/netmask to match (requires network be defined) - - ipv4 - Inverse-mask to match - - - - - - - - - Network/netmask to match (requires inverse-mask be defined) - - ipv4net - Inverse-mask to match - - - - - - + #include + #include + #include @@ -148,14 +82,13 @@ IPv6 access-list filter - 470 txt Name of IPv6 access-list - #include + #include Rule for this access-list6 @@ -168,8 +101,8 @@ - #include - #include + #include + #include Source IPv6 network to match @@ -208,14 +141,13 @@ Border Gateway Protocol (BGP) autonomous system path filter - 470 txt AS path list name - #include + #include Rule for this as-path-list @@ -228,8 +160,8 @@ - #include - #include + #include + #include Regular expression to match against an AS path @@ -246,14 +178,13 @@ Border Gateway Protocol (BGP) autonomous system path filter - 470 txt Border Gateway Protocol (BGP) community-list filter - #include + #include Rule for this BGP community list @@ -266,8 +197,8 @@ - #include - #include + #include + #include Regular expression to match against a community list @@ -291,7 +222,7 @@ - #include + #include Rule for this BGP extended community list @@ -304,8 +235,8 @@ - #include - #include + #include + #include Regular expression to match against an extended community list @@ -330,14 +261,13 @@ Border Gateway Protocol (BGP) large-community-list filter - 470 txt Border Gateway Protocol (BGP) large-community-list filter - #include + #include Rule for this BGP extended community list @@ -350,8 +280,8 @@ - #include - #include + #include + #include Regular expression to match against a large community list @@ -368,14 +298,13 @@ IP prefix-list filter - 470 txt Prefix list name - #include + #include Rule for this prefix-list @@ -388,8 +317,8 @@ - #include - #include + #include + #include Prefix length to match a netmask greater than or equal to it @@ -433,14 +362,13 @@ IPv6 prefix-list filter - 470 txt Prefix list name - #include + #include Rule for this prefix-list6 @@ -453,8 +381,8 @@ - #include - #include + #include + #include Prefix length to match a netmask greater than or equal to it @@ -498,14 +426,17 @@ IP route-map - 470 txt Route map name + + ^[-a-zA-Z0-9.]+$ + + Route-map name can only contain alpha-numeric letters and a hyphen - #include + #include Rule for this route-map @@ -518,7 +449,7 @@ - #include + #include Call another route-map on match @@ -540,7 +471,7 @@ - #include + #include Route parameters to match @@ -759,11 +690,11 @@ IPv6 next-hop of route to match - ipv4 - Peer IP address + ipv6 + Nexthop IPv6 address - + @@ -962,6 +893,7 @@ Border Gateway Protocol (BGP) atomic aggregate attribute + @@ -1198,7 +1130,7 @@ Orignator IP address - + @@ -1214,8 +1146,8 @@ IPv6 address - - + + -- cgit v1.2.3