summaryrefslogtreecommitdiff
path: root/scripts/VyattaQosPolicy.pm
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-03-05 15:05:42 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-03-05 15:05:42 -0800
commit4ef3988035e980e62da5d1557ebec817cba7f3a5 (patch)
tree6513a9e0f50deea7095a2880a48f73f2030f1812 /scripts/VyattaQosPolicy.pm
parent095dfa147f6e3ea833e9c4a4824672a2060b1b2b (diff)
downloadvyatta-cfg-qos-4ef3988035e980e62da5d1557ebec817cba7f3a5.tar.gz
vyatta-cfg-qos-4ef3988035e980e62da5d1557ebec817cba7f3a5.zip
use object factory rather than hardcoded switch for policy config
Having a hardcoded switch statement is harder to update than using a hash.
Diffstat (limited to 'scripts/VyattaQosPolicy.pm')
-rw-r--r--scripts/VyattaQosPolicy.pm34
1 files changed, 0 insertions, 34 deletions
diff --git a/scripts/VyattaQosPolicy.pm b/scripts/VyattaQosPolicy.pm
deleted file mode 100644
index 76f86eb..0000000
--- a/scripts/VyattaQosPolicy.pm
+++ /dev/null
@@ -1,34 +0,0 @@
-package VyattaQosPolicy;
-
-use strict;
-
-require VyattaConfig;
-use VyattaQosTrafficShaper;
-use VyattaQosFairQueue;
-
-# Main class for all QoS policys
-# It is a base class, and actual policies are subclass instances.
-
-# Build a new traffic shaper of the proper type based
-# on the configuration information.
-sub config {
- my ( $class, $config, $type ) = @_;
- my $object = undef;
-
- SWITCH: {
- ( $type eq 'fair-queue' ) && do {
- $object = new VyattaQosFairQueue($config);
- last SWITCH;
- };
-
- ( $type eq 'traffic-shaper' ) && do {
- $object = new VyattaQosTrafficShaper($config);
- last SWITCH;
- };
-
- die "Unknown policy type \"$type\"\n";
- }
- return $object;
-}
-
-1;