From 4587430e4ae235ac125711db2c4aa3329f2fb91e Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 18 Jan 2013 13:06:55 -0800 Subject: [PATCH] Move get_action_logging() to the Config Module Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 19 ------------------- Shorewall/Perl/Shorewall/Config.pm | 10 +++++++++- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index c14328cf3..f6e53766f 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -75,7 +75,6 @@ our @EXPORT = ( qw( dont_optimize dont_delete dont_move - get_action_logging add_interface_options %chain_table @@ -2459,24 +2458,6 @@ sub require_audit($$;$) { return ensure_audit_chain $target, $action, $tgt; } -# -# Returns the Level and Tag for the current action chain -# -sub get_action_logging() { - my $chainref = get_action_chain; - my $wholeaction = $chainref->{action}; - - if ( $wholeaction ) { - my ( undef, $level, $tag, undef ) = split ':', $wholeaction; - - $level = '' if $level =~ /^none/; - - ( $level, $tag ); - } else { - ( '' , '' ); - } -} - # # Add all builtin chains to the chain table -- it is separate from initialize() because it depends on capabilities and configuration. # The function also initializes the target table with the pre-defined targets available for the specfied address family. diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 8ba7a3170..0d8d0fa76 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -59,6 +59,7 @@ our @EXPORT = qw( get_action_params get_action_chain + get_action_logging set_action_param have_capability @@ -936,7 +937,7 @@ sub initialize( $;$$) { %compiler_params = (); - %actparms = ( ); + %actparms = ( 0 => 0, loglevel => '', logtag => '', chain => '' ); %helpers_enabled = ( amanda => 1, @@ -2817,6 +2818,13 @@ sub get_action_params( $ ) { @return; } +# +# Returns the Level and Tag for the current action chain +# +sub get_action_logging() { + @actparms{ 'loglevel', 'logtag' }; +} + sub get_action_chain() { $actparms{0}; }