From 86fc4e7801919a1da123f34500218a69a30c2059 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 30 Jan 2008 12:19:39 -0800 Subject: Initial version of vyatta-cfg-qos This the initial checkin prior to integration --- scripts/vyatta-qos-util.pl | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 scripts/vyatta-qos-util.pl (limited to 'scripts/vyatta-qos-util.pl') diff --git a/scripts/vyatta-qos-util.pl b/scripts/vyatta-qos-util.pl new file mode 100755 index 0000000..5dd869f --- /dev/null +++ b/scripts/vyatta-qos-util.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl +# +# Utility routines for validating input +# These functions don't change existing QoS parameters +# + +use lib "/opt/vyatta/share/perl5/"; +use VyattaQosUtil; +use Getopt::Long; + +GetOptions( + "rate=s" => \$rate, + "burst=s" => \$burst, + "protocol=s" => \$protocol, + "dsfield=s" => \$dsfield, +); + +if ( defined $rate ) { + my $r = VyattaQosUtil::getRate($rate); + exit 0; +} + +if ( defined $burst ) { + my $b = VyattaQosUtil::getSize($burst); + exit 0; +} + +if ( defined $protocol ) { + my $p = VyattaQosUtil::getProtocol($protocol); + exit 0; +} + +if ( defined $dsfield ) { + my $d = VyattaQosUtil::getDsfield($dsfield); + exit 0; +} + +print <