summaryrefslogtreecommitdiff
path: root/schema
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2020-01-14 09:18:16 -0600
committerGitHub <noreply@github.com>2020-01-14 09:18:16 -0600
commit29e3f990303c6d01c37f4fafc44d0d3cbcd4558e (patch)
tree2828d034d5ae467abbfb155015f40685d2518424 /schema
parent91de4ec9d95a6a99df0ad5363633251bcb5f4874 (diff)
parent29e438755c8bd2b9598a2016a3c42891f0cbfa1d (diff)
downloadvyos-1x-29e3f990303c6d01c37f4fafc44d0d3cbcd4558e.tar.gz
vyos-1x-29e3f990303c6d01c37f4fafc44d0d3cbcd4558e.zip
Merge pull request #205 from jestabro/syntax-version
Syntax version
Diffstat (limited to 'schema')
-rw-r--r--schema/interface_definition.rnc17
-rw-r--r--schema/interface_definition.rng18
2 files changed, 35 insertions, 0 deletions
diff --git a/schema/interface_definition.rnc b/schema/interface_definition.rnc
index 02175fec8..0ce8226cd 100644
--- a/schema/interface_definition.rnc
+++ b/schema/interface_definition.rnc
@@ -24,9 +24,16 @@
# Interface definition starts with interfaceDefinition tag that may contain node tags
start = element interfaceDefinition
{
+ syntaxVersion*,
node*
}
+# interfaceDefinition may contain syntax version attribute lists.
+syntaxVersion = element syntaxVersion
+{
+ (componentAttr & versionAttr)
+}
+
# node tag may contain node, leafNode, or tagNode tags
# Those are intermediate configuration nodes that may only contain
# other nodes and must not have values
@@ -97,6 +104,16 @@ properties = element properties
(element keepChildOrder { empty })?
}
+componentAttr = attribute component
+{
+ text
+}
+
+versionAttr = attribute version
+{
+ text
+}
+
# All nodes must have "name" attribute
nodeNameAttr = attribute name
{
diff --git a/schema/interface_definition.rng b/schema/interface_definition.rng
index 195ef27f4..bfd8d376f 100644
--- a/schema/interface_definition.rng
+++ b/schema/interface_definition.rng
@@ -29,10 +29,22 @@
<start>
<element name="interfaceDefinition">
<zeroOrMore>
+ <ref name="syntaxVersion"/>
+ </zeroOrMore>
+ <zeroOrMore>
<ref name="node"/>
</zeroOrMore>
</element>
</start>
+ <!-- interfaceDefinition may contain syntax version attribute lists. -->
+ <define name="syntaxVersion">
+ <element name="syntaxVersion">
+ <interleave>
+ <ref name="componentAttr"/>
+ <ref name="versionAttr"/>
+ </interleave>
+ </element>
+ </define>
<!--
node tag may contain node, leafNode, or tagNode tags
Those are intermediate configuration nodes that may only contain
@@ -184,6 +196,12 @@
</interleave>
</element>
</define>
+ <define name="componentAttr">
+ <attribute name="component"/>
+ </define>
+ <define name="versionAttr">
+ <attribute name="version"/>
+ </define>
<!-- All nodes must have "name" attribute -->
<define name="nodeNameAttr">
<attribute name="name"/>