mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-15 10:08:43 +01:00
Add some documentation and remove a couple of double-initialization cases
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6542 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
09dd725a3c
commit
8b4f23252f
@ -39,6 +39,15 @@ our @EXPORT = qw( setup_accounting );
|
||||
our @EXPORT_OK = qw( );
|
||||
our @VERSION = 1.00;
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
our $jumpchainref;
|
||||
$jumpchainref = undef;
|
||||
|
@ -76,10 +76,12 @@ our %actions;
|
||||
#
|
||||
my %logactionchains;
|
||||
#
|
||||
# Maps each used macro to it's 'macro. ...' file.
|
||||
#
|
||||
#
|
||||
# This function determines the logging for a subordinate action or a rule within a superior action
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
@ -95,6 +97,9 @@ INIT {
|
||||
initialize;
|
||||
}
|
||||
|
||||
#
|
||||
# This function determines the logging for a subordinate action or a rule within a superior action
|
||||
#
|
||||
sub merge_levels ($$) {
|
||||
my ( $superior, $subordinate ) = @_;
|
||||
|
||||
|
@ -164,12 +164,12 @@ our @VERSION = 1.00;
|
||||
#
|
||||
our @policy_chains;
|
||||
our %chain_table;
|
||||
our $nat_table = $chain_table{nat};
|
||||
our $mangle_table = $chain_table{mangle};
|
||||
our $filter_table = $chain_table{filter};
|
||||
our $nat_table;
|
||||
our $mangle_table;
|
||||
our $filter_table;
|
||||
our %sections;
|
||||
our $section;
|
||||
our $comment = '';
|
||||
our $comment;
|
||||
|
||||
use constant { STANDARD => 1, #defined by Netfilter
|
||||
NATRULE => 2, #Involves NAT
|
||||
@ -181,6 +181,7 @@ use constant { STANDARD => 1, #defined by Netfilter
|
||||
MACRO => 128, #A Macro
|
||||
LOGRULE => 256, #'LOG'
|
||||
};
|
||||
|
||||
our %targets;
|
||||
#
|
||||
# expand_rule() restrictions
|
||||
@ -192,10 +193,19 @@ use constant { NO_RESTRICT => 0, # FORWARD chain rule - Both -i and
|
||||
POSTROUTE_RESTRICT => 16, # POSTROUTING chain rule - -i converted to -s <address list> using main routing table
|
||||
ALL_RESTRICT => 12 # fw->fw rule - neither -i nor -o allowed
|
||||
};
|
||||
our $exclseq = 0;
|
||||
our $iprangematch = 0;
|
||||
our $exclseq;
|
||||
our $iprangematch;
|
||||
our $chainseq;
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
@policy_chains = ();
|
||||
%chain_table = ( raw => {} ,
|
||||
|
@ -73,6 +73,15 @@ our $indent;
|
||||
our ( $dir, $file ); # Object's Directory and File
|
||||
our $tempfile; # Temporary File Name
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
$line = ''; # Current config file line
|
||||
|
||||
|
@ -113,6 +113,14 @@ our $currentlinenumber; # Line number
|
||||
|
||||
our $shorewall_dir; #Shorewall Directory
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
sub initialize() {
|
||||
#
|
||||
# Misc Globals
|
||||
|
@ -67,6 +67,15 @@ our @interfaces;
|
||||
our %interfaces;
|
||||
our @bridges;
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
@interfaces = ();
|
||||
%interfaces = ();
|
||||
|
@ -45,6 +45,15 @@ our @VERSION = 1.00;
|
||||
|
||||
our %macros;
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
%macros = ();
|
||||
}
|
||||
|
@ -43,6 +43,15 @@ our @VERSION = 1.00;
|
||||
our @addresses_to_add;
|
||||
our %addresses_to_add;
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
@addresses_to_add = ();
|
||||
%addresses_to_add = ();
|
||||
|
@ -54,6 +54,15 @@ our %providers;
|
||||
|
||||
our @providers;
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
@providers = ();
|
||||
%routemarked_interfaces = ();
|
||||
|
@ -40,6 +40,15 @@ our @VERSION = 1.00;
|
||||
|
||||
our @proxyarp;
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
@proxyarp = ();
|
||||
}
|
||||
|
@ -62,6 +62,15 @@ our @rule_chains;
|
||||
#
|
||||
our $sectioned;
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
@rule_chains = ();
|
||||
$sectioned = 0;
|
||||
|
@ -123,6 +123,15 @@ our %classids;
|
||||
|
||||
our @deferred_rules;
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
%classids = ();
|
||||
@deferred_rules = ();
|
||||
|
@ -114,6 +114,15 @@ our %reservedName = ( all => 1,
|
||||
SOURCE => 1,
|
||||
DEST => 1 );
|
||||
|
||||
#
|
||||
# Initialize globals -- we take this novel approach to globals initialization to allow
|
||||
# the compiler to run multiple times in the same process. The
|
||||
# initialize() function does globals initialization for this
|
||||
# module and is called from an INIT block below. The function is
|
||||
# also called by Shorewall::Compiler::compiler at the beginning of
|
||||
# the second and subsequent calls to that function.
|
||||
#
|
||||
|
||||
sub initialize() {
|
||||
@zones = ();
|
||||
%zones = ();
|
||||
|
Loading…
Reference in New Issue
Block a user