Commit 9d127b4a authored by Jonathon Duerig's avatar Jonathon Duerig

Fixed to accomodate Tarun's tweaks to the schema which changed a few thing...

Fixed to accomodate Tarun's tweaks to the schema which changed a few thing from elements to attributes and used interface_ref.
parent e59c6569
...@@ -17,9 +17,15 @@ ...@@ -17,9 +17,15 @@
<xs:element name="link" type="rspec:LinkContents"/> <xs:element name="link" type="rspec:LinkContents"/>
<xs:complexType name="NodeContents"> <xs:complexType name="NodeContents">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:group ref="rspec:NodeTypeList"/> <xs:group ref="rspec:NodeTypeList"/>
<xs:element ref="rspec:interface"/> <xs:element ref="rspec:interface"/>
</xs:choice> </xs:choice>
<xs:choice>
<xs:element ref="rspec:location"/>
<xs:element ref="rspec:available"/>
</xs:choice>
</xs:choice>
<xs:attribute name="virtualization_type"> <xs:attribute name="virtualization_type">
<xs:simpleType> <xs:simpleType>
<xs:restriction base="xs:token"> <xs:restriction base="xs:token">
...@@ -30,37 +36,22 @@ ...@@ -30,37 +36,22 @@
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
</xs:attribute> </xs:attribute>
<xs:attributeGroup ref="rspec:VirtualName"/> <xs:attributeGroup ref="rspec:ComponentName"/>
<xs:attribute name="component_manager_uuid"/>
<xs:attribute name="component_name"/>
<xs:attribute name="component_uuid"/>
<xs:attribute name="colocate"/>
<xs:attribute name="virtualization_subtype"/>
</xs:complexType>
<xs:element name="interface">
<xs:complexType>
<xs:attributeGroup ref="rspec:InterfaceDecl"/>
</xs:complexType> </xs:complexType>
</xs:element> <xs:element name="interface" type="rspec:InterfaceDecl"/>
<xs:element name="available" type="xs:boolean"/>
<xs:complexType name="LinkContents"> <xs:complexType name="LinkContents">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:choice> <xs:choice>
<xs:group ref="rspec:LinkTypeList"/> <xs:group ref="rspec:LinkTypeList"/>
<xs:element name="interface_ref"> <xs:element ref="rspec:interface_ref"/>
<xs:complexType>
<xs:attributeGroup ref="rspec:InterfaceRef"/>
</xs:complexType>
</xs:element>
</xs:choice> </xs:choice>
<xs:choice>
<xs:group ref="rspec:LinkMapping"/>
<xs:choice> <xs:choice>
<xs:element ref="rspec:bandwidth"/> <xs:element ref="rspec:bandwidth"/>
<xs:element ref="rspec:latency"/> <xs:element ref="rspec:latency"/>
<xs:element ref="rspec:packet_loss"/> <xs:element ref="rspec:packet_loss"/>
</xs:choice> </xs:choice>
</xs:choice> </xs:choice>
</xs:choice>
<xs:attribute name="virtualization_type"> <xs:attribute name="virtualization_type">
<xs:simpleType> <xs:simpleType>
<xs:restriction base="xs:token"> <xs:restriction base="xs:token">
...@@ -71,9 +62,13 @@ ...@@ -71,9 +62,13 @@
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
</xs:attribute> </xs:attribute>
<xs:attribute name="link_type"/> <xs:attributeGroup ref="rspec:ComponentName"/>
<xs:attributeGroup ref="rspec:VirtualName"/>
</xs:complexType> </xs:complexType>
<xs:element name="interface_ref">
<xs:complexType>
<xs:attributeGroup ref="rspec:InterfaceRef"/>
</xs:complexType>
</xs:element>
<xs:element name="bandwidth"> <xs:element name="bandwidth">
<xs:annotation> <xs:annotation>
<xs:documentation>Bandwidth of the link in kbps</xs:documentation> <xs:documentation>Bandwidth of the link in kbps</xs:documentation>
...@@ -126,14 +121,19 @@ ...@@ -126,14 +121,19 @@
<xs:attribute name="component_node_uuid" use="required"/> <xs:attribute name="component_node_uuid" use="required"/>
<xs:attribute name="component_interface_id" use="required"/> <xs:attribute name="component_interface_id" use="required"/>
</xs:attributeGroup> </xs:attributeGroup>
<xs:attributeGroup name="InterfaceDecl"> <xs:complexType name="InterfaceDecl">
<xs:attribute name="component_id"/> <xs:sequence>
<xs:attributeGroup ref="rspec:VirtualName"/> <xs:element minOccurs="0" ref="rspec:monitoring"/>
</xs:attributeGroup> </xs:sequence>
<xs:attributeGroup ref="rspec:ComponentInterfaceDeclName"/>
</xs:complexType>
<xs:element name="monitoring">
<xs:complexType>
<xs:attribute name="user_traffic"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="InterfaceRef"> <xs:attributeGroup name="InterfaceRef">
<xs:attribute name="tunnel_ip"/> <xs:attributeGroup ref="rspec:ComponentInterfaceRefName"/>
<xs:attribute name="virtual_node_id" use="required"/>
<xs:attribute name="virtual_interface_id" use="required"/>
</xs:attributeGroup> </xs:attributeGroup>
<xs:element name="location"> <xs:element name="location">
<xs:complexType> <xs:complexType>
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
<xs:attribute name="type" use="required"> <xs:attribute name="type" use="required">
<xs:simpleType> <xs:simpleType>
<xs:restriction base="xs:token"> <xs:restriction base="xs:token">
<xs:enumeration value="request"/> <xs:enumeration value="advertisement"/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
</xs:attribute> </xs:attribute>
......
...@@ -1341,17 +1341,17 @@ sub print_node_types ...@@ -1341,17 +1341,17 @@ sub print_node_types
$name = substr($name, 1); $name = substr($name, 1);
$is_static = 1; $is_static = 1;
} }
print " <node_type>\n"; print " <node_type \n";
print " <type_name>$name</type_name>\n"; print " type_name=\"$name\"\n";
if ($count eq "*") { if ($count eq "*") {
print " <unlimited/>\n"; print " type_slots=\"unlimited\"\n";
} else { } else {
print " <type_slots>$count</type_slots>\n"; print " type_slots=\"$count\"\n";
} }
if ($is_static) { if ($is_static) {
print " <static/>\n"; print " static=\"true\"\n";
} }
print " </node_type>\n"; print " />\n";
} }
} }
...@@ -1414,7 +1414,7 @@ sub print_node_interfaces ...@@ -1414,7 +1414,7 @@ sub print_node_interfaces
for (; $i < scalar(@interfaces); ++$i) { for (; $i < scalar(@interfaces); ++$i) {
my $name = $interfaces[$i]; my $name = $interfaces[$i];
my $urn = GeniHRN::GenerateInterface($OURDOMAIN, $nodeName, $name); my $urn = GeniHRN::GenerateInterface($OURDOMAIN, $nodeName, $name);
print " <interface component_name=\"$urn\"/>\n"; print " <interface component_id=\"$urn\"/>\n";
} }
} }
...@@ -1473,11 +1473,18 @@ sub print_named_link_xml ...@@ -1473,11 +1473,18 @@ sub print_named_link_xml
print " <bandwidth>$bw</bandwidth>\n"; print " <bandwidth>$bw</bandwidth>\n";
print " <latency>$delay</latency>\n"; print " <latency>$delay</latency>\n";
print " <packet_loss>$loss</packet_loss>\n"; print " <packet_loss>$loss</packet_loss>\n";
if ($genimode) {
my $i = 0;
for (; $i < $proto_count; ++$i) {
print " <link_type type_name=\"" . $_[$i] . "\" />\n";
}
} else {
my $i = 0; my $i = 0;
for (; $i < $proto_count; ++$i) { for (; $i < $proto_count; ++$i) {
print " <link_type><type_name>" . $_[$i] print " <link_type><type_name>" . $_[$i]
. "</type_name></link_type>\n"; . "</type_name></link_type>\n";
} }
}
print "</link>\n\n"; print "</link>\n\n";
} }
...@@ -1485,13 +1492,13 @@ sub print_interface ...@@ -1485,13 +1492,13 @@ sub print_interface
{ {
my $node = shift(@_); my $node = shift(@_);
my $interface = shift(@_); my $interface = shift(@_);
print " <interface "; print " <interface_ref ";
print "component_node_uuid=\""; print "component_node_uuid=\"";
my $nodeUrn = GeniHRN::Generate($OURDOMAIN, "node", $node); my $nodeUrn = GeniHRN::Generate($OURDOMAIN, "node", $node);
print $nodeUrn; print $nodeUrn;
my $interfaceUrn = GeniHRN::GenerateInterface($OURDOMAIN, $node, my $interfaceUrn = GeniHRN::GenerateInterface($OURDOMAIN, $node,
$interface); $interface);
print "\" component_interface_name=\"" . $interfaceUrn . "\""; print "\" component_interface_id=\"" . $interfaceUrn . "\"";
print "/>\n"; print "/>\n";
} }
......
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