forked from extern/shorewall_code
Add logical->physical mapping to Shorewall::Chains
This commit is contained in:
parent
09f1b6501c
commit
83621ff416
@ -2136,7 +2136,7 @@ sub interface_address( $ ) {
|
|||||||
# Record that the ruleset requires the first IP address on the passed interface
|
# Record that the ruleset requires the first IP address on the passed interface
|
||||||
#
|
#
|
||||||
sub get_interface_address ( $ ) {
|
sub get_interface_address ( $ ) {
|
||||||
my ( $interface ) = $_[0];
|
my ( $interface ) = physical_name $_[0];
|
||||||
|
|
||||||
my $variable = interface_address( $interface );
|
my $variable = interface_address( $interface );
|
||||||
my $function = interface_is_optional( $interface ) ? 'find_first_interface_address_if_any' : 'find_first_interface_address';
|
my $function = interface_is_optional( $interface ) ? 'find_first_interface_address_if_any' : 'find_first_interface_address';
|
||||||
@ -2160,7 +2160,7 @@ sub interface_bcasts( $ ) {
|
|||||||
# Record that the ruleset requires the broadcast addresses on the passed interface
|
# Record that the ruleset requires the broadcast addresses on the passed interface
|
||||||
#
|
#
|
||||||
sub get_interface_bcasts ( $ ) {
|
sub get_interface_bcasts ( $ ) {
|
||||||
my ( $interface ) = $_[0];
|
my ( $interface ) = physical_name $_[0];
|
||||||
|
|
||||||
my $variable = interface_bcasts( $interface );
|
my $variable = interface_bcasts( $interface );
|
||||||
|
|
||||||
@ -2183,7 +2183,7 @@ sub interface_acasts( $ ) {
|
|||||||
# Record that the ruleset requires the anycast addresses on the passed interface
|
# Record that the ruleset requires the anycast addresses on the passed interface
|
||||||
#
|
#
|
||||||
sub get_interface_acasts ( $ ) {
|
sub get_interface_acasts ( $ ) {
|
||||||
my ( $interface ) = $_[0];
|
my ( $interface ) = physical_name $_[0];
|
||||||
|
|
||||||
$global_variables |= NOT_RESTORE;
|
$global_variables |= NOT_RESTORE;
|
||||||
|
|
||||||
@ -2206,15 +2206,16 @@ sub interface_gateway( $ ) {
|
|||||||
# Record that the ruleset requires the gateway address on the passed interface
|
# Record that the ruleset requires the gateway address on the passed interface
|
||||||
#
|
#
|
||||||
sub get_interface_gateway ( $ ) {
|
sub get_interface_gateway ( $ ) {
|
||||||
my ( $interface ) = $_[0];
|
my ( $logical ) = $_[0];
|
||||||
|
|
||||||
|
my $interface = physical_name $logical;
|
||||||
my $variable = interface_gateway( $interface );
|
my $variable = interface_gateway( $interface );
|
||||||
|
|
||||||
my $routine = $config{USE_DEFAULT_RT} ? 'detect_dynamic_gateway' : 'detect_gateway';
|
my $routine = $config{USE_DEFAULT_RT} ? 'detect_dynamic_gateway' : 'detect_gateway';
|
||||||
|
|
||||||
$global_variables |= ALL_COMMANDS;
|
$global_variables |= ALL_COMMANDS;
|
||||||
|
|
||||||
if ( interface_is_optional $interface ) {
|
if ( interface_is_optional $logical ) {
|
||||||
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$($routine $interface)\n);
|
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$($routine $interface)\n);
|
||||||
} else {
|
} else {
|
||||||
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$($routine $interface)
|
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$($routine $interface)
|
||||||
@ -2237,13 +2238,14 @@ sub interface_addresses( $ ) {
|
|||||||
# Record that the ruleset requires the IP addresses on the passed interface
|
# Record that the ruleset requires the IP addresses on the passed interface
|
||||||
#
|
#
|
||||||
sub get_interface_addresses ( $ ) {
|
sub get_interface_addresses ( $ ) {
|
||||||
my ( $interface ) = $_[0];
|
my ( $logical ) = $_[0];
|
||||||
|
|
||||||
|
my $interface = physical_name( $logical );
|
||||||
my $variable = interface_addresses( $interface );
|
my $variable = interface_addresses( $interface );
|
||||||
|
|
||||||
$global_variables |= NOT_RESTORE;
|
$global_variables |= NOT_RESTORE;
|
||||||
|
|
||||||
if ( interface_is_optional $interface ) {
|
if ( interface_is_optional $logical ) {
|
||||||
$interfaceaddrs{$interface} = qq($variable=\$(find_interface_addresses $interface)\n);
|
$interfaceaddrs{$interface} = qq($variable=\$(find_interface_addresses $interface)\n);
|
||||||
} else {
|
} else {
|
||||||
$interfaceaddrs{$interface} = qq($variable=\$(find_interface_addresses $interface)
|
$interfaceaddrs{$interface} = qq($variable=\$(find_interface_addresses $interface)
|
||||||
@ -2266,13 +2268,14 @@ sub interface_nets( $ ) {
|
|||||||
# Record that the ruleset requires the networks routed out of the passed interface
|
# Record that the ruleset requires the networks routed out of the passed interface
|
||||||
#
|
#
|
||||||
sub get_interface_nets ( $ ) {
|
sub get_interface_nets ( $ ) {
|
||||||
my ( $interface ) = $_[0];
|
my ( $logical ) = $_[0];
|
||||||
|
|
||||||
|
my $interface = physical_name( $logical );
|
||||||
my $variable = interface_nets( $interface );
|
my $variable = interface_nets( $interface );
|
||||||
|
|
||||||
$global_variables |= ALL_COMMANDS;
|
$global_variables |= ALL_COMMANDS;
|
||||||
|
|
||||||
if ( interface_is_optional $interface ) {
|
if ( interface_is_optional $logical ) {
|
||||||
$interfacenets{$interface} = qq($variable=\$(get_routed_networks $interface)\n);
|
$interfacenets{$interface} = qq($variable=\$(get_routed_networks $interface)\n);
|
||||||
} else {
|
} else {
|
||||||
$interfacenets{$interface} = qq($variable=\$(get_routed_networks $interface)
|
$interfacenets{$interface} = qq($variable=\$(get_routed_networks $interface)
|
||||||
@ -2296,13 +2299,14 @@ sub interface_mac( $$ ) {
|
|||||||
# Record the fact that the ruleset requires MAC address of the passed gateway IP routed out of the passed interface for the passed provider number
|
# Record the fact that the ruleset requires MAC address of the passed gateway IP routed out of the passed interface for the passed provider number
|
||||||
#
|
#
|
||||||
sub get_interface_mac( $$$ ) {
|
sub get_interface_mac( $$$ ) {
|
||||||
my ( $ipaddr, $interface , $table ) = @_;
|
my ( $ipaddr, $logical , $table ) = @_;
|
||||||
|
|
||||||
|
my $interface = physical_name( $logical );
|
||||||
my $variable = interface_mac( $interface , $table );
|
my $variable = interface_mac( $interface , $table );
|
||||||
|
|
||||||
$global_variables |= NOT_RESTORE;
|
$global_variables |= NOT_RESTORE;
|
||||||
|
|
||||||
if ( interface_is_optional $interface ) {
|
if ( interface_is_optional $logical ) {
|
||||||
$interfacemacs{$table} = qq($variable=\$(find_mac $ipaddr $interface)\n);
|
$interfacemacs{$table} = qq($variable=\$(find_mac $ipaddr $interface)\n);
|
||||||
} else {
|
} else {
|
||||||
$interfacemacs{$table} = qq($variable=\$(find_mac $ipaddr $interface)
|
$interfacemacs{$table} = qq($variable=\$(find_mac $ipaddr $interface)
|
||||||
|
Loading…
Reference in New Issue
Block a user