mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-29 02:51:45 -04:00
Merging branches/v0.5-peernet/libbitdht (Merging r4237 through r4353 into '.')
There are many significant improvements to the DHT here. See commit logs on v0.5-peernet branch for details. This is not the final merge, but brings over the majority of expected v0.5-peernet/libbitdht changes git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4354 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f517442989
commit
fff40eceac
40 changed files with 6843 additions and 746 deletions
|
@ -113,6 +113,17 @@ virtual void removeCallback(BitDhtCallback *cb);
|
|||
/***** Get Results Details *****/
|
||||
virtual int getDhtPeerAddress(const bdNodeId *id, struct sockaddr_in &from);
|
||||
virtual int getDhtValue(const bdNodeId *id, std::string key, std::string &value);
|
||||
virtual int getDhtBucket(const int idx, bdBucket &bucket);
|
||||
|
||||
virtual int getDhtQueries(std::map<bdNodeId, bdQueryStatus> &queries);
|
||||
virtual int getDhtQueryStatus(const bdNodeId *id, bdQuerySummary &query);
|
||||
|
||||
/***** Connection Interface ****/
|
||||
virtual void ConnectionRequest(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t start);
|
||||
virtual void ConnectionAuth(bdId *srcId, bdId *proxyId, bdId *destId,
|
||||
uint32_t mode, uint32_t loc, uint32_t answer);
|
||||
virtual void ConnectionOptions(uint32_t allowedModes, uint32_t flags);
|
||||
|
||||
|
||||
/* stats and Dht state */
|
||||
virtual int startDht();
|
||||
|
@ -124,7 +135,9 @@ virtual uint32_t statsBDVersionSize(); /* same version as us! */
|
|||
|
||||
// Overloaded from bdnode for external node callback.
|
||||
virtual void addPeer(const bdId *id, uint32_t peerflags);
|
||||
|
||||
// Overloaded from bdnode for external node callback.
|
||||
virtual void callbackConnect(bdId *srcId, bdId *proxyId, bdId *destId,
|
||||
int mode, int point, int cbtype, int errcode);
|
||||
|
||||
int isBitDhtPacket(char *data, int size, struct sockaddr_in &from);
|
||||
private:
|
||||
|
@ -139,7 +152,9 @@ int checkStatus();
|
|||
int checkPingStatus();
|
||||
int SearchOutOfDate();
|
||||
void startQueries();
|
||||
void QueryRandomLocalNet();
|
||||
|
||||
int QueryRandomLocalNet();
|
||||
void SearchForLocalNet();
|
||||
|
||||
std::map<bdNodeId, bdQueryPeer> mActivePeers;
|
||||
std::list<BitDhtCallback *> mCallbacks;
|
||||
|
@ -147,6 +162,10 @@ void QueryRandomLocalNet();
|
|||
uint32_t mMode;
|
||||
time_t mModeTS;
|
||||
|
||||
time_t mStartTS;
|
||||
time_t mSearchTS;
|
||||
bool mSearchingDone;
|
||||
|
||||
bdDhtFunctions *mFns;
|
||||
|
||||
uint32_t mNetworkSize;
|
||||
|
@ -162,8 +181,10 @@ class bdDebugCallback: public BitDhtCallback
|
|||
{
|
||||
public:
|
||||
~bdDebugCallback();
|
||||
virtual int dhtPeerCallback(const bdNodeId *id, uint32_t status);
|
||||
virtual int dhtPeerCallback(const bdId *id, uint32_t status);
|
||||
virtual int dhtValueCallback(const bdNodeId *id, std::string key, uint32_t status);
|
||||
virtual int dhtConnectCallback(const bdId *srcId, const bdId *proxyId, const bdId *destId,
|
||||
uint32_t mode, uint32_t point, uint32_t cbtype, uint32_t errcode);
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue