summaryrefslogtreecommitdiff
path: root/scripts/vyatta-qos.pl
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-11-20 12:16:02 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-11-20 20:34:16 -0800
commit790663c88fb291ddb5b645bdde62d8229d5e115b (patch)
treebdf236cc76437e82df9254d3cb89ef1c271424bc /scripts/vyatta-qos.pl
parent22fba825c57ed336bca64ff154bbd911bc6754d5 (diff)
downloadvyatta-cfg-qos-790663c88fb291ddb5b645bdde62d8229d5e115b.tar.gz
vyatta-cfg-qos-790663c88fb291ddb5b645bdde62d8229d5e115b.zip
Change perl module names from VyattaQosXXX to Vyatta::Qos:XXX
Use more multi-level directory hierarchy instead of having all modules at top level.
Diffstat (limited to 'scripts/vyatta-qos.pl')
-rwxr-xr-xscripts/vyatta-qos.pl28
1 files changed, 15 insertions, 13 deletions
diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl
index 29a86d0..3437b1b 100755
--- a/scripts/vyatta-qos.pl
+++ b/scripts/vyatta-qos.pl
@@ -14,7 +14,7 @@
# All Rights Reserved.
# **** End License ****
-use lib "/opt/vyatta/share/perl5/";
+use lib "/opt/vyatta/share/perl5";
use VyattaConfig;
use strict;
@@ -41,43 +41,45 @@ GetOptions(
my %policies = (
'out' => {
- 'traffic-shaper' => 'VyattaQosTrafficShaper',
- 'fair-queue' => 'VyattaQosFairQueue',
- 'rate-limit' => 'VyattaQosRateLimiter',
- 'drop-tail' => 'VyattaQosDropTail',
+ 'traffic-shaper' => 'TrafficShaper',
+ 'fair-queue' => 'FairQueue',
+ 'rate-limit' => 'RateLimiter',
+ 'drop-tail' => 'DropTail',
},
'in' => {
- 'traffic-limiter' => 'VyattaQosTrafficLimiter',
+ 'traffic-limiter' => 'TrafficLimiter',
}
);
# class factory for policies
sub make_policy {
my ($config, $type, $name, $direction) = @_;
- my $class;
+ my $policy_type;
if ($direction) {
- $class = $policies{$direction}{$type};
+ $policy_type = $policies{$direction}{$type};
} else {
foreach $direction (keys %policies) {
- $class = $policies{$direction}{$type};
- last if defined $class;
+ $policy_type = $policies{$direction}{$type};
+ last if defined $policy_type;
}
}
# This means template exists but we don't know what it is.
- if (! defined $class) {
+ if (! defined $policy_type) {
foreach $direction (keys %policies) {
die "QoS policy $name is type $type and is only valid for $direction\n"
if defined $policies{$direction}{$type};
}
die "QoS policy $name has not been created\n";
}
+ $config->setLevel("qos-policy $type $name");
+
+ my $location = "Vyatta/Qos/$policy_type.pm";
+ my $class = "Vyatta::Qos::$policy_type";
- my $location = "$class.pm";
require $location;
- $config->setLevel("qos-policy $type $name");
return $class->new($config, $name, $direction);
}