mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 15:35:49 -04:00
- added more debug info to p3LinkMgr
- added check for banned IP from DHT at connection time - added regular removal of banned IPs from friend IP lists - increased time of banned IP storage to 1 week (previously 6 hours) - added save for banned IPs to keep them after restart (in bdfilter.cc) to file bdfilter.txt (can be manually updated) - changed mFiltered into a std::map for increased search efficiency - added secondary check of cert ID at connection time.-This line, and those below, will be ignored-- M libretroshare/src/pqi/p3netmgr.cc M libretroshare/src/pqi/pqimonitor.h M libretroshare/src/pqi/p3peermgr.cc M libretroshare/src/pqi/p3linkmgr.h M libretroshare/src/pqi/pqissllistener.cc M libretroshare/src/pqi/p3peermgr.h M libretroshare/src/pqi/p3linkmgr.cc M libretroshare/src/pqi/pqiperson.cc M libretroshare/src/pqi/pqissl.cc M libretroshare/src/rsserver/rsinit.cc M libretroshare/src/dht/p3bitdht_relay.cc M libretroshare/src/dht/p3bitdht.cc M libretroshare/src/dht/p3bitdht.h M libretroshare/src/retroshare/rsdht.h M libbitdht/src/udp/udpbitdht.h M libbitdht/src/udp/udpbitdht.cc M libbitdht/src/bitdht/bdmanager.cc M libbitdht/src/bitdht/bdmanager.h M libbitdht/src/bitdht/bdnode.h M libbitdht/src/bitdht/bdfilter.h M libbitdht/src/bitdht/bdfilter.cc M libbitdht/src/bitdht/bdnode.cc M libbitdht/src/bitdht/bdstore.h git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8289 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e9b9dce9f5
commit
5b2ba1e81c
23 changed files with 442 additions and 200 deletions
|
@ -82,7 +82,7 @@ virtual int dhtInfoCallback(const bdId *id, uint32_t type, uint32_t flags, std::
|
|||
|
||||
|
||||
p3BitDht::p3BitDht(const RsPeerId& id, pqiConnectCb *cb, p3NetMgr *nm,
|
||||
UdpStack *udpstack, std::string bootstrapfile)
|
||||
UdpStack *udpstack, std::string bootstrapfile,const std::string& filteredipfile)
|
||||
:p3Config(), pqiNetAssistConnect(id, cb), mNetMgr(nm), dhtMtx("p3BitDht")
|
||||
{
|
||||
mDhtStunner = NULL;
|
||||
|
@ -129,7 +129,7 @@ p3BitDht::p3BitDht(const RsPeerId& id, pqiConnectCb *cb, p3NetMgr *nm,
|
|||
#endif
|
||||
|
||||
/* create dht */
|
||||
mUdpBitDht = new UdpBitDht(udpstack, &mOwnDhtId, dhtVersion, bootstrapfile, mDhtFns);
|
||||
mUdpBitDht = new UdpBitDht(udpstack, &mOwnDhtId, dhtVersion, bootstrapfile, filteredipfile,mDhtFns);
|
||||
udpstack->addReceiver(mUdpBitDht);
|
||||
|
||||
/* setup callback to here */
|
||||
|
@ -373,7 +373,18 @@ bool p3BitDht::getExternalInterface(struct sockaddr_storage &/*raddr*/,
|
|||
#endif
|
||||
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool p3BitDht::isAddressBanned(const sockaddr_storage &raddr)
|
||||
{
|
||||
if(raddr.ss_family == AF_INET6) // the DHT does not handle INET6 addresses yet.
|
||||
return false ;
|
||||
|
||||
if(raddr.ss_family == AF_INET)
|
||||
return mUdpBitDht->isAddressBanned((sockaddr_in&)raddr) ;
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ class p3BitDht: public p3Config, public pqiNetAssistConnect, public RsDht
|
|||
{
|
||||
public:
|
||||
p3BitDht(const RsPeerId& id, pqiConnectCb *cb, p3NetMgr *nm,
|
||||
UdpStack *udpstack, std::string bootstrapfile);
|
||||
UdpStack *udpstack, std::string bootstrapfile, const std::string &filteredipfile);
|
||||
|
||||
|
||||
virtual ~p3BitDht();
|
||||
|
@ -214,6 +214,7 @@ virtual bool getPeerStatus(const RsPeerId& id,
|
|||
virtual bool getExternalInterface(struct sockaddr_storage &raddr,
|
||||
uint32_t &mode);
|
||||
|
||||
virtual bool isAddressBanned(const struct sockaddr_storage& raddr) ;
|
||||
|
||||
virtual bool setAttachMode(bool on);
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ bool p3BitDht::saveList(bool &cleanup, std::list<RsItem *> &saveList)
|
|||
|
||||
config->print(std::cerr, 0);
|
||||
|
||||
saveList.push_back(config);
|
||||
saveList.push_back(config);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue