summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav Sinha <gaurav.sinha@vyatta.com>2012-02-06 17:19:00 -0800
committerGaurav Sinha <gaurav.sinha@vyatta.com>2012-03-16 16:39:38 -0700
commitfe3908e77451c419c9e4b8351cb72cde9c875312 (patch)
treef448b1073a290f06e7e9ef0e301d64901bb7f922
parentb5e891c97c391f7a6b20c7676883dd9b1e894ef4 (diff)
downloadvyatta-conntrack-fe3908e77451c419c9e4b8351cb72cde9c875312.tar.gz
vyatta-conntrack-fe3908e77451c419c9e4b8351cb72cde9c875312.zip
adding an initial version of conntrack-timeouts script
(cherry picked from commit 8235f2a9a3b3e1a5a289c4365d809bb09f941ee4)
-rw-r--r--Makefile.am1
-rw-r--r--templates-cfg/system/conntrack/timeout/custom/node.def12
-rw-r--r--templates-cfg/system/conntrack/timeout/custom/rule/node.def2
3 files changed, 14 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 46e3603..1e53937 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,6 +21,7 @@ sbin_SCRIPTS = scripts/vyatta-update-conntrack-log.pl
bin_sudo_usersdir = $(bindir)/sudo-users
bin_sudo_users_SCRIPTS = scripts/vyatta-show-conntrack.pl
bin_sudo_users_SCRIPTS += scripts/vyatta-delete-conntrack.pl
+bin_sudo_users_SCRIPTS += scripts/vyatta-conntrack-timeouts.pl
curver_DATA = cfg-version/conntrack@1
diff --git a/templates-cfg/system/conntrack/timeout/custom/node.def b/templates-cfg/system/conntrack/timeout/custom/node.def
index c8e5841..7967ead 100644
--- a/templates-cfg/system/conntrack/timeout/custom/node.def
+++ b/templates-cfg/system/conntrack/timeout/custom/node.def
@@ -1 +1,13 @@
help: Define custom timeouts per flow
+end: if sudo /opt/vyatta/bin/sudo-users/vyatta-conntrack-timeouts.pl --update 'true';
+ then
+ if [ ${COMMIT_ACTION} = 'DELETE' ] ;
+ then
+ sudo /opt/vyatta/bin/sudo-users/vyatta-conntrack-timeouts.pl --delete 'true';
+ fi
+ else
+ exit 1;
+ fi
+
+create: sudo /opt/vyatta/bin/sudo-users/vyatta-conntrack-timeouts.pl --create 'true'
+
diff --git a/templates-cfg/system/conntrack/timeout/custom/rule/node.def b/templates-cfg/system/conntrack/timeout/custom/rule/node.def
index c31dfbd..077603e 100644
--- a/templates-cfg/system/conntrack/timeout/custom/rule/node.def
+++ b/templates-cfg/system/conntrack/timeout/custom/rule/node.def
@@ -4,6 +4,6 @@ type: u32
help: Rule number (1-9999)
-syntax:expression: $VAR(@) > 0 && $VAR(@) <= 9999; "firewall rule number must be between 1 and 9999"
+syntax:expression: $VAR(@) > 0 && $VAR(@) <= 9999; "Custom timeout rule number must be between 1 and 9999"
val_help: u32:1-9999; Rule number