Improvement to BanPeers Sharing Code.

* Added p3BanList as a service.
 * Added interfaces to communicate addresses.
 * Added debug to p3BanList.
 * Fixed several bugs in the AddEntry/Condense
 * Fixed Mutex deadlocks.

Improvements to Dsdv code too.
 * Added p3Dsdv as a service.
 * Added Function to create a TEST service for routing.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-dhtmods@4687 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2011-11-25 00:58:01 +00:00
parent 8d4a7ed4f0
commit 85ea54395b
15 changed files with 304 additions and 18 deletions

View file

@ -65,13 +65,18 @@ class BanList
* Exchange list of Banned IP addresses with peers.
*/
class p3BanList: /* public RsBanList, */ public p3Service /* , public p3Config, public pqiMonitor */
class p3BanList: /* public RsBanList, */ public p3Service, public pqiNetAssistPeerShare /* , public p3Config, public pqiMonitor */
{
public:
p3BanList(p3LinkMgr *lm, p3NetMgr *nm);
/***** overloaded from RsBanList *****/
/***** overloaded from pqiNetAssistPeerShare *****/
virtual void updatePeer(std::string id, struct sockaddr_in addr, int type, int reason, int age);
/***** overloaded from p3Service *****/
/*!
* This retrieves all chat msg items and also (important!)
@ -93,8 +98,6 @@ class p3BanList: /* public RsBanList, */ public p3Service /* , public p3Config,
void sendBanLists();
int sendBanSet(std::string peerid);
int printBanSources(std::ostream &out);
int printBanSet(std::ostream &out);
/*!
* Interface stuff.
@ -115,6 +118,8 @@ class p3BanList: /* public RsBanList, */ public p3Service /* , public p3Config,
RsMutex mBanMtx;
int condenseBanSources_locked();
int printBanSources_locked(std::ostream &out);
int printBanSet_locked(std::ostream &out);
time_t mSentListTime;
std::map<std::string, BanList> mBanSources;