mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 16:09:37 -05:00
Changes to upnp interface to support miniupnpc-1.0
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@421 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5d8e5d4905
commit
048e84630e
@ -132,7 +132,7 @@ bool upnphandler::initUPnPState()
|
|||||||
/* allocate memory */
|
/* allocate memory */
|
||||||
uPnPConfigData *upcd = new uPnPConfigData;
|
uPnPConfigData *upcd = new uPnPConfigData;
|
||||||
|
|
||||||
upcd->devlist = upnpDiscover(2000);
|
upcd->devlist = upnpDiscover(2000, NULL, NULL);
|
||||||
if(upcd->devlist)
|
if(upcd->devlist)
|
||||||
{
|
{
|
||||||
struct UPNPDev * device;
|
struct UPNPDev * device;
|
||||||
|
@ -69,7 +69,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i % 300 == 20)
|
if (i % 300 == 120)
|
||||||
{
|
{
|
||||||
/* shutdown a forward */
|
/* shutdown a forward */
|
||||||
upnp.enableUPnP(false);
|
upnp.enableUPnP(false);
|
||||||
|
@ -27,6 +27,7 @@ void DisplayInfos(struct UPNPUrls * urls,
|
|||||||
char externalIPAddress[16];
|
char externalIPAddress[16];
|
||||||
char connectionType[64];
|
char connectionType[64];
|
||||||
char status[64];
|
char status[64];
|
||||||
|
char lastconnerror[64];
|
||||||
unsigned int uptime;
|
unsigned int uptime;
|
||||||
unsigned int brUp, brDown;
|
unsigned int brUp, brDown;
|
||||||
UPNP_GetConnectionTypeInfo(urls->controlURL,
|
UPNP_GetConnectionTypeInfo(urls->controlURL,
|
||||||
@ -36,8 +37,8 @@ void DisplayInfos(struct UPNPUrls * urls,
|
|||||||
printf("Connection Type : %s\n", connectionType);
|
printf("Connection Type : %s\n", connectionType);
|
||||||
else
|
else
|
||||||
printf("GetConnectionTypeInfo failed.\n");
|
printf("GetConnectionTypeInfo failed.\n");
|
||||||
UPNP_GetStatusInfo(urls->controlURL, data->servicetype, status, &uptime);
|
UPNP_GetStatusInfo(urls->controlURL, data->servicetype, status, &uptime, lastconnerror);
|
||||||
printf("Status : %s, uptime=%u\n", status, uptime);
|
printf("Status : %s, uptime=%u LastConnError %s\n", status, uptime, lastconnerror);
|
||||||
UPNP_GetLinkLayerMaxBitRates(urls->controlURL_CIF, data->servicetype_CIF,
|
UPNP_GetLinkLayerMaxBitRates(urls->controlURL_CIF, data->servicetype_CIF,
|
||||||
&brDown, &brUp);
|
&brDown, &brUp);
|
||||||
printf("MaxBitRateDown : %u bps MaxBitRateUp %u bps\n", brDown, brUp);
|
printf("MaxBitRateDown : %u bps MaxBitRateUp %u bps\n", brDown, brUp);
|
||||||
|
Loading…
Reference in New Issue
Block a user