Add a capability to use log levels as a target.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-11-18 14:50:59 -08:00
parent 65e1b1c9e7
commit a4294658b6

View File

@ -1588,6 +1588,11 @@ sub process_macro ( $$$$$$$$$$$$$$$$$$$) {
$mtarget = substitute_param $param, $mtarget;
}
if ( $mtarget =~ s/&$// ) {
fatal_error "$mtarget& requires a parameter to be supplied in macro invocation" unless $param ne '';
$mtarget = "$mtarget:$macro($param)";
}
my $action = isolate_basic_target $mtarget;
fatal_error "Invalid or missing ACTION ($mtarget)" unless defined $action;
@ -1714,16 +1719,6 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$$$ ) {
( $basictarget, $actiontype , $param ) = map_old_actions( $basictarget ) unless $actiontype || $param;
}
unless ( $actiontype ) {
if ( $action =~ /^NFLOG\(?/ ) {
$basictarget = 'LOG';
$actiontype = $targets{LOG};
fatal_error "Invalid NFLOG action($action:$loglevel)" if $loglevel;
$loglevel = supplied $param ? "NFLOG($param)" : 'NFLOG';
$param = '';
}
}
fatal_error "Unknown ACTION ($action)" unless $actiontype;
if ( $actiontype == MACRO ) {