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

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

parent b3b91531
...@@ -1071,6 +1071,10 @@ sub Start($$$) ...@@ -1071,6 +1071,10 @@ sub Start($$$)
$msg .= "Failed to setup vlans"; $msg .= "Failed to setup vlans";
goto bad; goto bad;
} }
if ($experiment->SyncPortLans()) {
$msg .= "Failed to add ports to shared vlans";
goto bad;
}
} }
# #
...@@ -1301,6 +1305,10 @@ sub Stop($$) ...@@ -1301,6 +1305,10 @@ sub Stop($$)
%vnodes = %tmp; %vnodes = %tmp;
if ($version >= 2) { if ($version >= 2) {
if ($experiment->ClearPortLans()) {
$msg .= "Failed to remove ports from shared vlans";
goto bad;
}
system("$SNMPIT -r $pid $eid"); system("$SNMPIT -r $pid $eid");
if ($?) { if ($?) {
$msg .= "Failed to remove vlans"; $msg .= "Failed to remove vlans";
......
...@@ -1345,8 +1345,10 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -1345,8 +1345,10 @@ sub GetTicketAuxAux($$$$$$$$$)
$ifacemap{$node_nickname}->{$virtual_id} = {"rspec" => $linkref, $ifacemap{$node_nickname}->{$virtual_id} = {"rspec" => $linkref,
"vport" => $vport}; "vport" => $vport};
my $member = "$node_nickname:$vport";
# This is used after the mapper runs since it uses vname: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($$$$$$$$$) ...@@ -1423,6 +1425,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"hoplist" => \@hoplist }; "hoplist" => \@hoplist };
} }
} }
# #
# Now deal with links for wildcarded nodes. # Now deal with links for wildcarded nodes.
# #
...@@ -1766,6 +1769,22 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -1766,6 +1769,22 @@ sub GetTicketAuxAux($$$$$$$$$)
$bridge_vname = $bblob->{'name'}; $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 = my $virtlan =
$virtexperiment->NewTableRow("virt_lans", $virtexperiment->NewTableRow("virt_lans",
{"vname" => $lanname, {"vname" => $lanname,
......
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# GENIPUBLIC-COPYRIGHT # 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. # All rights reserved.
# #
package GeniXML; package GeniXML;
...@@ -31,7 +31,7 @@ use Carp qw(cluck carp); ...@@ -31,7 +31,7 @@ use Carp qw(cluck carp);
use vars qw($RSPEC_0_1 $RSPEC_0_2 $RSPEC_2 $RSPEC_3 use vars qw($RSPEC_0_1 $RSPEC_0_2 $RSPEC_2 $RSPEC_3
$RSPEC_0_1_NS $RSPEC_0_2_NS $RSPEC_2_NS $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_2_URL $MANIFEST_2_URL
$REQUEST_3_URL $MANIFEST_3_URL); $REQUEST_3_URL $MANIFEST_3_URL);
$RSPEC_0_1 = "0.1"; $RSPEC_0_1 = "0.1";
...@@ -46,6 +46,7 @@ our $RSPEC_3_NS = "http://www.geni.net/resources/rspec/3"; ...@@ -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 $EMULAB_NS = "http://www.protogeni.net/resources/rspec/ext/emulab/1";
our $XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"; our $XSI_NS = "http://www.w3.org/2001/XMLSchema-instance";
our $STITCH_NS = "http://hpn.east.isi.edu/rspec/ext/stitch/0.1/"; 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"; $REQUEST_2_URL = "http://www.protogeni.net/resources/rspec/2/request.xsd";
$MANIFEST_2_URL = "http://www.protogeni.net/resources/rspec/2/manifest.xsd"; $MANIFEST_2_URL = "http://www.protogeni.net/resources/rspec/2/manifest.xsd";
...@@ -667,6 +668,24 @@ sub GetDelayPipes($) ...@@ -667,6 +668,24 @@ sub GetDelayPipes($)
return @result; 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 # 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 # 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 # 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