Implement FORMAT-2 interfaces file.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-02-21 11:23:58 -08:00
parent 2137840fec
commit d5af9c360d
3 changed files with 28 additions and 2 deletions

View File

@ -912,10 +912,27 @@ sub process_interface( $$ ) {
my ( $nextinum, $export ) = @_;
my $netsref = '';
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 $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 '-' ) {
$zone = '';
} else {
@ -1185,7 +1202,8 @@ sub process_interface( $$ ) {
# Parse the interfaces file.
#
sub validate_interfaces_file( $ ) {
my $export = shift;
my $export = shift;
our $format = 1;
my @ifaces;
my $nextinum = 1;

View File

@ -7,4 +7,8 @@
# http://www.shorewall.net/manpages/shorewall-interfaces.html
#
###############################################################################
FORMAT 1
#ZONE INTERFACE BROADCAST OPTIONS
FORMAT 2
#ZONE INTERFACE OPTIONS

View File

@ -7,4 +7,8 @@
# http://www.shorewall.net/manpages6/shorewall6-interfaces.html
#
###############################################################################
FORMAT 1
#ZONE INTERFACE ANYCAST OPTIONS
FORMAT 2
#ZONE INTERFACE OPTIONS