summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-06 10:29:43 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-06 10:29:43 -0800
commitb67e379379ca5be816c7d6d9cdcec99395556733 (patch)
tree4b1ed37060b4be7c819d899ddacef524b9d3dd59 /scripts
parent0b8d73903c3a1245c95d3ed92756fe3df649bbed (diff)
downloadvyatta-cfg-qos-b67e379379ca5be816c7d6d9cdcec99395556733.tar.gz
vyatta-cfg-qos-b67e379379ca5be816c7d6d9cdcec99395556733.zip
rename rate to bandwidth
Make qos syntax more familar to IOS users.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VyattaQosTrafficShaper.pm8
-rw-r--r--scripts/VyattaQosUtil.pm5
2 files changed, 8 insertions, 5 deletions
diff --git a/scripts/VyattaQosTrafficShaper.pm b/scripts/VyattaQosTrafficShaper.pm
index 16c1fef..e051542 100644
--- a/scripts/VyattaQosTrafficShaper.pm
+++ b/scripts/VyattaQosTrafficShaper.pm
@@ -34,8 +34,8 @@
my $level = $config->setLevel();
my @matches = ();
- $self->{_rate} = $config->returnValue("rate");
- defined $self->{_rate} or die "Rate not defined for class $id\n";
+ $self->{_rate} = $config->returnValue("bandwidth");
+ defined $self->{_rate} or die "Bandwidth not defined for class $id\n";
$self->{_id} = sprintf "%04x", $id;
$self->{_priority} = $config->returnValue("priority");
@@ -79,14 +79,14 @@
my $matches = $self->{_match};
$rate <= $speed or
- die "Rate for class $id ($rate) must be less than overall rate ($speed)\n";
+ die "Bandwidth for class $id ($rate) must be less than overall bandwidth ($speed)\n";
# create the class
my $cmd ="class add dev $dev parent 1:1 classid 1:$id htb rate $rate";
if ( defined $ceil) {
$ceil >= $rate or
- die "Rate ceiling ($ceil) must be greater than base rate ($rate)\n";
+ die "Ceiling ($ceil) must be greater than bandwith ($rate)\n";
$cmd .= " ceil $ceil";
}
diff --git a/scripts/VyattaQosUtil.pm b/scripts/VyattaQosUtil.pm
index 0c9ab83..d8a5fa1 100644
--- a/scripts/VyattaQosUtil.pm
+++ b/scripts/VyattaQosUtil.pm
@@ -47,9 +47,12 @@ sub getRate {
die "Rate must be a number followed by a optional suffix (kbit, mbps, ...)\n";
}
+ } else {
+ # No suffix implies Kbps just as IOS
+ $num *= 8000;
}
- die "Negative rate not allowed\n" if ($num < 0);
+ ($num >= 0) or die "Negative rate not allowed\n";
return $num;
}