Commit d9e2ff8d authored by Leigh B Stoller's avatar Leigh B Stoller

Integrate shared vlan support. See protogeni/test/openflow.rspec

parent b3b91531
......@@ -1071,6 +1071,10 @@ sub Start($$$)
$msg .= "Failed to setup vlans";
goto bad;
}
if ($experiment->SyncPortLans()) {
$msg .= "Failed to add ports to shared vlans";
goto bad;
}
}
#
......@@ -1301,6 +1305,10 @@ sub Stop($$)
%vnodes = %tmp;
if ($version >= 2) {
if ($experiment->ClearPortLans()) {
$msg .= "Failed to remove ports from shared vlans";
goto bad;
}
system("$SNMPIT -r $pid $eid");
if ($?) {
$msg .= "Failed to remove vlans";
......
......@@ -1345,8 +1345,10 @@ sub GetTicketAuxAux($$$$$$$$$)
$ifacemap{$node_nickname}->{$virtual_id} = {"rspec" => $linkref,
"vport" => $vport};
my $member = "$node_nickname:$vport";
# This is used after the mapper runs since it uses vname:vport.
$vportmap{"$node_nickname:$vport"} = {"rspec" => $linkref};
$vportmap{$member} = {"rspec" => $linkref};
}
#
......@@ -1423,6 +1425,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"hoplist" => \@hoplist };
}
}
#
# Now deal with links for wildcarded nodes.
#
......@@ -1725,7 +1728,7 @@ sub GetTicketAuxAux($$$$$$$$$)
my $ip = GeniXML::GetIp($ref, $nodemap{$node_nickname}->{'rspec'});
my $mask = GeniXML::GetMask($ref, $nodemap{$node_nickname}->{'rspec'});
stitch:
# XXX
$ip = "10.10.${linknum}.${ifacenum}" if (!defined($ip));
......@@ -1765,7 +1768,23 @@ sub GetTicketAuxAux($$$$$$$$$)
if (defined($bblob->{'latency'}));
$bridge_vname = $bblob->{'name'};
}
# Watch for shared lans; we have to add the lan entries for them.
my $shared_vlan = GeniXML::GetSharedLanName($linkref);
if (defined($shared_vlan)) {
# This is the magic for libvtop.
$virtexperiment->NewTableRow("virt_lan_settings",
{"vname" => $lanname,
"capkey" => "portvlan",
"capval" => $shared_vlan});
# Clear all this.
$bandwidth = 0;
$latency = 0.0;
$lossrate = 0.0;
}
stitch:
my $virtlan =
$virtexperiment->NewTableRow("virt_lans",
{"vname" => $lanname,
......
#!/usr/bin/perl -w
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2010-2011 University of Utah and the Flux Group.
# Copyright (c) 2010-2012 University of Utah and the Flux Group.
# All rights reserved.
#
package GeniXML;
......@@ -31,7 +31,7 @@ use Carp qw(cluck carp);
use vars qw($RSPEC_0_1 $RSPEC_0_2 $RSPEC_2 $RSPEC_3
$RSPEC_0_1_NS $RSPEC_0_2_NS $RSPEC_2_NS
$EMULAB_NS $XSI_NS $STITCH_NS
$EMULAB_NS $XSI_NS $STITCH_NS $SHAREDVLAN_NS
$REQUEST_2_URL $MANIFEST_2_URL
$REQUEST_3_URL $MANIFEST_3_URL);
$RSPEC_0_1 = "0.1";
......@@ -46,6 +46,7 @@ our $RSPEC_3_NS = "http://www.geni.net/resources/rspec/3";
our $EMULAB_NS = "http://www.protogeni.net/resources/rspec/ext/emulab/1";
our $XSI_NS = "http://www.w3.org/2001/XMLSchema-instance";
our $STITCH_NS = "http://hpn.east.isi.edu/rspec/ext/stitch/0.1/";
our $SHAREDVLAN_NS = "http://www.protogeni.net/resources/rspec/ext/emulab/1";
$REQUEST_2_URL = "http://www.protogeni.net/resources/rspec/2/request.xsd";
$MANIFEST_2_URL = "http://www.protogeni.net/resources/rspec/2/manifest.xsd";
......@@ -667,6 +668,24 @@ sub GetDelayPipes($)
return @result;
}
sub GetSharedLanName($)
{
my ($iface) = @_;
if (! IsVersion0($iface)) {
my $interface_name = FindNodesNS("vlan:link_shared_vlan", $iface,
$SHAREDVLAN_NS)->pop();
if (defined($interface_name)) {
my $name = GetText("name", $interface_name);
if (defined($name) and $name ne "") {
return $name;
}
}
}
return undef;
}
# Takes an attribute/element name, *NOT AN XPATH* and a node and sets
# the text of that node to a particular value. If the node is an
# attribute, the value is set. If it is an element with just a text
......
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