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