Commit 2bc7dd72 authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

Improve stitching support in advertisement.

parent 1f16d7ae
......@@ -32,371 +32,11 @@ $V_3 = "3";
$emulabns = "http://www.protogeni.net/resources/rspec/ext/emulab/1";
# XXX: This needs to be changed
$emulaburl = "http://www.protogeni.net/resources/rspec/ext/emulab/1/ptop_extension.xsd";
$sharedns = "http://www.protogeni.net/resources/rspec/ext/shared-vlan/1";
$sharedns = "http://www.geni.net/resources/rspec/ext/shared-vlan/1";
$sharedurl = "http://www.geni.net/resources/rspec/ext/shared-vlan/1/ad.xsd";
$stitchns = "http://hpn.east.isi.edu/rspec/ext/stitch/0.1/";
$stitchurl = "http://hpn.east.isi.edu/rspec/ext/stitch/0.1/stitch-schema.xsd";
$stitchxml = <<'STITCH_END';
<stitching xmlns="http://hpn.east.isi.edu/rspec/ext/stitch/0.1/" lastUpdateTime="20110220:09:30:21">
<aggregate id="urn:publicid:IDN+emulab.net+authority+cm" url="https://www.emulab.net/protogeni/xmlrpc/cm">
<aggregatetype>protogeni</aggregatetype>
<stitchingmode>chainANDTree</stitchingmode>
<scheduledservices>false</scheduledservices>
<negotiatedservices>false</negotiatedservices>
<lifetime id="urn:publicid:IDN+emulab.net+authority+cm">
<start type="time">2011-06-01T20:57:53Z</start>
<end type="time">2011-06-01T20:57:53Z</end>
</lifetime>
<node id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-kans">
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-kans:10">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-kans:10:ion">
<remoteLinkId>urn:publicid:IDN+ion.internet2.edu+interface+rtr.kans:ge-7/1/3:protogeni</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-kans:(null)">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-kans:(null):*">
<remoteLinkId>urn:publicid:IDN+emulab.net+interface+*:*:*</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
</node>
<node id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-wash">
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-wash:10">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-wash:10:ion">
<remoteLinkId>"urn:publicid:IDN+ion.internet2.edu+interface+rtr.wash:ge-7/1/3:protogeni"</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-wash:11">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-wash:11:ion">
<remoteLinkId>"urn:publicid:IDN+dragon.maxgigapop.net+interface+mcln:1/2/2:*"</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-wash:(null)">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-wash:(null):*">
<remoteLinkId>urn:publicid:IDN+emulab.net+interface+*:*:*</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
</node>
<node id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-losa">
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-losa:10">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-losa:10:ion">
<remoteLinkId>urn:publicid:IDN+ion.internet2.edu+interface+rtr.losa:ge-7/1/3:protogeni</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-losa:(null)">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-losa:(null):*">
<remoteLinkId>urn:publicid:IDN+emulab.net+interface+*:*:*</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
</node>
<node id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-hous">
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-hous:10">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-hous:10:ion">
<remoteLinkId>urn:publicid:IDN+ion.internet2.edu+interface+rtr.hous:ge-9/1/4:protogeni</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-hous:(null)">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-hous:(null):*">
<remoteLinkId>urn:publicid:IDN+emulab.net+interface+*:*:*</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
</node>
<node id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-atla">
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-atla:10">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-atla:10:ion">
<remoteLinkId>urn:publicid:IDN+ion.internet2.edu+interface+rtr.atla:ge-7/1/6:protogeni</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-atla:(null)">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-atla:(null):*">
<remoteLinkId>urn:publicid:IDN+emulab.net+interface+*:*:*</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
</node>
<node id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-salt">
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-salt:10">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-salt:10:ion">
<remoteLinkId>urn:publicid:IDN+ion.internet2.edu+interface+rtr.salt:ge-7/1/2:protogeni</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
<port id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-salt:(null)">
<capacity>1000000000</capacity>
<maximumReservableCapacity>1000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-salt:(null):*">
<remoteLinkId>urn:publicid:IDN+emulab.net+interface+*:*:*</remoteLinkId>
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<maximumReservableCapacity>10000000000</maximumReservableCapacity>
<minimumReservableCapacity>1000000</minimumReservableCapacity>
<granularity>1000000</granularity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
</port>
</node>
</aggregate>
</stitching>
STITCH_END
if ($PGENISUPPORT) {
require GeniHRN;
}
......@@ -656,6 +296,42 @@ while (($node,$card,$port,$iface,$type,$role,$ip) = $result->fetchrow_array) {
}
}
my %external_nodes;
my %external_ifaces;
my %contact_nodes;
my %contact_ifaces;
my %contact_links;
$result = DBQueryFatal("select w.node_id1, w.card1, w.port1, i1.iface, ".
"w.node_id2, w.card2, w.port2, i2.iface, ".
"e.node_id, e.min_vlan, e.max_vlan ".
"from wires as w ".
"left join external_networks as e ".
"on w.node_id1=e.node_id or w.node_id2=e.node_id ".
"left join interfaces as i1 on w.node_id1=i1.node_id and w.card1=i1.card and w.port1=i1.port ".
"left join interfaces as i2 on w.node_id2=i2.node_id and w.card2=i2.card and w.port2=i2.port ".
"where e.node_id is not null");
while (my ($cnode, $ccard, $cport, $ciface, $enode, $ecard, $eport, $eiface,
$external, $minLan, $maxLan) = $result->fetchrow_array) {
if ($external eq $cnode) {
my $temp;
$temp = $cnode; $cnode = $enode; $enode = $temp;
$temp = $ccard; $ccard = $ecard; $ecard = $temp;
$temp = $cport; $cport = $eport; $eport = $temp;
$temp = $ciface; $ciface = $eiface; $eiface = $temp;
}
if (! defined($eiface)) {
$eiface = "$ecard.$eport";
}
if (! defined($ciface)) {
$ciface = "$ccard.$cport";
}
$external_nodes{$enode} = "$minLan-$maxLan";
$external_ifaces{"$cnode:$enode"} = $eiface;
$contact_nodes{$cnode} = $enode;
$contact_ifaces{"$cnode:$enode"} = $ciface;
}
my %nodetouuid;
my %nodetoavailable;
......@@ -2098,9 +1774,8 @@ sub print_header {
if ($genimode eq $V_2 || $genimode eq $V_3) {
print "xmlns:emulab=\"$emulabns\" ";
print "xsi:schemaLocation=\"$ns $url $emulabns $emulaburl ";
if (defined($MAINSITE) && $MAINSITE) {
print "$stitchns $stitchurl ";
}
print "$sharedns $sharedurl ";
print "\" ";
}
else {
......@@ -2142,8 +1817,36 @@ sub print_footer {
} elsif ($do_xml && $genimode ne $NO_GENI) {
if ($genimode eq $V_2 || $genimode eq $V_3) {
print_type_limits();
if (defined($MAINSITE) && $MAINSITE) {
print $stitchxml;
if (scalar(keys(%contact_nodes)) > 0) {
print "<stitching xmlns=\"$stitchns\" ";
my @times = gmtime(time());
printf("lastUpdateTime=\"%04d-%02d-%02dT%02d:%02d:%02dZ\" ",
$times[5] + 1900, $times[4] + 1, $times[3],
$times[2], $times[1], $times[0]);
print ">\n";
my $cmurn = GeniHRN::Generate($OURDOMAIN, "authority", "cm");
my $cmurl = "@PROTOGENI_URL@";
print "<aggregate id=\"$cmurn\" url=\"$cmurl/am\">\n";
print "<aggregatetype>protogeni</aggregatetype>\n".
"<stitchingmode>chainANDTree</stitchingmode>\n".
"<scheduledservices>false</scheduledservices>\n".
"<negotiatedservices>false</negotiatedservices>\n".
"<lifetime id=\"urn:publicid:IDN+emulab.net+authority+cm\">\n".
" <start type=\"time\">2011-06-01T20:57:53Z</start>\n".
" <end type=\"time\">2011-06-01T20:57:53Z</end>\n".
"</lifetime>\n";
foreach my $node (keys(%contact_nodes)) {
my $external = $contact_nodes{$node};
my $vlans = $external_nodes{$external};
print_stitch_node($node, $contact_ifaces{"$node:$external"},
$contact_links{"$node:$external"},
$external_ifaces{"$node:$external"},
1000000, $vlans, 0);
}
print "</aggregate>\n";
print "</stitching>\n";
}
}
print "</rspec>\n";
......@@ -2203,6 +1906,8 @@ sub print_node
" - " . join(" ", @$flags);
print "$text\n";
} elsif ($genimode ne $NO_GENI) {
add_stitch_interfaces($name, $interfaces);
# rspec format
my $exclusive = "true";
if ($sharing_mode{$name}) {
......@@ -2276,6 +1981,31 @@ sub print_node
}
}
sub add_stitch_interfaces
{
my ($name, $interfaces) = @_;
add_stitch_point($name, $interfaces, \%external_nodes, \%external_ifaces);
add_stitch_point($name, $interfaces, \%contact_nodes, \%contact_ifaces);
}
sub add_stitch_point
{
my ($name, $interfaces, $stitch_nodes, $stitch_ifaces) = @_;
if (exists($stitch_nodes->{$name})) {
foreach my $key (keys(%$stitch_ifaces)) {
if ($key =~ /([^:]+):([^:]+)/) {
if ($name eq $1 || $name eq $2) {
my $foundCount = grep $_ eq $stitch_ifaces->{$key},
@$interfaces;
if ($foundCount == 0) {
push(@$interfaces, $stitch_ifaces->{$key});
}
}
}
}
}
}
# Print osids
sub print_osids
{
......@@ -2575,6 +2305,15 @@ sub print_named_link_xml
my $is_interconnect = shift(@_);
my $proto_count = scalar(@proto);
if ($genimode ne $NO_GENI) {
if (exists($external_ifaces{"$source:$dest"})) {
$source_if = $contact_ifaces{"$source:$dest"};
$dest_if = $external_ifaces{"$source:$dest"};
$contact_links{"$source:$dest"} = $name;
} elsif (exists($external_ifaces{"$dest:$source"})) {
$source_if = $external_ifaces{"$dest:$source"};
$dest_if = $contact_ifaces{"$dest:$source"};
$contact_links{"$dest:$source"} = $name;
}
print "<link ";
my $cmurn = GeniHRN::Generate($OURDOMAIN, "authority", "cm");
if ($genimode eq $V_0_1 || $genimode eq $V_0_2) {
......@@ -2697,8 +2436,8 @@ sub print_type_relation
sub print_stitch_node
{
my ($node, $iface, $link, $remote_iface, $capacity, $vlan_min,
$vlan_max, $vlan_will_translate) = @_;
my ($node, $iface, $link, $remote_iface, $capacity, $vlans,
$vlan_will_translate) = @_;
my $node_urn = GeniHRN::Generate($OURDOMAIN, "node", $node);
my $iface_urn = GeniHRN::GenerateInterface($OURDOMAIN, $node, $iface);
my $link_urn = GeniHRN::Generate($OURDOMAIN, "link", $link);
......@@ -2710,7 +2449,7 @@ sub print_stitch_node
}
print "<node id=\"$node_urn\">\n";
print " <port id=\"$iface_urn\">\n";
print " <capacity>$bits</capacity\n";
print " <capacity>$bits</capacity>\n";
print " <maximumReservableCapacity>$bits".
"</maximumReservableCapacity>\n";
print " <minimumReservableCapacity>1000000".
......@@ -2731,7 +2470,7 @@ sub print_stitch_node
print " <switchingCapabilitySpecificInfo>\n";
print " <switchingCapabilitySpecificInfo_L2sc>\n";
print " <interfaceMTU>9000</interfaceMTU>\n";
print " <vlanRangeAvailability>$vlan_min-$vlan_max".
print " <vlanRangeAvailability>$vlans".
"</vlanRangeAvailability>\n";
print " <vlanTranslation>$vlan_translate</vlanTranslation>\n";
print " </switchingCapabilitySpecificInfo_L2sc>\n";
......
Supports Markdown
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