Reviews by Michael Robinton

cpanratings
 

RSS

NetAddr-IP (4.058) *****

Re: request for...
NetAddr::IP::isMask to validate string as a mask from any notation "contiguous 1's on the left followed by contiguous 0's to the right"

See the sub-module NetAddr::IP::Util function "notcontiguous"

usage:

$ip = NetAddr::IP->new("some address");

($spurious,$cidr) = notcontiguous($ip->{mask});

This function counts the bit positions remaining in
the mask when the rightmost '0's are removed.

input: 128 bit netmask

returns true if there are spurious

zero bits remaining in the

mask, false if the mask is

contiguous one's,

128 bit cidr number