mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-19 03:58:27 +01:00
Eliminate silly duplication
This commit is contained in:
parent
370cd04408
commit
4ea02a5e72
@ -350,7 +350,8 @@ sub initialize( $ ) {
|
|||||||
$indent = ''; # Current total indentation
|
$indent = ''; # Current total indentation
|
||||||
( $dir, $file ) = ('',''); # Script's Directory and Filename
|
( $dir, $file ) = ('',''); # Script's Directory and Filename
|
||||||
$tempfile = ''; # Temporary File Name
|
$tempfile = ''; # Temporary File Name
|
||||||
$sillyname = ''; # Temporary ipchain
|
$sillyname =
|
||||||
|
$sillyname1 = ''; # Temporary ipchains
|
||||||
|
|
||||||
#
|
#
|
||||||
# Misc Globals
|
# Misc Globals
|
||||||
@ -367,13 +368,9 @@ sub initialize( $ ) {
|
|||||||
VERSION => "4.4.17-Beta1",
|
VERSION => "4.4.17-Beta1",
|
||||||
CAPVERSION => 40415 ,
|
CAPVERSION => 40415 ,
|
||||||
);
|
);
|
||||||
|
|
||||||
#
|
#
|
||||||
# From shorewall.conf file
|
# From shorewall.conf file
|
||||||
#
|
#
|
||||||
if ( $family == F_IPV4 ) {
|
|
||||||
$globals{PRODUCT} = 'shorewall';
|
|
||||||
|
|
||||||
%config =
|
%config =
|
||||||
( STARTUP_ENABLED => undef,
|
( STARTUP_ENABLED => undef,
|
||||||
VERBOSITY => undef,
|
VERBOSITY => undef,
|
||||||
@ -398,7 +395,6 @@ sub initialize( $ ) {
|
|||||||
#
|
#
|
||||||
# Location of Files
|
# Location of Files
|
||||||
#
|
#
|
||||||
IPTABLES => undef,
|
|
||||||
IP => undef,
|
IP => undef,
|
||||||
TC => undef,
|
TC => undef,
|
||||||
IPSET => undef,
|
IPSET => undef,
|
||||||
@ -515,133 +511,9 @@ sub initialize( $ ) {
|
|||||||
EMERG => 0,
|
EMERG => 0,
|
||||||
PANIC => 0,
|
PANIC => 0,
|
||||||
NONE => '',
|
NONE => '',
|
||||||
ULOG => 'ULOG',
|
|
||||||
NFLOG => 'NFLOG',
|
NFLOG => 'NFLOG',
|
||||||
LOGMARK => 'LOGMARK' );
|
LOGMARK => 'LOGMARK' );
|
||||||
} else {
|
|
||||||
$globals{SHAREDIR} = '/usr/share/shorewall6';
|
|
||||||
$globals{CONFDIR} = '/etc/shorewall6';
|
|
||||||
$globals{PRODUCT} = 'shorewall6';
|
|
||||||
|
|
||||||
%config =
|
|
||||||
( STARTUP_ENABLED => undef,
|
|
||||||
VERBOSITY => undef,
|
|
||||||
#
|
|
||||||
# Logging
|
|
||||||
#
|
|
||||||
LOGFILE => undef,
|
|
||||||
LOGFORMAT => undef,
|
|
||||||
LOGTAGONLY => undef,
|
|
||||||
LOGLIMIT => undef,
|
|
||||||
LOGRATE => undef,
|
|
||||||
LOGBURST => undef,
|
|
||||||
LOGALLNEW => undef,
|
|
||||||
BLACKLIST_LOGLEVEL => undef,
|
|
||||||
TCP_FLAGS_LOG_LEVEL => undef,
|
|
||||||
SMURF_LOG_LEVEL => undef,
|
|
||||||
LOG_VERBOSITY => undef,
|
|
||||||
STARTUP_LOG => undef,
|
|
||||||
#
|
|
||||||
# Location of Files
|
|
||||||
#
|
|
||||||
IP6TABLES => undef,
|
|
||||||
IP => undef,
|
|
||||||
TC => undef,
|
|
||||||
IPSET => undef,
|
|
||||||
PERL => undef,
|
|
||||||
#
|
|
||||||
#PATH is inherited
|
|
||||||
#
|
|
||||||
PATH => undef,
|
|
||||||
SHOREWALL_SHELL => undef,
|
|
||||||
SUBSYSLOCK => undef,
|
|
||||||
MODULESDIR => undef,
|
|
||||||
#
|
|
||||||
#CONFIG_PATH is inherited
|
|
||||||
#
|
|
||||||
CONFIG_PATH => undef,
|
|
||||||
RESTOREFILE => undef,
|
|
||||||
LOCKFILE => undef,
|
|
||||||
#
|
|
||||||
# Default Actions/Macros
|
|
||||||
#
|
|
||||||
DROP_DEFAULT => undef,
|
|
||||||
REJECT_DEFAULT => undef,
|
|
||||||
ACCEPT_DEFAULT => undef,
|
|
||||||
QUEUE_DEFAULT => undef,
|
|
||||||
NFQUEUE_DEFAULT => undef,
|
|
||||||
#
|
|
||||||
# RSH/RCP Commands
|
|
||||||
#
|
|
||||||
RSH_COMMAND => undef,
|
|
||||||
RCP_COMMAND => undef,
|
|
||||||
#
|
|
||||||
# Firewall Options
|
|
||||||
#
|
|
||||||
IP_FORWARDING => undef,
|
|
||||||
TC_ENABLED => undef,
|
|
||||||
TC_EXPERT => undef,
|
|
||||||
TC_PRIOMAP => undef,
|
|
||||||
CLEAR_TC => undef,
|
|
||||||
MARK_IN_FORWARD_CHAIN => undef,
|
|
||||||
CLAMPMSS => undef,
|
|
||||||
MUTEX_TIMEOUT => undef,
|
|
||||||
ADMINISABSENTMINDED => undef,
|
|
||||||
BLACKLISTNEWONLY => undef,
|
|
||||||
MODULE_SUFFIX => undef,
|
|
||||||
MAPOLDACTIONS => '',
|
|
||||||
FASTACCEPT => undef,
|
|
||||||
IMPLICIT_CONTINUE => undef,
|
|
||||||
HIGH_ROUTE_MARKS => undef,
|
|
||||||
OPTIMIZE => undef,
|
|
||||||
EXPORTPARAMS => undef,
|
|
||||||
EXPAND_POLICIES => undef,
|
|
||||||
KEEP_RT_TABLES => undef,
|
|
||||||
DELETE_THEN_ADD => undef,
|
|
||||||
MULTICAST => undef,
|
|
||||||
DONT_LOAD => '',
|
|
||||||
AUTO_COMMENT => undef,
|
|
||||||
MANGLE_ENABLED => undef ,
|
|
||||||
AUTOMAKE => undef ,
|
|
||||||
WIDE_TC_MARKS => undef,
|
|
||||||
TRACK_PROVIDERS => undef,
|
|
||||||
ZONE2ZONE => undef,
|
|
||||||
ACCOUNTING => undef,
|
|
||||||
OPTIMIZE_ACCOUNTING => undef,
|
|
||||||
DYNAMIC_BLACKLIST => undef,
|
|
||||||
LOAD_HELPERS_ONLY => undef,
|
|
||||||
REQUIRE_INTERFACE => undef,
|
|
||||||
FORWARD_CLEAR_MARK => undef,
|
|
||||||
COMPLETE => undef,
|
|
||||||
#
|
|
||||||
# Packet Disposition
|
|
||||||
#
|
|
||||||
TCP_FLAGS_DISPOSITION => undef,
|
|
||||||
BLACKLIST_DISPOSITION => undef,
|
|
||||||
#
|
|
||||||
# Mark Geometry
|
|
||||||
#
|
|
||||||
TC_BITS => undef,
|
|
||||||
PROVIDER_BITS => undef,
|
|
||||||
PROVIDER_OFFSET => undef,
|
|
||||||
MASK_BITS => undef
|
|
||||||
);
|
|
||||||
|
|
||||||
%validlevels = ( DEBUG => 7,
|
|
||||||
INFO => 6,
|
|
||||||
NOTICE => 5,
|
|
||||||
WARNING => 4,
|
|
||||||
WARN => 4,
|
|
||||||
ERR => 3,
|
|
||||||
ERROR => 3,
|
|
||||||
CRIT => 2,
|
|
||||||
ALERT => 1,
|
|
||||||
EMERG => 0,
|
|
||||||
PANIC => 0,
|
|
||||||
NONE => '',
|
|
||||||
NFLOG => 'NFLOG',
|
|
||||||
LOGMARK => 'LOGMARK' );
|
|
||||||
}
|
|
||||||
#
|
#
|
||||||
# From parsing the capabilities file or capabilities detection
|
# From parsing the capabilities file or capabilities detection
|
||||||
#
|
#
|
||||||
@ -734,6 +606,19 @@ sub initialize( $ ) {
|
|||||||
$compiler_params{$_} = 1 for keys %params;
|
$compiler_params{$_} = 1 for keys %params;
|
||||||
|
|
||||||
%actparms = ();
|
%actparms = ();
|
||||||
|
|
||||||
|
if ( $family == F_IPV4 ) {
|
||||||
|
$globals{SHAREDIR} = '/usr/share/shorewall';
|
||||||
|
$globals{CONFDIR} = '/etc/shorewall';
|
||||||
|
$globals{PRODUCT} = 'shorewall';
|
||||||
|
$config{IPTABLES} = undef;
|
||||||
|
$validlevels{ULOG} => 'ULOG',
|
||||||
|
} else {
|
||||||
|
$globals{SHAREDIR} = '/usr/share/shorewall6';
|
||||||
|
$globals{CONFDIR} = '/etc/shorewall6';
|
||||||
|
$globals{PRODUCT} = 'shorewall6';
|
||||||
|
$config{IP6TABLES} = undef;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
|
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
|
||||||
|
Loading…
Reference in New Issue
Block a user