diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-01-12 08:00:04 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-01-12 08:00:04 -0800 |
commit | 092a710bbe0ac05607ca9d4417b534597849aaa9 (patch) | |
tree | dce90d3674e31cd196e3f0464e9862970d64b8c0 /lib/Vyatta/Qos/TrafficLimiter.pm | |
parent | 1f8762b9f955bd2b4c024012df783a1d51191a86 (diff) | |
parent | 33b8a1ebeb7925890bd744d1bda5f5c6c686c537 (diff) | |
download | vyatta-cfg-qos-092a710bbe0ac05607ca9d4417b534597849aaa9.tar.gz vyatta-cfg-qos-092a710bbe0ac05607ca9d4417b534597849aaa9.zip |
Merge branch 'kenwood' of suva.vyatta.com:/git/vyatta-cfg-qos into kenwood
Diffstat (limited to 'lib/Vyatta/Qos/TrafficLimiter.pm')
-rw-r--r-- | lib/Vyatta/Qos/TrafficLimiter.pm | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/lib/Vyatta/Qos/TrafficLimiter.pm b/lib/Vyatta/Qos/TrafficLimiter.pm index fd3460c..e5731d0 100644 --- a/lib/Vyatta/Qos/TrafficLimiter.pm +++ b/lib/Vyatta/Qos/TrafficLimiter.pm @@ -83,56 +83,13 @@ 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}; - } - } -} - -# Walk configuration tree and look for changed nodes -# The configuration system should do this but doesn't do it right -sub isChanged { - my ( $self, $name ) = @_; - my $config = new Vyatta::Config; + my $police = " police rate " . $class->{rate} + . " burst " . $class->{burst}; - $config->setLevel("qos-policy traffic-limiter $name"); - my %classNodes = $config->listNodeStatus('class'); - while ( my ( $class, $status ) = each %classNodes ) { - if ( $status ne 'static' ) { - return "class $class"; - } - - foreach my $attr ( 'bandwidth', 'burst', 'priority' ) { - if ( $config->isChanged("class $class $attr") ) { - return "class $class $attr"; - } - } - - my %matchNodes = $config->listNodeStatus("class $class match"); - while ( my ( $match, $status ) = each %matchNodes ) { - my $level = "class $class match $match"; - if ( $status ne 'static' ) { - return $level; - } - - foreach my $parm ( - 'vif', - 'interface', - 'ip dscp', - 'ip protocol', - 'ip source address', - 'ip destination address', - 'ip source port', - 'ip destination port' - ) - { - return "$level $parm" if ( $config->isChanged("$level $parm") ); - } + $match->filter( $dev, $parent, $class->{id}, $class->{priority}, + undef, $police ); } } - - return; # false } 1; |