Commit 64847cde authored by Jonathon Duerig's avatar Jonathon Duerig

Tweaked top format so that 'global' and 'local' contain their operators rather than precede them.

parent 25bf9b83
......@@ -110,10 +110,20 @@ FeatureDesireSpec = element fd {
## a feature is a constraint violation
element violatable { empty }?,
## Type information expressed in features and desires
((element global { empty }, element operator { "OnceOnly" | "FirstFree" }) |
(element local { empty }, element operator { "+" }))?
(GlobalSpec | LocalSpec)?
}
GlobalSpec = element global {
element operator { "OnceOnly" | "FirstFree" }
}
LocalSpec = element local {
element operator { "+" }
}
## ((element global { empty }, element operator { "OnceOnly" | "FirstFree" }) |
## (element local { empty }, element operator { "+" }))?
## "Legacy" assign node flags - will be replaced with properties, and in some
## cases, explicit links
NodeFlagSpec =
......
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://emulab.net/resources/ptop/0.1" xmlns:ptop="http://emulab.net/resources/ptop/0.1">
<!--
EMULAB-COPYRIGHT
......@@ -23,10 +23,10 @@
</xs:annotation>
</xs:element>
<xs:choice>
<xs:element ref="type_slots"/>
<xs:element ref="unlimited"/>
<xs:element ref="ptop:type_slots"/>
<xs:element ref="ptop:unlimited"/>
</xs:choice>
<xs:element minOccurs="0" ref="static"/>
<xs:element minOccurs="0" ref="ptop:static"/>
</xs:sequence>
</xs:complexType>
</xs:element>
......@@ -43,21 +43,21 @@
<xs:element name="static">
<xs:complexType/>
</xs:element>
<xs:element name="node" type="NodeContents"/>
<xs:element name="node" type="ptop:NodeContents"/>
<xs:complexType name="NodeContents">
<xs:sequence>
<xs:group ref="NodeSpec.NodeType"/>
<xs:group ref="NodeFlagSpec">
<xs:group ref="ptop:NodeSpec.NodeType"/>
<xs:group ref="ptop:NodeFlagSpec">
<xs:annotation>
<xs:documentation>Legacy flags</xs:documentation>
</xs:annotation>
</xs:group>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="fd">
<xs:element minOccurs="0" maxOccurs="unbounded" ref="ptop:fd">
<xs:annotation>
<xs:documentation>Legacy features and desires</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="ptop:property"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
</xs:complexType>
......@@ -66,7 +66,7 @@
<xs:documentation>A node can (by default) have one or more types</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="node_type"/>
<xs:element maxOccurs="unbounded" ref="ptop:node_type"/>
</xs:sequence>
</xs:group>
<xs:element name="link_type">
......@@ -76,16 +76,21 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="link" type="LinkContents"/>
<xs:element name="link" type="ptop: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:group ref="ptop:LinkEndPoints">
<xs:annotation>
<xs:documentation>The two interfaces which form the endpoints of this link.</xs:documentation>
</xs:annotation>
</xs:group>
<xs:group ref="ptop:LinkCharacteristics">
<xs:annotation>
<xs:documentation>The characteristics (bandwidth, latency, loss) which affect traffic.</xs:documentation>
</xs:annotation>
</xs:group>
<xs:group ref="ptop:LinkSpec.LinkType"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="ptop:property">
<xs:annotation>
<xs:documentation>Properties of this link</xs:documentation>
</xs:annotation>
......@@ -97,13 +102,33 @@
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="source_interface" type="InterfaceSpec"/>
<xs:element name="destination_interface" type="InterfaceSpec">
<xs:group name="LinkEndPoints">
<xs:sequence>
<xs:element ref="ptop:source_interface"/>
<xs:element ref="ptop:destination_interface"/>
</xs:sequence>
</xs:group>
<xs:element name="source_interface" type="ptop:InterfaceSpec">
<xs:annotation>
<xs:documentation>First interface for this link</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="destination_interface" type="ptop:InterfaceSpec">
<xs:annotation>
<xs:documentation>Second interface for this link</xs:documentation>
</xs:annotation>
</xs:element>
<xs:group name="LinkCharacteristics">
<xs:sequence>
<xs:element ref="ptop:bandwidth"/>
<xs:element ref="ptop:latency"/>
<xs:element ref="ptop:packet_loss"/>
</xs:sequence>
</xs:group>
<xs:element name="bandwidth">
<xs:annotation>
<xs:documentation>Bandwidth of the link in kbps</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minExclusive value="0.0"/>
......@@ -132,14 +157,14 @@
<xs:documentation>A link can (by default) have zero or more types</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="link_type"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="ptop:link_type"/>
</xs:sequence>
</xs:group>
<xs:element name="fd">
<xs:complexType>
<xs:sequence>
<xs:element ref="fd_name"/>
<xs:element ref="fd_weight"/>
<xs:element ref="ptop:fd_name"/>
<xs:element ref="ptop:fd_weight"/>
<xs:element minOccurs="0" name="violatable">
<xs:complexType/>
</xs:element>
......@@ -147,27 +172,8 @@
<xs:annotation>
<xs:documentation>Type information expressed in features and desires</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element ref="global"/>
<xs:element name="operator">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="OnceOnly"/>
<xs:enumeration value="FirstFree"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:sequence>
<xs:element ref="local"/>
<xs:element name="operator">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="+"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:element ref="ptop:global"/>
<xs:element ref="ptop:local"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
......@@ -183,17 +189,38 @@
</xs:annotation>
</xs:element>
<xs:element name="global">
<xs:complexType/>
<xs:complexType>
<xs:sequence>
<xs:element name="operator">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="OnceOnly"/>
<xs:enumeration value="FirstFree"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="local">
<xs:complexType/>
<xs:complexType>
<xs:sequence>
<xs:element name="operator">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="+"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="NodeFlagSpec">
<xs:sequence>
<xs:element minOccurs="0" ref="trivial_bandwidth"/>
<xs:element minOccurs="0" ref="subnode_of"/>
<xs:element minOccurs="0" ref="unique"/>
<xs:element minOccurs="0" ref="disallow_trivial_mix"/>
<xs:element minOccurs="0" ref="ptop:trivial_bandwidth"/>
<xs:element minOccurs="0" ref="ptop:subnode_of"/>
<xs:element minOccurs="0" ref="ptop:unique"/>
<xs:element minOccurs="0" ref="ptop:disallow_trivial_mix"/>
</xs:sequence>
</xs:group>
<xs:element name="trivial_bandwidth" type="xs:integer"/>
......@@ -209,18 +236,18 @@
<xs:documentation>Interfaces</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="interface" type="InterfaceContents"/>
<xs:element name="interface" type="ptop:InterfaceContents"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="InterfaceContents">
<xs:sequence>
<xs:element ref="node_name"/>
<xs:element ref="ptop: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:element minOccurs="0" maxOccurs="unbounded" ref="ptop:property">
<xs:annotation>
<xs:documentation>Properties of the interface</xs:documentation>
</xs:annotation>
......@@ -235,9 +262,9 @@
<xs:element name="property">
<xs:complexType>
<xs:sequence>
<xs:element ref="property_name"/>
<xs:element ref="property_value"/>
<xs:element ref="property_penalty"/>
<xs:element ref="ptop:property_name"/>
<xs:element ref="ptop:property_value"/>
<xs:element ref="ptop:property_penalty"/>
<xs:element minOccurs="0" name="violatable">
<xs:annotation>
<xs:documentation>If this flag is present, not having the property is considered a violation</xs:documentation>
......@@ -246,7 +273,9 @@
</xs:element>
<xs:choice minOccurs="0">
<xs:sequence>
<xs:element ref="global"/>
<xs:element name="global">
<xs:complexType/>
</xs:element>
<xs:element name="operator">
<xs:simpleType>
<xs:restriction base="xs:token">
......@@ -257,7 +286,9 @@
</xs:element>
</xs:sequence>
<xs:sequence>
<xs:element ref="local"/>
<xs:element name="local">
<xs:complexType/>
</xs:element>
<xs:element name="operator">
<xs:simpleType>
<xs:restriction base="xs:token">
......
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