kget
bt::IPBlocklist Class Reference
#include <ipblocklist.h>
Detailed Description
Keeps track of blocked peers
This class is used for keeping the IP addresses list of peers that have sent bad chunks.
Peers that have sent >= 3 bad chunks are blocked.
Definition at line 64 of file ipblocklist.h.
Public Member Functions | |
| void | addRange (const QString &ip) |
| QStringList * | getBlocklist () |
| void | insert (const QString &ip, int state=1) |
| bool | isBlocked (const QString &ip) |
| void | removeRange (const QString &ip) |
| void | setBlocklist (QStringList *list) |
| void | setPluginInterfacePtr (IPBlockingInterface *ptr) |
| void | unsetPluginInterfacePtr () |
Static Public Member Functions | |
| static IPBlocklist & | instance () |
Member Function Documentation
| void bt::IPBlocklist::addRange | ( | const QString & | ip | ) |
Adds IP range to the list It is used for blocking plugin.
For single IP use insert() instead.
- Parameters:
-
ip QString peer IP address. Uses ''*" for ranges.
Definition at line 89 of file ipblocklist.cpp.
| QStringList * bt::IPBlocklist::getBlocklist | ( | ) |
This function will fill QStringList with all banned peer IP addresses.
- Returns:
- QStringList filled with blacklisted peers. It will create a new QStringList object so don't forget to delete it after using.
Definition at line 288 of file ipblocklist.cpp.
| void bt::IPBlocklist::insert | ( | const QString & | ip, | |
| int | state = 1 | |||
| ) |
Adds ip address to the list.
It also increases the number of times this IP appeared in the list.
- Parameters:
-
ip QString containing the peer IP address state int number of bad chunks client from ip sent. Basically this parameter is used only to permanently block some IP (by setting this param to 3)
Definition at line 78 of file ipblocklist.cpp.
| IPBlocklist & bt::IPBlocklist::instance | ( | ) | [static] |
Definition at line 64 of file ipblocklist.cpp.
| bool bt::IPBlocklist::isBlocked | ( | const QString & | ip | ) |
Checks if IP is in the blocking list.
- Parameters:
-
ip - IP address to check
- Returns:
- true if IP is blocked
Definition at line 245 of file ipblocklist.cpp.
| void bt::IPBlocklist::removeRange | ( | const QString & | ip | ) |
Removes IP range from list It is used for blocking plugin.
- Parameters:
-
ip QString peer IP address. Uses ''*" for ranges.
Definition at line 172 of file ipblocklist.cpp.
| void bt::IPBlocklist::setBlocklist | ( | QStringList * | list | ) |
This function will load blacklisted peers to IPFilter.
- Parameters:
-
list QStringList containing all banned peers.
- Note:
- This function will remove current peers from blocklist before setting new list!!!
Definition at line 301 of file ipblocklist.cpp.
| void bt::IPBlocklist::setPluginInterfacePtr | ( | IPBlockingInterface * | ptr | ) |
Sets the pointer to the IPBlockingInterface (IPBlocking plugin) Call this function from IPBlocking plugin when it gets loaded.
- ptr - pointer to be set
Definition at line 240 of file ipblocklist.cpp.
| void bt::IPBlocklist::unsetPluginInterfacePtr | ( | ) | [inline] |
Unsets the interface pointer Call this when IPBlockingPlugin gets unloaded or deleted.
Definition at line 119 of file ipblocklist.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference