mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
Remove miniupnp and add libupnp code
Conflicts: libretroshare/src/libretroshare.pro git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1744 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b6c2b6897a
commit
4fe1bd8801
8 changed files with 2426 additions and 620 deletions
|
@ -3,15 +3,15 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
/* platform independent networking... */
|
||||
#include "pqi/pqinetwork.h"
|
||||
#include "pqi/pqiassist.h"
|
||||
|
||||
#include "util/rsthreads.h"
|
||||
|
||||
#include "upnp.h"
|
||||
#include "upnp/UPnPBase.h"
|
||||
|
||||
class upnpentry
|
||||
{
|
||||
public:
|
||||
|
@ -48,58 +48,60 @@ class upnphandler: public pqiNetAssistFirewall
|
|||
{
|
||||
public:
|
||||
|
||||
upnphandler();
|
||||
virtual ~upnphandler();
|
||||
upnphandler();
|
||||
virtual ~upnphandler();
|
||||
|
||||
/* External Interface (pqiNetAssistFirewall) */
|
||||
virtual void enable(bool active);
|
||||
virtual void shutdown();
|
||||
virtual void restart();
|
||||
/* External Interface (pqiNetAssistFirewall) */
|
||||
virtual void enable(bool active);
|
||||
virtual void shutdown();
|
||||
virtual void restart();
|
||||
|
||||
virtual bool getEnabled();
|
||||
virtual bool getActive();
|
||||
virtual bool getEnabled();
|
||||
virtual bool getActive();
|
||||
|
||||
virtual void setInternalPort(unsigned short iport_in);
|
||||
virtual void setExternalPort(unsigned short eport_in);
|
||||
virtual bool getInternalAddress(struct sockaddr_in &addr);
|
||||
virtual bool getExternalAddress(struct sockaddr_in &addr);
|
||||
virtual void setInternalPort(unsigned short iport_in);
|
||||
virtual void setExternalPort(unsigned short eport_in);
|
||||
virtual bool getInternalAddress(struct sockaddr_in &addr);
|
||||
virtual bool getExternalAddress(struct sockaddr_in &addr);
|
||||
|
||||
/* Public functions - for background thread operation,
|
||||
* but effectively private from rest of RS, as in derived class
|
||||
*/
|
||||
/* Public functions - for background thread operation,
|
||||
* but effectively private from rest of RS, as in derived class
|
||||
*/
|
||||
unsigned int upnpState;
|
||||
|
||||
bool start_upnp();
|
||||
bool shutdown_upnp();
|
||||
bool start_upnp();
|
||||
bool shutdown_upnp();
|
||||
|
||||
bool initUPnPState();
|
||||
bool printUPnPState();
|
||||
bool initUPnPState();
|
||||
|
||||
/* Mutex for data below */
|
||||
RsMutex dataMtx;
|
||||
|
||||
private:
|
||||
|
||||
bool background_setup_upnp(bool, bool);
|
||||
bool checkUPnPActive();
|
||||
CUPnPControlPoint *cUPnPControlPoint;
|
||||
|
||||
/* Mutex for data below */
|
||||
RsMutex dataMtx;
|
||||
bool background_setup_upnp(bool, bool);
|
||||
|
||||
bool toEnable; /* overall on/off switch */
|
||||
bool toStart; /* if set start forwarding */
|
||||
bool toStop; /* if set stop forwarding */
|
||||
|
||||
unsigned short iport;
|
||||
unsigned short eport; /* config */
|
||||
unsigned short eport_curr; /* current forwarded */
|
||||
bool toEnable; /* overall on/off switch */
|
||||
bool toStart; /* if set start forwarding */
|
||||
bool toStop; /* if set stop forwarding */
|
||||
|
||||
/* info from upnp */
|
||||
unsigned int upnpState;
|
||||
uPnPConfigData *upnpConfig;
|
||||
unsigned short iport;
|
||||
unsigned short eport; /* config */
|
||||
unsigned short eport_curr; /* current forwarded */
|
||||
|
||||
struct sockaddr_in upnp_iaddr;
|
||||
struct sockaddr_in upnp_eaddr;
|
||||
/* info from upnp */
|
||||
struct sockaddr_in upnp_iaddr;
|
||||
struct sockaddr_in upnp_eaddr;
|
||||
|
||||
/* active port forwarding */
|
||||
std::list<upnpforward> activeForwards;
|
||||
/* active port forwarding */
|
||||
std::list<upnpforward> activeForwards;
|
||||
|
||||
};
|
||||
|
||||
/* info from upnp */
|
||||
int CtrlPointCallbackEventHandler(Upnp_EventType ,void* , void*);
|
||||
|
||||
#endif /* _RS_UPNP_IFACE_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue