mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-24 03:31:24 +02:00
Implement FORMAT-2 interfaces file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
2137840fec
commit
d5af9c360d
@ -912,9 +912,26 @@ sub process_interface( $$ ) {
|
|||||||
my ( $nextinum, $export ) = @_;
|
my ( $nextinum, $export ) = @_;
|
||||||
my $netsref = '';
|
my $netsref = '';
|
||||||
my $filterref = [];
|
my $filterref = [];
|
||||||
my ($zone, $originalinterface, $bcasts, $options ) = split_line 'interfaces file', { zone => 0, interface => 1, broadcast => 2, options => 3 };
|
my ($zone, $originalinterface, $bcasts, $options );
|
||||||
my $zoneref;
|
my $zoneref;
|
||||||
my $bridge = '';
|
my $bridge = '';
|
||||||
|
our $format;
|
||||||
|
|
||||||
|
if ( $format == 1 ) {
|
||||||
|
($zone, $originalinterface, $bcasts, $options ) = split_line1 'interfaces file', { zone => 0, interface => 1, broadcast => 2, options => 3 }, { COMMENT => 0, FORMAT => 2 };
|
||||||
|
} else {
|
||||||
|
($zone, $originalinterface, $options ) = split_line1 'interfaces file', { zone => 0, interface => 1, options => 2 }, { COMMENT => 0, FORMAT => 2 };
|
||||||
|
$bcasts = '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $zone eq 'FORMAT' ) {
|
||||||
|
if ( $originalinterface =~ /^[12]$/ ) {
|
||||||
|
$format = $1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fatal_error "Invalid FORMAT ($1)";
|
||||||
|
}
|
||||||
|
|
||||||
if ( $zone eq '-' ) {
|
if ( $zone eq '-' ) {
|
||||||
$zone = '';
|
$zone = '';
|
||||||
@ -1185,7 +1202,8 @@ sub process_interface( $$ ) {
|
|||||||
# Parse the interfaces file.
|
# Parse the interfaces file.
|
||||||
#
|
#
|
||||||
sub validate_interfaces_file( $ ) {
|
sub validate_interfaces_file( $ ) {
|
||||||
my $export = shift;
|
my $export = shift;
|
||||||
|
our $format = 1;
|
||||||
|
|
||||||
my @ifaces;
|
my @ifaces;
|
||||||
my $nextinum = 1;
|
my $nextinum = 1;
|
||||||
|
@ -7,4 +7,8 @@
|
|||||||
# http://www.shorewall.net/manpages/shorewall-interfaces.html
|
# http://www.shorewall.net/manpages/shorewall-interfaces.html
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
FORMAT 1
|
||||||
#ZONE INTERFACE BROADCAST OPTIONS
|
#ZONE INTERFACE BROADCAST OPTIONS
|
||||||
|
|
||||||
|
FORMAT 2
|
||||||
|
#ZONE INTERFACE OPTIONS
|
||||||
|
@ -7,4 +7,8 @@
|
|||||||
# http://www.shorewall.net/manpages6/shorewall6-interfaces.html
|
# http://www.shorewall.net/manpages6/shorewall6-interfaces.html
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
FORMAT 1
|
||||||
#ZONE INTERFACE ANYCAST OPTIONS
|
#ZONE INTERFACE ANYCAST OPTIONS
|
||||||
|
|
||||||
|
FORMAT 2
|
||||||
|
#ZONE INTERFACE OPTIONS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user