Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv4 filter enhancement #11

Closed
chros73 opened this issue Dec 10, 2017 · 1 comment
Closed

IPv4 filter enhancement #11

chros73 opened this issue Dec 10, 2017 · 1 comment

Comments

@chros73
Copy link
Owner

chros73 commented Dec 10, 2017

Rebase @sallyswiss's IPv4 filter mod on current master branch, only small change was made:

  • enhance readability
  • remove extra spaces and unnecessary comments

A. Overview

IPv4 filter enhancement is:

  • not a memory hog
  • 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 for extents 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)

B. References

More info about IPv4 Filtering in rtorrent.

Depended by: chros73/rtorrent#21
Makes this duplicate: rakshasa#32
Closes: rakshasa/rtorrent#71, rakshasa/rtorrent#106

@chros73
Copy link
Owner Author

chros73 commented Jun 9, 2018

Merged.

@chros73 chros73 closed this as completed Jun 9, 2018
@chros73 chros73 added the merged label Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant