Commit 92bf08ac authored by Leigh B Stoller's avatar Leigh B Stoller

More bits and pieces for vlan stitching.

Lbs
parent de382e17
...@@ -746,17 +746,23 @@ sub AddInterface($$$$;$$) ...@@ -746,17 +746,23 @@ sub AddInterface($$$$;$$)
if (!defined($interface)); if (!defined($interface));
#print "fee $interface\n"; #print "fee $interface\n";
#
# Set the attribute for the physical interface. # Set the attribute for the physical interface.
if (defined($iface) && # If a member was provided, then the physical interface
$interface->SetAttribute("iface", $iface) != 0) { # is already set. Do not overwrite it.
$interface->Destroy(); #
return undef; if (!defined($member)) {
} if (defined($iface) &&
# And the node $interface->SetAttribute("iface", $iface) != 0) {
if ($interface->SetAttribute("node_id", $node->node_id()) != 0) { $interface->Destroy();
$interface->Destroy(); return undef;
return undef; }
# And the node
if ($interface->SetAttribute("node_id", $node->node_id()) != 0) {
$interface->Destroy();
return undef;
}
} }
return $interface; return $interface;
} }
......
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2005-2010 University of Utah and the Flux Group. # Copyright (c) 2005-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
package Node; package Node;
...@@ -1862,6 +1862,7 @@ sub CreateVnodes($$$) ...@@ -1862,6 +1862,7 @@ sub CreateVnodes($$$)
else { else {
$nodeprefix = $pnode; $nodeprefix = $pnode;
$nodenum = ""; $nodenum = "";
$ipbase = 0;
if ($isjailed) { if ($isjailed) {
# #
......
...@@ -1179,7 +1179,7 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -1179,7 +1179,7 @@ sub GetTicketAuxAux($$$$$$$$$)
my ($auth,undef,undef) = GeniHRN::Parse($urn); my ($auth,undef,undef) = GeniHRN::Parse($urn);
if (defined($auth) and $auth eq $OURDOMAIN) { if (defined($auth) and $auth eq $OURDOMAIN) {
$hopref = $hops{$urn}; $hopref = $hops{$urn};
$hop_urn= $urn; $hop_urn = $urn;
last; last;
} }
} }
...@@ -1189,32 +1189,38 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -1189,32 +1189,38 @@ sub GetTicketAuxAux($$$$$$$$$)
"$lanname: no local component_hop"); "$lanname: no local component_hop");
goto bad; goto bad;
} }
my (undef,undef,$hop_id) = GeniHRN::Parse($hop_urn);
print "$hop_id\n";
# #
# An artifact of the way we convert physical links # Inside is an interface_ref.
# into urns is that we now have to undo that to
# figure out what node and interface. At the moment
# it looks like "link-ion:eth2-procurve-pgeni-wash:(null)"
# #
my ($link,$iface,undef) = split(":", $hop_id); my $ifaceref =
if (! (defined($link) && defined($iface))) { GeniXML::FindFirst("n:interface_ref", $hopref);
if (!defined($ifaceref)) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"$lanname: no iface in component_hop");
goto bad;
}
my (undef,undef,$network_id) = GeniHRN::Parse($hop_urn);
my $iface_node_urn =
GeniXML::GetText("component_node_urn", $ifaceref);
my $iface_iface_id =
GeniXML::GetText("component_interface_id", $ifaceref);
my (undef, undef, $iface_node_id) =
GeniHRN::Parse($iface_node_urn);
if (! (defined($network_id) && defined($iface_node_id) &&
defined($iface_iface_id))) {
$response = $response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef, GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"$lanname: bad component_hop"); "$lanname: bad component_hop");
goto bad; goto bad;
} }
# and strip off the link- stuff.
my ($network_id) = ($link =~ /^link-(.*)$/);
# ditto for the iface cruft.
my ($iface_id) = ($iface =~ /^(eth\d*)/);
if (! ($network_id =~ /^[-\w]*$/ && if (! ($network_id =~ /^[-\w]*$/ &&
$iface_id =~ /^[-\w]*$/)) { $iface_node_id =~ /^[-\w]*$/ &&
$iface_iface_id =~ /^[-\w]*$/)) {
$response = $response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef, GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"$lanname: bad network or iface"); "$lanname: bad network, node or iface");
goto bad; goto bad;
} }
...@@ -1229,7 +1235,7 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -1229,7 +1235,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"$lanname: unknown component_hop"); "$lanname: unknown component_hop");
goto bad; goto bad;
} }
my $network_node = Node->Lookup($network->node_id()); my $network_node = Node->Lookup($iface_node_id);
if (!defined($network_node)) { if (!defined($network_node)) {
$response = $response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef, GeniResponse->Create(GENIRESPONSE_ERROR, undef,
...@@ -1259,7 +1265,7 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -1259,7 +1265,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"desire" => "pcshared", "desire" => "pcshared",
"weight" => 0.95}); "weight" => 0.95});
$virtexperiment->encap_style("vlan"); $virtexperiment->encap_style("vlan");
$iface_name = $iface_id; $iface_name = $iface_iface_id;
$iface_vport = 0; $iface_vport = 0;
goto stitch; goto stitch;
} }
......
...@@ -1711,23 +1711,7 @@ sub ReserveVlanTags($) ...@@ -1711,23 +1711,7 @@ sub ReserveVlanTags($)
goto done; goto done;
} }
my $hop_urn = GeniXML::GetNodeId($hopref); my $hop_urn = GeniXML::GetNodeId($hopref);
my (undef,undef,$hop_id) = GeniHRN::Parse($hop_urn); my (undef,undef,$network_id) = GeniHRN::Parse($hop_urn);
#
# An artifact of the way we convert physical links
# into urns is that we now have to undo that to
# figure out what node and interface. At the moment
# it looks like "link-ion:eth2-procurve-pgeni-wash:(null)"
#
my ($link,$iface,undef) = split(":", $hop_id);
if (! (defined($link) && defined($iface))) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"badly specified component_hop");
goto done;
}
# and strip off the link- stuff.
my ($network_id) = ($link =~ /^link-(.*)$/);
my $network = ExternalNetwork->Lookup($network_id); my $network = ExternalNetwork->Lookup($network_id);
if (!defined($network)) { if (!defined($network)) {
......
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# GENIPUBLIC-COPYRIGHT # GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group. # Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
package GeniSA; package GeniSA;
...@@ -706,7 +706,7 @@ sub BindToSlice($) ...@@ -706,7 +706,7 @@ sub BindToSlice($)
print STDERR "Could not find local authority object\n"; print STDERR "Could not find local authority object\n";
return GeniResponse->Create(GENIRESPONSE_ERROR); return GeniResponse->Create(GENIRESPONSE_ERROR);
} }
my $credential = CheckCredential($cred, $authority); my $credential = CheckCredential($cred);
return $credential return $credential
if (GeniResponse::IsResponse($credential)); if (GeniResponse::IsResponse($credential));
......
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