diff options
author | Gaurav <gaurav.sinha@vyatta.com> | 2012-02-16 15:03:55 -0800 |
---|---|---|
committer | Gaurav Sinha <gaurav.sinha@vyatta.com> | 2012-03-16 16:40:42 -0700 |
commit | 4c2e2d79f28734c97a0e374ca217e24ff954fe96 (patch) | |
tree | 026f1205c9cd0f96ab060816ee19ee645d64cd25 /scripts | |
parent | f0118dc081cfa4e4efd9cbfe6f008cd322539b10 (diff) | |
download | vyatta-conntrack-4c2e2d79f28734c97a0e374ca217e24ff954fe96.tar.gz vyatta-conntrack-4c2e2d79f28734c97a0e374ca217e24ff954fe96.zip |
Adding rule and address setup/parsing libraries
(cherry picked from commit 2f59f3ef67d70981ff0501868d5ea206eb9359ae)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyatta-conntrack-timeouts.pl | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/vyatta-conntrack-timeouts.pl b/scripts/vyatta-conntrack-timeouts.pl index 09d24ce..7de1a02 100644 --- a/scripts/vyatta-conntrack-timeouts.pl +++ b/scripts/vyatta-conntrack-timeouts.pl @@ -5,9 +5,8 @@ use warnings; use strict; use Vyatta::Config; -use Vyatta::IpTables::Rule; -use Vyatta::IpTables::AddressFilter; -use Vyatta::IpTables::Mgr; +use Vyatta::Conntrack::RuleCT; +use Vyatta::Conntrack::AddressFilterCT; use Getopt::Long; use Vyatta::Zone; use Sys::Syslog qw(:standard :macros); @@ -23,9 +22,7 @@ GetOptions("create=s" => \$create, "update=s" => \$update, ); -if (($create eq 'true') or ($update eq 'true')) { - update_config(); -} +update_config(); sub update_config { my $config = new Vyatta::Config; @@ -35,5 +32,15 @@ sub update_config { $config->setLevel("system conntrack timeout custom rule"); %rules = $config->listNodeStatus(); print %rules; + foreach my $rule (sort keys %rules) { + if ("$rules{$rule}" eq 'static') { + } elsif ("$rules{$rule}" eq 'added') { + my $node = new Vyatta::Conntrack::RuleCT; + $node->setup("system conntrack timeout custom rule $rule"); + $node->print(); + } elsif ("$rules{$rule}" eq 'changed') { + } elsif ("$rules{$rule}" eq 'deleted'){ + } + } } |