summaryrefslogtreecommitdiff
path: root/interface-definitions
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-01-26 20:48:08 +0100
committerGitHub <noreply@github.com>2022-01-26 20:48:08 +0100
commitf5a29d46656651035a9f53b5a12ee99ee7c1d704 (patch)
tree7d63e7c6b3b5ec90758d012eb9087097695cc7a4 /interface-definitions
parentc8e32f6adff3bf9f5721581c1a8cb8936677a7d5 (diff)
parent1d65ce9558b7c814295474a7cdf648866b612ff6 (diff)
downloadvyos-1x-f5a29d46656651035a9f53b5a12ee99ee7c1d704.tar.gz
vyos-1x-f5a29d46656651035a9f53b5a12ee99ee7c1d704.zip
Merge pull request #1191 from sever-sever/T4138
nat: T4138: Add port-range validation for NAT
Diffstat (limited to 'interface-definitions')
-rw-r--r--interface-definitions/include/nat-port.xml.i7
-rw-r--r--interface-definitions/include/nat-translation-port.xml.i3
2 files changed, 10 insertions, 0 deletions
diff --git a/interface-definitions/include/nat-port.xml.i b/interface-definitions/include/nat-port.xml.i
index 7aabc33c3..5f762cfb3 100644
--- a/interface-definitions/include/nat-port.xml.i
+++ b/interface-definitions/include/nat-port.xml.i
@@ -3,6 +3,10 @@
<properties>
<help>Port number</help>
<valueHelp>
+ <format>txt</format>
+ <description>Named port (any name in /etc/services, e.g., http)</description>
+ </valueHelp>
+ <valueHelp>
<format>u32:1-65535</format>
<description>Numeric IP port</description>
</valueHelp>
@@ -14,6 +18,9 @@
<format/>
<description>\n\nMultiple destination ports can be specified as a comma-separated list.\nThe whole list can also be negated using '!'.\nFor example: '!22,telnet,http,123,1001-1005'</description>
</valueHelp>
+ <constraint>
+ <validator name="port-multi"/>
+ </constraint>
</properties>
</leafNode>
<!-- include end -->
diff --git a/interface-definitions/include/nat-translation-port.xml.i b/interface-definitions/include/nat-translation-port.xml.i
index 6e507353c..6f17df3d9 100644
--- a/interface-definitions/include/nat-translation-port.xml.i
+++ b/interface-definitions/include/nat-translation-port.xml.i
@@ -10,6 +10,9 @@
<format>range</format>
<description>Numbered port range (e.g., 1001-1005)</description>
</valueHelp>
+ <constraint>
+ <validator name="port-range"/>
+ </constraint>
</properties>
</leafNode>
<!-- include end -->