summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-04-16 11:48:43 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-04-16 11:48:43 -0700
commit671a8b2b64c93bc8bd0a5165d03017f968852e38 (patch)
treea6f0d3f94cd4144cfcc5c9ef2bbca2cb05997276
parent527c0217a5365e452cb1f4aa13cd27a9953e6bae (diff)
downloadvyatta-op-qos-671a8b2b64c93bc8bd0a5165d03017f968852e38.tar.gz
vyatta-op-qos-671a8b2b64c93bc8bd0a5165d03017f968852e38.zip
Cleanup show input policy
Skip interfaces with no input policy. Also fix copyright and comments
-rw-r--r--scripts/show-input-policy.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/show-input-policy.pl b/scripts/show-input-policy.pl
index 41ea209..98ef37f 100644
--- a/scripts/show-input-policy.pl
+++ b/scripts/show-input-policy.pl
@@ -13,12 +13,11 @@
# General Public License for more details.
#
# This code was originally developed by Vyatta, Inc.
-# Portions created by Vyatta are Copyright (C) 2007 Vyatta, Inc.
+# Copyright (C) 2010 Vyatta, Inc.
# All Rights Reserved.
#
# Author: Stephen Hemminger
-# Date: July 2008
-# Description: Script to display QoS information in pretty form
+# Description: Script to display input filter information in pretty form
#
# **** End License ****
#
@@ -112,14 +111,16 @@ sub get_filter {
sub show {
my $interface = shift;
my $filters = get_filter($interface);
- return unless $filters;
+
+ my @classes = keys %{$filters};
+ return if $#classes < 0; # no ingress
print "\n$interface input:\n";
my $fmt = "%-10s %-10s %-10s %-9s %-9s %s\n";
printf $fmt, 'Class', 'Policy', 'Received', 'Dropped', 'Overlimit', 'Rate';
- foreach my $id (sort keys %{$filters}) {
+ foreach my $id (sort @classes) {
my @args = @{$filters->{$id}};
my $class = ($id eq $INGRESS) ? 'default' : $id;
my $rate = pop @args;