Net::BitTorrent::Network::IPFilter - Simple, rule-based IP filter
# Example of a "ipfilter.dat" file # # All entered IP ranges will be blocked in both directions. Be careful # what you enter here. Wrong entries may totally block access to the # network. # # Format: # IP-Range , Access Level , Description # # Access Levels: # 127 blocked # >=127 permitted 064.094.089.000 - 064.094.089.255 , 000 , Gator.com
This entry will block the IPs from 064.094.089.000 to 064.094.089.255, i.e. Net::BitTorrent will not connect to any IP in this range.
Warning:
The example above will block any connection to the specified IP-range. This may reduce the number of sources for downloads.
At the moment only one access levels are implemented. A value below 127 means that any connection-attempt is denied.
Remember...
Filtering will prevent up and downloading to the banned clients
Filtering is done at the protocol level so no connection to banned clients is ever established
This constructs a new, empty object. There are currently no accepted arguments.
This method adds a new range to the in-memory ipfilter.
This method coerces the arguments into a new range which is the added to the in-memory ipfilter.
Returns how many rules are loaded.
Returns a boolean value indicating whether or not there are any rules loaded in the ipfilter.
Deletes all rules from the ipfilter.
Slurps an ipfilter.dat-like file and adds the rules found inside to the ipfilter.
Stores the in-memory ipfilter to disk.
Indicates whether or not $ip is banned. If so, the rule in which it was found is returned. If not, a false value is returned.
$ip
The standard ipfilter.dat only supports IPv4 addresses but Net::BitTorrent's current implementation supports IPv6 as well. Keep this in mind when storing an ipfilter.dat file to disk.
Emule Project's ipfilter.dat documentation
Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
CPAN ID: SANKO
Copyright (C) 2008-2010 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 Net::BitTorrent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::BitTorrent
CPAN shell
perl -MCPAN -e shell install Net::BitTorrent
For more information on module installation, please visit the detailed CPAN module installation guide.