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 the syntax of an IP address for validity.
Check the syntax of an IP address prefix for validity.
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.
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>
To install IPDevice::IPv4, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IPDevice::IPv4
CPAN shell
perl -MCPAN -e shell install IPDevice::IPv4
For more information on module installation, please visit the detailed CPAN module installation guide.