forked from extern/shorewall_code
Remove debugging dump functions -- they have served their purpose
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5610 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
ae4718fb2f
commit
8d0d75bab2
@ -42,7 +42,6 @@ our @EXPORT = qw( merge_levels
|
||||
process_actions1
|
||||
process_actions2
|
||||
process_actions3
|
||||
dump_action_table
|
||||
|
||||
%usedactions
|
||||
%default_actions
|
||||
@ -635,27 +634,4 @@ sub process_actions3 () {
|
||||
}
|
||||
}
|
||||
|
||||
sub dump_action_table() {
|
||||
my $action;
|
||||
|
||||
print "\n";
|
||||
|
||||
for $action ( sort keys %actions ) {
|
||||
print "Action $action\n";
|
||||
my $already = 0;
|
||||
for my $requires ( keys %{$actions{$action}{requires}} ) {
|
||||
print " Requires:\n" unless $already;
|
||||
print " $requires\n";
|
||||
$already = 1;
|
||||
}
|
||||
}
|
||||
|
||||
print "\nAction Chains:\n";
|
||||
|
||||
for $action ( sort keys %usedactions ) {
|
||||
$action .= ':none' unless $action =~ /:/;
|
||||
print " $action = $logactionchains{$action}{name}\n";
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -71,7 +71,6 @@ our @EXPORT = qw( STANDARD
|
||||
new_standard_chain
|
||||
new_builtin_chain
|
||||
initialize_chain_table
|
||||
dump_chain_table
|
||||
finish_section
|
||||
newexclusionchain
|
||||
clearrule
|
||||
@ -527,43 +526,6 @@ sub initialize_chain_table()
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Dump the contents of the Chain Table
|
||||
#
|
||||
sub dump_chain_table()
|
||||
{
|
||||
print "\n";
|
||||
|
||||
for my $table qw/filter nat mangle/ {
|
||||
print "Table: $table\n";
|
||||
|
||||
for my $chain ( sort keys %{$chain_table{$table}} ) {
|
||||
my $chainref = $chain_table{$table}{$chain};
|
||||
print " Chain $chain:\n";
|
||||
|
||||
if ( $chainref->{is_policy} ) {
|
||||
print " This is a policy chain\n";
|
||||
my $val = $chainref->{is_optional} ? 'Yes' : 'No';
|
||||
print " Optional: $val\n";
|
||||
print " Log Level: $chainref->{loglevel}\n" if $chainref->{loglevel};
|
||||
print " Syn Parms: $chainref->{synparams}\n" if $chainref->{synparams};
|
||||
print " Default: $chainref->{default}\n" if $chainref->{default};
|
||||
}
|
||||
|
||||
print " Policy chain: $chainref->{policychain}{name}\n" if $chainref->{policychain} ;
|
||||
print " Policy: $chainref->{policy}\n" if $chainref->{policy};
|
||||
print " Referenced\n" if $chainref->{referenced};
|
||||
|
||||
if ( @{$chainref->{rules}} ) {
|
||||
print " Rules:\n";
|
||||
for my $rule ( @{$chainref->{rules}} ) {
|
||||
print " $rule\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Add ESTABLISHED,RELATED rules and synparam jumps to the passed chain
|
||||
#
|
||||
|
@ -32,7 +32,6 @@ use strict;
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw( add_group_to_zone
|
||||
validate_interfaces_file
|
||||
dump_interface_info
|
||||
known_interface
|
||||
find_interfaces_by_option
|
||||
get_interface_option
|
||||
@ -206,47 +205,6 @@ sub validate_interfaces_file()
|
||||
close INTERFACES;
|
||||
}
|
||||
|
||||
#
|
||||
# Dump the tables built by validate_interface_file
|
||||
#
|
||||
sub dump_interface_info()
|
||||
{
|
||||
print "\n";
|
||||
|
||||
for my $interface ( @interfaces ) {
|
||||
my $interfaceref = $interfaces{$interface};
|
||||
print "Interface: $interface\n";
|
||||
my $root = $interfaceref->{root};
|
||||
print " Root = $root\n";
|
||||
my $bcastref = $interfaceref->{broadcast};
|
||||
if ( $bcastref ) {
|
||||
my $spaces = '';
|
||||
print ' Broadcast: ';
|
||||
for my $addr (@$bcastref) {
|
||||
print "${spaces}${addr}\n";
|
||||
$spaces = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
my $options = $interfaceref->{options};
|
||||
|
||||
if ( $options ) {
|
||||
print ' Options: ';
|
||||
my $spaces = '';
|
||||
for my $option ( keys %$options ) {
|
||||
my $val = ${$options}{$option};
|
||||
print "${spaces}${option} = $val\n";
|
||||
$spaces = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
my $zone = $interfaceref->{zone};
|
||||
print " zone: $zone\n" if $zone;
|
||||
}
|
||||
|
||||
print "\n";
|
||||
}
|
||||
|
||||
#
|
||||
# Returns true if passed interface matches an entry in /etc/shorewall/interfaces
|
||||
#
|
||||
|
@ -36,7 +36,6 @@ our @EXPORT = qw( NOTHING
|
||||
IPSECMODE
|
||||
|
||||
determine_zones
|
||||
dump_zone_info
|
||||
zone_report
|
||||
|
||||
@zones
|
||||
@ -266,93 +265,6 @@ sub determine_zones()
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Dump out all information about zones.
|
||||
#
|
||||
sub dump_zone_info()
|
||||
{
|
||||
print "\n";
|
||||
|
||||
for my $zone ( @zones )
|
||||
{
|
||||
my $zoneref = $zones{$zone};
|
||||
my $typeref = $zoneref->{hosts};
|
||||
my $optionref = $zoneref->{options};
|
||||
my $zonetype = $zoneref->{type};
|
||||
|
||||
print "Zone: $zone\n";
|
||||
|
||||
print " Type: $zonetype\n";
|
||||
print " Parents:\n";
|
||||
|
||||
my $parentsref = $zoneref->{parents};
|
||||
|
||||
for my $parent ( @$parentsref ) {
|
||||
print " $parent\n";
|
||||
}
|
||||
|
||||
if ( %$optionref ) {
|
||||
print " Options:\n";
|
||||
|
||||
for my $opttype ( keys %$optionref ) {
|
||||
if ( $opttype eq 'complex' ) {
|
||||
print " Complex: $optionref->{$opttype}\n";
|
||||
} else {
|
||||
print " $opttype:\n";
|
||||
while ( my ( $option, $val ) = each %{$optionref->{$opttype}} ) { print " $option=$val\n"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $typeref ) {
|
||||
print " Host Groups:\n";
|
||||
while ( my ( $type, $interfaceref ) = ( each %$typeref ) ) {
|
||||
print " Type: $type\n";
|
||||
|
||||
for my $interface ( sort keys %$interfaceref ) {
|
||||
my $arrayref = $interfaceref->{$interface};
|
||||
|
||||
print " Interface: $interface\n";
|
||||
|
||||
for my $groupref ( @$arrayref ) {
|
||||
my $hosts = $groupref->{hosts};
|
||||
my $options = $groupref->{options};
|
||||
my $ipsec = $groupref->{ipsec};
|
||||
|
||||
if ( $ipsec ) {
|
||||
print " Ipsec: $ipsec\n" ;
|
||||
}
|
||||
|
||||
if ( $hosts ) {
|
||||
my $space = '';
|
||||
print " Hosts: " ;
|
||||
for my $host ( @{$hosts} ) {
|
||||
print "${space}${host}\n";
|
||||
$space = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
if ( $options ) {
|
||||
print " Options: ";
|
||||
for my $option (sort keys %$options ) {
|
||||
print "$option ";
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#
|
||||
# Empty ?
|
||||
#
|
||||
print " ***Empty***\n" if $zonetype ne 'firewall';
|
||||
}
|
||||
}
|
||||
|
||||
print "\n";
|
||||
}
|
||||
|
||||
#
|
||||
# Report about zones.
|
||||
#
|
||||
|
@ -31,7 +31,6 @@
|
||||
# EXPORT=Yes -e option specified to /sbin/shorewall
|
||||
# SHOREWALL_DIR A directory name was passed to /sbin/shorewall
|
||||
# VERBOSE Standard Shorewall verbosity control.
|
||||
# DEBUG=Yes Debugging Enabled
|
||||
# VERSION Shorewall Version
|
||||
# TMP_DIR Temporary Directory containing stripped copies
|
||||
# of all configuration files. Shell variable substitution
|
||||
@ -587,19 +586,16 @@ sub compile_firewall( $ ) {
|
||||
#
|
||||
progress_message2 "Validating interfaces file...";
|
||||
validate_interfaces_file;
|
||||
dump_interface_info if $ENV{DEBUG};
|
||||
#
|
||||
# Process the hosts file.
|
||||
#
|
||||
progress_message2 "Validating hosts file...";
|
||||
validate_hosts_file;
|
||||
|
||||
if ( $ENV{DEBUG} ) {
|
||||
dump_zone_info;
|
||||
} elsif ( $ENV{VERBOSE} > 1 ) {
|
||||
progress_message "Determining Hosts in Zones...";
|
||||
zone_report;
|
||||
}
|
||||
#
|
||||
# Report zone contents
|
||||
#
|
||||
progress_message "Determining Hosts in Zones...";
|
||||
zone_report;
|
||||
#
|
||||
# Do action pre-processing.
|
||||
#
|
||||
@ -684,7 +680,6 @@ sub compile_firewall( $ ) {
|
||||
#
|
||||
progress_message2 'Applying Policies...';
|
||||
apply_policy_rules;
|
||||
dump_action_table if $ENV{DEBUG};
|
||||
#
|
||||
# Setup Nat
|
||||
#
|
||||
@ -703,7 +698,6 @@ sub compile_firewall( $ ) {
|
||||
#
|
||||
progress_message2 'Generating Rule Matrix...';
|
||||
generate_matrix;
|
||||
dump_chain_table if $ENV{DEBUG};
|
||||
generate_script_3;
|
||||
finalize_object;
|
||||
#
|
||||
@ -718,7 +712,6 @@ sub compile_firewall( $ ) {
|
||||
# E x e c u t i o n S t a r t s H e r e
|
||||
#
|
||||
|
||||
$ENV{VERBOSE} = 2 if $ENV{DEBUG};
|
||||
#
|
||||
# Get shorewall.conf and capabilities.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user