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

More tweaks to stitching.

parent b46f1f63
......@@ -1201,6 +1201,8 @@ sub GetTicketAuxAux($$$$$$$$$)
goto bad;
}
my (undef,undef,$network_id) = GeniHRN::Parse($hop_urn);
# We seem to ignore this for now, since the node we want
# to use is inside the network data structure.
my $iface_node_urn =
GeniXML::GetText("component_node_urn", $ifaceref);
my $iface_iface_id =
......@@ -1235,7 +1237,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"$lanname: unknown component_hop");
goto bad;
}
my $network_node = Node->Lookup($iface_node_id);
my $network_node = Node->Lookup($network->node_id());
if (!defined($network_node)) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
......
......@@ -1554,13 +1554,18 @@ sub ReserveVlanTags($)
my $taglist = $argref->{'taglist'};
my $response;
my $actualtag;
my ($myauth,undef,undef) = GeniHRN::Parse($ENV{'MYURN'});
# List of vlans to delete after getting the tags.
my @delete = ();
my %linkmap = ();
require Lan;
my $me = GeniAuthority->Lookup($ENV{'MYURN'});
if (!defined($me)) {
print STDERR
"Could not find local authority object for $ENV{'MYURN'}\n";
return GeniResponse->Create(GENIRESPONSE_ERROR);
}
if (! (defined($credentials) && defined($slice_cert) &&
defined($taglist) &&
defined($linkname) && defined($slice_urn) && defined($rspecstr))) {
......@@ -1699,8 +1704,8 @@ sub ReserveVlanTags($)
foreach my $ref (GeniXML::FindNodes("n:component_hop",
$linkref)->get_nodelist()) {
my $component_urn = GeniXML::GetNodeId($ref);
my ($auth,undef,undef) = GeniHRN::Parse($component_urn);
if (defined($auth) and $auth eq $myauth) {
my ($domain,undef,undef) = GeniHRN::Parse($component_urn);
if (defined($domain) and $domain eq $me->domain()) {
$hopref = $ref;
last;
}
......@@ -1793,8 +1798,8 @@ sub ReserveVlanTags($)
# Get the last two tokens. Not always the right thing to do.
my $dom = join('.', splice(@tmp, -2, 2));
if ($myauth =~ /$dom$/ && $hisauth =~ /$dom$/) {
print STDERR "ElabInElab clause is true: $myauth $hisauth\n";
if ($me->domain() =~ /$dom$/ && $hisauth =~ /$dom$/) {
print STDERR "ElabInElab clause is true\n";
my $tag = pop(@tags);
if ($vlan->ReserveVlanTag($tag)) {
......
......@@ -19,8 +19,6 @@ sub usage()
exit(1);
}
my $optlist = "";
my $mintag = 750;
my $maxtag = 1000;
my $other_manager;
#
# Configure variables
......@@ -139,6 +137,33 @@ if (!defined($other_manager)) {
fatal("Who is the other manager?");
}
#
# Go through the component hops and find the one that refers to us.
# This is our external network point.
#
my $hopref;
foreach my $ref (GeniXML::FindNodes("n:component_hop",
$linkref)->get_nodelist()) {
my $component_urn = GeniXML::GetNodeId($ref);
my ($domain,undef,undef) = GeniHRN::Parse($component_urn);
if (defined($domain) and $domain eq $me->domain()) {
$hopref = $ref;
last;
}
}
if (!defined($hopref)) {
fatal("Could not find hop in link");
}
my $hop_urn = GeniXML::GetNodeId($hopref);
my (undef,undef,$network_id) = GeniHRN::Parse($hop_urn);
my $network = ExternalNetwork->Lookup($network_id);
if (!defined($network)) {
fatal("$hop_urn is not an external network");
}
# The bounds of the vlan tags we can use for this network point.
my $mintag = $network->min_vlan();
my $maxtag = $network->max_vlan();
#
# Need the slice experiment as the context within to allocate the
# the tags.
......@@ -270,7 +295,8 @@ sub ReserveLocalTags(@)
while (@otags) {
my $t = pop(@otags);
push(@try, $t)
if (VLan->VlanTagAvailable($t));
if ($network->VlanTagOkay($t) &&
VLan->VlanTagAvailable($t));
# But do not let the other CM make us reserve too many at once
last
......
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