diff options
author | slioch <slioch@eng-140.vyatta.com> | 2009-07-24 16:59:27 -0700 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2009-07-24 16:59:27 -0700 |
commit | f672a6d5ca04b643a9d8583fcb8ade4da9fde6f3 (patch) | |
tree | 07bf2b8289e4bffc561f5d0fc7bb1c664d7ee6da /scripts | |
parent | e99605daeed8b412073694ee35d54da78920703f (diff) | |
download | vyatta-wanloadbalance-f672a6d5ca04b643a9d8583fcb8ade4da9fde6f3.tar.gz vyatta-wanloadbalance-f672a6d5ca04b643a9d8583fcb8ade4da9fde6f3.zip |
bug fixes on mult targets. added packet rate limit option to rules
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyatta-wanloadbalance.pl | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/scripts/vyatta-wanloadbalance.pl b/scripts/vyatta-wanloadbalance.pl index 36ecdfb..57e0ae1 100644 --- a/scripts/vyatta-wanloadbalance.pl +++ b/scripts/vyatta-wanloadbalance.pl @@ -101,7 +101,6 @@ sub write_health { print FILE_LCK "\t\t}\n"; } - print FILE_LCK "\t}\n"; } print FILE_LCK "}\n\n"; @@ -144,9 +143,38 @@ sub write_rules { exit 1; } + if ($config->exists("$rule limit") && $config->exists("$rule exclude")) { + print "limit cannot be used with exclude\n"; + exit 1; + } + + if ($config->exists("$rule limit")) { + print FILE_LCK "\tlimit {\n"; + my $limit_burst = $config->returnValue("$rule limit burst"); + if (defined $limit_burst) { + print FILE_LCK "\t\tburst " . $limit_burst . "\n"; + } + + my $limit_rate = $config->returnValue("$rule limit rate"); + if (defined $limit_rate) { + print FILE_LCK "\t\trate " . $limit_rate . "\n"; + } + + my $limit_period = $config->returnValue("$rule limit period"); + if (defined $limit_period) { + print FILE_LCK "\t\tperiod " . $limit_period . "\n"; + } + + my $limit_thresh = $config->returnValue("$rule limit threshold"); + if (defined $limit_thresh) { + print FILE_LCK "\t\tthresh " . $limit_thresh . "\n"; + } + print FILE_LCK "\t}\n"; + } + my $protocol = $config->returnValue("$rule protocol"); if (defined $protocol) { - print FILE_LCK "\tprotocol " . $protocol . "\n" + print FILE_LCK "\tprotocol " . $protocol . "\n"; } else { $protocol = ""; |