Generate list of builtins in initialize()

This commit is contained in:
Tom Eastep 2009-10-01 15:02:14 -07:00
parent a8cc7d2a7e
commit a87cb7b95d

View File

@ -86,6 +86,8 @@ our %macros;
our $family; our $family;
our @builtins;
# #
# Commands that can be embedded in a macro file and how many total tokens on the line (0 => unlimited). # Commands that can be embedded in a macro file and how many total tokens on the line (0 => unlimited).
# #
@ -112,6 +114,12 @@ sub initialize( $ ) {
%actions = (); %actions = ();
%logactionchains = (); %logactionchains = ();
%macros = (); %macros = ();
if ( $family == F_IPV4 ) {
@builtins = qw/dropBcast allowBcast dropNotSyn rejNotSyn dropInvalid allowInvalid allowinUPnP forwardUPnP Limit/;
} else {
@builtins = qw/dropBcast allowBcast dropNotSyn rejNotSyn dropInvalid allowInvalid/;
}
} }
# #
@ -509,11 +517,7 @@ sub process_actions1() {
# #
# Add built-in actions to the target table and create those actions # Add built-in actions to the target table and create those actions
# #
if ( $family == F_IPV4 ) { $targets{$_} = ACTION + BUILTIN, new_action( $_ ) for @builtins;
$targets{$_} = ACTION + BUILTIN, new_action $_ for qw/dropBcast allowBcast dropNotSyn rejNotSyn dropInvalid allowInvalid allowinUPnP forwardUPnP Limit/;
} else {
$targets{$_} = ACTION + BUILTIN, new_action $_ for qw/dropBcast allowBcast dropNotSyn rejNotSyn dropInvalid allowInvalid/;
}
for my $file ( qw/actions.std actions/ ) { for my $file ( qw/actions.std actions/ ) {
open_file $file; open_file $file;