IPv4 filter enhancement
chros73 opened this issue · 0 comments
chros73 commented
A. Overview
Backport @sallyswiss's IPv4 filter enhancement that is:
- not a memory hog
- current implementation uses 200 times more memory than it should
- supports p2p lists as well (along with cidr notaion:
10.0.0.0/8
)- e.g. from bluetack
- line format:
foo bar:1.2.3.4-5.6.7.8
- strores ranges as in p2p file format
- supports comments in file
- with
LOG_PEER_INFO
log level it logs when connection to unwanted peer is prevented
- still has quick
log n
lookup time forextents
data structure- use ordered map instead of sparse hash
B. Usage
Download and extract one of the links into your session
directory (first one is updated daily):
Add this into your rtorrent
config:
# Loads unwanted peers from external text file into IPv4 Filter every day, e.g.:
# - https://silo.glasz.org/antip2p.list.gz (https://gist.github.com/glaszig/bf96beccf4694ae25d4f1f7cc6224985)
# - https://www.wael.name/wael.list.p2p.gz (https://www.wael.name/other/best-blocklist/)
#schedule2 = load_ipv4_filter, 0, 24:00:00, "ipv4_filter.load=(cat,(session.path),antip2p.list),unwanted"
schedule2 = load_ipv4_filter, 0, 24:00:00, "ipv4_filter.load=(cat,(session.path),Wael-Blacklist-v8.dat),unwanted"
You can debug it with CTRL+X
and one of the following:
print=(ipv4_filter.size_data)
print=(ipv4_filter.get,10.10.10.10)
print=(ipv4_filter.dump)
C. References
More info about IPv4 Filtering in rtorrent
.
Relates to: rakshasa/rtorrent#109 , rakshasa/libtorrent#32, rakshasa/rtorrent#71, rakshasa/rtorrent#106