Commit a33930bc authored by Jonathon Duerig's avatar Jonathon Duerig

Modified top.rnc to allow merging inside of node/link/interface elements

parent da232ef8
......@@ -26,7 +26,9 @@ NodeTypeSpec = element node_type {
}
## A node in the topology
NodeSpec = element node {
NodeSpec = element node { NodeContents }
NodeContents =
## Name of the node - each node name must be unique within the
## top element
attribute name { text },
......@@ -42,7 +44,6 @@ NodeSpec = element node {
## Desires of this node, which should (or must) be matched by the
## physical node we are assigned to
PropertySpec*
}
## A node can (by default) have one or more types
NodeSpec.NodeType = NodeTypeSpec+
......@@ -59,7 +60,9 @@ LinkTypeSpec = element link_type {
}
## Links in the topology - zero or more
LinkSpec = element link {
LinkSpec = element link { LinkContents }
LinkContents =
## Name of the link - must be unique in the top
attribute name { text },
## First interface for this link - links are assumed to be
......@@ -83,7 +86,6 @@ LinkSpec = element link {
LinkSpec.LinkType,
## Properties of this link
PropertySpec*
}
## A link can (by default) have zero or more types
LinkSpec.LinkType = LinkTypeSpec*
......@@ -124,14 +126,15 @@ NodeFlagSpec =
element disallow_trivial_mix { empty }?
## Interfaces
InterfaceSpec = element interface {
InterfaceSpec = element interface { InterfaceContents }
InterfaceContents =
## Name of the node, which must match one of the nodes in this topology
element node_name { text },
## Name of the interface itself
element interface { text },
## Properties of the interface
PropertySpec*
}
## Properties - new: replacements for features and desires. Not yet implemented
## in assign, and not yet fully fleshed out in this schema.
......
......@@ -47,31 +47,34 @@ of static types at a time</a:documentation>
<define name="NodeSpec">
<a:documentation>A node in the topology</a:documentation>
<element name="node">
<attribute name="name">
<a:documentation>Name of the node - each node name must be unique within the
<ref name="NodeContents"/>
</element>
</define>
<define name="NodeContents">
<attribute name="name">
<a:documentation>Name of the node - each node name must be unique within the
top element</a:documentation>
</attribute>
<ref name="NodeSpec.NodeType">
<a:documentation>Type specification - we use a named pattern here (defined below), so
</attribute>
<ref name="NodeSpec.NodeType">
<a:documentation>Type specification - we use a named pattern here (defined below), so
that it can be overriden in the virtual topology schema, where you are
only allowed to have one</a:documentation>
</ref>
<ref name="NodeFlagSpec">
<a:documentation>Legacy flags</a:documentation>
</ref>
<zeroOrMore>
<ref name="FeatureDesireSpec">
<a:documentation>Legacy features and desires</a:documentation>
</ref>
<ref name="NodeFlagSpec">
<a:documentation>Legacy flags</a:documentation>
</ref>
<zeroOrMore>
<ref name="FeatureDesireSpec">
<a:documentation>Legacy features and desires</a:documentation>
</ref>
</zeroOrMore>
<zeroOrMore>
<ref name="PropertySpec">
<a:documentation>Types of virtual nodes that this physical node can satisfy
</zeroOrMore>
<zeroOrMore>
<ref name="PropertySpec">
<a:documentation>Types of virtual nodes that this physical node can satisfy
Desires of this node, which should (or must) be matched by the
physical node we are assigned to</a:documentation>
</ref>
</zeroOrMore>
</element>
</ref>
</zeroOrMore>
</define>
<define name="NodeSpec.NodeType">
<a:documentation>A node can (by default) have one or more types</a:documentation>
......@@ -96,51 +99,54 @@ TODO: MAYBE this should be combined with NodeTypeSpec</a:documentation>
<define name="LinkSpec">
<a:documentation>Links in the topology - zero or more</a:documentation>
<element name="link">
<attribute name="name">
<a:documentation>Name of the link - must be unique in the top</a:documentation>
</attribute>
<element name="source_interface">
<a:documentation>First interface for this link - links are assumed to be
<ref name="LinkContents"/>
</element>
</define>
<define name="LinkContents">
<attribute name="name">
<a:documentation>Name of the link - must be unique in the top</a:documentation>
</attribute>
<element name="source_interface">
<a:documentation>First interface for this link - links are assumed to be
symmetric, so the order of the interfaces does not currently
matter</a:documentation>
<ref name="InterfaceSpec"/>
</element>
<element name="destination_interface">
<a:documentation>Second interface for this link</a:documentation>
<ref name="InterfaceSpec"/>
</element>
<element name="bandwidth">
<a:documentation>TODO: In the future, the bandwidth, latency, and packet loss will be
<ref name="InterfaceSpec"/>
</element>
<element name="destination_interface">
<a:documentation>Second interface for this link</a:documentation>
<ref name="InterfaceSpec"/>
</element>
<element name="bandwidth">
<a:documentation>TODO: In the future, the bandwidth, latency, and packet loss will be
moved to features and/or properties
Bandwidth of the link in kbps</a:documentation>
<data type="float">
<param name="minExclusive">0.0</param>
</data>
</element>
<element name="latency">
<a:documentation>Latency of the link in ms</a:documentation>
<data type="float">
<param name="minInclusive">0.0</param>
</data>
</element>
<element name="packet_loss">
<a:documentation>Static packet loss probability of the link as a fraction
<data type="float">
<param name="minExclusive">0.0</param>
</data>
</element>
<element name="latency">
<a:documentation>Latency of the link in ms</a:documentation>
<data type="float">
<param name="minInclusive">0.0</param>
</data>
</element>
<element name="packet_loss">
<a:documentation>Static packet loss probability of the link as a fraction
(ie. 0.01 == 1%)</a:documentation>
<data type="float">
<param name="minInclusive">0.0</param>
</data>
</element>
<ref name="LinkSpec.LinkType">
<a:documentation>Type of this link - we use a named pattern here (defined below), so
<data type="float">
<param name="minInclusive">0.0</param>
</data>
</element>
<ref name="LinkSpec.LinkType">
<a:documentation>Type of this link - we use a named pattern here (defined below), so
that it can be overriden in the virtual topology schema, where you are
only allowed to have one</a:documentation>
</ref>
<zeroOrMore>
<ref name="PropertySpec">
<a:documentation>Properties of this link</a:documentation>
</ref>
<zeroOrMore>
<ref name="PropertySpec">
<a:documentation>Properties of this link</a:documentation>
</ref>
</zeroOrMore>
</element>
</zeroOrMore>
</define>
<define name="LinkSpec.LinkType">
<a:documentation>A link can (by default) have zero or more types</a:documentation>
......@@ -234,20 +240,23 @@ none of them must be. Possibly expressible with properties?</a:documentation>
<define name="InterfaceSpec">
<a:documentation>Interfaces</a:documentation>
<element name="interface">
<element name="node_name">
<a:documentation>Name of the node, which must match one of the nodes in this topology</a:documentation>
<text/>
</element>
<element name="interface">
<a:documentation>Name of the interface itself</a:documentation>
<text/>
</element>
<zeroOrMore>
<ref name="PropertySpec">
<a:documentation>Properties of the interface</a:documentation>
</ref>
</zeroOrMore>
<ref name="InterfaceContents"/>
</element>
</define>
<define name="InterfaceContents">
<element name="node_name">
<a:documentation>Name of the node, which must match one of the nodes in this topology</a:documentation>
<text/>
</element>
<element name="interface">
<a:documentation>Name of the interface itself</a:documentation>
<text/>
</element>
<zeroOrMore>
<ref name="PropertySpec">
<a:documentation>Properties of the interface</a:documentation>
</ref>
</zeroOrMore>
</define>
<define name="PropertySpec">
<a:documentation>Properties - new: replacements for features and desires. Not yet implemented
......
......@@ -43,25 +43,24 @@
<xs:element name="static">
<xs:complexType/>
</xs:element>
<xs:element name="node">
<xs:complexType>
<xs:sequence>
<xs:group ref="NodeSpec.NodeType"/>
<xs:group ref="NodeFlagSpec">
<xs:annotation>
<xs:documentation>Legacy flags</xs:documentation>
</xs:annotation>
</xs:group>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="fd">
<xs:annotation>
<xs:documentation>Legacy features and desires</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="node" type="NodeContents"/>
<xs:complexType name="NodeContents">
<xs:sequence>
<xs:group ref="NodeSpec.NodeType"/>
<xs:group ref="NodeFlagSpec">
<xs:annotation>
<xs:documentation>Legacy flags</xs:documentation>
</xs:annotation>
</xs:group>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="fd">
<xs:annotation>
<xs:documentation>Legacy features and desires</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
</xs:complexType>
<xs:group name="NodeSpec.NodeType">
<xs:annotation>
<xs:documentation>A node can (by default) have one or more types</xs:documentation>
......@@ -77,28 +76,27 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="link">
<xs:complexType>
<xs:sequence>
<xs:element ref="source_interface"/>
<xs:element ref="destination_interface"/>
<xs:element ref="bandwidth"/>
<xs:element ref="latency"/>
<xs:element ref="packet_loss"/>
<xs:group ref="LinkSpec.LinkType"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property">
<xs:annotation>
<xs:documentation>Properties of this link</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:element name="link" type="LinkContents"/>
<xs:complexType name="LinkContents">
<xs:sequence>
<xs:element ref="source_interface"/>
<xs:element ref="destination_interface"/>
<xs:element ref="bandwidth"/>
<xs:element ref="latency"/>
<xs:element ref="packet_loss"/>
<xs:group ref="LinkSpec.LinkType"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property">
<xs:annotation>
<xs:documentation>Name of the link - must be unique in the top</xs:documentation>
<xs:documentation>Properties of this link</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:element>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:annotation>
<xs:documentation>Name of the link - must be unique in the top</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="source_interface" type="InterfaceSpec"/>
<xs:element name="destination_interface" type="InterfaceSpec">
<xs:annotation>
......@@ -211,26 +209,24 @@
<xs:documentation>Interfaces</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element ref="interface"/>
<xs:element name="interface" type="InterfaceContents"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="InterfaceContents">
<xs:sequence>
<xs:element ref="node_name"/>
<xs:element name="interface" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the interface itself</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property">
<xs:annotation>
<xs:documentation>Properties of the interface</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="interface">
<xs:complexType>
<xs:sequence>
<xs:element ref="node_name"/>
<xs:element name="interface" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the interface itself</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property">
<xs:annotation>
<xs:documentation>Properties of the interface</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="node_name" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the node, which must match one of the nodes in this topology</xs:documentation>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment