diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-02-06 10:29:43 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-02-06 10:29:43 -0800 |
commit | b67e379379ca5be816c7d6d9cdcec99395556733 (patch) | |
tree | 4b1ed37060b4be7c819d899ddacef524b9d3dd59 | |
parent | 0b8d73903c3a1245c95d3ed92756fe3df649bbed (diff) | |
download | vyatta-cfg-qos-b67e379379ca5be816c7d6d9cdcec99395556733.tar.gz vyatta-cfg-qos-b67e379379ca5be816c7d6d9cdcec99395556733.zip |
rename rate to bandwidth
Make qos syntax more familar to IOS users.
-rw-r--r-- | scripts/VyattaQosTrafficShaper.pm | 8 | ||||
-rw-r--r-- | scripts/VyattaQosUtil.pm | 5 | ||||
-rw-r--r-- | templates/qos-policy/traffic-shaper/node.tag/bandwidth/node.def (renamed from templates/qos-policy/traffic-shaper/node.tag/rate/node.def) | 7 | ||||
-rw-r--r-- | templates/qos-policy/traffic-shaper/node.tag/class/node.tag/bandwidth/node.def (renamed from templates/qos-policy/traffic-shaper/node.tag/class/node.tag/rate/node.def) | 6 | ||||
-rw-r--r-- | templates/qos-policy/traffic-shaper/node.tag/class/node.tag/ceiling/node.def | 7 | ||||
-rw-r--r-- | templates/qos-policy/traffic-shaper/node.tag/default/bandwidth/node.def (renamed from templates/qos-policy/traffic-shaper/node.tag/default/rate/node.def) | 8 | ||||
-rw-r--r-- | templates/qos-policy/traffic-shaper/node.tag/default/ceiling/node.def | 8 |
7 files changed, 31 insertions, 18 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; } diff --git a/templates/qos-policy/traffic-shaper/node.tag/rate/node.def b/templates/qos-policy/traffic-shaper/node.tag/bandwidth/node.def index 1dc02ad..76fa6e2 100644 --- a/templates/qos-policy/traffic-shaper/node.tag/rate/node.def +++ b/templates/qos-policy/traffic-shaper/node.tag/bandwidth/node.def @@ -1,10 +1,11 @@ type: txt -help: Set the base rate for this policy +help: Set the available bandwidth for this policy default: "auto" syntax:expression: exec "[[ \"$VAR(@)\" == \"auto\" ]] || \ /opt/vyatta/sbin/vyatta-qos-util.pl --rate \"$VAR(@)\"" comp_help: Allowed values: - auto Set rate based on interface speed (default) - <number><suffix> Bitrate with scaling suffix + auto Set bandwidth based on interface speed (default) + <number> Bandwidth in Kbps + <number><suffix> Value with scaling suffix bits per sec (kbit, mbit, gbit) bytes per sec (kbps, mbps, gbps) diff --git a/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/rate/node.def b/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/bandwidth/node.def index 94fdd42..839cb0f 100644 --- a/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/rate/node.def +++ b/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/bandwidth/node.def @@ -1,11 +1,11 @@ type: txt default: "100%" -help: Set the base rate for this class +help: Set the bandwidth used for this class syntax:expression: exec "[[ \"$VAR(@)\" =~ '^[0-9]+(\.[0-9]*)?%$' ]] || \ /opt/vyatta/sbin/vyatta-qos-util.pl --rate \"$VAR(@)\"" comp_help: Allowed values: + <number> Bandwidth in Kbps <number>% Percentage of overall rate (default 100%) - <number><suffix> Bitrate with scaling suffix + <number><suffix> Value with scaling suffix bits per sec (kbit, mbit, gbit) bytes per sec (kbps, mbps, gbps) - diff --git a/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/ceiling/node.def b/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/ceiling/node.def index f20191b..65909d0 100644 --- a/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/ceiling/node.def +++ b/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/ceiling/node.def @@ -1,4 +1,9 @@ type: txt -help: Set the limit for this class +help: Set the bandwidth limit for this class syntax:expression: exec "[[ \"$VAR(@)\" =~ '^[0-9]+(\.[0-9]*)?%$' ]] || \ /opt/vyatta/sbin/vyatta-qos-util.pl --rate \"$VAR(@)\"" +comp_help: Allowed values: + <number> Limit in Kbps + <number>% Percentage of overall rate (default 100%) + <number><suffix> Value with scaling suffix + bits per sec (kbit, mbit, gbit) diff --git a/templates/qos-policy/traffic-shaper/node.tag/default/rate/node.def b/templates/qos-policy/traffic-shaper/node.tag/default/bandwidth/node.def index b206332..d728aa1 100644 --- a/templates/qos-policy/traffic-shaper/node.tag/default/rate/node.def +++ b/templates/qos-policy/traffic-shaper/node.tag/default/bandwidth/node.def @@ -1,11 +1,11 @@ type: txt -default: "50%" -help: Set the rate for default traffic +help: Set the bandwidth used for default traffic syntax:expression: exec "[[ \"$VAR(@)\" =~ '^[0-9]+(\.[0-9]*)?%$' ]] || \ /opt/vyatta/sbin/vyatta-qos-util.pl --rate \"$VAR(@)\"" comp_help: Allowed values: - <number>% Percentage of overall rate (default 50%) - <number><suffix> Bitrate with scaling suffix + <number> Bandwidth in Kbps per second + <number>% Percentage of overall rate + <number><suffix> Value with scaling suffix bits per sec (kbit, mbit, gbit) bytes per sec (kbps, mbps, gbps) diff --git a/templates/qos-policy/traffic-shaper/node.tag/default/ceiling/node.def b/templates/qos-policy/traffic-shaper/node.tag/default/ceiling/node.def index a72de5d..4b8bb3f 100644 --- a/templates/qos-policy/traffic-shaper/node.tag/default/ceiling/node.def +++ b/templates/qos-policy/traffic-shaper/node.tag/default/ceiling/node.def @@ -1,6 +1,10 @@ type: txt -help: Set the limit for default traffic +help: Set the bandwidth limit for default traffic default: "100%" syntax:expression: exec "[[ \"$VAR(@)\" =~ '^[0-9]+(\.[0-9]*)?%$' ]] || \ /opt/vyatta/sbin/vyatta-qos-util.pl --rate \"$VAR(@)\"" - +comp_help: Allowed values: + <number> Limit in Kbps + <number>% Percentage of overall rate (default 100%) + <number><suffix> Value with scaling suffix + bits per sec (kbit, mbit, gbit) |