Added new Upnp interface fn, and dummy implementations.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5734 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2012-10-28 18:17:06 +00:00
parent d208b59d33
commit a5f52e85a1
4 changed files with 31 additions and 0 deletions

View File

@ -64,6 +64,20 @@ virtual int tick() { return 0; } /* for internal accounting */
};
#define PFP_TYPE_UDP 0x0001
#define PFP_TYPE_TCP 0x0002
class PortForwardParams
{
public:
uint32_t fwdId;
uint32_t status;
uint32_t typeFlags;
struct sockaddr_in intAddr;
struct sockaddr_in extaddr;
};
class pqiNetAssistFirewall: public pqiNetAssist
{
public:
@ -78,6 +92,12 @@ virtual void setExternalPort(unsigned short eport_in) = 0;
virtual bool getInternalAddress(struct sockaddr_in &addr) = 0;
virtual bool getExternalAddress(struct sockaddr_in &addr) = 0;
/* New Port Forward interface to support as many ports as necessary */
virtual bool requestPortForward(const PortForwardParams &params) = 0;
virtual bool statusPortForward(const uint32_t fwdId, PortForwardParams &params) = 0;
};

View File

@ -39,6 +39,10 @@ class upnphandler: public pqiNetAssistFirewall
virtual bool getInternalAddress(struct sockaddr_in &addr);
virtual bool getExternalAddress(struct sockaddr_in &addr);
/* TO IMPLEMENT: New Port Forward interface to support as many ports as necessary */
virtual bool requestPortForward(const PortForwardParams &params) { return false; }
virtual bool statusPortForward(const uint32_t fwdId, PortForwardParams &params) { return false; }
/* Public functions - for background thread operation,
* but effectively private from rest of RS, as in derived class
*/

View File

@ -65,6 +65,10 @@ virtual void setExternalPort(unsigned short eport_in);
virtual bool getInternalAddress(struct sockaddr_in &addr);
virtual bool getExternalAddress(struct sockaddr_in &addr);
/* TO IMPLEMENT: New Port Forward interface to support as many ports as necessary */
virtual bool requestPortForward(const PortForwardParams &params) { return false; }
virtual bool statusPortForward(const uint32_t fwdId, PortForwardParams &params) { return false; }
/* Public functions - for background thread operation,
* but effectively private from rest of RS, as in derived class
*/

View File

@ -64,6 +64,9 @@ virtual void setExternalPort(unsigned short eport_in);
virtual bool getInternalAddress(struct sockaddr_in &addr);
virtual bool getExternalAddress(struct sockaddr_in &addr);
/* TO IMPLEMENT: New Port Forward interface to support as many ports as necessary */
virtual bool requestPortForward(const PortForwardParams &params) { return false; }
virtual bool statusPortForward(const uint32_t fwdId, PortForwardParams &params) { return false; }
/* pqiNetAssistConnect - external interface functions */