diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-19 10:10:59 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-19 10:10:59 -0700 |
commit | e955a55bcdf42ee9079e9d9575b53ae8c050c122 (patch) | |
tree | cea95d99cc561600d1bbf9882d64a081d39da274 /lib/Vyatta/Qos/TrafficShaper.pm | |
parent | df1d6348323708b34958cd622e02cbba122c748a (diff) | |
download | vyatta-cfg-qos-e955a55bcdf42ee9079e9d9575b53ae8c050c122.tar.gz vyatta-cfg-qos-e955a55bcdf42ee9079e9d9575b53ae8c050c122.zip |
Move getAutoRate into Util
The getAutoRate function is needed by WRED as well
Diffstat (limited to 'lib/Vyatta/Qos/TrafficShaper.pm')
-rw-r--r-- | lib/Vyatta/Qos/TrafficShaper.pm | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/lib/Vyatta/Qos/TrafficShaper.pm b/lib/Vyatta/Qos/TrafficShaper.pm index 114bba7..665a47d 100644 --- a/lib/Vyatta/Qos/TrafficShaper.pm +++ b/lib/Vyatta/Qos/TrafficShaper.pm @@ -45,25 +45,6 @@ sub new { return $self; } -# Rate can be something like "auto" or "10.2mbit" -sub _getAutoRate { - my ( $rate, $dev ) = @_; - - if ( $rate eq "auto" ) { - $rate = interfaceRate($dev); - if ( !defined $rate ) { - print STDERR - "Interface $dev speed cannot be determined (assuming 10mbit)\n"; - $rate = 10000000; - } - } - else { - $rate = getRate($rate); - } - - return $rate; -} - sub _getClasses { my $level = shift; my @classes; @@ -103,7 +84,7 @@ sub _checkClasses { sub commands { my ( $self, $dev ) = @_; - my $rate = _getAutoRate( $self->{_rate}, $dev ); + my $rate = getAutoRate( $self->{_rate}, $dev ); my $classes = $self->{_classes}; my %dsmark = (); my $default = shift @$classes; |