summaryrefslogtreecommitdiff
path: root/interface-definitions
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-02-05 23:10:59 +0100
committerChristian Poessinger <christian@poessinger.com>2021-02-05 23:10:59 +0100
commitd7a84dc144951f698ae17111ed50d6dbd2f65fe7 (patch)
tree3d1998a19ed20625d14335e817e55808c7ee3bf0 /interface-definitions
parentf55fe07dc1894e22eda522d65cb4b1364da16c38 (diff)
parent96d51fa69fbe072fe5c9e8efd4fa6a89d8a2771a (diff)
downloadvyos-1x-d7a84dc144951f698ae17111ed50d6dbd2f65fe7.tar.gz
vyos-1x-d7a84dc144951f698ae17111ed50d6dbd2f65fe7.zip
Merge branch 't2450-vrf' of github.com:c-po/vyos-1x into current
* 't2450-vrf' of github.com:c-po/vyos-1x: xml: add new common "interface-name" validator xml: include: accel: add missing file include comments smoketest: static: improve static route testing route: static: T2450: provide full protocol support in XML and Python with new CLI vrf: T2450: provide full protocol support in XML and Python with new CLI migrator: ospf: T3267: cleanup empty interface "ip" nodes
Diffstat (limited to 'interface-definitions')
-rw-r--r--interface-definitions/include/accel-radius-additions-disable-accounting.xlm.in3
-rw-r--r--interface-definitions/include/bgp-update-source.xml.i2
-rw-r--r--interface-definitions/include/static-route-blackhole.xml.i10
-rw-r--r--interface-definitions/include/static-route-disable.xml.i8
-rw-r--r--interface-definitions/include/static-route-interface.xml.i17
-rw-r--r--interface-definitions/include/static-route-vrf.xml.i (renamed from interface-definitions/include/static-route-next-hop-vrf.xml.i)14
-rw-r--r--interface-definitions/include/static-route.xml.i75
-rw-r--r--interface-definitions/include/static-route6.xml.i75
-rw-r--r--interface-definitions/protocols-bgp.xml.in2
-rw-r--r--interface-definitions/protocols-multicast.xml.in1
-rw-r--r--interface-definitions/protocols-ospf.xml.in5
-rw-r--r--interface-definitions/protocols-ospfv3.xml.in2
-rw-r--r--interface-definitions/protocols-static-arp.xml.in (renamed from interface-definitions/arp.xml.in)2
-rw-r--r--interface-definitions/protocols-static.xml.in341
-rw-r--r--interface-definitions/protocols-vrf.xml.in347
-rw-r--r--interface-definitions/vrf.xml.in2
16 files changed, 212 insertions, 694 deletions
diff --git a/interface-definitions/include/accel-radius-additions-disable-accounting.xlm.in b/interface-definitions/include/accel-radius-additions-disable-accounting.xlm.in
index 026f67453..0b5797483 100644
--- a/interface-definitions/include/accel-radius-additions-disable-accounting.xlm.in
+++ b/interface-definitions/include/accel-radius-additions-disable-accounting.xlm.in
@@ -1,7 +1,8 @@
+<!-- included start from accel-radius-additions-disable-accounting.xlm.in -->
<leafNode name="disable-accounting">
<properties>
<help>Disable accounting</help>
<valueless/>
</properties>
</leafNode>
-
+<!-- included end -->
diff --git a/interface-definitions/include/bgp-update-source.xml.i b/interface-definitions/include/bgp-update-source.xml.i
index c1db2e2c1..a8b212720 100644
--- a/interface-definitions/include/bgp-update-source.xml.i
+++ b/interface-definitions/include/bgp-update-source.xml.i
@@ -21,7 +21,7 @@
<constraint>
<validator name="ipv4-address"/>
<validator name="ipv6-address"/>
- <regex>^(br|bond|dum|en|eth|gnv|peth|tun|vti|vxlan|wg|wlan)[0-9]+|lo$</regex>
+ <validator name="interface-name"/>
</constraint>
</properties>
</leafNode>
diff --git a/interface-definitions/include/static-route-blackhole.xml.i b/interface-definitions/include/static-route-blackhole.xml.i
new file mode 100644
index 000000000..c880ee778
--- /dev/null
+++ b/interface-definitions/include/static-route-blackhole.xml.i
@@ -0,0 +1,10 @@
+<!-- included start from static-route-blackhole.xml.i -->
+<node name="blackhole">
+ <properties>
+ <help>Silently discard packets when matched</help>
+ </properties>
+ <children>
+ #include <include/static-route-distance.xml.i>
+ </children>
+</node>
+<!-- included end -->
diff --git a/interface-definitions/include/static-route-disable.xml.i b/interface-definitions/include/static-route-disable.xml.i
deleted file mode 100644
index 100ca3cbf..000000000
--- a/interface-definitions/include/static-route-disable.xml.i
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- included start from static-route-disable.xml.i.xml.i -->
-<leafNode name="disable">
- <properties>
- <help>Disable interface static route</help>
- <valueless/>
- </properties>
-</leafNode>
-<!-- included end -->
diff --git a/interface-definitions/include/static-route-interface.xml.i b/interface-definitions/include/static-route-interface.xml.i
new file mode 100644
index 000000000..0f10837df
--- /dev/null
+++ b/interface-definitions/include/static-route-interface.xml.i
@@ -0,0 +1,17 @@
+<!-- included start from static-route-interface.xml.i -->
+<leafNode name="interface">
+ <properties>
+ <help>Gateway interface name</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py</script>
+ </completionHelp>
+ <valueHelp>
+ <format>txt</format>
+ <description>Gateway interface name</description>
+ </valueHelp>
+ <constraint>
+ <validator name="interface-name"/>
+ </constraint>
+ </properties>
+</leafNode>
+<!-- included end -->
diff --git a/interface-definitions/include/static-route-next-hop-vrf.xml.i b/interface-definitions/include/static-route-vrf.xml.i
index c90140856..70f8b0be8 100644
--- a/interface-definitions/include/static-route-next-hop-vrf.xml.i
+++ b/interface-definitions/include/static-route-vrf.xml.i
@@ -1,16 +1,18 @@
-<!-- included start from static-route-next-hop-vrf.xml.i -->
-<leafNode name="next-hop-vrf">
+<!-- included start from static-route-vrf.xml.i -->
+<leafNode name="vrf">
<properties>
<help>VRF to leak route</help>
+ <completionHelp>
+ <list>default</list>
+ <path>vrf name</path>
+ </completionHelp>
<valueHelp>
<format>txt</format>
<description>Name of VRF to leak to</description>
</valueHelp>
- <completionHelp>
- <path>protocols vrf</path>
- </completionHelp>
<constraint>
- <regex>^[a-zA-Z0-9\-_]{1,100}$</regex>
+ <regex>^(default)$</regex>
+ <validator name="vrf-name"/>
</constraint>
</properties>
</leafNode>
diff --git a/interface-definitions/include/static-route.xml.i b/interface-definitions/include/static-route.xml.i
new file mode 100644
index 000000000..6225025ca
--- /dev/null
+++ b/interface-definitions/include/static-route.xml.i
@@ -0,0 +1,75 @@
+<!-- included start from static-route.xml.i -->
+<tagNode name="route">
+ <properties>
+ <help>VRF static IPv4 route</help>
+ <valueHelp>
+ <format>ipv4net</format>
+ <description>IPv4 static route</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv4-prefix"/>
+ </constraint>
+ </properties>
+ <children>
+ <node name="blackhole">
+ <properties>
+ <help>Silently discard pkts when matched</help>
+ </properties>
+ <children>
+ #include <include/static-route-distance.xml.i>
+ <leafNode name="tag">
+ <properties>
+ <help>Tag value for this route</help>
+ <valueHelp>
+ <format>u32:1-4294967295</format>
+ <description>Tag value for this route</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-4294967295"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ <tagNode name="interface">
+ <properties>
+ <help>Next-hop IPv4 router interface</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py</script>
+ </completionHelp>
+ <valueHelp>
+ <format>txt</format>
+ <description>Gateway interface name</description>
+ </valueHelp>
+ <constraint>
+ <validator name="interface-name"/>
+ </constraint>
+ </properties>
+ <children>
+ #include <include/generic-disable-node.xml.i>
+ #include <include/static-route-distance.xml.i>
+ #include <include/static-route-vrf.xml.i>
+ </children>
+ </tagNode>
+ <tagNode name="next-hop">
+ <properties>
+ <help>Next-hop IPv4 router address</help>
+ <valueHelp>
+ <format>ipv4</format>
+ <description>Next-hop router address</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv4-address"/>
+ </constraint>
+ </properties>
+ <children>
+ #include <include/generic-disable-node.xml.i>
+ #include <include/static-route-distance.xml.i>
+ #include <include/static-route-interface.xml.i>
+ #include <include/static-route-vrf.xml.i>
+ </children>
+ </tagNode>
+ </children>
+</tagNode>
+<!-- included end -->
+
diff --git a/interface-definitions/include/static-route6.xml.i b/interface-definitions/include/static-route6.xml.i
new file mode 100644
index 000000000..25d4d22a2
--- /dev/null
+++ b/interface-definitions/include/static-route6.xml.i
@@ -0,0 +1,75 @@
+<!-- included start from static-route6.xml.i -->
+<tagNode name="route6">
+ <properties>
+ <help>VRF static IPv6 route</help>
+ <valueHelp>
+ <format>ipv6net</format>
+ <description>IPv6 static route</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv6-prefix"/>
+ </constraint>
+ </properties>
+ <children>
+ <node name="blackhole">
+ <properties>
+ <help>Silently discard pkts when matched</help>
+ </properties>
+ <children>
+ #include <include/static-route-distance.xml.i>
+ <leafNode name="tag">
+ <properties>
+ <help>Tag value for this route</help>
+ <valueHelp>
+ <format>u32:1-4294967295</format>
+ <description>Tag value for this route</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-4294967295"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ <tagNode name="interface">
+ <properties>
+ <help>IPv6 gateway interface name</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py</script>
+ </completionHelp>
+ <valueHelp>
+ <format>txt</format>
+ <description>Gateway interface name</description>
+ </valueHelp>
+ <constraint>
+ <validator name="interface-name"/>
+ </constraint>
+ </properties>
+ <children>
+ #include <include/generic-disable-node.xml.i>
+ #include <include/static-route-distance.xml.i>
+ #include <include/static-route-vrf.xml.i>
+ </children>
+ </tagNode>
+ <tagNode name="next-hop">
+ <properties>
+ <help>IPv6 gateway address</help>
+ <valueHelp>
+ <format>ipv6</format>
+ <description>Next-hop IPv6 router</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv6-address"/>
+ </constraint>
+ </properties>
+ <children>
+ #include <include/generic-disable-node.xml.i>
+ #include <include/static-route-distance.xml.i>
+ #include <include/static-route-interface.xml.i>
+ #include <include/static-route-vrf.xml.i>
+ </children>
+ </tagNode>
+ </children>
+</tagNode>
+<!-- included end -->
+
diff --git a/interface-definitions/protocols-bgp.xml.in b/interface-definitions/protocols-bgp.xml.in
index 3edacb0ca..e5122fe8d 100644
--- a/interface-definitions/protocols-bgp.xml.in
+++ b/interface-definitions/protocols-bgp.xml.in
@@ -307,7 +307,7 @@
<constraint>
<validator name="ipv4-address"/>
<validator name="ipv6-address"/>
- <regex>^(br|bond|dum|en|eth|gnv|peth|tun|vti|vxlan|wg|wlan)[0-9]+|lo$</regex>
+ <validator name="interface-name"/>
</constraint>
</properties>
<children>
diff --git a/interface-definitions/protocols-multicast.xml.in b/interface-definitions/protocols-multicast.xml.in
index a06f2b287..bf0ead78f 100644
--- a/interface-definitions/protocols-multicast.xml.in
+++ b/interface-definitions/protocols-multicast.xml.in
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-<!-- Multicast static routing configuration -->
<interfaceDefinition>
<node name="protocols">
<children>
diff --git a/interface-definitions/protocols-ospf.xml.in b/interface-definitions/protocols-ospf.xml.in
index 7a5cef6ef..ca848c289 100644
--- a/interface-definitions/protocols-ospf.xml.in
+++ b/interface-definitions/protocols-ospf.xml.in
@@ -697,7 +697,8 @@
<description>Default to suppress routing updates on all interfaces</description>
</valueHelp>
<constraint>
- <regex>^(br|bond|dum|en|eth|gnv|peth|tun|vti|vxlan|wg|wlan)[0-9]+|lo|default$</regex>
+ <regex>^(default)$</regex>
+ <validator name="interface-name"/>
</constraint>
<multi/>
</properties>
@@ -713,7 +714,7 @@
<description>Interface to be passive (i.e. suppress routing updates)</description>
</valueHelp>
<constraint>
- <regex>^(br|bond|dum|en|eth|gnv|peth|tun|vti|vxlan|wg|wlan)[0-9]+|lo$</regex>
+ <validator name="interface-name"/>
</constraint>
<multi/>
</properties>
diff --git a/interface-definitions/protocols-ospfv3.xml.in b/interface-definitions/protocols-ospfv3.xml.in
index 7f80f9f9d..bd6a55b45 100644
--- a/interface-definitions/protocols-ospfv3.xml.in
+++ b/interface-definitions/protocols-ospfv3.xml.in
@@ -52,7 +52,7 @@
<description>Interface used for routing information exchange</description>
</valueHelp>
<constraint>
- <regex>^(br|bond|dum|en|eth|gnv|peth|tun|vti|vxlan|wg|wlan)[0-9]+|lo$</regex>
+ <validator name="interface-name"/>
</constraint>
<multi/>
</properties>
diff --git a/interface-definitions/arp.xml.in b/interface-definitions/protocols-static-arp.xml.in
index 082afe00f..e5e8a9ad9 100644
--- a/interface-definitions/arp.xml.in
+++ b/interface-definitions/protocols-static-arp.xml.in
@@ -18,7 +18,7 @@
<children>
<leafNode name="hwaddr">
<properties>
- <help>mac address to translate to</help>
+ <help>Translation MAC address</help>
<valueHelp>
<format>macaddr</format>
<description>Hardware (MAC) address</description>
diff --git a/interface-definitions/protocols-static.xml.in b/interface-definitions/protocols-static.xml.in
index 2a9f7014f..59a7927a5 100644
--- a/interface-definitions/protocols-static.xml.in
+++ b/interface-definitions/protocols-static.xml.in
@@ -1,193 +1,15 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Protocol STATIC configuration -->
+<?xml version="1.0"?>
<interfaceDefinition>
<node name="protocols">
<children>
- <node name="nstatic" owner="${vyos_conf_scripts_dir}/protocols_static.py">
+ <node name="static" owner="${vyos_conf_scripts_dir}/protocols_static.py">
<properties>
<help>Static route parameters</help>
</properties>
<children>
- <tagNode name="interface-route">
- <properties>
- <help>Interface based static route</help>
- <valueHelp>
- <format>ipv4net</format>
- <description>Interface based static route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv4-prefix"/>
- </constraint>
- </properties>
- <children>
- <tagNode name="next-hop-interface">
- <properties>
- <help>Next-hop interface [REQUIRED]</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- </properties>
- <children>
- #include <include/static-route-disable.xml.i>
- #include <include/static-route-distance.xml.i>
- #include <include/static-route-next-hop-vrf.xml.i>
- </children>
- </tagNode>
- </children>
- </tagNode>
- <tagNode name="interface-route6">
- <properties>
- <help>Interface based IPv6 static route</help>
- <valueHelp>
- <format>ipv6net</format>
- <description>Interface based IPv6 static route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv6-prefix"/>
- </constraint>
- </properties>
- <children>
- <tagNode name="next-hop-interface">
- <properties>
- <help>Next-hop interface [REQUIRED]</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- </properties>
- <children>
- #include <include/static-route-disable.xml.i>
- #include <include/static-route-distance.xml.i>
- </children>
- </tagNode>
- </children>
- </tagNode>
#include <include/static-route-map.xml.i>
- <tagNode name="route">
- <properties>
- <help>Static route</help>
- <valueHelp>
- <format>ipv4net</format>
- <description>Static route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv4-prefix"/>
- </constraint>
- </properties>
- <children>
- <node name="blackhole">
- <properties>
- <help>Silently discard pkts when matched</help>
- </properties>
- <children>
- #include <include/static-route-distance.xml.i>
- <leafNode name="tag">
- <properties>
- <help>Tag value for this route</help>
- <valueHelp>
- <format>u32:1-4294967295</format>
- <description>Tag value for this route</description>
- </valueHelp>
- <constraint>
- <validator name="numeric" argument="--range 1-4294967295"/>
- </constraint>
- </properties>
- </leafNode>
- </children>
- </node>
- <leafNode name="dhcp-interface">
- <properties>
- <help>DHCP interface that supplies the next-hop IP address for this static route</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- <valueHelp>
- <format>txt</format>
- <description>DHCP interface</description>
- </valueHelp>
- </properties>
- </leafNode>
- <tagNode name="next-hop">
- <properties>
- <help>Next-hop router</help>
- <valueHelp>
- <format>ipv4</format>
- <description>Next-hop router</description>
- </valueHelp>
- <constraint>
- <validator name="ipv4-address"/>
- </constraint>
- </properties>
- <children>
- #include <include/static-route-disable.xml.i>
- #include <include/static-route-distance.xml.i>
- <leafNode name="next-hop-interface">
- <properties>
- <help>IPv4 gateway interface name</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- <valueHelp>
- <format>txt</format>
- <description>IPv4 gateway interface name</description>
- </valueHelp>
- </properties>
- </leafNode>
- #include <include/static-route-next-hop-vrf.xml.i>
- </children>
- </tagNode>
- </children>
- </tagNode>
- <tagNode name="route6">
- <properties>
- <help>Static IPv6 route</help>
- <valueHelp>
- <format>ipv6net</format>
- <description>Static IPv6 route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv6-prefix"/>
- </constraint>
- </properties>
- <children>
- <node name="blackhole">
- <properties>
- <help>Silently discard pkts when matched</help>
- </properties>
- <children>
- #include <include/static-route-distance.xml.i>
- </children>
- </node>
- <tagNode name="next-hop">
- <properties>
- <help>Next-hop IPv6 router [REQUIRED]</help>
- <valueHelp>
- <format>ipv6</format>
- <description>Next-hop IPv6 router [REQUIRED]</description>
- </valueHelp>
- <constraint>
- <validator name="ipv6-address"/>
- </constraint>
- </properties>
- <children>
- #include <include/static-route-disable.xml.i>
- #include <include/static-route-distance.xml.i>
- <leafNode name="interface">
- <properties>
- <help>IPv6 gateway interface name</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- <valueHelp>
- <format>txt</format>
- <description>IPv6 gateway interface name</description>
- </valueHelp>
- </properties>
- </leafNode>
- #include <include/static-route-next-hop-vrf.xml.i>
- </children>
- </tagNode>
- </children>
- </tagNode>
+ #include <include/static-route.xml.i>
+ #include <include/static-route6.xml.i>
<tagNode name="table">
<properties>
<help>Policy route table number</help>
@@ -200,159 +22,8 @@
</constraint>
</properties>
<children>
- <tagNode name="interface-route">
- <properties>
- <help>Interface based static route</help>
- <valueHelp>
- <format>ipv4net</format>
- <description>Interface based static route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv4-prefix"/>
- </constraint>
- </properties>
- <children>
- <tagNode name="next-hop-interface">
- <properties>
- <help>Next-hop interface [REQUIRED]</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- </properties>
- <children>
- #include <include/static-route-disable.xml.i>
- #include <include/static-route-distance.xml.i>
- </children>
- </tagNode>
- </children>
- </tagNode>
- <tagNode name="interface-route6">
- <properties>
- <help>Interface based IPv6 static route</help>
- <valueHelp>
- <format>ipv6net</format>
- <description>Interface based IPv6 static route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv6-prefix"/>
- </constraint>
- </properties>
- <children>
- <tagNode name="next-hop-interface">
- <properties>
- <help>Next-hop interface [REQUIRED]</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- </properties>
- <children>
- #include <include/static-route-disable.xml.i>
- #include <include/static-route-distance.xml.i>
- </children>
- </tagNode>
- </children>
- </tagNode>
- <tagNode name="route">
- <properties>
- <help>Static route</help>
- <valueHelp>
- <format>ipv4net</format>
- <description>Static route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv4-prefix"/>
- </constraint>
- </properties>
- <children>
- <node name="blackhole">
- <properties>
- <help>Silently discard pkts when matched</help>
- </properties>
- <children>
- #include <include/static-route-distance.xml.i>
- </children>
- </node>
- <leafNode name="dhcp-interface">
- <properties>
- <help>DHCP interface that supplies the next-hop IP address for this static route</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- <valueHelp>
- <format>txt</format>
- <description>DHCP interface</description>
- </valueHelp>
- </properties>
- </leafNode>
- <tagNode name="next-hop">
- <properties>
- <help>Next-hop router</help>
- <valueHelp>
- <format>ipv4</format>
- <description>Next-hop router</description>
- </valueHelp>
- <constraint>
- <validator name="ipv4-address"/>
- </constraint>
- </properties>
- <children>
- #include <include/static-route-disable.xml.i>
- #include <include/static-route-distance.xml.i>
- <leafNode name="next-hop-interface">
- <properties>
- <help>IPv4 gateway interface name</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- <valueHelp>
- <format>txt</format>
- <description>IPv4 gateway interface name</description>
- </valueHelp>
- </properties>
- </leafNode>
- #include <include/static-route-next-hop-vrf.xml.i>
- </children>
- </tagNode>
- </children>
- </tagNode>
- <tagNode name="route6">
- <properties>
- <help>Static IPv6 route</help>
- <valueHelp>
- <format>ipv6net</format>
- <description>Static IPv6 route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv6-prefix"/>
- </constraint>
- </properties>
- <children>
- <node name="blackhole">
- <properties>
- <help>Silently discard pkts when matched</help>
- </properties>
- <children>
- #include <include/static-route-distance.xml.i>
- </children>
- </node>
- <tagNode name="next-hop">
- <properties>
- <help>Next-hop IPv6 router [REQUIRED]</help>
- <valueHelp>
- <format>ipv6</format>
- <description>Next-hop IPv6 router [REQUIRED]</description>
- </valueHelp>
- <constraint>
- <validator name="ipv6-address"/>
- </constraint>
- </properties>
- <children>
- #include <include/static-route-disable.xml.i>
- #include <include/static-route-distance.xml.i>
- </children>
- </tagNode>
- </children>
- </tagNode>
+ #include <include/static-route.xml.i>
+ #include <include/static-route6.xml.i>
</children>
</tagNode>
</children>
diff --git a/interface-definitions/protocols-vrf.xml.in b/interface-definitions/protocols-vrf.xml.in
index d58f85b02..81942d124 100644
--- a/interface-definitions/protocols-vrf.xml.in
+++ b/interface-definitions/protocols-vrf.xml.in
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Protocol VRF configuration -->
<interfaceDefinition>
<node name="protocols">
<children>
- <tagNode name="nvrf" owner="${vyos_conf_scripts_dir}/vrf.py">
+ <tagNode name="vrf" owner="${vyos_conf_scripts_dir}/protocols_vrf.py">
<properties>
<help>Name of VRF to add route for</help>
+ <completionHelp>
+ <path>vrf name</path>
+ </completionHelp>
<valueHelp>
<format>txt</format>
- <description>Name of VRF to add route for</description>
+ <description>VRF instance name</description>
</valueHelp>
- <completionHelp>
- <path>protocols vrf</path>
- </completionHelp>
+ <constraint>
+ <validator name="vrf-name"/>
+ </constraint>
+ <constraintErrorMessage>VRF instance name must be 15 characters or less and can not\nbe named as regular network interfaces.\n</constraintErrorMessage>
</properties>
<children>
<node name="static">
@@ -20,336 +23,8 @@
<help>Static route parameters</help>
</properties>
<children>
- <tagNode name="interface-route">
- <properties>
- <help>Interface based static route</help>
- <valueHelp>
- <format>ipv4net</format>
- <description>Interface based static route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv4-prefix"/>
- </constraint>
- </properties>
- <children>
- <tagNode name="next-hop-interface">
- <properties>
- <help>Next-hop interface [REQUIRED]</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- </properties>
- <children>
- <leafNode name="disable">
- <properties>
- <help>Disable IPv4 interface static route</help>
- <valueless/>
- </properties>
- </leafNode>
- <leafNode name="distance">
- <properties>
- <help>Distance for this route</help>
- <valueHelp>
- <format>u32:1-255</format>
- <description>Distance for this route</description>
- </valueHelp>
- <constraint>
- <validator name="numeric" argument="--range 1-255"/>
- </constraint>
- </properties>
- </leafNode>
- <leafNode name="next-hop-vrf">
- <properties>
- <help>VRF to leak route</help>
- <valueHelp>
- <format>txt</format>
- <description>Name of VRF to leak to</description>
- </valueHelp>
- <valueHelp>
- <format>default</format>
- <description>Name of VRF to leak to</description>
- </valueHelp>
- <completionHelp>
- <list>default</list>
- <path>protocols vrf</path>
- </completionHelp>
- <constraint>
- <regex>^[a-zA-Z0-9\-_]{1,100}$</regex>
- </constraint>
- </properties>
- </leafNode>
- </children>
- </tagNode>
- </children>
- </tagNode>
- <tagNode name="interface-route6">
- <properties>
- <help>Interface based IPv6 static route</help>
- <valueHelp>
- <format>ipv6net</format>
- <description>Interface based IPv6 static route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv6-prefix"/>
- </constraint>
- </properties>
- <children>
- <tagNode name="next-hop-interface">
- <properties>
- <help>Next-hop interface [REQUIRED]</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- </properties>
- <children>
- <leafNode name="disable">
- <properties>
- <help>Disable IPv6 interface static route</help>
- <valueless/>
- </properties>
- </leafNode>
- <leafNode name="distance">
- <properties>
- <help>Distance for this route</help>
- <valueHelp>
- <format>u32:1-255</format>
- <description>Distance for this route</description>
- </valueHelp>
- <constraint>
- <validator name="numeric" argument="--range 1-255"/>
- </constraint>
- </properties>
- </leafNode>
- <leafNode name="next-hop-vrf">
- <properties>
- <help>VRF to leak route</help>
- <valueHelp>
- <format>txt</format>
- <description>Name of VRF to leak to</description>
- </valueHelp>
- <valueHelp>
- <format>default</format>
- <description>Name of VRF to leak to</description>
- </valueHelp>
- <completionHelp>
- <list>default</list>
- <path>protocols vrf</path>
- </completionHelp>
- <constraint>
- <regex>^[a-zA-Z0-9\-_]{1,100}$</regex>
- </constraint>
- </properties>
- </leafNode>
- </children>
- </tagNode>
- </children>
- </tagNode>
- <tagNode name="route">
- <properties>
- <help>VRF static IPv4 route</help>
- <valueHelp>
- <format>ipv4net</format>
- <description>VRF static IPv4 route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv4-prefix"/>
- </constraint>
- </properties>
- <children>
- <node name="blackhole">
- <properties>
- <help>Silently discard pkts when matched</help>
- </properties>
- <children>
- <leafNode name="distance">
- <properties>
- <help>Distance value for this route</help>
- <valueHelp>
- <format>u32:1-255</format>
- <description>Distance for this route</description>
- </valueHelp>
- <constraint>
- <validator name="numeric" argument="--range 1-255"/>
- </constraint>
- </properties>
- </leafNode>
- </children>
- </node>
- <leafNode name="dhcp-interface">
- <properties>
- <help>DHCP interface that supplies the next-hop IP address for this static route</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- <valueHelp>
- <format>txt</format>
- <description>DHCP interface</description>
- </valueHelp>
- </properties>
- </leafNode>
- <tagNode name="next-hop">
- <properties>
- <help>Next-hop router</help>
- <valueHelp>
- <format>ipv4</format>
- <description>Next-hop router</description>
- </valueHelp>
- <constraint>
- <validator name="ipv4-address"/>
- </constraint>
- </properties>
- <children>
- <leafNode name="disable">
- <properties>
- <help>Disable IPv4 interface static route</help>
- <valueless/>
- </properties>
- </leafNode>
- <leafNode name="distance">
- <properties>
- <help>Distance for this route</help>
- <valueHelp>
- <format>u32:1-255</format>
- <description>Distance for this route</description>
- </valueHelp>
- <constraint>
- <validator name="numeric" argument="--range 1-255"/>
- </constraint>
- </properties>
- </leafNode>
- <leafNode name="next-hop-interface">
- <properties>
- <help>IPv4 gateway interface name</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- <valueHelp>
- <format>txt</format>
- <description>IPv4 gateway interface name</description>
- </valueHelp>
- </properties>
- </leafNode>
- <leafNode name="next-hop-vrf">
- <properties>
- <help>VRF to leak route</help>
- <valueHelp>
- <format>txt</format>
- <description>Name of VRF to leak to</description>
- </valueHelp>
- <valueHelp>
- <format>default</format>
- <description>Name of VRF to leak to</description>
- </valueHelp>
- <completionHelp>
- <list>default</list>
- <path>protocols vrf</path>
- </completionHelp>
- <constraint>
- <regex>^[a-zA-Z0-9\-_]{1,100}$</regex>
- </constraint>
- </properties>
- </leafNode>
- </children>
- </tagNode>
- </children>
- </tagNode>
- <tagNode name="route6">
- <properties>
- <help>VRF static IPv6 route</help>
- <valueHelp>
- <format>ipv6net</format>
- <description>VRF static IPv6 route</description>
- </valueHelp>
- <constraint>
- <validator name="ipv6-prefix"/>
- </constraint>
- </properties>
- <children>
- <node name="blackhole">
- <properties>
- <help>Silently discard pkts when matched</help>
- </properties>
- <children>
- <leafNode name="distance">
- <properties>
- <help>Distance value for this route</help>
- <valueHelp>
- <format>u32:1-255</format>
- <description>Distance for this route</description>
- </valueHelp>
- <constraint>
- <validator name="numeric" argument="--range 1-255"/>
- </constraint>
- </properties>
- </leafNode>
- </children>
- </node>
- <tagNode name="next-hop">
- <properties>
- <help>Next-hop IPv6 router [REQUIRED]</help>
- <valueHelp>
- <format>ipv6</format>
- <description>Next-hop IPv6 router [REQUIRED]</description>
- </valueHelp>
- <constraint>
- <validator name="ipv6-address"/>
- </constraint>
- </properties>
- <children>
- <leafNode name="disable">
- <properties>
- <help>Disable IPv6 interface static route</help>
- <valueless/>
- </properties>
- </leafNode>
- <leafNode name="distance">
- <properties>
- <help>Distance for this route</help>
- <valueHelp>
- <format>u32:1-255</format>
- <description>Distance for this route</description>
- </valueHelp>
- <constraint>
- <validator name="numeric" argument="--range 1-255"/>
- </constraint>
- </properties>
- </leafNode>
- <leafNode name="interface">
- <properties>
- <help>IPv6 gateway interface name</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
- <valueHelp>
- <format>txt</format>
- <description>IPv6 gateway interface name</description>
- </valueHelp>
- </properties>
- </leafNode>
- <leafNode name="next-hop-vrf">
- <properties>
- <help>VRF to leak route</help>
- <valueHelp>
- <format>txt</format>
- <description>Name of VRF to leak to</description>
- </valueHelp>
- <valueHelp>
- <format>default</format>
- <description>Name of VRF to leak to</description>
- </valueHelp>
- <completionHelp>
- <list>default</list>
- <path>protocols vrf</path>
- </completionHelp>
- <constraint>
- <regex>^[a-zA-Z0-9\-_]{1,100}$</regex>
- </constraint>
- </properties>
- </leafNode>
- </children>
- </tagNode>
- </children>
- </tagNode>
+ #include <include/static-route.xml.i>
+ #include <include/static-route6.xml.i>
</children>
</node>
</children>
diff --git a/interface-definitions/vrf.xml.in b/interface-definitions/vrf.xml.in
index 81c89d94b..eca9e75a7 100644
--- a/interface-definitions/vrf.xml.in
+++ b/interface-definitions/vrf.xml.in
@@ -21,7 +21,7 @@
</constraint>
<constraintErrorMessage>VRF instance name must be 15 characters or less and can not\nbe named as regular network interfaces.\n</constraintErrorMessage>
<valueHelp>
- <format>name</format>
+ <format>txt</format>
<description>Instance name</description>
</valueHelp>
</properties>