Registered Member
|
Is it at all possible to add filtering to the next release of KTorrent? I'm thinking loading a .txt file with ranges of IPs it should allow or block.
It's the only thing still keeping me on Azureus, that beast is heavy (eats up 130 MB of RAM) and slow... KTorrent perfectly fits my needs, except for the IP filtering... What do you think? |
Registered Member
|
|
Registered Member
|
|
Registered Member
|
|
Registered Member
|
I've been looking at the code, and from what I've seen it only accepts IP ranges in the "dot" notation using wildcards, such as "127.0.0.*" or "127.0.*.*".
This is somewhat limitative, since we're dealing with arbitrary range widths. A much better solution would be the standard "slash" notation, i.e. "127.0.0.0/24" or "127.0.0.0/16" for the same examples. This allows for network ranges of any length. It can be implemented by storing the IP in binary format inside an uint32, and then comparing IPs with bitwise operations (building a mask, applying an "and", and comparing to the base IP), which you already do to some point, but you could generalize for any range width. Anyway, it's a great start. I guess I'll have to make a little converter to split my IP ranges into what KTorrent is able to process, but that should be relatively easy (well, as long as all the ranges are sufficiently big) BTW, I'm the guest that had started this thread. Thanks for implementing this! |
Registered Member
|
It would be nice if KTorrent also accepted the list from Bluetack:
http://www.bluetack.co.uk/config/IPfilter.dat.gz Bart |
Registered Member
|
We are still working on this and it may be changed these days really fast and may cause some problems, so I suggest extra caution when testing this.
Current version in SVN accepts TXT file with one IP per line. Ranges may be included using wildcards '*' like this:
First line blocks singe IP with all zeros. Second blocks all IPs starting with 10 in highest level and ending with 0. Third line is sub-level of the 2nd so it's not needed. Fourth line blocks IPs from 10.0.0.0 to 10.0.255.0 Make sure you don't enter anything else in the file since KT doesn't check it for errors. It'll simply crash or something. This is still temporary solution and will be changed in the next couple of days.[/code] |
Registered Member
|
I wrote this reply when I saw the first post and forgot to post it. So, I need to reply again
We were thinking about this, but since this whole process turned out to be very slow and painfull if the files with ranges are very big (like the one from bluetack), we had to find another solution leaving current code as is. For example, file from Bluetack is ~7MB in size. Converted to the format KT currently accepts, file grows to ~20MB - that's a whole lot of memory wasted. For smaller number of ranges, this is the fastest way of blocking IPs and it's doesn't use much memory. We will probably leave this system for manually added ranges. For the Bluetack list we'll add option to download, convert to binary file and search the file itself so it won't be using RAM.
This is the idea from start. Don't worry it will be done |
Registered Member
|
Won't that get rather slow, I mean, checking a file on the hard disk on every package received? |
Moderator
|
We will use memory mapped files. |
Registered Member
|
Well, a price for big filter files must be paid one way or another. But since we're going to use mmap, as George mentioned, I hope this won't affect the speed too much. It's better this way than to load whole file in memory... |
Registered Member
|
Well, that should work nicely as long as there's enough RAM to keep everything in memory If there isn't, everything will probably be paged in and paged out on every package. But it's a good solution, because it gives you the loading in memory "for free" if there's enough space there, and if there isn't, well, it still works, although slower. Keep up the good work! |
Registered Member
|
Ok guys, I've just finished this plugin. You should be able to :
1. Use your own filter files (regular txt files with one ip/range per line) 2. Use antip2p filters from e.g. bluetack.co.uk or any other with the same format Please, find some time to test this plugin and report any unusual experience here. You may also want to know that this is still unstable and I need to fix some things, so be carefull |
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]