mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-24 19:51:40 +02:00
More code structure cleanup -- Providers.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
08b5abbdb2
commit
110b6a613d
@ -495,6 +495,8 @@ sub add_a_provider( ) {
|
||||
emit "fi\n";
|
||||
|
||||
push @providers, $table;
|
||||
|
||||
progress_message " Provider \"$currentline\" $done";
|
||||
}
|
||||
|
||||
sub add_an_rtrule( ) {
|
||||
@ -586,15 +588,7 @@ sub setup_null_routing() {
|
||||
}
|
||||
}
|
||||
|
||||
sub setup_providers() {
|
||||
my $providers = 0;
|
||||
|
||||
my $fn = open_file 'providers';
|
||||
|
||||
while ( read_a_line ) {
|
||||
unless ( $providers ) {
|
||||
progress_message2 "$doing $fn ...";
|
||||
|
||||
sub start_providers() {
|
||||
require_capability( 'MANGLE_ENABLED' , 'a non-empty providers file' , 's' );
|
||||
|
||||
fatal_error "A non-empty providers file is not permitted with MANGLE_ENABLED=No" unless $config{MANGLE_ENABLED};
|
||||
@ -631,17 +625,9 @@ sub setup_providers() {
|
||||
emit 'DEFAULT_ROUTE=';
|
||||
emit 'FALLBACK_ROUTE=';
|
||||
emit '';
|
||||
}
|
||||
}
|
||||
|
||||
add_a_provider;
|
||||
|
||||
$providers++;
|
||||
|
||||
progress_message " Provider \"$currentline\" $done";
|
||||
|
||||
}
|
||||
|
||||
if ( $providers ) {
|
||||
sub finish_providers() {
|
||||
if ( $balancing ) {
|
||||
my $table = MAIN_TABLE;
|
||||
|
||||
@ -714,6 +700,19 @@ sub setup_providers() {
|
||||
|
||||
emit "fi\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub setup_providers() {
|
||||
my $providers = 0;
|
||||
|
||||
my $fn = open_file 'providers';
|
||||
|
||||
first_entry sub() { progress_message2 "$doing $fn..."; start_providers; };
|
||||
|
||||
add_a_provider, $providers++ while read_a_line;
|
||||
|
||||
if ( $providers ) {
|
||||
finish_providers;
|
||||
|
||||
my $fn = open_file 'route_rules';
|
||||
|
||||
@ -752,6 +751,7 @@ sub setup_providers() {
|
||||
emit "fi\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub lookup_provider( $ ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user