summaryrefslogtreecommitdiff
path: root/interface-definitions
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-05-16 22:20:43 +0200
committerChristian Poessinger <christian@poessinger.com>2020-05-16 22:52:30 +0200
commit7d01f7fec95f65705ec886f4de8bce21e0bfee07 (patch)
treec34361e7c4a6d0f04eae4567fd2a7abb14c4a51a /interface-definitions
parent9e305400f281a1ce558aab692f44426da0d76bcc (diff)
downloadvyos-1x-7d01f7fec95f65705ec886f4de8bce21e0bfee07.tar.gz
vyos-1x-7d01f7fec95f65705ec886f4de8bce21e0bfee07.zip
nat: nptv6: T2198: add XML/Python skeleton
- define XML CLI interface - read CLI into Python dict
Diffstat (limited to 'interface-definitions')
-rw-r--r--interface-definitions/include/nat-outbound-interface.xml.i8
-rw-r--r--interface-definitions/nat.xml.in81
2 files changed, 81 insertions, 8 deletions
diff --git a/interface-definitions/include/nat-outbound-interface.xml.i b/interface-definitions/include/nat-outbound-interface.xml.i
new file mode 100644
index 000000000..d562f7f03
--- /dev/null
+++ b/interface-definitions/include/nat-outbound-interface.xml.i
@@ -0,0 +1,8 @@
+<leafNode name="outbound-interface">
+ <properties>
+ <help>Outbound interface of NAT traffic</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py</script>
+ </completionHelp>
+ </properties>
+</leafNode>
diff --git a/interface-definitions/nat.xml.in b/interface-definitions/nat.xml.in
index af9dd1eff..a0b3b815b 100644
--- a/interface-definitions/nat.xml.in
+++ b/interface-definitions/nat.xml.in
@@ -52,22 +52,87 @@
</tagNode>
</children>
</node>
- <node name="source">
+ <node name="nptv6">
<properties>
- <help>Source NAT settings</help>
+ <help>IPv6-to-IPv6 Network Prefix Translation Settings</help>
</properties>
<children>
- #include <include/nat-rule.xml.i>
<tagNode name="rule">
+ <properties>
+ <help>NPTv6 rule number</help>
+ <valueHelp>
+ <format>1-9999</format>
+ <description>Number for this rule</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-9999"/>
+ </constraint>
+ <constraintErrorMessage>NAT rule number must be between 1 and 9999</constraintErrorMessage>
+ </properties>
<children>
- <leafNode name="outbound-interface">
+ <leafNode name="description">
<properties>
- <help>Outbound interface of NAT traffic</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces.py</script>
- </completionHelp>
+ <help>Rule description</help>
</properties>
</leafNode>
+ <leafNode name="disable">
+ <properties>
+ <help>Disable NAT rule</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ #include <include/nat-outbound-interface.xml.i>
+ <node name="source">
+ <properties>
+ <help>IPv6 source prefix options</help>
+ </properties>
+ <children>
+ <leafNode name="prefix">
+ <properties>
+ <help>IPv6 prefix to be translated</help>
+ <valueHelp>
+ <format>ipv6net</format>
+ <description>IPv6 prefix</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv6-prefix"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ <node name="translation">
+ <properties>
+ <help>Translated IPv6 prefix options</help>
+ </properties>
+ <children>
+ <leafNode name="prefix">
+ <properties>
+ <help>IPv6 prefix to translate to</help>
+ <valueHelp>
+ <format>ipv6net</format>
+ <description>IPv6 prefix</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv6-prefix"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ <node name="source">
+ <properties>
+ <help>Source NAT settings</help>
+ </properties>
+ <children>
+ #include <include/nat-rule.xml.i>
+ <tagNode name="rule">
+ <children>
+ #include <include/nat-outbound-interface.xml.i>
<node name="translation">
<properties>
<help>Outside NAT IP (source NAT only)</help>