* Modified p3ConnectMgr to enable Standalone testing of components.

* Created pqiNetAssist interfaces for DHT and UPnP.
 * Created PQIHub etc for standalone testing (in ft/pqitestor.h for now).
 * Add basics of first server test ... its not quite complete yet.
 * Improvements to ftserver.
 * Changes to many tests to match other mods.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@689 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-08-16 15:02:24 +00:00
parent 483118daec
commit 33032e8a83
20 changed files with 882 additions and 141 deletions

View file

@ -412,7 +412,7 @@ upnphandler::~upnphandler()
}
/* RsIface */
void upnphandler::enableUPnP(bool active)
void upnphandler::enable(bool active)
{
dataMtx.lock(); /*** LOCK MUTEX ***/
@ -443,7 +443,7 @@ void upnphandler::enableUPnP(bool active)
}
void upnphandler::shutdownUPnP()
void upnphandler::shutdown()
{
/* blocking call to shutdown upnp */
@ -451,7 +451,7 @@ void upnphandler::shutdownUPnP()
}
void upnphandler::restartUPnP()
void upnphandler::restart()
{
/* non-blocking call to shutdown upnp, and startup again. */
background_setup_upnp(true, true);
@ -459,7 +459,7 @@ void upnphandler::restartUPnP()
bool upnphandler::getUPnPEnabled()
bool upnphandler::getEnabled()
{
dataMtx.lock(); /*** LOCK MUTEX ***/
@ -470,7 +470,7 @@ bool upnphandler::getUPnPEnabled()
return on;
}
bool upnphandler::getUPnPActive()
bool upnphandler::getActive()
{
dataMtx.lock(); /*** LOCK MUTEX ***/

View file

@ -8,7 +8,9 @@
/* platform independent networking... */
#include "pqi/pqinetwork.h"
#include "pqi/p3upnpmgr.h"
#include "pqi/pqiassist.h"
#include "util/rsthreads.h"
class upnpentry
{
@ -42,20 +44,20 @@ class upnpforward
class uPnPConfigData;
class upnphandler: public p3UpnpMgr
class upnphandler: public pqiNetAssistFirewall
{
public:
upnphandler();
virtual ~upnphandler();
/* External Interface */
virtual void enableUPnP(bool active);
virtual void shutdownUPnP();
virtual void restartUPnP();
/* External Interface (pqiNetAssistFirewall) */
virtual void enable(bool active);
virtual void shutdown();
virtual void restart();
virtual bool getUPnPEnabled();
virtual bool getUPnPActive();
virtual bool getEnabled();
virtual bool getActive();
virtual void setInternalPort(unsigned short iport_in);
virtual void setExternalPort(unsigned short eport_in);

View file

@ -64,20 +64,20 @@ int main(int argc, char **argv)
if (i % 120 == 10)
{
/* start up a forward */
upnp.enableUPnP(true);
upnp.enable(true);
}
if (i % 120 == 60)
{
/* shutdown a forward */
upnp.restartUPnP();
upnp.restart();
}
if (i % 120 == 100)
{
/* shutdown a forward */
upnp.shutdownUPnP();
upnp.shutdown();
}
}