summaryrefslogtreecommitdiff
path: root/interface-definitions/include/firewall
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-11-03 17:39:19 +0100
committerChristian Poessinger <christian@poessinger.com>2022-11-03 17:39:19 +0100
commit4ae434d50337b6a1543176b0b86e938fc0663626 (patch)
tree9e726851fcf21b7f27200605718f3ebb6fd75f0d /interface-definitions/include/firewall
parentf11b76ec56f9a94c4cfb435081c7b9a5986c060c (diff)
downloadvyos-1x-4ae434d50337b6a1543176b0b86e938fc0663626.tar.gz
vyos-1x-4ae434d50337b6a1543176b0b86e938fc0663626.zip
xml: T4795: provide common and re-usable XML definitions for policy
Remove duplicated code and move to single-source of truth.
Diffstat (limited to 'interface-definitions/include/firewall')
-rw-r--r--interface-definitions/include/firewall/common-rule.xml.i17
-rw-r--r--interface-definitions/include/firewall/mac-address.xml.i18
2 files changed, 19 insertions, 16 deletions
diff --git a/interface-definitions/include/firewall/common-rule.xml.i b/interface-definitions/include/firewall/common-rule.xml.i
index a4f66f5cb..75ad427f9 100644
--- a/interface-definitions/include/firewall/common-rule.xml.i
+++ b/interface-definitions/include/firewall/common-rule.xml.i
@@ -219,22 +219,7 @@
<children>
#include <include/firewall/address.xml.i>
#include <include/firewall/source-destination-group.xml.i>
- <leafNode name="mac-address">
- <properties>
- <help>Source MAC address</help>
- <valueHelp>
- <format>&lt;MAC address&gt;</format>
- <description>MAC address to match</description>
- </valueHelp>
- <valueHelp>
- <format>!&lt;MAC address&gt;</format>
- <description>Match everything except the specified MAC address</description>
- </valueHelp>
- <constraint>
- <validator name="mac-address-firewall"/>
- </constraint>
- </properties>
- </leafNode>
+ #include <include/firewall/mac-address.xml.i>
#include <include/firewall/port.xml.i>
</children>
</node>
diff --git a/interface-definitions/include/firewall/mac-address.xml.i b/interface-definitions/include/firewall/mac-address.xml.i
new file mode 100644
index 000000000..83aaf1ce1
--- /dev/null
+++ b/interface-definitions/include/firewall/mac-address.xml.i
@@ -0,0 +1,18 @@
+<!-- include start from firewall/mac-address.xml.i -->
+<leafNode name="mac-address">
+ <properties>
+ <help>MAC address</help>
+ <valueHelp>
+ <format>macaddr;</format>
+ <description>MAC address to match</description>
+ </valueHelp>
+ <valueHelp>
+ <format>!macaddr</format>
+ <description>Match everything except the specified MAC address</description>
+ </valueHelp>
+ <constraint>
+ <validator name="mac-address-firewall"/>
+ </constraint>
+ </properties>
+</leafNode>
+<!-- include end -->