diff --git a/Shorewall-perl/Shorewall/Common.pm b/Shorewall-perl/Shorewall/Common.pm index 72f7eeb52..f58662e39 100644 --- a/Shorewall-perl/Shorewall/Common.pm +++ b/Shorewall-perl/Shorewall/Common.pm @@ -34,8 +34,7 @@ use Cwd 'abs_path'; use strict; our @ISA = qw(Exporter); -our @EXPORT = qw(ALLIPv4 - +our @EXPORT = qw( create_temp_object finalize_object emit @@ -53,8 +52,6 @@ our @EXPORT = qw(ALLIPv4 create_temp_aux_config finalize_aux_config - @allipv4 - @rfc1918_networks $line $command $doing @@ -64,15 +61,6 @@ our @EXPORT = qw(ALLIPv4 our @EXPORT_OK = (); our @VERSION = 1.00; -# -# Some IPv4 useful stuff -# -our @allipv4 = ( '0.0.0.0/0' ); - -use constant { ALLIPv4 => '0.0.0.0/0' }; - -our @rfc1918_networks = ( "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16" ); - our $line = ''; # Current config file line our ( $command, $doing, $done ) = qw/ compile Compiling Compiled/; #describe the current command, it's present progressive, and it's completion. diff --git a/Shorewall-perl/Shorewall/Hosts.pm b/Shorewall-perl/Shorewall/Hosts.pm index d4484ae8b..c8ea5e2c3 100644 --- a/Shorewall-perl/Shorewall/Hosts.pm +++ b/Shorewall-perl/Shorewall/Hosts.pm @@ -27,6 +27,7 @@ package Shorewall::Hosts; require Exporter; use Shorewall::Common; use Shorewall::Config; +use Shorewall::IPAddrs; use Shorewall::Zones; use Shorewall::Interfaces; diff --git a/Shorewall-perl/Shorewall/IPAddrs.pm b/Shorewall-perl/Shorewall/IPAddrs.pm index b260b4e0c..c7fd941ae 100644 --- a/Shorewall-perl/Shorewall/IPAddrs.pm +++ b/Shorewall-perl/Shorewall/IPAddrs.pm @@ -30,15 +30,28 @@ use Shorewall::Config; use strict; our @ISA = qw(Exporter); -our @EXPORT = qw( +our @EXPORT = qw( ALLIPv4 + validate_address validate_net validate_range ip_range_explicit + + @allipv4 + @rfc1918_networks ); our @EXPORT_OK = qw( ); our @VERSION = 1.00; +# +# Some IPv4 useful stuff +# +our @allipv4 = ( '0.0.0.0/0' ); + +use constant { ALLIPv4 => '0.0.0.0/0' }; + +our @rfc1918_networks = ( "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16" ); + sub valid_address( $ ) { my $address = $_[0]; diff --git a/Shorewall-perl/Shorewall/Interfaces.pm b/Shorewall-perl/Shorewall/Interfaces.pm index 4c2c51b4b..ea3b753f6 100644 --- a/Shorewall-perl/Shorewall/Interfaces.pm +++ b/Shorewall-perl/Shorewall/Interfaces.pm @@ -29,6 +29,7 @@ package Shorewall::Interfaces; require Exporter; use Shorewall::Common; use Shorewall::Config; +use Shorewall::IPAddrs; use Shorewall::Zones; use strict; diff --git a/Shorewall-perl/Shorewall/Nat.pm b/Shorewall-perl/Shorewall/Nat.pm index bc7e5d207..34317a567 100644 --- a/Shorewall-perl/Shorewall/Nat.pm +++ b/Shorewall-perl/Shorewall/Nat.pm @@ -27,6 +27,7 @@ package Shorewall::Nat; require Exporter; use Shorewall::Common; use Shorewall::Config; +use Shorewall::IPAddrs; use Shorewall::Zones; use Shorewall::Interfaces; use Shorewall::Chains; diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index 3f23e3b40..64215e889 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -26,6 +26,7 @@ package Shorewall::Rules; require Exporter; use Shorewall::Common; use Shorewall::Config; +use Shorewall::IPAddrs; use Shorewall::Zones; use Shorewall::Interfaces; use Shorewall::Chains;