forked from extern/shorewall_code
Rename process_rule to process_raw_rule and process_rule1 to process_rule
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
61d8f704f9
commit
27c5e67632
@ -55,7 +55,7 @@ our @EXPORT = qw(
|
|||||||
perl_action_tcp_helper
|
perl_action_tcp_helper
|
||||||
);
|
);
|
||||||
|
|
||||||
our @EXPORT_OK = qw( initialize process_rule1 );
|
our @EXPORT_OK = qw( initialize process_rule );
|
||||||
our $VERSION = 'MODULEVERSION';
|
our $VERSION = 'MODULEVERSION';
|
||||||
#
|
#
|
||||||
# Globals are documented in the initialize() function
|
# Globals are documented in the initialize() function
|
||||||
@ -1670,11 +1670,11 @@ sub process_actions() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub process_rule1 ( $$$$$$$$$$$$$$$$$$$ );
|
sub process_rule ( $$$$$$$$$$$$$$$$$$$ );
|
||||||
|
|
||||||
#
|
#
|
||||||
# Populate an action invocation chain. As new action tuples are encountered,
|
# Populate an action invocation chain. As new action tuples are encountered,
|
||||||
# the function will be called recursively by process_rule1().
|
# the function will be called recursively by process_rule().
|
||||||
#
|
#
|
||||||
sub process_action($$) {
|
sub process_action($$) {
|
||||||
my ( $chainref, $caller ) = @_;
|
my ( $chainref, $caller ) = @_;
|
||||||
@ -1724,7 +1724,7 @@ sub process_action($$) {
|
|||||||
fatal_error 'DEFAULTS only allowed in FORMAT-2 actions';
|
fatal_error 'DEFAULTS only allowed in FORMAT-2 actions';
|
||||||
}
|
}
|
||||||
|
|
||||||
process_rule1( $chainref,
|
process_rule( $chainref,
|
||||||
'',
|
'',
|
||||||
$nolog ? $target : merge_levels( join(':', @actparms{'chain','loglevel','logtag'}), $target ),
|
$nolog ? $target : merge_levels( join(':', @actparms{'chain','loglevel','logtag'}), $target ),
|
||||||
'',
|
'',
|
||||||
@ -1867,7 +1867,7 @@ sub process_macro ($$$$$$$$$$$$$$$$$$$$) {
|
|||||||
$mdest = '';
|
$mdest = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$generated |= process_rule1(
|
$generated |= process_rule(
|
||||||
$chainref,
|
$chainref,
|
||||||
$matches,
|
$matches,
|
||||||
$mtarget,
|
$mtarget,
|
||||||
@ -1986,7 +1986,7 @@ sub process_inline ($$$$$$$$$$$$$$$$$$$$$) {
|
|||||||
$mdest = '';
|
$mdest = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$generated |= process_rule1(
|
$generated |= process_rule(
|
||||||
$chainref,
|
$chainref,
|
||||||
$matches,
|
$matches,
|
||||||
$mtarget,
|
$mtarget,
|
||||||
@ -2041,7 +2041,7 @@ sub verify_audit($;$$) {
|
|||||||
# reference is also passed when rules are being generated during processing of a macro used as a default action.
|
# reference is also passed when rules are being generated during processing of a macro used as a default action.
|
||||||
#
|
#
|
||||||
|
|
||||||
sub process_rule1 ( $$$$$$$$$$$$$$$$$$$ ) {
|
sub process_rule ( $$$$$$$$$$$$$$$$$$$ ) {
|
||||||
my ( $chainref, #reference to Action Chain if we are being called from process_action(); undef otherwise
|
my ( $chainref, #reference to Action Chain if we are being called from process_action(); undef otherwise
|
||||||
$rule, #Matches
|
$rule, #Matches
|
||||||
$target,
|
$target,
|
||||||
@ -2091,7 +2091,7 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
|
|
||||||
if ( $actiontype == MACRO ) {
|
if ( $actiontype == MACRO ) {
|
||||||
#
|
#
|
||||||
# process_macro() will call process_rule1() recursively for each rule in the macro body
|
# process_macro() will call process_rule() recursively for each rule in the macro body
|
||||||
#
|
#
|
||||||
fatal_error "Macro/Inline invocations nested too deeply" if ++$macro_nest_level > MAX_MACRO_NEST_LEVEL;
|
fatal_error "Macro/Inline invocations nested too deeply" if ++$macro_nest_level > MAX_MACRO_NEST_LEVEL;
|
||||||
|
|
||||||
@ -2438,7 +2438,7 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
$action = $basictarget; # Remove params, if any, from $action.
|
$action = $basictarget; # Remove params, if any, from $action.
|
||||||
} elsif ( $actiontype & INLINE ) {
|
} elsif ( $actiontype & INLINE ) {
|
||||||
#
|
#
|
||||||
# process_inline() will call process_rule1() recursively for each rule in the macro body
|
# process_inline() will call process_rule() recursively for each rule in the macro body
|
||||||
#
|
#
|
||||||
fatal_error "Macro/Inline invocations nested too deeply" if ++$macro_nest_level > MAX_MACRO_NEST_LEVEL;
|
fatal_error "Macro/Inline invocations nested too deeply" if ++$macro_nest_level > MAX_MACRO_NEST_LEVEL;
|
||||||
|
|
||||||
@ -2665,13 +2665,13 @@ sub perl_action_helper($$) {
|
|||||||
assert( $chainref );
|
assert( $chainref );
|
||||||
|
|
||||||
if ( $inlines{$action} ) {
|
if ( $inlines{$action} ) {
|
||||||
$result = &process_rule1( $chainref,
|
$result = &process_rule( $chainref,
|
||||||
$matches,
|
$matches,
|
||||||
$target,
|
$target,
|
||||||
'', # CurrentParam
|
'', # CurrentParam
|
||||||
@columns );
|
@columns );
|
||||||
} else {
|
} else {
|
||||||
$result = process_rule1( $chainref,
|
$result = process_rule( $chainref,
|
||||||
$matches,
|
$matches,
|
||||||
$target,
|
$target,
|
||||||
'', # Current Param
|
'', # Current Param
|
||||||
@ -2714,7 +2714,7 @@ sub perl_action_tcp_helper($$) {
|
|||||||
|
|
||||||
fatal_error "Invalid PROTO ($passedproto) for the $action action" unless $passedproto eq '-' || $passedproto eq 'tcp' || $passedproto eq '6';
|
fatal_error "Invalid PROTO ($passedproto) for the $action action" unless $passedproto eq '-' || $passedproto eq 'tcp' || $passedproto eq '6';
|
||||||
|
|
||||||
$result = &process_rule1( $chainref,
|
$result = &process_rule( $chainref,
|
||||||
$proto,
|
$proto,
|
||||||
$target,
|
$target,
|
||||||
'',
|
'',
|
||||||
@ -2723,7 +2723,7 @@ sub perl_action_tcp_helper($$) {
|
|||||||
@columns[3..14]
|
@columns[3..14]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$result = process_rule1( $chainref,
|
$result = process_rule( $chainref,
|
||||||
$proto,
|
$proto,
|
||||||
$target,
|
$target,
|
||||||
'', # Current Param
|
'', # Current Param
|
||||||
@ -2751,7 +2751,7 @@ sub perl_action_tcp_helper($$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Helper functions for process_rule(). That function deals with the ugliness of wildcard zones ('all' and 'any') and zone lists.
|
# Helper functions for process_raw_rule(). That function deals with the ugliness of wildcard zones ('all' and 'any') and zone lists.
|
||||||
#
|
#
|
||||||
# Process a SECTION header
|
# Process a SECTION header
|
||||||
#
|
#
|
||||||
@ -2852,7 +2852,7 @@ sub build_zone_list( $$$\$\$ ) {
|
|||||||
#
|
#
|
||||||
# Process a Record in the rules file
|
# Process a Record in the rules file
|
||||||
#
|
#
|
||||||
sub process_rule ( ) {
|
sub process_raw_rule ( ) {
|
||||||
my ( $target, $source, $dest, $protos, $ports, $sports, $origdest, $ratelimit, $users, $mark, $connlimit, $time, $headers, $condition, $helper )
|
my ( $target, $source, $dest, $protos, $ports, $sports, $origdest, $ratelimit, $users, $mark, $connlimit, $time, $headers, $condition, $helper )
|
||||||
= split_line1 'rules file', \%rulecolumns, $rule_commands;
|
= split_line1 'rules file', \%rulecolumns, $rule_commands;
|
||||||
|
|
||||||
@ -2895,7 +2895,7 @@ sub process_rule ( ) {
|
|||||||
if ( ! $wild || $intrazone || ( $sourcezone ne $destzone ) ) {
|
if ( ! $wild || $intrazone || ( $sourcezone ne $destzone ) ) {
|
||||||
for my $proto ( @protos ) {
|
for my $proto ( @protos ) {
|
||||||
for my $user ( @users ) {
|
for my $user ( @users ) {
|
||||||
if ( process_rule1( undef,
|
if ( process_rule( undef,
|
||||||
'',
|
'',
|
||||||
$target,
|
$target,
|
||||||
'',
|
'',
|
||||||
@ -3037,7 +3037,7 @@ sub process_rules( $ ) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
process_rule while read_a_line( NORMAL_READ );
|
process_raw_rule while read_a_line( NORMAL_READ );
|
||||||
}
|
}
|
||||||
|
|
||||||
$section = NULL_SECTION;
|
$section = NULL_SECTION;
|
||||||
@ -3055,7 +3055,7 @@ sub process_rules( $ ) {
|
|||||||
|
|
||||||
first_entry "$doing $fn...";
|
first_entry "$doing $fn...";
|
||||||
|
|
||||||
process_rule while read_a_line( NORMAL_READ );
|
process_raw_rule while read_a_line( NORMAL_READ );
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
# No need to finish the NEW section since no rules need to be generated
|
# No need to finish the NEW section since no rules need to be generated
|
||||||
|
Loading…
Reference in New Issue
Block a user