diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-17 10:38:08 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-17 10:38:08 -0700 |
commit | c667c9b128af7a9d8344459c8c65ee9ee8703f02 (patch) | |
tree | 7d81e69553460d081b899016bcc6b0c9e395baa5 /lib/Vyatta/Qos/TrafficShaper.pm | |
parent | 426d6086ebecea13fe29721130f071284ebca899 (diff) | |
download | vyatta-cfg-qos-c667c9b128af7a9d8344459c8c65ee9ee8703f02.tar.gz vyatta-cfg-qos-c667c9b128af7a9d8344459c8c65ee9ee8703f02.zip |
Use select to avoid passing output path around
Easier to just use 'select' in perl to avoid passing file
descriptor everywhere.
Diffstat (limited to 'lib/Vyatta/Qos/TrafficShaper.pm')
-rw-r--r-- | lib/Vyatta/Qos/TrafficShaper.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Vyatta/Qos/TrafficShaper.pm b/lib/Vyatta/Qos/TrafficShaper.pm index dbc3d31..8295764 100644 --- a/lib/Vyatta/Qos/TrafficShaper.pm +++ b/lib/Vyatta/Qos/TrafficShaper.pm @@ -127,7 +127,7 @@ sub _define { } sub commands { - my ( $self, $out, $dev ) = @_; + my ( $self, $dev ) = @_; my $rate = _getAutoRate( $self->{_rate}, $dev ); my $classes = $self->{_classes}; my %dsmark = (); @@ -170,14 +170,14 @@ sub commands { ++$indices; } - print {$out} "qdisc add dev $dev handle 1:0 root dsmark" + print "qdisc add dev $dev handle 1:0 root dsmark" . " indices $indices default_index $default->{id} set_tc_index\n"; foreach my $class (@$classes) { - $class->dsmarkClass( $out, 1, $dev ); + $class->dsmarkClass( 1, $dev ); foreach my $match ( $class->matchRules() ) { - $match->filter( $out, $dev, 1, 1 ); - printf {$out} " classid %x:%x\n", $parent, $class->{id}; + $match->filter( $dev, 1, 1 ); + printf " classid %x:%x\n", $parent, $class->{id}; } } @@ -185,17 +185,17 @@ sub commands { $root = "parent 1:1"; } - printf {$out} "qdisc add dev %s %s handle %x: htb default %x\n", + printf "qdisc add dev %s %s handle %x: htb default %x\n", $dev, $root, $parent, $default->{id}; - printf {$out} "class add dev %s parent %x: classid %x:1 htb rate %s\n", + printf "class add dev %s parent %x: classid %x:1 htb rate %s\n", $dev, $parent, $parent, $rate; foreach my $class (@$classes) { - $class->htbClass( $out, $dev, $parent, $rate ); + $class->htbClass( $dev, $parent, $rate ); foreach my $match ( $class->matchRules() ) { - $match->filter( $out, $dev, $parent, 1, $class->{dsmark} ); - printf {$out} " classid %x:%x\n", $parent, $class->{id}; + $match->filter( $dev, $parent, 1, $class->{dsmark} ); + printf " classid %x:%x\n", $parent, $class->{id}; } } } |