NAME

Paranoid::Network - Network functions for paranoid programs

VERSION

$Id: Network.pm,v 0.61 2009/03/05 00:07:00 acorliss Exp $

SYNOPSIS

use Paranoid::Network;

$rv = ipInNetwork($ip, @networks);
$rv = hostInDomain($host, @domains);

DESCRIPTION

This modules contains functions that may be useful for network operations.

SUBROUTINES/METHODS

ipInNetwork

$rv = ipInNetwork($ip, @networks);

This function checks the passed IP against each of the networks or IPs in the list and returns true if there's a match. The list of networks can be either individual IP address or network addresses in CIDR notation or with full netmasks:

@networks = qw(127.0.0.1 
               192.168.0.0/24 
               172.16.12.0/255.255.240.0);

hostInDomain

$rv = hostInDomain($host, @domains);

This function checks the passed hostname (fully qualified) against each of the domains in the list and returns true if there's a match. None of the domains should have the preceding '.' (i.e., 'foo.com' rather than '.foo.com').

DEPENDENCIES

o

Paranoid

o

Socket

BUGS AND LIMITATIONS

AUTHOR

Arthur Corliss (corliss@digitalmages.com)

LICENSE AND COPYRIGHT

This software is licensed under the same terms as Perl, itself. Please see http://dev.perl.org/licenses/ for more information.

(c) 2005, Arthur Corliss (corliss@digitalmages.com)