forked from extern/shorewall_code
Convert some lexical variables to globals
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6463 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
3ee0d1fddc
commit
95a269a825
@ -40,9 +40,10 @@ our @VERSION = 1.00;
|
||||
#
|
||||
# Accounting
|
||||
#
|
||||
my $jumpchainref;
|
||||
|
||||
sub process_accounting_rule( $$$$$$$$$ ) {
|
||||
|
||||
our $jumpchainref;
|
||||
|
||||
my ($action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark ) = @_;
|
||||
|
||||
sub accounting_error() {
|
||||
|
@ -243,15 +243,15 @@ use constant { NO_RESTRICT => 0,
|
||||
#
|
||||
# Used to sequence 'exclusion' chains with names 'excl0', 'excl1', ...
|
||||
#
|
||||
my $exclseq = 0;
|
||||
our $exclseq = 0;
|
||||
#
|
||||
# Used to suppress duplicate match specifications.
|
||||
#
|
||||
my $iprangematch = 0;
|
||||
our $iprangematch = 0;
|
||||
#
|
||||
# Sequence for naming temporary chains
|
||||
#
|
||||
my $chainseq;
|
||||
our $chainseq;
|
||||
#
|
||||
# Add a run-time command to a chain. Arguments are:
|
||||
#
|
||||
|
@ -67,12 +67,12 @@ our ( $command, $doing, $done ) = qw/ compile Compiling Compiled/; #describe the
|
||||
|
||||
our $verbose; # Verbosity setting. 0 = almost silent, 1 = major progress messages only, 2 = all progress messages (very noisy)
|
||||
|
||||
my $timestamp; # If true, we are to timestamp each progress message
|
||||
my $object = 0; # Object (script) file Handle Reference
|
||||
my $lastlineblank = 0; # Avoid extra blank lines in the output
|
||||
my $indent = ''; # Current indentation
|
||||
my ( $dir, $file ); # Object's Directory and File
|
||||
my $tempfile; # Temporary File Name
|
||||
our $timestamp; # If true, we are to timestamp each progress message
|
||||
our $object = 0; # Object (script) file Handle Reference
|
||||
our $lastlineblank = 0; # Avoid extra blank lines in the output
|
||||
our $indent = ''; # Current indentation
|
||||
our ( $dir, $file ); # Object's Directory and File
|
||||
our $tempfile; # Temporary File Name
|
||||
|
||||
INIT {
|
||||
$verbose = $ENV{VERBOSE} || 0;
|
||||
|
@ -173,8 +173,8 @@ our %config =
|
||||
#
|
||||
# Config options and global settings that are to be copied to object script
|
||||
#
|
||||
my @propagateconfig = qw/ CLEAR_TC DISABLE_IPV6 ADMINISABSENTMINDED IP_FORWARDING MODULESDIR MODULE_SUFFIX LOGFORMAT SUBSYSLOCK LOCKFILE/;
|
||||
my @propagateenv = qw/ LOGLIMIT LOGTAGONLY LOGRULENUMBERS /;
|
||||
our @propagateconfig = qw/ CLEAR_TC DISABLE_IPV6 ADMINISABSENTMINDED IP_FORWARDING MODULESDIR MODULE_SUFFIX LOGFORMAT SUBSYSLOCK LOCKFILE /;
|
||||
our @propagateenv = qw/ LOGLIMIT LOGTAGONLY LOGRULENUMBERS /;
|
||||
|
||||
#
|
||||
# From parsing the capabilities file
|
||||
@ -217,7 +217,7 @@ our %services;
|
||||
#
|
||||
# Capabilities
|
||||
#
|
||||
my %capdesc = ( NAT_ENABLED => 'NAT',
|
||||
our %capdesc = ( NAT_ENABLED => 'NAT',
|
||||
MANGLE_ENABLED => 'Packet Mangling',
|
||||
MULTIPORT => 'Multi-port Match' ,
|
||||
XMULTIPORT => 'Extended Multi-port Match',
|
||||
@ -248,19 +248,19 @@ my %capdesc = ( NAT_ENABLED => 'NAT',
|
||||
#
|
||||
# Directories to search for configuration files
|
||||
#
|
||||
my @config_path;
|
||||
our @config_path;
|
||||
#
|
||||
# Stash away file references here when we encounter INCLUDE
|
||||
#
|
||||
my @includestack;
|
||||
our @includestack;
|
||||
#
|
||||
# Allow nested opens
|
||||
#
|
||||
my @openstack;
|
||||
our @openstack;
|
||||
|
||||
my $currentfile; # File handle reference
|
||||
my $currentfilename; # File NAME
|
||||
my $currentlinenumber = 0; # Line number
|
||||
our $currentfile; # File handle reference
|
||||
our $currentfilename; # File NAME
|
||||
our $currentlinenumber = 0; # Line number
|
||||
|
||||
#
|
||||
# Issue a Warning Message
|
||||
@ -1135,15 +1135,15 @@ sub get_configuration( $ ) {
|
||||
}
|
||||
|
||||
#
|
||||
# The values of the options in @Shorewall:Config::propagateconfig are copied to the object file in OPTION=<value> format.
|
||||
# The values of the options in @propagateconfig are copied to the object file in OPTION=<value> format.
|
||||
#
|
||||
sub propagateconfig() {
|
||||
for my $option ( @Shorewall::Config::propagateconfig ) {
|
||||
for my $option ( @propagateconfig ) {
|
||||
my $value = $config{$option} || '';
|
||||
emit "$option=\"$value\"";
|
||||
}
|
||||
|
||||
for my $option ( @Shorewall::Config::propagateenv ) {
|
||||
for my $option ( @propagateenv ) {
|
||||
my $value = $globals{$option} || '';
|
||||
emit "$option=\"$value\"";
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ our @EXPORT = qw( setup_masq setup_nat setup_netmap add_addresses );
|
||||
our @EXPORT_OK = ();
|
||||
our @VERSION = 1.00;
|
||||
|
||||
my @addresses_to_add;
|
||||
my %addresses_to_add;
|
||||
our @addresses_to_add;
|
||||
our %addresses_to_add;
|
||||
|
||||
#
|
||||
# Handle IPSEC Options in a masq record
|
||||
|
@ -38,7 +38,7 @@ our @EXPORT = qw(
|
||||
our @EXPORT_OK = qw( );
|
||||
our @VERSION = 1.00;
|
||||
|
||||
my @proxyarp;
|
||||
our @proxyarp;
|
||||
|
||||
sub setup_one_proxy_arp( $$$$$ ) {
|
||||
my ( $address, $interface, $external, $haveroute, $persistent) = @_;
|
||||
|
@ -56,11 +56,11 @@ our @VERSION = 1.00;
|
||||
#
|
||||
# Keep track of chains for the /var/lib/shorewall[-lite]/chains file
|
||||
#
|
||||
my @rule_chains;
|
||||
our @rule_chains;
|
||||
#
|
||||
# Set to one if we find a SECTION
|
||||
#
|
||||
my $sectioned = 0;
|
||||
our $sectioned = 0;
|
||||
|
||||
use constant { MAX_MACRO_NEST_LEVEL => 5 };
|
||||
|
||||
|
@ -43,7 +43,7 @@ our @EXPORT = qw( setup_tc );
|
||||
our @EXPORT_OK = qw( process_tc_rule );
|
||||
our @VERSION = 1.00;
|
||||
|
||||
my %tcs = ( T => { chain => 'tcpost',
|
||||
our %tcs = ( T => { chain => 'tcpost',
|
||||
connmark => 0,
|
||||
fw => 1
|
||||
} ,
|
||||
@ -93,7 +93,7 @@ use constant { NOMARK => 0 ,
|
||||
HIGHMARK => 2
|
||||
};
|
||||
|
||||
my @tccmd = ( { match => sub ( $ ) { $_[0] eq 'SAVE' } ,
|
||||
our @tccmd = ( { match => sub ( $ ) { $_[0] eq 'SAVE' } ,
|
||||
target => 'CONNMARK --save-mark --mask' ,
|
||||
mark => SMALLMARK ,
|
||||
mask => '0xFF'
|
||||
|
@ -107,7 +107,7 @@ our $firewall_zone;
|
||||
#
|
||||
our %interfaces;
|
||||
|
||||
my %reservedName = ( all => 1,
|
||||
our %reservedName = ( all => 1,
|
||||
none => 1,
|
||||
SOURCE => 1,
|
||||
DEST => 1 );
|
||||
|
@ -55,7 +55,7 @@ use Shorewall::Rules;
|
||||
use Shorewall::Proc;
|
||||
use Shorewall::Proxyarp;
|
||||
|
||||
my $export;
|
||||
our $export;
|
||||
|
||||
INIT {
|
||||
$export = $ENV{EXPORT};
|
||||
|
Loading…
Reference in New Issue
Block a user