Net::CIDR::Lookup::IPv6
This is the IPv6 version of Net::CIDR::Lookup. It generally provides the same methods, with the distinction that the add_num/add_num_range methods that accept an IPv4 address as an integer have been split in two to accommodate different representations for an IPv6 address:
add_num
add_num_range
add_vec
add_vec_range
add_str
add_str_range
Socket::unpack_sockaddr_in6
For all other methods, see Net::CIDR::Lookup.
This module requires an IPv6-enabled Socket. As there is no way to ask for this using ExtUtils::MakeMaker, do make sure you have it.
See Net::CIDR::Lookup::IPv6::Changes
Arguments: $cidr, $value
$cidr
$value
Return Value: none; dies on error
Adds VALUE to the tree under the key CIDR. CIDR must be a string containing an IPv6 address followed by a slash and a number of network bits. Bits to the right of this mask will be ignored.
Arguments: $range, $value
$range
Adds VALUE to the tree for each address included in RANGE which must be a hyphenated range of IPv6 addresses and with the first address being numerically smaller the second. This range will be split up into as many CIDR blocks as necessary (algorithm adapted from a script by Dr. Liviu Daia).
Arguments: $address, $bits, $value
$address
$bits
Like add() but accepts an address as a Bit::Vector object and the network bits as a separate integer instead of all in one string.
add()
Like add_vec() but accepts an address as a packed string as returned by Socket::unpack_sockaddr_in6.
add_vec()
Arguments: $start, $end, $value
$start
$end
Like add_range() but accepts addresses as separate Bit::Vector objects instead of a range string.
add_range()
Return Value: true for successful completion; dies on error
Like add_vec_range() but accepts addresses as packed strings as returned by Socket::unpack_sockaddr_in6.
add_vec_range()
Arguments: $address
Return Value: value assoiated with this address or undef
undef
Looks up an IPv6 address specified as a string and returns the value associated with the network containing it. So far there is no way to tell which network that is though.
Like lookup() but accepts the address as a Bit::Vector object.
lookup()
Like lookup() but accepts the address as a packed string as returned by Socket::unpack_sockaddr_in6.
Arguments: none
Return Value: $hashref
$hashref
Returns a hash representation of the tree with keys being CIDR-style network addresses.
Arguments: $coderef to call for each tree entry. Callback arguments are:
$coderef
The network address as a Bit::Vector object. The callback must not change this object's contents, use $addr->Clone if in doubt!
The current CIDR block's number of network bits
The value associated with this block
Return Value: nothing useful
Matthias Bethke <matthias@towiski.de>
Licensed unter the Artistic License 2.0
This module's methods are based even more loosely on Net::CIDR::Lite than those of Net::CIDR::Lookup.
To install Net::CIDR::Lookup, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::CIDR::Lookup
CPAN shell
perl -MCPAN -e shell install Net::CIDR::Lookup
For more information on module installation, please visit the detailed CPAN module installation guide.