summaryrefslogtreecommitdiff
path: root/schema
diff options
context:
space:
mode:
Diffstat (limited to 'schema')
-rw-r--r--schema/interface_definition.rnc2
-rw-r--r--schema/interface_definition.rng10
-rw-r--r--schema/op-mode-definition.rnc15
-rw-r--r--schema/op-mode-definition.rng64
4 files changed, 70 insertions, 21 deletions
diff --git a/schema/interface_definition.rnc b/schema/interface_definition.rnc
index 9434f5d18..a338b875f 100644
--- a/schema/interface_definition.rnc
+++ b/schema/interface_definition.rnc
@@ -1,6 +1,6 @@
# interface_definition.rnc: VyConf reference tree XML grammar
#
-# Copyright (C) 2014. 2017 VyOS maintainers and contributors <maintainers@vyos.net>
+# Copyright VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
diff --git a/schema/interface_definition.rng b/schema/interface_definition.rng
index e3d582452..d653d1b01 100644
--- a/schema/interface_definition.rng
+++ b/schema/interface_definition.rng
@@ -2,19 +2,19 @@
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<!--
interface_definition.rnc: VyConf reference tree XML grammar
-
- Copyright (C) 2014. 2017 VyOS maintainers and contributors <maintainers@vyos.net>
-
+
+ Copyright VyOS maintainers and contributors <maintainers@vyos.io>
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
-
+
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
diff --git a/schema/op-mode-definition.rnc b/schema/op-mode-definition.rnc
index 46430daa4..c10cf0431 100644
--- a/schema/op-mode-definition.rnc
+++ b/schema/op-mode-definition.rnc
@@ -1,6 +1,6 @@
# interface_definition.rnc: VyConf reference tree XML grammar
#
-# Copyright (C) 2014-2025 VyOS maintainers and contributors <maintainers@vyos.net>
+# Copyright VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -60,6 +60,15 @@ standalone = element standalone
help & command
}
+# Virtual tag nodes provide a way to add a variable argument
+# to a command that also needs fixed arguments,
+# like "show ip route" that can take "show ip route bgp"
+# or a network and arguments after it, like "show ip route 10.0.0.0/8 longer-prefixes"
+virtualTagNode = element virtualTagNode
+{
+ (properties? & children? & command?)
+}
+
# Leaf nodes are terminal configuration nodes that can't have children,
# but can have values.
@@ -69,9 +78,11 @@ leafNode = element leafNode
(command & properties)
}
-# Normal and tag nodes may have children
+# Normal and tag nodes may have children: nodes, leaf nodes, or tag nodes.
+# There can only be one virtual tag node child, though.
children = element children
{
+ (virtualTagNode? & (node | tagNode | leafNode)*) |
(node | tagNode | leafNode)+
}
diff --git a/schema/op-mode-definition.rng b/schema/op-mode-definition.rng
index bfd5cb50a..692584fb4 100644
--- a/schema/op-mode-definition.rng
+++ b/schema/op-mode-definition.rng
@@ -2,19 +2,19 @@
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<!--
interface_definition.rnc: VyConf reference tree XML grammar
-
- Copyright (C) 2014-2025 VyOS maintainers and contributors <maintainers@vyos.net>
-
+
+ Copyright VyOS maintainers and contributors <maintainers@vyos.io>
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
-
+
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
@@ -102,6 +102,27 @@
</element>
</define>
<!--
+ Virtual tag nodes provide a way to add a variable argument
+ to a command that also needs fixed arguments,
+ like "show ip route" that can take "show ip route bgp"
+ or a network and arguments after it, like "show ip route 10.0.0.0/8 longer-prefixes"
+ -->
+ <define name="virtualTagNode">
+ <element name="virtualTagNode">
+ <interleave>
+ <optional>
+ <ref name="properties"/>
+ </optional>
+ <optional>
+ <ref name="children"/>
+ </optional>
+ <optional>
+ <ref name="command"/>
+ </optional>
+ </interleave>
+ </element>
+ </define>
+ <!--
Leaf nodes are terminal configuration nodes that can't have children,
but can have values.
-->
@@ -114,16 +135,33 @@
</interleave>
</element>
</define>
- <!-- Normal and tag nodes may have children -->
+ <!--
+ Normal and tag nodes may have children: nodes, leaf nodes, or tag nodes.
+ There can only be one virtual tag node child, though.
+ -->
<define name="children">
<element name="children">
- <oneOrMore>
- <choice>
- <ref name="node"/>
- <ref name="tagNode"/>
- <ref name="leafNode"/>
- </choice>
- </oneOrMore>
+ <choice>
+ <interleave>
+ <optional>
+ <ref name="virtualTagNode"/>
+ </optional>
+ <zeroOrMore>
+ <choice>
+ <ref name="node"/>
+ <ref name="tagNode"/>
+ <ref name="leafNode"/>
+ </choice>
+ </zeroOrMore>
+ </interleave>
+ <oneOrMore>
+ <choice>
+ <ref name="node"/>
+ <ref name="tagNode"/>
+ <ref name="leafNode"/>
+ </choice>
+ </oneOrMore>
+ </choice>
</element>
</define>
<!--