NAME

App::Tel::HostRange - Support for HostRanges

SYNOPSIS

if (check_hostrange($_, $host));

Searches an IPv4 or IPv6 range to see if it contains a particular IP address. Returns true if the host is contained in the range, false if it is not.

AUTHOR

Robert Drake, <rdrake at cpan.org>

COPYRIGHT & LICENSE

Copyright 2015 Robert Drake, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

check_hostrange

if (check_hostrange($rangelist, $host));

Searches an IPv4 or IPv6 range to see if it contains a particular IP address. Returns true if the host is contained in the range, false if it is not.

This does no validation, leaving it all up to NetAddr:IP and the calling function.

This should support the following types of ranges:

# 1. 192.168.13.17-192.168.32.128 # 2. 192.168.13.17-22 # 3. fe80::1-fe80::256 # 4. 192.168.13.0/24 # 5. fe80::/64 # 6. 192.168.13.17-192.168.32.128,172.16.0.2-172.16.0.13,172.28.0.0/24 # 7. 192.168.13.12