Changeset 4251


Ignore:
Timestamp:
Dec 20, 2007, 8:18:22 PM (15 years ago)
Author:
charles
Message:

upgrade to miniupnp-20071213

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/upnp.c

    r4175 r4251  
    8888        struct UPNPDev * devlist;
    8989        errno = 0;
    90         devlist = upnpDiscover( 2000, NULL );
     90        devlist = upnpDiscover( 2000, NULL, NULL );
    9191        if( devlist == NULL ) {
    9292            tr_err( KEY "upnpDiscover returned NULL (errno %d - %s)", errno, strerror(errno) );
  • trunk/third-party/miniupnp/README

    r3731 r4251  
    11MiniUPnP is written by Thomas Bernard.
    22Its homepage is http://miniupnp.free.fr/
    3 This code is from the miniupnpc-20071103 snapshot
     3This code is from the miniupnpc-20071213 snapshot
  • trunk/third-party/miniupnp/minisoap.c

    r3731 r4251  
    1 /* $Id: minisoap.c,v 1.11 2007/05/19 13:13:08 nanard Exp $ */
     1/* $Id: minisoap.c,v 1.12 2007/12/13 17:09:03 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas Bernard
     
    6363        int headerssize;
    6464        bodysize = (int)strlen(body);
     65        /* We are not using keep-alive HTTP connections.
     66         * HTTP/1.1 needs the header Connection: close to do that.
     67         * This is the default with HTTP/1.0 */
    6568        headerssize = snprintf(headerbuf, sizeof(headerbuf),
    66                        "POST %s HTTP/1.1\r\n"
    67                            "HOST: %s:%d\r\n"
    68                            "Content-length: %d\r\n"
     69/*                       "POST %s HTTP/1.1\r\n"*/
     70                       "POST %s HTTP/1.0\r\n"
     71                           "Host: %s:%d\r\n"
     72                                           "User-Agent: POSIX, UPnP/1.0, miniUPnPc/1.0\r\n"
     73                           "Content-Length: %d\r\n"
    6974                                           "Content-Type: text/xml\r\n"
    7075                                           "SOAPAction: \"%s\"\r\n"
    71                                            "Connection: Close\r\n"
     76/*                                         "Connection: Close\r\n" */
    7277                                           "\r\n",
    7378                                           url, host, port, bodysize, action);
  • trunk/third-party/miniupnp/minissdpc.c

    r3731 r4251  
    1 /* $Id: minissdpc.c,v 1.3 2007/09/01 23:34:12 nanard Exp $ */
     1/* $Id: minissdpc.c,v 1.4 2007/12/19 14:56:58 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas BERNARD
     
    1717#include "miniupnpc.h"
    1818
     19#define DECODELENGTH(n, p) n = 0; \
     20                           do { n = (n << 7) | (*p & 0x7f); } \
     21                           while(*(p++)&0x80);
     22#define CODELENGTH(n, p) do { *p = (n & 0x7f) | ((n > 0x7f) ? 0x80 : 0); \
     23                              p++; n >>= 7; } while(n);
     24
    1925struct UPNPDev *
    2026getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath)
     
    2228        struct UPNPDev * tmp;
    2329        struct UPNPDev * devlist = NULL;
    24         unsigned char buffer[512];
     30        unsigned char buffer[2048];
    2531        ssize_t n;
    2632        unsigned char * p;
     33        unsigned char * url;
    2734        unsigned int i;
    28         unsigned int urlsize, stsize;
     35        unsigned int urlsize, stsize, usnsize, l;
    2936        int s;
    3037        struct sockaddr_un addr;
     
    4754        stsize = strlen(devtype);
    4855        buffer[0] = 1;
    49         buffer[1] = stsize;
    50         memcpy(buffer + 2, devtype, (int)buffer[1]);
    51         if(write(s, buffer, (int)buffer[1] + 2) < 0)
     56        p = buffer + 1;
     57        l = stsize;     CODELENGTH(l, p);
     58        memcpy(p, devtype, stsize);
     59        p += stsize;
     60        if(write(s, buffer, p - buffer) < 0)
    5261        {
    5362                /*syslog(LOG_ERR, "write(): %m");*/
    54                 perror("write()");
     63                perror("minissdpc.c: write()");
    5564                close(s);
    5665                return NULL;
     
    5968        if(n<=0)
    6069        {
     70                perror("minissdpc.c: read()");
    6171                close(s);
    6272                return NULL;
     
    6575        for(i = 0; i < buffer[0]; i++)
    6676        {
    67                 urlsize = *(p++);
    68                 stsize = p[urlsize];
     77                if(p+2>=buffer+sizeof(buffer))
     78                        break;
     79                DECODELENGTH(urlsize, p);
     80                if(p+urlsize+2>=buffer+sizeof(buffer))
     81                        break;
     82                url = p;
     83                p += urlsize;
     84                DECODELENGTH(stsize, p);
     85                if(p+stsize+2>=buffer+sizeof(buffer))
     86                        break;
    6987                tmp = (struct UPNPDev *)malloc(sizeof(struct UPNPDev)+urlsize+stsize);
    7088                tmp->pNext = devlist;
    7189                tmp->descURL = tmp->buffer;
    7290                tmp->st = tmp->buffer + 1 + urlsize;
    73                 memcpy(tmp->buffer, p, urlsize);
     91                memcpy(tmp->buffer, url, urlsize);
    7492                tmp->buffer[urlsize] = '\0';
    75                 p += urlsize;
    76                 p++;
    7793                memcpy(tmp->buffer + urlsize + 1, p, stsize);
     94                p += stsize;
    7895                tmp->buffer[urlsize+1+stsize] = '\0';
    7996                devlist = tmp;
     97                /* added for compatibility with recent versions of MiniSSDPd
     98                 * >= 2007/12/19 */
     99                DECODELENGTH(usnsize, p);
     100                p += usnsize;
     101                if(p>buffer + sizeof(buffer))
     102                        break;
    80103        }
    81104        close(s);
  • trunk/third-party/miniupnp/miniupnpc.c

    r3731 r4251  
    1 /* $Id: miniupnpc.c,v 1.45 2007/10/16 15:23:44 nanard Exp $ */
     1/* $Id: miniupnpc.c,v 1.49 2007/12/19 14:58:54 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas BERNARD
     
    129129/* simpleUPnPcommand :
    130130 * not so simple !
    131  * */
     131 * TODO: return some error codes */
    132132int simpleUPnPcommand(int s, const char * url, const char * service,
    133133                      const char * action, struct UPNParg * args,
     
    148148        if(args==NULL)
    149149        {
    150                 soapbodylen = snprintf(soapbody, sizeof(soapbody),
     150                /*soapbodylen = snprintf(soapbody, sizeof(soapbody),
    151151                                                "<?xml version=\"1.0\"?>\r\n"
    152152                              "<SOAP-ENV:Envelope "
     
    156156                                                  "<m:%s xmlns:m=\"%s\"/>"
    157157                                                  "</SOAP-ENV:Body></SOAP-ENV:Envelope>"
    158                                                   "\r\n", action, service);
     158                                                  "\r\n", action, service);*/
     159                soapbodylen = snprintf(soapbody, sizeof(soapbody),
     160                                                "<?xml version=\"1.0\"?>\r\n"
     161                              "<s:Envelope "
     162                                                  "xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" "
     163                                                  "s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
     164                                                  "<s:Body>"
     165                                                  "<m:%s xmlns:m=\"%s\">"
     166                                                  "</m:%s>"
     167                                                  "</s:Body></s:Envelope>"
     168                                                  "\r\n", action, service, action);
    159169        }
    160170        else
     
    317327 * It is up to the caller to free the chained list
    318328 * delay is in millisecond (poll) */
    319 struct UPNPDev * upnpDiscover(int delay, const char * multicastif)
     329struct UPNPDev * upnpDiscover(int delay, const char * multicastif,
     330                              const char * minissdpdsock)
    320331{
    321332        struct UPNPDev * tmp;
     
    344355#ifndef WIN32
    345356        /* first try to get infos from minissdpd ! */
    346         devlist = getDevicesFromMiniSSDPD(deviceList[0], "/var/run/minissdpd.sock");
    347         if(devlist)
    348                 return devlist;
     357        if(!minissdpdsock)
     358                minissdpdsock = "/var/run/minissdpd.sock";
     359        while(!devlist && deviceList[deviceIndex]) {
     360                devlist = getDevicesFromMiniSSDPD(deviceList[deviceIndex],
     361                                                  minissdpdsock);
     362                /* We return what we have found if it was not only a rootdevice */
     363                if(devlist && !strstr(deviceList[deviceIndex], "rootdevice"))
     364                        return devlist;
     365                deviceIndex++;
     366        }
     367        deviceIndex = 0;
    349368#endif
    350369        /* fallback to direct discovery */
     
    575594    timeval.tv_sec = timeout / 1000;
    576595    timeval.tv_usec = (timeout % 1000) * 1000;
    577     n = select(0, &socketSet, NULL, NULL, &timeval);
     596    /*n = select(0, &socketSet, NULL, NULL, &timeval);*/
     597    n = select(FD_SETSIZE, &socketSet, NULL, NULL, &timeval);
    578598    if(n < 0)
    579599    {
  • trunk/third-party/miniupnp/miniupnpc.h

    r3731 r4251  
    1 /* $Id: miniupnpc.h,v 1.15 2007/10/16 15:07:32 nanard Exp $ */
     1/* $Id: miniupnpc.h,v 1.17 2007/12/19 14:58:54 nanard Exp $ */
    22/* Project: miniupnp
    33 * http://miniupnp.free.fr/
     
    1616#endif
    1717
     18/* Structures definitions : */
    1819struct UPNParg { const char * elt; const char * val; };
    1920
     
    2930};
    3031
    31 /* discover UPnP devices on the network */
    32 LIBSPEC struct UPNPDev * upnpDiscover(int delay, const char * multicastif);
    33 /* free returned list from above function */
     32/* upnpDiscover()
     33 * discover UPnP devices on the network.
     34 * The discovered devices are returned as a chained list.
     35 * It is up to the caller to free the list with freeUPNPDevlist().
     36 * delay (in millisecond) is the maximum time for waiting any device
     37 * response.
     38 * If available, device list will be obtained from MiniSSDPd.
     39 * Default path for minissdpd socket will be used if minissdpdsock argument
     40 * is NULL.
     41 * If multicastif is not NULL, it will be used instead of the default
     42 * multicast interface for sending SSDP discover packets. */
     43LIBSPEC struct UPNPDev * upnpDiscover(int delay, const char * multicastif,
     44                                      const char * minissdpdsock);
     45/* freeUPNPDevlist()
     46 * free list returned by upnpDiscover() */
    3447LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist);
    3548
     49/* parserootdesc() :
     50 * parse root XML description of a UPnP device and fill the IGDdatas
     51 * structure. */
    3652LIBSPEC void parserootdesc(const char *, int, struct IGDdatas *);
    3753
     
    3955 * controlURL: controlURL of the WANIPConnection
    4056 * ipcondescURL: url of the description of the WANIPConnection
    41  * controlURL_CIF: controlURL of the WANCOmmonInterfaceConfig
     57 * controlURL_CIF: controlURL of the WANCommonInterfaceConfig
    4258 */
    4359struct UPNPUrls {
  • trunk/third-party/miniupnp/upnpcommands.c

    r3731 r4251  
    1 /* $Id: upnpcommands.c,v 1.16 2007/08/03 14:11:42 nanard Exp $ */
     1/* $Id: upnpcommands.c,v 1.18 2007/12/19 14:56:14 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas Bernard
     
    225225/* UPNP_GetExternalIPAddress() call the corresponding UPNP method.
    226226 * if the third arg is not null the value is copied to it.
    227  * at least 16 bytes must be available */
    228 void UPNP_GetExternalIPAddress(const char * controlURL, const char * servicetype, char * extIpAdd)
    229 {
    230         struct NameValueParserData pdata;
    231         char buffer[4096];
    232         int bufsize = 4096;
    233         char * p;
    234 
    235         if(!extIpAdd)
    236                 return;
     227 * at least 16 bytes must be available
     228 *
     229 * Return values :
     230 * 0 : SUCCESS
     231 * NON ZERO : ERROR Either an UPnP error code or an unknown error.
     232 *
     233 * 402 Invalid Args - See UPnP Device Architecture section on Control.
     234 * 501 Action Failed - See UPnP Device Architecture section on Control.
     235 */
     236int UPNP_GetExternalIPAddress(const char * controlURL,
     237                              const char * servicetype,
     238                                                          char * extIpAdd)
     239{
     240        struct NameValueParserData pdata;
     241        char buffer[4096];
     242        int bufsize = 4096;
     243        char * p;
     244        int ret = UPNPCOMMAND_UNKNOWN_ERROR;
     245
     246        if(!extIpAdd || !controlURL || !servicetype)
     247                return UPNPCOMMAND_INVALID_ARGS;
    237248
    238249        simpleUPnPcommand(-1, controlURL, servicetype, "GetExternalIPAddress", 0, buffer, &bufsize);
     
    242253        /*printf("external ip = %s\n", GetValueFromNameValueList(&pdata, "NewExternalIPAddress") );*/
    243254        p = GetValueFromNameValueList(&pdata, "NewExternalIPAddress");
    244 
    245         if(p){
     255        if(p) {
    246256                strncpy(extIpAdd, p, 16 );
    247257                extIpAdd[15] = '\0';
    248         }else
     258                ret = UPNPCOMMAND_SUCCESS;
     259        } else
    249260                extIpAdd[0] = '\0';
    250261
    251         ClearNameValueList(&pdata);
     262        p = GetValueFromNameValueList(&pdata, "errorCode");
     263        if(p) {
     264                ret = UPNPCOMMAND_UNKNOWN_ERROR;
     265                sscanf(p, "%d", &ret);
     266        }
     267
     268        ClearNameValueList(&pdata);
     269        return ret;
    252270}
    253271
     
    267285        int ret;
    268286
    269         if(!inPort || !inClient)
    270                 return 0;
     287        if(!inPort || !inClient || !proto || !extPort)
     288                return UPNPCOMMAND_INVALID_ARGS;
    271289
    272290        AddPortMappingArgs = calloc(9, sizeof(struct UPNParg));
     
    293311        ParseNameValue(buffer, bufsize, &pdata);
    294312        resVal = GetValueFromNameValueList(&pdata, "errorCode");
    295         ret = resVal?0:1;
    296         /* Do something with resVal if not null ! */
    297         /*printf("AddPortMapping errorCode = '%s'\n", resVal); */
     313        if(resVal) {
     314                /*printf("AddPortMapping errorCode = '%s'\n", resVal); */
     315                ret = UPNPCOMMAND_UNKNOWN_ERROR;
     316                sscanf(resVal, "%d", &ret);
     317        } else {
     318                ret = UPNPCOMMAND_SUCCESS;
     319        }
    298320        ClearNameValueList(&pdata);
    299321        free(AddPortMappingArgs);
     
    301323}
    302324
    303 void UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
    304                             const char * extPort, const char * proto)
     325int
     326UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
     327                       const char * extPort, const char * proto)
    305328{
    306329        /*struct NameValueParserData pdata;*/
     
    308331        char buffer[4096];
    309332        int bufsize = 4096;
    310 
    311         if(!extPort)
    312                 return;
     333        struct NameValueParserData pdata;
     334        const char * resVal;
     335        int ret;
     336
     337        if(!extPort || !proto)
     338                return UPNPCOMMAND_INVALID_ARGS;
    313339
    314340        DeletePortMappingArgs = calloc(4, sizeof(struct UPNParg));
     
    322348                                          DeletePortMappingArgs, buffer, &bufsize);
    323349        /*DisplayNameValueList(buffer, bufsize);*/
     350        ParseNameValue(buffer, bufsize, &pdata);
     351        resVal = GetValueFromNameValueList(&pdata, "errorCode");
     352        if(resVal) {
     353                ret = UPNPCOMMAND_UNKNOWN_ERROR;
     354                sscanf(resVal, "%d", &ret);
     355        } else {
     356                ret = UPNPCOMMAND_SUCCESS;
     357        }
     358        ClearNameValueList(&pdata);
    324359        free(DeletePortMappingArgs);
     360        return ret;
    325361}
    326362
     
    342378        int bufsize = 4096;
    343379        char * p;
    344         int r = -1;
     380        int r = UPNPCOMMAND_UNKNOWN_ERROR;
     381        if(!index)
     382                return UPNPCOMMAND_INVALID_ARGS;
    345383        intClient[0] = '\0';
    346384        intPort[0] = '\0';
     
    363401                strncpy(extPort, p, 6);
    364402                extPort[5] = '\0';
    365                 r = 0;
     403                r = UPNPCOMMAND_SUCCESS;
    366404        }
    367405        p = GetValueFromNameValueList(&pdata, "NewProtocol");
     
    402440                duration[15] = '\0';
    403441        }
     442        p = GetValueFromNameValueList(&pdata, "errorCode");
     443        if(p) {
     444                r = UPNPCOMMAND_UNKNOWN_ERROR;
     445                sscanf(p, "%d", &r);
     446        }
    404447        ClearNameValueList(&pdata);
    405448        free(GetPortMappingArgs);
     
    407450}
    408451
    409 void UPNP_GetPortMappingNumberOfEntries(const char * controlURL, const char * servicetype, unsigned int * numEntries)
     452int UPNP_GetPortMappingNumberOfEntries(const char * controlURL, const char * servicetype, unsigned int * numEntries)
    410453{
    411454        struct NameValueParserData pdata;
     
    413456        int bufsize = 4096;
    414457        char* p;
     458        int ret = UPNPCOMMAND_UNKNOWN_ERROR;
    415459        simpleUPnPcommand(-1, controlURL, servicetype, "GetPortMappingNumberOfEntries", 0, buffer, &bufsize);
    416460#ifndef NDEBUG
     
    418462#endif
    419463        ParseNameValue(buffer, bufsize, &pdata);
     464
    420465        p = GetValueFromNameValueList(&pdata, "NewPortMappingNumberOfEntries");
    421  
    422         if(numEntries && p)
    423         {
    424                 sscanf(p,"%u",numEntries);
     466        if(numEntries && p) {
     467                *numEntries = 0;
     468                sscanf(p, "%u", numEntries);
     469                ret = UPNPCOMMAND_SUCCESS;
    425470        }
     471
     472        p = GetValueFromNameValueList(&pdata, "errorCode");
     473        if(p) {
     474                ret = UPNPCOMMAND_UNKNOWN_ERROR;
     475                sscanf(p, "%d", &ret);
     476        }
     477
    426478        ClearNameValueList(&pdata);
     479        return ret;
    427480}
    428481
     
    430483 * the result is returned in the intClient and intPort strings
    431484 * please provide 16 and 6 bytes of data */
    432 void
     485int
    433486UPNP_GetSpecificPortMappingEntry(const char * controlURL,
    434487                                 const char * servicetype,
     
    443496        int bufsize = 4096;
    444497        char * p;
    445 
    446         if(!intPort && !intClient && !extPort)
    447                 return;
     498        int ret = UPNPCOMMAND_UNKNOWN_ERROR;
     499
     500        if(!intPort || !intClient || !extPort || !proto)
     501                return UPNPCOMMAND_INVALID_ARGS;
    448502
    449503        GetPortMappingArgs = calloc(4, sizeof(struct UPNParg));
     
    459513        /*DisplayNameValueList(buffer, bufsize);*/
    460514        ParseNameValue(buffer, bufsize, &pdata);
     515
    461516        p = GetValueFromNameValueList(&pdata, "NewInternalClient");
    462 
    463         if(intClient)
    464         {
    465                 if(p){
    466                         strncpy(intClient, p, 16);
    467                         intClient[15] = '\0';
    468                 }else
    469                         intClient[0] = '\0';
    470         }
     517        if(p) {
     518                strncpy(intClient, p, 16);
     519                intClient[15] = '\0';
     520                ret = UPNPCOMMAND_SUCCESS;
     521        } else
     522                intClient[0] = '\0';
    471523
    472524        p = GetValueFromNameValueList(&pdata, "NewInternalPort");
    473         if(intPort)
    474         {
    475                 if(p){
    476                         strncpy(intPort, p, 6);
    477                         intPort[5] = '\0';
    478                 }else
    479                         intPort[0] = '\0';
     525        if(p) {
     526                strncpy(intPort, p, 6);
     527                intPort[5] = '\0';
     528        } else
     529                intPort[0] = '\0';
     530
     531        p = GetValueFromNameValueList(&pdata, "errorCode");
     532        if(p) {
     533                ret = UPNPCOMMAND_UNKNOWN_ERROR;
     534                sscanf(p, "%d", &ret);
    480535        }
    481536
    482537        ClearNameValueList(&pdata);
    483538        free(GetPortMappingArgs);
    484 }
    485 
    486 
     539        return ret;
     540}
     541
     542
  • trunk/third-party/miniupnp/upnpcommands.h

    r3731 r4251  
    1 /* $Id: upnpcommands.h,v 1.10 2007/01/29 20:27:24 nanard Exp $ */
     1/* $Id: upnpcommands.h,v 1.12 2007/12/19 14:56:15 nanard Exp $ */
    22/* Miniupnp project : http://miniupnp.free.fr/
    33 * Author : Thomas Bernard
     
    1010#include "upnpreplyparse.h"
    1111#include "declspec.h"
     12
     13/* MiniUPnPc return codes : */
     14#define UPNPCOMMAND_SUCCESS (0)
     15#define UPNPCOMMAND_UNKNOWN_ERROR (-1)
     16#define UPNPCOMMAND_INVALID_ARGS (-2)
    1217
    1318#ifdef __cplusplus
     
    4449/* UPNP_GetExternalIPAddress() call the corresponding UPNP method.
    4550 * if the third arg is not null the value is copied to it.
    46  * at least 16 bytes must be available */
    47 LIBSPEC void
     51 * at least 16 bytes must be available
     52 *
     53 * Return values :
     54 * 0 : SUCCESS
     55 * NON ZERO : ERROR Either an UPnP error code or an unknown error.
     56 *
     57 * possible UPnP Errors :
     58 * 402 Invalid Args - See UPnP Device Architecture section on Control.
     59 * 501 Action Failed - See UPnP Device Architecture section on Control. */
     60LIBSPEC int
    4861UPNP_GetExternalIPAddress(const char * controlURL,
    4962                          const char * servicetype,
     
    5669                                                        unsigned int * bitrateUp);
    5770
    58 /* Returns zero if unable to add the port mapping, otherwise non-zero
    59  * to indicate success */
     71/* UPNP_AddPortMapping()
     72 *
     73 * Return values :
     74 * 0 : SUCCESS
     75 * NON ZERO : ERROR. Either an UPnP error code or an unknown error.
     76 *
     77 * List of possible UPnP errors for AddPortMapping :
     78 * errorCode errorDescription (short) - Description (long)
     79 * 402 Invalid Args - See UPnP Device Architecture section on Control.
     80 * 501 Action Failed - See UPnP Device Architecture section on Control.
     81 * 715 WildCardNotPermittedInSrcIP - The source IP address cannot be
     82 *                                   wild-carded
     83 * 716 WildCardNotPermittedInExtPort - The external port cannot be wild-carded
     84 * 718 ConflictInMappingEntry - The port mapping entry specified conflicts
     85 *                     with a mapping assigned previously to another client
     86 * 724 SamePortValuesRequired - Internal and External port values
     87 *                              must be the same
     88 * 725 OnlyPermanentLeasesSupported - The NAT implementation only supports
     89 *                  permanent lease times on port mappings
     90 * 726 RemoteHostOnlySupportsWildcard - RemoteHost must be a wildcard
     91 *                             and cannot be a specific IP address or DNS name
     92 * 727 ExternalPortOnlySupportsWildcard - ExternalPort must be a wildcard and
     93 *                                        cannot be a specific port value */
    6094LIBSPEC int
    6195UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
     
    66100                    const char * proto);
    67101
    68 LIBSPEC void
     102/* UPNP_DeletePortMapping()
     103 * Return Values :
     104 * 0 : SUCCESS
     105 * NON ZERO : error. Either an UPnP error code or an undefined error.
     106 *
     107 * List of possible UPnP errors for DeletePortMapping :
     108 * 402 Invalid Args - See UPnP Device Architecture section on Control.
     109 * 714 NoSuchEntryInArray - The specified value does not exist in the array */
     110LIBSPEC int
    69111UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
    70112                       const char * extPort, const char * proto);
    71113
    72 LIBSPEC void
     114LIBSPEC int
    73115UPNP_GetPortMappingNumberOfEntries(const char* controlURL, const char* servicetype, unsigned int * num);
    74116
     
    76118 * the result is returned in the intClient and intPort strings
    77119 * please provide 16 and 6 bytes of data */
    78 LIBSPEC void
     120LIBSPEC int
    79121UPNP_GetSpecificPortMappingEntry(const char * controlURL,
    80122                                 const char * servicetype,
     
    84126                                 char * intPort);
    85127
     128/* UPNP_GetGenericPortMappingEntry()
     129 *
     130 * Possible UPNP Error codes :
     131 * 402 Invalid Args - See UPnP Device Architecture section on Control.
     132 * 713 SpecifiedArrayIndexInvalid - The specified array index is out of bounds
     133 */
    86134LIBSPEC int
    87135UPNP_GetGenericPortMappingEntry(const char * controlURL,
Note: See TracChangeset for help on using the changeset viewer.