summaryrefslogtreecommitdiff
path: root/interface-definitions
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2023-03-30 12:55:30 +0000
committerNicolas Fort <nicolasfort1988@gmail.com>2023-03-31 12:28:24 +0000
commit599c5405e7ff5b76aa774b8cc97a82fbc053d46c (patch)
tree6cf68e89b33d6eebcc3d1e20c2859329ebaf04b3 /interface-definitions
parent623dfc9d87d513bd69e5e6eef9664056dc1a45f1 (diff)
downloadvyos-1x-599c5405e7ff5b76aa774b8cc97a82fbc053d46c.tar.gz
vyos-1x-599c5405e7ff5b76aa774b8cc97a82fbc053d46c.zip
T5128: Policy Route: allow wildcard on interface
Diffstat (limited to 'interface-definitions')
-rw-r--r--interface-definitions/include/constraint/interface-name-with-wildcard.xml.in4
-rw-r--r--interface-definitions/include/generic-interface-multi-wildcard.xml.i19
-rw-r--r--interface-definitions/policy-route.xml.in4
3 files changed, 25 insertions, 2 deletions
diff --git a/interface-definitions/include/constraint/interface-name-with-wildcard.xml.in b/interface-definitions/include/constraint/interface-name-with-wildcard.xml.in
new file mode 100644
index 000000000..09867b380
--- /dev/null
+++ b/interface-definitions/include/constraint/interface-name-with-wildcard.xml.in
@@ -0,0 +1,4 @@
+<!-- include start from constraint/interface-name-with-wildcard.xml.in -->
+<regex>(bond|br|dum|en|ersp|eth|gnv|ifb|lan|l2tp|l2tpeth|macsec|peth|ppp|pppoe|pptp|sstp|tun|veth|vti|vtun|vxlan|wg|wlan|wwan)([0-9]?)(\*?)(.+)?|lo</regex>
+<validator name="file-path --lookup-path /sys/class/net --directory"/>
+<!-- include end -->
diff --git a/interface-definitions/include/generic-interface-multi-wildcard.xml.i b/interface-definitions/include/generic-interface-multi-wildcard.xml.i
new file mode 100644
index 000000000..354841a85
--- /dev/null
+++ b/interface-definitions/include/generic-interface-multi-wildcard.xml.i
@@ -0,0 +1,19 @@
+
+<!-- include start from generic-interface-multi-wildcard.xml.i -->
+<leafNode name="interface">
+ <properties>
+ <help>Interface name to apply policy route configuration</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces</script>
+ </completionHelp>
+ <valueHelp>
+ <format>txt</format>
+ <description>Interface name</description>
+ </valueHelp>
+ <constraint>
+ #include <include/constraint/interface-name-with-wildcard.xml.in>
+ </constraint>
+ <multi/>
+ </properties>
+</leafNode>
+<!-- include end -->
diff --git a/interface-definitions/policy-route.xml.in b/interface-definitions/policy-route.xml.in
index bbd6dbf56..d4ec75786 100644
--- a/interface-definitions/policy-route.xml.in
+++ b/interface-definitions/policy-route.xml.in
@@ -12,8 +12,8 @@
</properties>
<children>
#include <include/generic-description.xml.i>
- #include <include/generic-interface-multi.xml.i>
#include <include/firewall/enable-default-log.xml.i>
+ #include <include/generic-interface-multi-wildcard.xml.i>
<tagNode name="rule">
<properties>
<help>Policy rule number</help>
@@ -67,8 +67,8 @@
</properties>
<children>
#include <include/generic-description.xml.i>
- #include <include/generic-interface-multi.xml.i>
#include <include/firewall/enable-default-log.xml.i>
+ #include <include/generic-interface-multi-wildcard.xml.i>
<tagNode name="rule">
<properties>
<help>Policy rule number</help>