From 0fdf5d942a6577a625b81eab2651af5f0d7afed5 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 9 Dec 2008 16:51:59 -0800 Subject: Add support for network emulation New QoS feature to allow emulating WAN characteristics --- scripts/vyatta-qos-util.pl | 10 ++-------- scripts/vyatta-qos.pl | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'scripts') 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(); - diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl index 10f8610..5db9025 100755 --- a/scripts/vyatta-qos.pl +++ b/scripts/vyatta-qos.pl @@ -45,6 +45,7 @@ my %policies = ( 'fair-queue' => 'FairQueue', 'rate-limit' => 'RateLimiter', 'drop-tail' => 'DropTail', + 'network-emulator' => 'NetworkEmulator', }, 'in' => { 'traffic-limiter' => 'TrafficLimiter', -- cgit v1.2.3