summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-06-07 10:31:08 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-06-07 10:31:08 -0700
commit4f12cc5f730a7759bc668b56165fe79b058dcfcd (patch)
treecef522671cb4575f9bca05ea61323e2956753557
parentc5bbc092581f7113d7aa967105ab46668314e9bc (diff)
downloadvyatta-cfg-qos-4f12cc5f730a7759bc668b56165fe79b058dcfcd.tar.gz
vyatta-cfg-qos-4f12cc5f730a7759bc668b56165fe79b058dcfcd.zip
Revert "Move traffic-limiter to input-policy"
This reverts commit b75a66a4d5768f22a4b995d49ba442de8762a800.
-rw-r--r--interface-templates/qos-policy/in/node.def5
-rw-r--r--lib/Vyatta/Qos/TrafficLimiter.pm (renamed from lib/Vyatta/Qos/IngressLimit.pm)14
-rw-r--r--templates/qos-policy/traffic-limiter/node.def8
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.def (renamed from interface-templates/input-policy/limit/class/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/bandwidth/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/bandwidth/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/burst/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/burst/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/description/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/description/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/description/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/description/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ether/destination/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ether/destination/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ether/protocol/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ether/protocol/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ether/source/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ether/source/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/destination/address/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/destination/address/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/destination/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/destination/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/destination/port/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/destination/port/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/dscp/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/dscp/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/protocol/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/protocol/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/source/address/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/source/address/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/source/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/source/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/source/port/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/source/port/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/destination/address/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/destination/address/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/destination/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/destination/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/destination/port/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/destination/port/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/dscp/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/dscp/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/protocol/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/protocol/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/source/address/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/source/address/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/source/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/source/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/source/port/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/source/port/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/vif/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/match/node.tag/vif/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/priority/node.def (renamed from interface-templates/input-policy/limit/class/node.tag/priority/node.def)0
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/description/node.def (renamed from interface-templates/input-policy/limit/description/node.def)0
31 files changed, 23 insertions, 4 deletions
diff --git a/interface-templates/qos-policy/in/node.def b/interface-templates/qos-policy/in/node.def
new file mode 100644
index 0000000..67d3e4b
--- /dev/null
+++ b/interface-templates/qos-policy/in/node.def
@@ -0,0 +1,5 @@
+type: txt
+help: Set inbound QOS policy for interface
+allowed: /opt/vyatta/sbin/vyatta-qos.pl --list-policy in
+update: /opt/vyatta/sbin/vyatta-qos.pl --update-interface $IFNAME in $VAR(@)
+delete: /opt/vyatta/sbin/vyatta-qos.pl --delete-interface $IFNAME in
diff --git a/lib/Vyatta/Qos/IngressLimit.pm b/lib/Vyatta/Qos/TrafficLimiter.pm
index e9e2fbb..246d593 100644
--- a/lib/Vyatta/Qos/IngressLimit.pm
+++ b/lib/Vyatta/Qos/TrafficLimiter.pm
@@ -1,4 +1,5 @@
-# Ingress traffic limit
+# Traffic limiter
+# This is a rate limiter based on ingress qdisc
#
# **** License ****
# This program is free software; you can redistribute it and/or modify
@@ -11,22 +12,26 @@
# General Public License for more details.
#
# This code was originally developed by Vyatta, Inc.
-# Portions created by Vyatta are Copyright (C) 2010 Vyatta, Inc.
+# Portions created by Vyatta are Copyright (C) 2008 Vyatta, Inc.
# All Rights Reserved.
# **** End License ****
-package Vyatta::Qos::IngressLimit;
+package Vyatta::Qos::TrafficLimiter;
use strict;
use warnings;
require Vyatta::Config;
require Vyatta::Qos::LimiterClass;
+my %fields = (
+ _level => undef,
+ _classes => undef,
+);
# Create a new instance based on config information
sub new {
my ( $that, $config, $name ) = @_;
- my $self = {};
+ my $self = {%fields};
my $class = ref($that) || $that;
bless $self, $class;
@@ -36,6 +41,7 @@ sub new {
}
# Setup new instance.
+# Assumes caller has done $config->setLevel to "traffic-limiter $name"
sub _define {
my ( $self, $config ) = @_;
my $level = $config->setLevel();
diff --git a/templates/qos-policy/traffic-limiter/node.def b/templates/qos-policy/traffic-limiter/node.def
new file mode 100644
index 0000000..f8bdf26
--- /dev/null
+++ b/templates/qos-policy/traffic-limiter/node.def
@@ -0,0 +1,8 @@
+tag:
+type: txt
+help: Set traffic input limiting policy
+syntax:expression: pattern $VAR(@) "^[[:alnum:]][-_[:alnum:]]*$"
+ ; "only alpha-numeric policy name allowed"
+create: /opt/vyatta/sbin/vyatta-qos.pl --create-policy $VAR(.) $VAR(@)
+delete: /opt/vyatta/sbin/vyatta-qos.pl --delete-policy $VAR(@)
+end: /opt/vyatta/sbin/vyatta-qos.pl --apply-policy $VAR(@)
diff --git a/interface-templates/input-policy/limit/class/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.def
index 2a77af0..2a77af0 100644
--- a/interface-templates/input-policy/limit/class/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/bandwidth/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/bandwidth/node.def
index 13c70ee..13c70ee 100644
--- a/interface-templates/input-policy/limit/class/node.tag/bandwidth/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/bandwidth/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/burst/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/burst/node.def
index e22453c..e22453c 100644
--- a/interface-templates/input-policy/limit/class/node.tag/burst/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/burst/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/description/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/description/node.def
index d4241e7..d4241e7 100644
--- a/interface-templates/input-policy/limit/class/node.tag/description/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/description/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.def
index 2a5d021..2a5d021 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/description/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/description/node.def
index a56c59c..a56c59c 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/description/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/description/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ether/destination/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ether/destination/node.def
index e8be347..e8be347 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ether/destination/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ether/destination/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ether/protocol/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ether/protocol/node.def
index 05d6511..05d6511 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ether/protocol/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ether/protocol/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ether/source/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ether/source/node.def
index b993af6..b993af6 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ether/source/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ether/source/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/destination/address/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/destination/address/node.def
index ccd2d14..ccd2d14 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/destination/address/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/destination/address/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/destination/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/destination/node.def
index 54eef5b..54eef5b 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/destination/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/destination/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/destination/port/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/destination/port/node.def
index 561899c..561899c 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/destination/port/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/destination/port/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/dscp/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/dscp/node.def
index d02dc5c..d02dc5c 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/dscp/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/dscp/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/protocol/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/protocol/node.def
index 9c665c2..9c665c2 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/protocol/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/protocol/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/source/address/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/source/address/node.def
index 0bc690a..0bc690a 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/source/address/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/source/address/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/source/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/source/node.def
index 4271b94..4271b94 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/source/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/source/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/source/port/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/source/port/node.def
index ecd96ab..ecd96ab 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ip/source/port/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ip/source/port/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/destination/address/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/destination/address/node.def
index 2f608f8..2f608f8 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/destination/address/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/destination/address/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/destination/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/destination/node.def
index 54eef5b..54eef5b 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/destination/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/destination/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/destination/port/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/destination/port/node.def
index 561899c..561899c 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/destination/port/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/destination/port/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/dscp/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/dscp/node.def
index d02dc5c..d02dc5c 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/dscp/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/dscp/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/protocol/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/protocol/node.def
index 9c665c2..9c665c2 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/protocol/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/protocol/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/source/address/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/source/address/node.def
index 23c96c2..23c96c2 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/source/address/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/source/address/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/source/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/source/node.def
index 4271b94..4271b94 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/source/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/source/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/source/port/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/source/port/node.def
index ecd96ab..ecd96ab 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/ipv6/source/port/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/ipv6/source/port/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/vif/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/vif/node.def
index e22250d..e22250d 100644
--- a/interface-templates/input-policy/limit/class/node.tag/match/node.tag/vif/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/match/node.tag/vif/node.def
diff --git a/interface-templates/input-policy/limit/class/node.tag/priority/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/priority/node.def
index a99400d..a99400d 100644
--- a/interface-templates/input-policy/limit/class/node.tag/priority/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/priority/node.def
diff --git a/interface-templates/input-policy/limit/description/node.def b/templates/qos-policy/traffic-limiter/node.tag/description/node.def
index 1e8e64f..1e8e64f 100644
--- a/interface-templates/input-policy/limit/description/node.def
+++ b/templates/qos-policy/traffic-limiter/node.tag/description/node.def