Config::IPFilter::Rule - A single block of IP addresses
use Config::IPFilter::Rule; my $rule = Config::IPFilter::Rule->new(access_level => 255, lower => '0.0.0.0', upper => '255.255.255.255', description => 'teh innernetz' ); # Hide in a cave $rule->set_access_level(126);
IPv6 is also supported...
use Config::IPFilter::Rule; my $rule = Config::IPFilter::Rule->new( access_level => 255, upper => 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', lower => '::', # ojai description => 'teh innernetz' ); # Hide in a cave $rule->set_access_level(126); $filter->is_banned('2001:db8::'); # It, and everything else, is banned
This is a single range of addresses (IPv4 or IPv6) which all share a single access level.
This constructs a new object. The following arguments are required:
access_level
This is an integer value.
description
This is a string. You should put the reason why this range exists here.
upper
This is the address at the highest end of this range.
lower
This is the address at the lowest end of this range.
Returns the access level currently defined for this range. See Config::IPFilter->is_banned( ... ).
Sets the access level for this range.
Sets the access level for this range $inc degrees higher. The default value of $inc is 1.
$inc
1
Sets the access level for this range $dec degrees lower. The default value of $dec is 1.
$dec
If the given address is within this rule's range, a true value is returned otherwise a false value is returned.
This is original string value you passed during construction.
This returns the address at the highest end of the range.
This returns the address at the lowest end of the range.
Sanko Robinson < sanko@cpan.org > - http://sankorobinson.com/
CPAN ID: SANKO
Copyright (C) 2010, 2011 by Sanko Robinson <sanko@cpan.org>
This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.
When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.
Neither this module nor the Author is affiliated with BitTorrent, Inc.
To install Config::IPFilter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::IPFilter
CPAN shell
perl -MCPAN -e shell install Config::IPFilter
For more information on module installation, please visit the detailed CPAN module installation guide.