summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Qos/TrafficLimiter.pm
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-20 08:59:52 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-20 08:59:52 -0700
commit97c6b53404e71fe1b6ccb617dafea346f8211ee4 (patch)
tree585859f7423c1dd81285dca22c45c01bdf409591 /lib/Vyatta/Qos/TrafficLimiter.pm
parent8c0855223c04240da56d2ba59e14675432dd88ab (diff)
downloadvyatta-cfg-qos-97c6b53404e71fe1b6ccb617dafea346f8211ee4.tar.gz
vyatta-cfg-qos-97c6b53404e71fe1b6ccb617dafea346f8211ee4.zip
Use perltidy to cleanup indentation
Diffstat (limited to 'lib/Vyatta/Qos/TrafficLimiter.pm')
-rw-r--r--lib/Vyatta/Qos/TrafficLimiter.pm34
1 files changed, 19 insertions, 15 deletions
diff --git a/lib/Vyatta/Qos/TrafficLimiter.pm b/lib/Vyatta/Qos/TrafficLimiter.pm
index b731c64..c30cbb9 100644
--- a/lib/Vyatta/Qos/TrafficLimiter.pm
+++ b/lib/Vyatta/Qos/TrafficLimiter.pm
@@ -53,8 +53,9 @@ sub _define {
my %matchTypes = ();
foreach my $class ( $config->listNodes("class") ) {
foreach my $match ( $config->listNodes("class $class match") ) {
- foreach my $type ( $config->listNodes("class $class match $match") ) {
- next if ($type eq 'description');
+ foreach my $type ( $config->listNodes("class $class match $match") )
+ {
+ next if ( $type eq 'description' );
$matchTypes{$type} = "$class match $match";
}
}
@@ -68,8 +69,8 @@ sub _define {
die "$level can not match on both ip and other types\n";
}
- if ($config->exists('default')) {
- $config->setLevel("$level default");
+ if ( $config->exists('default') ) {
+ $config->setLevel("$level default");
push @classes, new Vyatta::Qos::LimiterClass( $config, 0 );
}
@@ -86,31 +87,34 @@ sub commands {
my $parent;
die "traffic-policy limiter only applies for incoming traffic\n"
- unless ($direction eq 'in');
+ unless ( $direction eq 'in' );
- $parent = 0xffff;
+ $parent = 0xffff;
printf "qdisc add dev %s handle %x: ingress\n", $dev, $parent;
# find largest class id (to use for default)
my $maxid = 0;
foreach my $class (@$classes) {
- my $id = $class->{id};
- $maxid = $id if ($id > $maxid);
+ my $id = $class->{id};
+ $maxid = $id if ( $id > $maxid );
}
foreach my $class (@$classes) {
foreach my $match ( $class->matchRules() ) {
- my $id = $class->{id};
- $id = $maxid + 1 if ($id == 0);
+ my $id = $class->{id};
+ $id = $maxid + 1 if ( $id == 0 );
- my $police = " police rate " . $class->{rate}
- . " action drop burst " . $class->{burst};
+ my $police =
+ " police rate "
+ . $class->{rate}
+ . " action drop burst "
+ . $class->{burst};
- $match->filter( $dev, $parent, $id, $class->{priority},
- undef, $police );
+ $match->filter( $dev, $parent, $id, $class->{priority}, undef,
+ $police );
}
}
-
+
}
1;