Merge pull request #77 from mikedld/miniupnp-staticlib

Rename STATICLIB macro to resolve natpmp/miniupnp conflict
This commit is contained in:
Thomas BERNARD 2014-06-02 18:54:33 +02:00
commit 011e7e7acd
13 changed files with 79 additions and 79 deletions

View File

@ -86,7 +86,7 @@ endif (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "AmigaOS")
if (WIN32) if (WIN32)
set_source_files_properties (${MINIUPNPC_SOURCES} PROPERTIES set_source_files_properties (${MINIUPNPC_SOURCES} PROPERTIES
COMPILE_DEFINITIONS STATICLIB COMPILE_DEFINITIONS MINIUPNP_STATICLIB
COMPILE_DEFINITIONS MINIUPNP_EXPORTS COMPILE_DEFINITIONS MINIUPNP_EXPORTS
) )
endif (WIN32) endif (WIN32)

View File

@ -50,11 +50,11 @@ dll/upnpc.o: upnpc.o
echo $@ generated with $< echo $@ generated with $<
.c.o: .c.o:
$(CC) $(CFLAGS) -DSTATICLIB -c -o $@ $< $(CC) $(CFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
$(CC) $(CFLAGS) -DMINIUPNP_EXPORTS -c -o dll/$@ $< $(CC) $(CFLAGS) -DMINIUPNP_EXPORTS -c -o dll/$@ $<
upnpc.o: upnpc.o:
$(CC) $(CFLAGS) -DSTATICLIB -c -o $@ $< $(CC) $(CFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
$(CC) $(CFLAGS) -c -o dll/$@ $< $(CC) $(CFLAGS) -c -o dll/$@ $<
# --enable-stdcall-fixup # --enable-stdcall-fixup

View File

@ -1,19 +1,19 @@
#ifndef DECLSPEC_H_INCLUDED #ifndef DECLSPEC_H_INCLUDED
#define DECLSPEC_H_INCLUDED #define DECLSPEC_H_INCLUDED
#if defined(_WIN32) && !defined(STATICLIB) #if defined(_WIN32) && !defined(MINIUPNP_STATICLIB)
/* for windows dll */ /* for windows dll */
#ifdef MINIUPNP_EXPORTS #ifdef MINIUPNP_EXPORTS
#define LIBSPEC __declspec(dllexport) #define MINIUPNP_LIBSPEC __declspec(dllexport)
#else #else
#define LIBSPEC __declspec(dllimport) #define MINIUPNP_LIBSPEC __declspec(dllimport)
#endif #endif
#else #else
#if defined(__GNUC__) && __GNUC__ >= 4 #if defined(__GNUC__) && __GNUC__ >= 4
/* fix dynlib for OS X 10.9.2 and Apple LLVM version 5.0 */ /* fix dynlib for OS X 10.9.2 and Apple LLVM version 5.0 */
#define LIBSPEC __attribute__ ((visibility ("default"))) #define MINIUPNP_LIBSPEC __attribute__ ((visibility ("default")))
#else #else
#define LIBSPEC #define MINIUPNP_LIBSPEC
#endif #endif
#endif #endif

View File

@ -109,7 +109,7 @@ struct ip_mreqn
#define SERVICEPREFIX2 'u' #define SERVICEPREFIX2 'u'
/* root description parsing */ /* root description parsing */
LIBSPEC void parserootdesc(const char * buffer, int bufsize, struct IGDdatas * data) MINIUPNP_LIBSPEC void parserootdesc(const char * buffer, int bufsize, struct IGDdatas * data)
{ {
struct xmlparser parser; struct xmlparser parser;
/* xmlparser object */ /* xmlparser object */
@ -338,7 +338,7 @@ parseMSEARCHReply(const char * reply, int size,
* no devices was found. * no devices was found.
* It is up to the caller to free the chained list * It is up to the caller to free the chained list
* delay is in millisecond (poll) */ * delay is in millisecond (poll) */
LIBSPEC struct UPNPDev * MINIUPNP_LIBSPEC struct UPNPDev *
upnpDiscover(int delay, const char * multicastif, upnpDiscover(int delay, const char * multicastif,
const char * minissdpdsock, int sameport, const char * minissdpdsock, int sameport,
int ipv6, int ipv6,
@ -721,7 +721,7 @@ upnpDiscover(int delay, const char * multicastif,
/* freeUPNPDevlist() should be used to /* freeUPNPDevlist() should be used to
* free the chained list returned by upnpDiscover() */ * free the chained list returned by upnpDiscover() */
LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist) MINIUPNP_LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist)
{ {
struct UPNPDev * next; struct UPNPDev * next;
while(devlist) while(devlist)
@ -757,7 +757,7 @@ url_cpy_or_cat(char * dst, const char * src, int n)
/* Prepare the Urls for usage... /* Prepare the Urls for usage...
*/ */
LIBSPEC void MINIUPNP_LIBSPEC void
GetUPNPUrls(struct UPNPUrls * urls, struct IGDdatas * data, GetUPNPUrls(struct UPNPUrls * urls, struct IGDdatas * data,
const char * descURL, unsigned int scope_id) const char * descURL, unsigned int scope_id)
{ {
@ -847,7 +847,7 @@ GetUPNPUrls(struct UPNPUrls * urls, struct IGDdatas * data,
#endif #endif
} }
LIBSPEC void MINIUPNP_LIBSPEC void
FreeUPNPUrls(struct UPNPUrls * urls) FreeUPNPUrls(struct UPNPUrls * urls)
{ {
if(!urls) if(!urls)
@ -894,7 +894,7 @@ UPNPIGD_IsConnected(struct UPNPUrls * urls, struct IGDdatas * data)
* passed as parameters are set. Donc forget to call FreeUPNPUrls(urls) to * passed as parameters are set. Donc forget to call FreeUPNPUrls(urls) to
* free allocated memory. * free allocated memory.
*/ */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetValidIGD(struct UPNPDev * devlist, UPNP_GetValidIGD(struct UPNPDev * devlist,
struct UPNPUrls * urls, struct UPNPUrls * urls,
struct IGDdatas * data, struct IGDdatas * data,

View File

@ -54,19 +54,19 @@ struct UPNPDev {
* multicast interface for sending SSDP discover packets. * multicast interface for sending SSDP discover packets.
* If sameport is not null, SSDP packets will be sent from the source port * If sameport is not null, SSDP packets will be sent from the source port
* 1900 (same as destination port) otherwise system assign a source port. */ * 1900 (same as destination port) otherwise system assign a source port. */
LIBSPEC struct UPNPDev * MINIUPNP_LIBSPEC struct UPNPDev *
upnpDiscover(int delay, const char * multicastif, upnpDiscover(int delay, const char * multicastif,
const char * minissdpdsock, int sameport, const char * minissdpdsock, int sameport,
int ipv6, int ipv6,
int * error); int * error);
/* freeUPNPDevlist() /* freeUPNPDevlist()
* free list returned by upnpDiscover() */ * free list returned by upnpDiscover() */
LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist); MINIUPNP_LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist);
/* parserootdesc() : /* parserootdesc() :
* parse root XML description of a UPnP device and fill the IGDdatas * parse root XML description of a UPnP device and fill the IGDdatas
* structure. */ * structure. */
LIBSPEC void parserootdesc(const char *, int, struct IGDdatas *); MINIUPNP_LIBSPEC void parserootdesc(const char *, int, struct IGDdatas *);
/* structure used to get fast access to urls /* structure used to get fast access to urls
* controlURL: controlURL of the WANIPConnection * controlURL: controlURL of the WANIPConnection
@ -94,7 +94,7 @@ struct UPNPUrls {
* passed as parameters are set. Donc forget to call FreeUPNPUrls(urls) to * passed as parameters are set. Donc forget to call FreeUPNPUrls(urls) to
* free allocated memory. * free allocated memory.
*/ */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetValidIGD(struct UPNPDev * devlist, UPNP_GetValidIGD(struct UPNPDev * devlist,
struct UPNPUrls * urls, struct UPNPUrls * urls,
struct IGDdatas * data, struct IGDdatas * data,
@ -105,21 +105,21 @@ UPNP_GetValidIGD(struct UPNPDev * devlist,
* return value : * return value :
* 0 - Not ok * 0 - Not ok
* 1 - OK */ * 1 - OK */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetIGDFromUrl(const char * rootdescurl, UPNP_GetIGDFromUrl(const char * rootdescurl,
struct UPNPUrls * urls, struct UPNPUrls * urls,
struct IGDdatas * data, struct IGDdatas * data,
char * lanaddr, int lanaddrlen); char * lanaddr, int lanaddrlen);
LIBSPEC void MINIUPNP_LIBSPEC void
GetUPNPUrls(struct UPNPUrls *, struct IGDdatas *, GetUPNPUrls(struct UPNPUrls *, struct IGDdatas *,
const char *, unsigned int); const char *, unsigned int);
LIBSPEC void MINIUPNP_LIBSPEC void
FreeUPNPUrls(struct UPNPUrls *); FreeUPNPUrls(struct UPNPUrls *);
/* return 0 or 1 */ /* return 0 or 1 */
LIBSPEC int UPNPIGD_IsConnected(struct UPNPUrls *, struct IGDdatas *); MINIUPNP_LIBSPEC int UPNPIGD_IsConnected(struct UPNPUrls *, struct IGDdatas *);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -6,7 +6,7 @@
* This software is subjet to the conditions detailed in the * This software is subjet to the conditions detailed in the
* provided LICENCE file. */ * provided LICENCE file. */
#include <Python.h> #include <Python.h>
#define STATICLIB #define MINIUPNP_STATICLIB
#include "structmember.h" #include "structmember.h"
#include "miniupnpc.h" #include "miniupnpc.h"
#include "upnpcommands.h" #include "upnpcommands.h"

View File

@ -14,11 +14,11 @@
extern "C" { extern "C" {
#endif #endif
LIBSPEC void * getHTTPResponse(int s, int * size); MINIUPNP_LIBSPEC void * getHTTPResponse(int s, int * size);
LIBSPEC void * miniwget(const char *, int *, unsigned int); MINIUPNP_LIBSPEC void * miniwget(const char *, int *, unsigned int);
LIBSPEC void * miniwget_getaddr(const char *, int *, char *, int, unsigned int); MINIUPNP_LIBSPEC void * miniwget_getaddr(const char *, int *, char *, int, unsigned int);
int parseURL(const char *, char *, unsigned short *, char * *, unsigned int *); int parseURL(const char *, char *, unsigned short *, char * *, unsigned int *);

View File

@ -41,7 +41,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;STATICLIB;DEBUG" PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;MINIUPNP_STATICLIB;DEBUG"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
@ -104,7 +104,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;STATICLIB" PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;MINIUPNP_STATICLIB"
RuntimeLibrary="2" RuntimeLibrary="2"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"

View File

@ -41,7 +41,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;STATICLIB;DEBUG;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;MINIUPNP_STATICLIB;DEBUG;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
@ -115,7 +115,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;STATICLIB" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;MINIUPNP_STATICLIB"
RuntimeLibrary="2" RuntimeLibrary="2"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"

View File

@ -57,11 +57,11 @@ struct PortMappingParserData {
portMappingElt curelt; portMappingElt curelt;
}; };
LIBSPEC void MINIUPNP_LIBSPEC void
ParsePortListing(const char * buffer, int bufsize, ParsePortListing(const char * buffer, int bufsize,
struct PortMappingParserData * pdata); struct PortMappingParserData * pdata);
LIBSPEC void MINIUPNP_LIBSPEC void
FreePortListing(struct PortMappingParserData * pdata); FreePortListing(struct PortMappingParserData * pdata);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -20,7 +20,7 @@ my_atoui(const char * s)
/* /*
* */ * */
LIBSPEC UNSIGNED_INTEGER MINIUPNP_LIBSPEC UNSIGNED_INTEGER
UPNP_GetTotalBytesSent(const char * controlURL, UPNP_GetTotalBytesSent(const char * controlURL,
const char * servicetype) const char * servicetype)
{ {
@ -44,7 +44,7 @@ UPNP_GetTotalBytesSent(const char * controlURL,
/* /*
* */ * */
LIBSPEC UNSIGNED_INTEGER MINIUPNP_LIBSPEC UNSIGNED_INTEGER
UPNP_GetTotalBytesReceived(const char * controlURL, UPNP_GetTotalBytesReceived(const char * controlURL,
const char * servicetype) const char * servicetype)
{ {
@ -68,7 +68,7 @@ UPNP_GetTotalBytesReceived(const char * controlURL,
/* /*
* */ * */
LIBSPEC UNSIGNED_INTEGER MINIUPNP_LIBSPEC UNSIGNED_INTEGER
UPNP_GetTotalPacketsSent(const char * controlURL, UPNP_GetTotalPacketsSent(const char * controlURL,
const char * servicetype) const char * servicetype)
{ {
@ -92,7 +92,7 @@ UPNP_GetTotalPacketsSent(const char * controlURL,
/* /*
* */ * */
LIBSPEC UNSIGNED_INTEGER MINIUPNP_LIBSPEC UNSIGNED_INTEGER
UPNP_GetTotalPacketsReceived(const char * controlURL, UPNP_GetTotalPacketsReceived(const char * controlURL,
const char * servicetype) const char * servicetype)
{ {
@ -116,7 +116,7 @@ UPNP_GetTotalPacketsReceived(const char * controlURL,
/* UPNP_GetStatusInfo() call the corresponding UPNP method /* UPNP_GetStatusInfo() call the corresponding UPNP method
* returns the current status and uptime */ * returns the current status and uptime */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetStatusInfo(const char * controlURL, UPNP_GetStatusInfo(const char * controlURL,
const char * servicetype, const char * servicetype,
char * status, char * status,
@ -181,7 +181,7 @@ UPNP_GetStatusInfo(const char * controlURL,
/* UPNP_GetConnectionTypeInfo() call the corresponding UPNP method /* UPNP_GetConnectionTypeInfo() call the corresponding UPNP method
* returns the connection type */ * returns the connection type */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetConnectionTypeInfo(const char * controlURL, UPNP_GetConnectionTypeInfo(const char * controlURL,
const char * servicetype, const char * servicetype,
char * connectionType) char * connectionType)
@ -224,7 +224,7 @@ UPNP_GetConnectionTypeInfo(const char * controlURL,
* One of the values can be null * One of the values can be null
* Note : GetLinkLayerMaxBitRates belongs to WANPPPConnection:1 only * Note : GetLinkLayerMaxBitRates belongs to WANPPPConnection:1 only
* We can use the GetCommonLinkProperties from WANCommonInterfaceConfig:1 */ * We can use the GetCommonLinkProperties from WANCommonInterfaceConfig:1 */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetLinkLayerMaxBitRates(const char * controlURL, UPNP_GetLinkLayerMaxBitRates(const char * controlURL,
const char * servicetype, const char * servicetype,
unsigned int * bitrateDown, unsigned int * bitrateDown,
@ -293,7 +293,7 @@ UPNP_GetLinkLayerMaxBitRates(const char * controlURL,
* 402 Invalid Args - See UPnP Device Architecture section on Control. * 402 Invalid Args - See UPnP Device Architecture section on Control.
* 501 Action Failed - See UPnP Device Architecture section on Control. * 501 Action Failed - See UPnP Device Architecture section on Control.
*/ */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetExternalIPAddress(const char * controlURL, UPNP_GetExternalIPAddress(const char * controlURL,
const char * servicetype, const char * servicetype,
char * extIpAdd) char * extIpAdd)
@ -333,7 +333,7 @@ UPNP_GetExternalIPAddress(const char * controlURL,
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_AddPortMapping(const char * controlURL, const char * servicetype, UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
const char * extPort, const char * extPort,
const char * inPort, const char * inPort,
@ -394,7 +394,7 @@ UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_AddAnyPortMapping(const char * controlURL, const char * servicetype, UPNP_AddAnyPortMapping(const char * controlURL, const char * servicetype,
const char * extPort, const char * extPort,
const char * inPort, const char * inPort,
@ -461,7 +461,7 @@ UPNP_AddAnyPortMapping(const char * controlURL, const char * servicetype,
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_DeletePortMapping(const char * controlURL, const char * servicetype, UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
const char * extPort, const char * proto, const char * extPort, const char * proto,
const char * remoteHost) const char * remoteHost)
@ -505,7 +505,7 @@ UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_DeletePortMappingRange(const char * controlURL, const char * servicetype, UPNP_DeletePortMappingRange(const char * controlURL, const char * servicetype,
const char * extPortStart, const char * extPortEnd, const char * extPortStart, const char * extPortEnd,
const char * proto, const char * proto,
@ -551,7 +551,7 @@ UPNP_DeletePortMappingRange(const char * controlURL, const char * servicetype,
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetGenericPortMappingEntry(const char * controlURL, UPNP_GetGenericPortMappingEntry(const char * controlURL,
const char * servicetype, const char * servicetype,
const char * index, const char * index,
@ -646,7 +646,7 @@ UPNP_GetGenericPortMappingEntry(const char * controlURL,
return r; return r;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetPortMappingNumberOfEntries(const char * controlURL, UPNP_GetPortMappingNumberOfEntries(const char * controlURL,
const char * servicetype, const char * servicetype,
unsigned int * numEntries) unsigned int * numEntries)
@ -687,7 +687,7 @@ UPNP_GetPortMappingNumberOfEntries(const char * controlURL,
/* UPNP_GetSpecificPortMappingEntry retrieves an existing port mapping /* UPNP_GetSpecificPortMappingEntry retrieves an existing port mapping
* the result is returned in the intClient and intPort strings * the result is returned in the intClient and intPort strings
* please provide 16 and 6 bytes of data */ * please provide 16 and 6 bytes of data */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetSpecificPortMappingEntry(const char * controlURL, UPNP_GetSpecificPortMappingEntry(const char * controlURL,
const char * servicetype, const char * servicetype,
const char * extPort, const char * extPort,
@ -779,7 +779,7 @@ UPNP_GetSpecificPortMappingEntry(const char * controlURL,
* 733 InconsistantParameters - NewStartPort and NewEndPort values are not * 733 InconsistantParameters - NewStartPort and NewEndPort values are not
* consistent. * consistent.
*/ */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetListOfPortMappings(const char * controlURL, UPNP_GetListOfPortMappings(const char * controlURL,
const char * servicetype, const char * servicetype,
const char * startPort, const char * startPort,
@ -861,7 +861,7 @@ UPNP_GetListOfPortMappings(const char * controlURL,
} }
/* IGD:2, functions for service WANIPv6FirewallControl:1 */ /* IGD:2, functions for service WANIPv6FirewallControl:1 */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetFirewallStatus(const char * controlURL, UPNP_GetFirewallStatus(const char * controlURL,
const char * servicetype, const char * servicetype,
int * firewallEnabled, int * firewallEnabled,
@ -905,7 +905,7 @@ UPNP_GetFirewallStatus(const char * controlURL,
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype, UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype,
const char * remoteHost, const char * remoteHost,
const char * remotePort, const char * remotePort,
@ -960,7 +960,7 @@ UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_AddPinhole(const char * controlURL, const char * servicetype, UPNP_AddPinhole(const char * controlURL, const char * servicetype,
const char * remoteHost, const char * remoteHost,
const char * remotePort, const char * remotePort,
@ -1039,7 +1039,7 @@ UPNP_AddPinhole(const char * controlURL, const char * servicetype,
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_UpdatePinhole(const char * controlURL, const char * servicetype, UPNP_UpdatePinhole(const char * controlURL, const char * servicetype,
const char * uniqueID, const char * uniqueID,
const char * leaseTime) const char * leaseTime)
@ -1081,7 +1081,7 @@ UPNP_UpdatePinhole(const char * controlURL, const char * servicetype,
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_DeletePinhole(const char * controlURL, const char * servicetype, const char * uniqueID) UPNP_DeletePinhole(const char * controlURL, const char * servicetype, const char * uniqueID)
{ {
/*struct NameValueParserData pdata;*/ /*struct NameValueParserData pdata;*/
@ -1120,7 +1120,7 @@ UPNP_DeletePinhole(const char * controlURL, const char * servicetype, const char
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype, UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype,
const char * uniqueID, int * isWorking) const char * uniqueID, int * isWorking)
{ {
@ -1165,7 +1165,7 @@ UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype,
return ret; return ret;
} }
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetPinholePackets(const char * controlURL, const char * servicetype, UPNP_GetPinholePackets(const char * controlURL, const char * servicetype,
const char * uniqueID, int * packets) const char * uniqueID, int * packets)
{ {

View File

@ -23,19 +23,19 @@
extern "C" { extern "C" {
#endif #endif
LIBSPEC UNSIGNED_INTEGER MINIUPNP_LIBSPEC UNSIGNED_INTEGER
UPNP_GetTotalBytesSent(const char * controlURL, UPNP_GetTotalBytesSent(const char * controlURL,
const char * servicetype); const char * servicetype);
LIBSPEC UNSIGNED_INTEGER MINIUPNP_LIBSPEC UNSIGNED_INTEGER
UPNP_GetTotalBytesReceived(const char * controlURL, UPNP_GetTotalBytesReceived(const char * controlURL,
const char * servicetype); const char * servicetype);
LIBSPEC UNSIGNED_INTEGER MINIUPNP_LIBSPEC UNSIGNED_INTEGER
UPNP_GetTotalPacketsSent(const char * controlURL, UPNP_GetTotalPacketsSent(const char * controlURL,
const char * servicetype); const char * servicetype);
LIBSPEC UNSIGNED_INTEGER MINIUPNP_LIBSPEC UNSIGNED_INTEGER
UPNP_GetTotalPacketsReceived(const char * controlURL, UPNP_GetTotalPacketsReceived(const char * controlURL,
const char * servicetype); const char * servicetype);
@ -44,7 +44,7 @@ UPNP_GetTotalPacketsReceived(const char * controlURL,
* Return values : * Return values :
* UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
* or a UPnP Error code */ * or a UPnP Error code */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetStatusInfo(const char * controlURL, UPNP_GetStatusInfo(const char * controlURL,
const char * servicetype, const char * servicetype,
char * status, char * status,
@ -56,7 +56,7 @@ UPNP_GetStatusInfo(const char * controlURL,
* Return Values : * Return Values :
* UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
* or a UPnP Error code */ * or a UPnP Error code */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetConnectionTypeInfo(const char * controlURL, UPNP_GetConnectionTypeInfo(const char * controlURL,
const char * servicetype, const char * servicetype,
char * connectionType); char * connectionType);
@ -72,7 +72,7 @@ UPNP_GetConnectionTypeInfo(const char * controlURL,
* possible UPnP Errors : * possible UPnP Errors :
* 402 Invalid Args - See UPnP Device Architecture section on Control. * 402 Invalid Args - See UPnP Device Architecture section on Control.
* 501 Action Failed - See UPnP Device Architecture section on Control. */ * 501 Action Failed - See UPnP Device Architecture section on Control. */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetExternalIPAddress(const char * controlURL, UPNP_GetExternalIPAddress(const char * controlURL,
const char * servicetype, const char * servicetype,
char * extIpAdd); char * extIpAdd);
@ -83,7 +83,7 @@ UPNP_GetExternalIPAddress(const char * controlURL,
* return values : * return values :
* UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
* or a UPnP Error Code. */ * or a UPnP Error Code. */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetLinkLayerMaxBitRates(const char* controlURL, UPNP_GetLinkLayerMaxBitRates(const char* controlURL,
const char* servicetype, const char* servicetype,
unsigned int * bitrateDown, unsigned int * bitrateDown,
@ -122,7 +122,7 @@ UPNP_GetLinkLayerMaxBitRates(const char* controlURL,
* due to conflict with other mechanisms. * due to conflict with other mechanisms.
* 732 WildCardNotPermittedInIntPort - The internal port cannot be wild-carded * 732 WildCardNotPermittedInIntPort - The internal port cannot be wild-carded
*/ */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_AddPortMapping(const char * controlURL, const char * servicetype, UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
const char * extPort, const char * extPort,
const char * inPort, const char * inPort,
@ -155,7 +155,7 @@ UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
* due to conflict with other mechanisms. * due to conflict with other mechanisms.
* 732 WildCardNotPermittedInIntPort - The internal port cannot be wild-carded * 732 WildCardNotPermittedInIntPort - The internal port cannot be wild-carded
*/ */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_AddAnyPortMapping(const char * controlURL, const char * servicetype, UPNP_AddAnyPortMapping(const char * controlURL, const char * servicetype,
const char * extPort, const char * extPort,
const char * inPort, const char * inPort,
@ -178,7 +178,7 @@ UPNP_AddAnyPortMapping(const char * controlURL, const char * servicetype,
* 606 Action not authorized - The action requested REQUIRES authorization * 606 Action not authorized - The action requested REQUIRES authorization
* and the sender was not authorized. * and the sender was not authorized.
* 714 NoSuchEntryInArray - The specified value does not exist in the array */ * 714 NoSuchEntryInArray - The specified value does not exist in the array */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_DeletePortMapping(const char * controlURL, const char * servicetype, UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
const char * extPort, const char * proto, const char * extPort, const char * proto,
const char * remoteHost); const char * remoteHost);
@ -196,7 +196,7 @@ UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
* 730 PortMappingNotFound - This error message is returned if no port * 730 PortMappingNotFound - This error message is returned if no port
* mapping is found in the specified range. * mapping is found in the specified range.
* 733 InconsistentParameters - NewStartPort and NewEndPort values are not consistent. */ * 733 InconsistentParameters - NewStartPort and NewEndPort values are not consistent. */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_DeletePortMappingRange(const char * controlURL, const char * servicetype, UPNP_DeletePortMappingRange(const char * controlURL, const char * servicetype,
const char * extPortStart, const char * extPortEnd, const char * extPortStart, const char * extPortEnd,
const char * proto, const char * proto,
@ -204,7 +204,7 @@ UPNP_DeletePortMappingRange(const char * controlURL, const char * servicetype,
/* UPNP_GetPortMappingNumberOfEntries() /* UPNP_GetPortMappingNumberOfEntries()
* not supported by all routers */ * not supported by all routers */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetPortMappingNumberOfEntries(const char* controlURL, UPNP_GetPortMappingNumberOfEntries(const char* controlURL,
const char* servicetype, const char* servicetype,
unsigned int * num); unsigned int * num);
@ -232,7 +232,7 @@ UPNP_GetPortMappingNumberOfEntries(const char* controlURL,
* and the sender was not authorized. * and the sender was not authorized.
* 714 NoSuchEntryInArray - The specified value does not exist in the array. * 714 NoSuchEntryInArray - The specified value does not exist in the array.
*/ */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetSpecificPortMappingEntry(const char * controlURL, UPNP_GetSpecificPortMappingEntry(const char * controlURL,
const char * servicetype, const char * servicetype,
const char * extPort, const char * extPort,
@ -266,7 +266,7 @@ UPNP_GetSpecificPortMappingEntry(const char * controlURL,
* and the sender was not authorized. * and the sender was not authorized.
* 713 SpecifiedArrayIndexInvalid - The specified array index is out of bounds * 713 SpecifiedArrayIndexInvalid - The specified array index is out of bounds
*/ */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetGenericPortMappingEntry(const char * controlURL, UPNP_GetGenericPortMappingEntry(const char * controlURL,
const char * servicetype, const char * servicetype,
const char * index, const char * index,
@ -288,7 +288,7 @@ UPNP_GetGenericPortMappingEntry(const char * controlURL,
* 733 InconsistantParameters - NewStartPort and NewEndPort values are not * 733 InconsistantParameters - NewStartPort and NewEndPort values are not
* consistent. * consistent.
*/ */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetListOfPortMappings(const char * controlURL, UPNP_GetListOfPortMappings(const char * controlURL,
const char * servicetype, const char * servicetype,
const char * startPort, const char * startPort,
@ -298,13 +298,13 @@ UPNP_GetListOfPortMappings(const char * controlURL,
struct PortMappingParserData * data); struct PortMappingParserData * data);
/* IGD:2, functions for service WANIPv6FirewallControl:1 */ /* IGD:2, functions for service WANIPv6FirewallControl:1 */
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetFirewallStatus(const char * controlURL, UPNP_GetFirewallStatus(const char * controlURL,
const char * servicetype, const char * servicetype,
int * firewallEnabled, int * firewallEnabled,
int * inboundPinholeAllowed); int * inboundPinholeAllowed);
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype, UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype,
const char * remoteHost, const char * remoteHost,
const char * remotePort, const char * remotePort,
@ -313,7 +313,7 @@ UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype
const char * proto, const char * proto,
int * opTimeout); int * opTimeout);
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_AddPinhole(const char * controlURL, const char * servicetype, UPNP_AddPinhole(const char * controlURL, const char * servicetype,
const char * remoteHost, const char * remoteHost,
const char * remotePort, const char * remotePort,
@ -323,19 +323,19 @@ UPNP_AddPinhole(const char * controlURL, const char * servicetype,
const char * leaseTime, const char * leaseTime,
char * uniqueID); char * uniqueID);
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_UpdatePinhole(const char * controlURL, const char * servicetype, UPNP_UpdatePinhole(const char * controlURL, const char * servicetype,
const char * uniqueID, const char * uniqueID,
const char * leaseTime); const char * leaseTime);
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_DeletePinhole(const char * controlURL, const char * servicetype, const char * uniqueID); UPNP_DeletePinhole(const char * controlURL, const char * servicetype, const char * uniqueID);
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype, UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype,
const char * uniqueID, int * isWorking); const char * uniqueID, int * isWorking);
LIBSPEC int MINIUPNP_LIBSPEC int
UPNP_GetPinholePackets(const char * controlURL, const char * servicetype, UPNP_GetPinholePackets(const char * controlURL, const char * servicetype,
const char * uniqueID, int * packets); const char * uniqueID, int * packets);

View File

@ -17,7 +17,7 @@ extern "C" {
/* strupnperror() /* strupnperror()
* Return a string description of the UPnP error code * Return a string description of the UPnP error code
* or NULL for undefinded errors */ * or NULL for undefinded errors */
LIBSPEC const char * strupnperror(int err); MINIUPNP_LIBSPEC const char * strupnperror(int err);
#ifdef __cplusplus #ifdef __cplusplus
} }