From 2ac9c2d4bd5f514db922887eb489a7a9591273ec Mon Sep 17 00:00:00 2001 From: bbruns Date: Thu, 25 Nov 2010 18:58:30 +0000 Subject: [PATCH] Begin support of rule cache for quicker loading --- bin/firewall-sosdg | 3 ++- include/functions | 6 +++++- include/static | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/firewall-sosdg b/bin/firewall-sosdg index 7c9ed68..7d5aad3 100755 --- a/bin/firewall-sosdg +++ b/bin/firewall-sosdg @@ -144,7 +144,8 @@ if [ "$GEN_CACHE" ]; then force) IPTABLES="write_out_rules" if [ "$IPV6" ]; then - IP6TABLES="write_out_rules" + IP6TABLES="write_out_rules_v6" + rm -f "${RULE_CACHE_V6}" &>/dev/null fi rm -f "${RULE_CACHE}" &>/dev/null ;; diff --git a/include/functions b/include/functions index 60c2560..5b48ad4 100755 --- a/include/functions +++ b/include/functions @@ -119,6 +119,7 @@ function show_help { echo "Firewall/SOSDG ${FW_VERSION} - Brielle Bruns " echo -e "\t--help\t\tShows this info" echo -e "\t--flush\t\tFlushes all rules back to default ACCEPT" + echo -e "\t--generate-cache\tGenerate cached rule file" } @@ -164,7 +165,10 @@ function apply_ipv4_hack { echo -en "\n" } -# write_out_rules +# write_out_rules(_v6) function write_out_rules { echo "$*" >> "$RULE_CACHE" +} +function write_out_rules_v6 { + echo "$*" >> "$RULE_CACHE_V6" } \ No newline at end of file diff --git a/include/static b/include/static index 31e6151..6c3a685 100755 --- a/include/static +++ b/include/static @@ -62,3 +62,4 @@ STATE_TYPE="conntrack" # Where we store output of cached rules RULE_CACHE=$BASEDIR/cache/ipt-rules +RULE_CACHE_V6=$BASEDIR/cache/ipt6-rules