check_ip($ip)check_prefix($prefix)check_prefixlen($prefixlength)get_remote_ip_from_local_ip($local)
IPDevice::IPv4
This module provides routines for IP Version 4 based checks and conversions.
use IPDevice::IPv4; if (IPDevice::IPv4::check_ip("10.131.10.1")) { print "Valid IP address."; } else { print "Invalid IP address"; } if (IPDevice::IPv4::check_ip("10.131.10.1/24")) { print "Valid prefix."; } else { print "Invalid prefix"; }
check_ip($ip)Check the syntax of an IP address for validity.
check_prefix($prefix)Check the syntax of an IP address prefix for validity.
check_prefixlen($prefixlength)Check the syntax of an IP prefix length.
Convert a prefixlength to an IP mask address.
Convert an IP mask address to a prefixlength.
Convert a human readable (byte notated) ip address to a 4-byte integer value.
Convert a 4 byte integer value into a human readable (byte notated) ip address.
Returns TRUE if $prefix matches all of the given criterias.
get_remote_ip_from_local_ip($local)Given an IP address from a /30 network, this function returns the IP address of the remote site. If the IP address is invalid, the function returns FALSE.
Copyright (c) 2004 Samuel Abels, Ronny Weinreich. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Samuel Abels <spam debain org> Ronny Weinreich <rw AD nmc-m dtag de>