Changes to integrate bitdht into libretroshare.

Mainly re-organising tcponudp... 
	tests->test area
	network->trash (uses libbitdht classes).
	new udp interfaces (udppeer + udpstunner)

Changes include:
	* p3bitdht: added "addReceiver() call, and more debugging. 
	* p3bitdht: added DO_IDLE flag so searches are continous.
	* p3bitdht/pqiassist: matched up Assist interface.
	* fixed pqiNetListener interface.
	* rsinit/p3connmgr: setup udp init
	* tcpstream: switched to new udp receiver.
	* added "blogs" switch in libretroshare.pro (was stopping compiling ;)
	* added "bitdht" switch in libretroshare.pro 



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3323 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2010-07-31 18:14:10 +00:00
parent c1b624832f
commit fcdd7ee113
34 changed files with 627 additions and 1770 deletions

View file

@ -430,6 +430,10 @@ void p3ConnectMgr::netReset()
* NB: (*it)->reset_listener must be out of the mutex,
* as it calls back to p3ConnMgr.
*/
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
struct sockaddr_in iaddr = mOwnState.currentlocaladdr;
#ifdef CONN_DEBUG_RESET
std::cerr << "p3ConnectMgr::netReset() resetting listeners" << std::endl;
@ -437,7 +441,7 @@ void p3ConnectMgr::netReset()
std::list<pqiNetListener *>::const_iterator it;
for(it = mNetListeners.begin(); it != mNetListeners.end(); it++)
{
(*it)->reset_listener();
(*it)->resetListener(iaddr);
#ifdef CONN_DEBUG_RESET
std::cerr << "p3ConnectMgr::netReset() reset listener" << std::endl;
#endif
@ -741,8 +745,10 @@ void p3ConnectMgr::netTick()
void p3ConnectMgr::netUdpInit()
{
// All functionality has been moved elsewhere (pqiNetListener interface)
#if 0
#if defined(CONN_DEBUG_RESET)
std::cerr << "p3ConnectMgr::netUdpInit()" << std::endl;
std::cerr << "p3ConnectMgr::netUdpInit() Does nothing!" << std::endl;
#endif
connMtx.lock(); /* LOCK MUTEX */
@ -750,8 +756,12 @@ void p3ConnectMgr::netUdpInit()
connMtx.unlock(); /* UNLOCK MUTEX */
/* udp port now controlled by udpstack (from libbitdht) */
mUdpStack->resetAddress(iaddr);
/* open our udp port */
tou_init((struct sockaddr *) &iaddr, sizeof(iaddr));
#endif
}
@ -3349,11 +3359,13 @@ bool p3ConnectMgr::netAssistSetAddress( struct sockaddr_in &laddr,
struct sockaddr_in &eaddr,
uint32_t mode)
{
#if 0
std::map<uint32_t, pqiNetAssistConnect *>::iterator it;
for(it = mDhts.begin(); it != mDhts.end(); it++)
{
(it->second)->setExternalInterface(laddr, eaddr, mode);
}
#endif
return true;
}