summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Qos/TrafficLimiter.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/Qos/TrafficLimiter.pm')
-rw-r--r--lib/Vyatta/Qos/TrafficLimiter.pm15
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};
}
}
}