summaryrefslogtreecommitdiff
path: root/interface-definitions
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-03-31 16:16:08 +0200
committerGitHub <noreply@github.com>2023-03-31 16:16:08 +0200
commit11ace86f58261908f1ab15366b73aeddb14745c9 (patch)
tree9b76855c810d1a6600e2c8a3796bddafebb11133 /interface-definitions
parentd98b70aead175809f9b14b9f16779481bbde0877 (diff)
parentc41af9698abaeb1dc656933570c14fc9d75c9ce5 (diff)
downloadvyos-1x-11ace86f58261908f1ab15366b73aeddb14745c9.tar.gz
vyos-1x-11ace86f58261908f1ab15366b73aeddb14745c9.zip
Merge pull request #1922 from nicolas-fort/T5128
T5128: Policy Route: allow wildcard on interface
Diffstat (limited to 'interface-definitions')
-rw-r--r--interface-definitions/firewall.xml.in3
-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
4 files changed, 28 insertions, 2 deletions
diff --git a/interface-definitions/firewall.xml.in b/interface-definitions/firewall.xml.in
index 624d61759..edbf1e03a 100644
--- a/interface-definitions/firewall.xml.in
+++ b/interface-definitions/firewall.xml.in
@@ -349,6 +349,9 @@
<completionHelp>
<script>${vyos_completion_dir}/list_interfaces</script>
</completionHelp>
+ <constraint>
+ #include <include/constraint/interface-name-with-wildcard.xml.in>
+ </constraint>
</properties>
<children>
<node name="in">
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>