Commit 0608e843 authored by Jonathon Duerig's avatar Jonathon Duerig

Fix up 'any' vlantag support for stitching.

parent 603d3489
......@@ -3941,7 +3941,6 @@ use libdb;
use libtestbed;
use English;
use Lan;
use String::Util 'trim';
use overload ('""' => 'Stringify');
#
......@@ -4056,17 +4055,17 @@ sub VlanToSet($$)
}
my $i = $min;
for ($i = $min; $i <= $max; $i += 1) {
%result{$i} = 1;
$result{$i} = 1;
}
}
}
return %result;
return \%result;
}
sub CalculateVlans($)
{
my ($self) = @_;
$self->{'VLANSET'} = $($self->VlanToSet($self->vlans()));
$self->{'VLANSET'} = $self->VlanToSet($self->vlans());
# vlans is a comma-delimited list
# my @vlans = split(",", $self->vlans());
......@@ -4088,19 +4087,20 @@ sub CalculateVlans($)
sub GetRestrictedVlans($$)
{
my ($self, $restrictionString) = @_;
$restrictionString = trim($restrictionString);
$restrictionString =~ s/^\s*//g;
$restrictionString =~ s/\s*$//g;
my %result = ();
if ($restrictionString eq "" || $restrictionString eq "any") {
%result = %{ $self->{'VLANSET'} };
} else {
my %restriction = $self->VlanToSet($restrictionString);
my %restriction = %{ $self->VlanToSet($restrictionString) };
foreach my $candidate (keys(%{ $self->{'VLANSET'} })) {
if (%restriction{$candidate}) {
if ($restriction{$candidate}) {
$result{$candidate} = 1;
}
}
}
return %result;
return \%result;
}
# Return the list calculated above.
......
......@@ -115,7 +115,7 @@ sub vlan_list($)
foreach my $point (@{ $self->points() }) {
if ($first) {
my $available = GeniXML::GetAvailableVlanFromHop($point->{'internal_hop'});
@candidates = keys($point->{'network'}->GetRestrictedVlans(available));
@candidates = keys(%{ $point->{'network'}->GetRestrictedVlans($available) });
$first = 0;
} else {
my @newlist = ();
......
......@@ -3,8 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2 http://www.protogeni.net/resources/rspec/2/request.xsd"
type="request" >
<node client_id="my-node"
exclusive="true">
<sliver_type name="emulab-openvz" />
<node client_id="m">
<sliver_type name="emulab-xen" />
</node>
</rspec>
......@@ -4,27 +4,21 @@
xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
http://www.protogeni.net/resources/rspec/2/request.xsd"
type="request">
<node client_id="left"
component_manager_id="urn:publicid:IDN+emulab.net+authority+cm"
exclusive="true">
<sliver_type name="raw-pc">
<disk_image
name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA10-STD" />
</sliver_type>
<node client_id="l"
component_manager_id="urn:publicid:IDN+am-test.testbed.emulab.net+authority+cm">
<sliver_type name="emulab-xen" />
<interface client_id="left:if0">
<ip address="192.168.44.1" netmask="255.255.255.0" type="ipv4"/>
</interface>
</node>
<node client_id="right"
component_id="urn:publicid:IDN+dragon.maxgigapop.net+node+planetlab2"
component_manager_id="urn:publicid:IDN+dragon.maxgigapop.net+authority+cm"
exclusive="true">
<node client_id="r"
component_manager_id="urn:publicid:IDN+al2s.internet2.edu+authority+am"
exclusive="false">
<sliver_type name="raw-pc">
<disk_image
name="urn:publicid:IDN+uky.emulab.net+image+emulab-ops//FEDORA10-STD" />
</sliver_type>
<interface client_id="right:if0"
component_id="urn:publicid:IDN+dragon.maxgigapop.net+interface+planetlab2:eth1">
<interface client_id="right:if0">
<ip address="192.168.44.2" netmask="255.255.255.0" type="ipv4"/>
</interface>
</node>
......@@ -38,7 +32,7 @@ http://www.protogeni.net/resources/rspec/2/request.xsd"
<path id="mylink" >
<hop id="1" type="strict">
<link id="urn:publicid:IDN+emulab.net+interface+*:*">
<link id="urn:publicid:IDN+am-test.testbed.emulab.net+interface+*:*">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
......@@ -47,7 +41,7 @@ http://www.protogeni.net/resources/rspec/2/request.xsd"
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<suggestedVLANRange>null</suggestedVLANRange>
<suggestedVLANRange>any</suggestedVLANRange>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
......@@ -56,7 +50,7 @@ http://www.protogeni.net/resources/rspec/2/request.xsd"
</hop>
<hop id="2" type="strict">
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-salt:*">
<link id="urn:publicid:IDN+am-test.testbed.emulab.net+interface+cisco3:*">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<switchingCapabilityDescriptor>
......@@ -66,7 +60,7 @@ http://www.protogeni.net/resources/rspec/2/request.xsd"
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<suggestedVLANRange>null</suggestedVLANRange>
<suggestedVLANRange>any</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
......@@ -76,7 +70,7 @@ http://www.protogeni.net/resources/rspec/2/request.xsd"
</hop>
<hop id="3" type="strict">
<link id="urn:publicid:IDN+emulab.net+interface+procurve-pgeni-salt:eth0:ion">
<link id="urn:publicid:IDN+am-test.testbed.emulab.net+interface+interconnect-test:eth0">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<switchingCapabilityDescriptor>
......@@ -86,7 +80,7 @@ http://www.protogeni.net/resources/rspec/2/request.xsd"
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<suggestedVLANRange>null</suggestedVLANRange>
<suggestedVLANRange>any</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
......@@ -96,7 +90,7 @@ http://www.protogeni.net/resources/rspec/2/request.xsd"
</hop>
<hop id="4" type="strict">
<link id="urn:publicid:IDN+ion.internet2.edu+interface+rtr.salt:ge-7/1/2:protogeni">
<link id="urn:publicid:IDN+al2s.internet2.edu+interface+test-interface">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<switchingCapabilityDescriptor>
......@@ -112,86 +106,6 @@ http://www.protogeni.net/resources/rspec/2/request.xsd"
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>5</nextHop>
</hop>
<hop id="5" type="strict">
<link id="urn:publicid:IDN+ion.internet2.edu+interface+rtr.newy:xe-0/0/3:*">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>3020-3030,3100-3109,3200-3219</vlanRangeAvailability>
<suggestedVLANRange>null</suggestedVLANRange>
<vlanTranslation>true</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>6</nextHop>
</hop>
<hop id="6" type="strict">
<link id="urn:publicid:IDN+dragon.maxgigapop.net+interface+clpk:1/2/3:*">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>3020-3030,3100-3109,3200-3219</vlanRangeAvailability>
<suggestedVLANRange>null</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>7</nextHop>
</hop>
<hop id="7" type="strict">
<link id="urn:publicid:IDN+dragon.maxgigapop.net+interface+clpk:(null):*">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>1000000000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<suggestedVLANRange>null</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>8</nextHop>
</hop>
<hop id="8" type="strict">
<link id="urn:publicid:IDN+dragon.maxgigapop.net+interface+planetlab2:eth1">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>1000000000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<suggestedVLANRange>null</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>null</nextHop>
</hop>
......
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