Added new (optional) callback to libbitdht to ask upper layer if an IP is banned.

In case this callback is implemented it will be used in favour of the built-in ban list.
This commit is contained in:
sehraf 2016-06-20 22:30:51 +02:00
parent ddce43b282
commit 3bb03ff89d
8 changed files with 102 additions and 31 deletions

View file

@ -70,10 +70,10 @@
#define HISTORY_PERIOD 60
bdNode::bdNode(bdNodeId *ownId, std::string dhtVersion, const std::string& bootfile, const std::string& filterfile, bdDhtFunctions *fns)
bdNode::bdNode(bdNodeId *ownId, std::string dhtVersion, const std::string& bootfile, const std::string& filterfile, bdDhtFunctions *fns, bdNodeManager *manager)
:mNodeSpace(ownId, fns),
mFilterPeers(filterfile,ownId, BITDHT_FILTER_REASON_OWNID, fns),
mQueryMgr(NULL),
mFilterPeers(filterfile,ownId, BITDHT_FILTER_REASON_OWNID, fns, manager),
mQueryMgr(NULL),
mConnMgr(NULL),
mOwnId(*ownId), mDhtVersion(dhtVersion), mStore(bootfile, fns), mFns(fns),
mFriendList(ownId), mHistory(HISTORY_PERIOD)