diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-12-09 16:51:59 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-12-09 16:51:59 -0800 |
commit | 0fdf5d942a6577a625b81eab2651af5f0d7afed5 (patch) | |
tree | 1960f3717be59a1fdfde96cbcf8557b6bd18ad92 /scripts/vyatta-qos-util.pl | |
parent | 326ee1c8565c55315275771f73aae4d0d1a27cf9 (diff) | |
download | vyatta-cfg-qos-0fdf5d942a6577a625b81eab2651af5f0d7afed5.tar.gz vyatta-cfg-qos-0fdf5d942a6577a625b81eab2651af5f0d7afed5.zip |
Add support for network emulation
New QoS feature to allow emulating WAN characteristics
Diffstat (limited to 'scripts/vyatta-qos-util.pl')
-rwxr-xr-x | scripts/vyatta-qos-util.pl | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/scripts/vyatta-qos-util.pl b/scripts/vyatta-qos-util.pl index a19baee..9bb2ea1 100755 --- a/scripts/vyatta-qos-util.pl +++ b/scripts/vyatta-qos-util.pl @@ -24,13 +24,8 @@ use Vyatta::Qos::Util qw( getPercent getRate getBurstSize getProtocol use Getopt::Long; sub getPercentOrRate { - my $percent = shift; - if ( $percent =~ /%$/ ) { - return getPercent($percent); - } - else { - return getRate($percent); - } + my $rate = shift; + return ( $rate =~ /%$/ ) ? getPercent($rate) : getRate($rate); } sub usage { @@ -57,4 +52,3 @@ GetOptions( "tos=s" => sub { getDsfield( $_[1] ); }, "time=s" => sub { getTime( $_[1] ); }, ) or usage(); - |