mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-25 04:01:45 +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";
|
emit "fi\n";
|
||||||
|
|
||||||
push @providers, $table;
|
push @providers, $table;
|
||||||
|
|
||||||
|
progress_message " Provider \"$currentline\" $done";
|
||||||
}
|
}
|
||||||
|
|
||||||
sub add_an_rtrule( ) {
|
sub add_an_rtrule( ) {
|
||||||
@ -586,15 +588,7 @@ sub setup_null_routing() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setup_providers() {
|
sub start_providers() {
|
||||||
my $providers = 0;
|
|
||||||
|
|
||||||
my $fn = open_file 'providers';
|
|
||||||
|
|
||||||
while ( read_a_line ) {
|
|
||||||
unless ( $providers ) {
|
|
||||||
progress_message2 "$doing $fn ...";
|
|
||||||
|
|
||||||
require_capability( 'MANGLE_ENABLED' , 'a non-empty providers file' , 's' );
|
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};
|
fatal_error "A non-empty providers file is not permitted with MANGLE_ENABLED=No" unless $config{MANGLE_ENABLED};
|
||||||
@ -633,15 +627,7 @@ sub setup_providers() {
|
|||||||
emit '';
|
emit '';
|
||||||
}
|
}
|
||||||
|
|
||||||
add_a_provider;
|
sub finish_providers() {
|
||||||
|
|
||||||
$providers++;
|
|
||||||
|
|
||||||
progress_message " Provider \"$currentline\" $done";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $providers ) {
|
|
||||||
if ( $balancing ) {
|
if ( $balancing ) {
|
||||||
my $table = MAIN_TABLE;
|
my $table = MAIN_TABLE;
|
||||||
|
|
||||||
@ -714,6 +700,19 @@ sub setup_providers() {
|
|||||||
|
|
||||||
emit "fi\n";
|
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';
|
my $fn = open_file 'route_rules';
|
||||||
|
|
||||||
@ -752,6 +751,7 @@ sub setup_providers() {
|
|||||||
emit "fi\n";
|
emit "fi\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub lookup_provider( $ ) {
|
sub lookup_provider( $ ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user