Commit 5bcc384d authored by Leigh Stoller's avatar Leigh Stoller

Add force_shaping extension to geni-lib and rspec. This will force

end node shaping (and the delay agent) on.
parent 8fb435e0
......@@ -347,6 +347,12 @@ for child in tree.getroot():
lan.best_effort = True
pass
pass
if row.find("mustdelay") != None:
mustdelay = int(row.find("mustdelay").text)
if mustdelay:
lan.setForceShaping()
pass
pass
if row.find("protocol") != None:
protocol = row.find("protocol").text
if protocol != "ethernet":
......
......@@ -432,6 +432,9 @@ foreach my $linkref (GeniXML::FindNodes("n:link", $rspec)->get_nodelist()) {
if (GeniXML::HasBestEffortSetting($linkref)) {
AddLinkStatement($client_id, "best_effort = True");
}
if (GeniXML::HasForceShapingSetting($linkref)) {
AddLinkStatement($client_id, "setForceShaping()");
}
if (GeniXML::HasTrivialSetting($linkref)) {
my $istrivial = (GeniXML::TrivialOkay($linkref) ? "True" : "False");
AddLinkStatement($client_id, "trivial_ok = $istrivial");
......
......@@ -785,6 +785,7 @@ sub GetTicketAuxAux($$$$$$$$$$$)
"Bad routing style: $routertype");
goto bad;
}
#
# User can set the delay image.
#
......@@ -2169,13 +2170,17 @@ sub GetTicketAuxAux($$$$$$$$$$$)
}
#
# Allow user to specify best effort.
# Allow user to specify best effort and force delays.
#
my $besteffort = 0;
my $forcedelay = 0;
if (GeniXML::HasBestEffortSetting($linkref)) {
$besteffort = 1;
}
if (GeniXML::HasForceShapingSetting($linkref)) {
$forcedelay = 1;
}
# Ditto for new direct link option.
my $nointerswitch = GeniXML::NoInterSwitch($linkref);
......@@ -2428,7 +2433,7 @@ sub GetTicketAuxAux($$$$$$$$$$$)
my $rlossrate = 0.0;
my $estbw = undef;
my $restbw = undef;
my $uselinkdelay = 0;
my $uselinkdelay = $forcedelay;
# Let user override.
my $user_bandwidth = GeniXML::GetBandwidth($linkref);
......
......@@ -1094,6 +1094,14 @@ sub HasBestEffortSetting($)
return scalar(@tagged);
}
sub HasForceShapingSetting($)
{
my ($link) = @_;
my @foo = FindNodesNS("n:force_shaping", $link,
$EMULAB_NS)->get_nodelist();
return scalar(@foo);
}
sub HasTrivialSetting($)
{
my ($link) = @_;
......
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