Add get_target_param1() that doesn't accept the <action>/<param> syntax

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-12-19 09:17:11 -08:00
parent f32a777099
commit 4c2cedb670

View File

@ -82,6 +82,7 @@ our @EXPORT = ( qw(
state_imatch state_imatch
split_action split_action
get_target_param get_target_param
get_target_param1
get_inline_matches get_inline_matches
handle_inline handle_inline
@ -8430,7 +8431,7 @@ sub get_inline_matches( $ ) {
} }
# #
# Split the passed target into the basic target and parameter (previously duplicated in this file) # Split the passed target into the basic target and parameter
# #
sub get_target_param( $ ) { sub get_target_param( $ ) {
my ( $target, $param ) = split '/', $_[0]; my ( $target, $param ) = split '/', $_[0];
@ -8442,6 +8443,16 @@ sub get_target_param( $ ) {
( $target, $param ); ( $target, $param );
} }
sub get_target_param1( $ ) {
my $target = $_[0];
if ( $target =~ /^(.*?)[(](.*)[)]$/ ) {
( $1, $2 );
} else {
( $target, '' );
}
}
sub handle_inline( $$$$ ) { sub handle_inline( $$$$ ) {
my ( $action, $basictarget, $param, $loglevel ) = @_; my ( $action, $basictarget, $param, $loglevel ) = @_;
my $inline_matches = get_inline_matches(1); my $inline_matches = get_inline_matches(1);