diff options
-rw-r--r-- | lib/Vyatta/Qos/Match.pm | 9 | ||||
-rw-r--r-- | lib/Vyatta/Qos/RoundRobin.pm | 3 | ||||
-rw-r--r-- | lib/Vyatta/Qos/TrafficLimiter.pm | 8 |
3 files changed, 11 insertions, 9 deletions
diff --git a/lib/Vyatta/Qos/Match.pm b/lib/Vyatta/Qos/Match.pm index 033aee1..327fbd4 100644 --- a/lib/Vyatta/Qos/Match.pm +++ b/lib/Vyatta/Qos/Match.pm @@ -63,7 +63,7 @@ sub new { } sub filter { - my ( $self, $dev, $parent, $classid, $prio, $dsmark ) = @_; + my ( $self, $dev, $parent, $classid, $prio, $dsmark, $police ) = @_; # empty match return unless %{$self}; @@ -126,8 +126,8 @@ sub filter { print " match $sel dst $$p{dst}" if $$p{dst}; print " match $sel dport $$p{dport} 0xffff" if $$p{dport}; } - - printf " classid %x:%x\n", $parent, $classid; + print " $police" if $police; + printf " flowid %x:%x\n", $parent, $classid; } my $indev = $self->{_indev}; @@ -137,6 +137,7 @@ sub filter { print " protocol all basic"; print " match meta\(rt_iif eq $indev\)" if $indev; print " match meta\(vlan mask 0xfff eq $vif\)" if $vif; - printf " classid %x:%x\n", $parent, $classid; + print " $police" if $police; + printf " flowid %x:%x\n", $parent, $classid; } } diff --git a/lib/Vyatta/Qos/RoundRobin.pm b/lib/Vyatta/Qos/RoundRobin.pm index af45875..a1d7787 100644 --- a/lib/Vyatta/Qos/RoundRobin.pm +++ b/lib/Vyatta/Qos/RoundRobin.pm @@ -68,8 +68,7 @@ sub commands { $class->gen_class( $dev, 'drr', $parent ); $class->gen_leaf( $dev, $parent ); foreach my $match ( $class->matchRules() ) { - $match->filter( $dev, $parent, 1 ); - printf " classid %x:%x\n", $parent, $class->{id}; + $match->filter( $dev, $parent, $class->{id}, 1); } } } diff --git a/lib/Vyatta/Qos/TrafficLimiter.pm b/lib/Vyatta/Qos/TrafficLimiter.pm index b2fd07c..e5731d0 100644 --- a/lib/Vyatta/Qos/TrafficLimiter.pm +++ b/lib/Vyatta/Qos/TrafficLimiter.pm @@ -83,9 +83,11 @@ sub commands { printf "qdisc add dev %s handle %x: ingress\n", $dev, $parent; foreach my $class (@$classes) { foreach my $match ( $class->matchRules() ) { - $match->filter( $dev, $parent, $class->{priority} ); - printf " police rate %s burst %s drop flowid :%x\n", - $class->{rate}, $class->{burst}, $class->{id}; + my $police = " police rate " . $class->{rate} + . " burst " . $class->{burst}; + + $match->filter( $dev, $parent, $class->{id}, $class->{priority}, + undef, $police ); } } } |