diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-11-21 08:47:13 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-11-21 08:47:13 -0800 |
commit | 1962b4d7d72833479789d29622ef5ce2c2f4662f (patch) | |
tree | 05f4718142fb328ea9972a50b5371c5a7a5d6b71 /lib/Vyatta/Qos/TrafficLimiter.pm | |
parent | 790663c88fb291ddb5b645bdde62d8229d5e115b (diff) | |
parent | 375ee54821c5d1f4b29ea11c1b522b0cdabf2e3f (diff) | |
download | vyatta-cfg-qos-1962b4d7d72833479789d29622ef5ce2c2f4662f.tar.gz vyatta-cfg-qos-1962b4d7d72833479789d29622ef5ce2c2f4662f.zip |
Merge branch 'jenner' of suva.vyatta.com:/git/vyatta-cfg-qos into jenner
Conflicts:
lib/Vyatta/Qos/TrafficLimiter.pm
Diffstat (limited to 'lib/Vyatta/Qos/TrafficLimiter.pm')
-rw-r--r-- | lib/Vyatta/Qos/TrafficLimiter.pm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Vyatta/Qos/TrafficLimiter.pm b/lib/Vyatta/Qos/TrafficLimiter.pm index 8564e87..03b3021 100644 --- a/lib/Vyatta/Qos/TrafficLimiter.pm +++ b/lib/Vyatta/Qos/TrafficLimiter.pm @@ -27,6 +27,7 @@ my %fields = ( id => undef, priority => undef, + burst => undef, rate => undef, _match => undef, ); @@ -50,8 +51,11 @@ my @matches = (); my $rate = $config->returnValue("bandwidth"); - defined $rate or die "bandwidth must be defined for $level\n"; $self->{rate} = getRate($rate); + defined $rate or die "bandwidth must be defined for $level\n"; + + $self->{burst} = $config->returnValue("burst"); + defined $self->{burst} or die "burst must be defined for $level\n"; $self->{priority} = $config->returnValue("priority"); @@ -133,13 +137,10 @@ sub commands { printf {$out} "qdisc add dev %s handle %x: ingress\n", $dev, $parent; foreach my $class (@$classes) { - my $id = $class->{id}; - my $rate = $class->{rate}; - my $priority = $class->{priority}; - foreach my $match ( $class->matchRules() ) { - $match->filter( $out, $dev, $parent, $priority ); - printf {$out} " police avrate %s drop flowid :%x\n", $rate, $id; + $match->filter( $out, $dev, $parent, $class->{priority} ); + printf {$out} " police rate %s burst %s drop flowid :%x\n", + $class->{rate}, $class->{burst}, $class->{id}; } } } |