Move get_action_logging() to the Config Module

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-01-18 13:06:55 -08:00
parent 8ccd1ab52b
commit 4587430e4a
2 changed files with 9 additions and 20 deletions

View File

@ -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.

View File

@ -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};
}