Changeset 5743


Ignore:
Timestamp:
May 4, 2008, 10:09:33 PM (14 years ago)
Author:
charles
Message:

update to the miniupnpc-20080427 snapshot
update to the libnatpmp-20080428 snapshot

Location:
trunk/third-party
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/third-party/libnatpmp/README

    r4151 r5743  
    11libnatpmp is written by Thomas Bernard.
    22Its homepage is http://miniupnp.tuxfamily.org/libnatpmp.html
    3 This code is from the libnatpmp-20071213 snapshot
     3This code is from the libnatpmp-20080428 snapshot
    44
  • trunk/third-party/libnatpmp/natpmp.c

    r4095 r5743  
    1 /* $Id: natpmp.c,v 1.4 2007/12/02 00:12:47 nanard Exp $ */
     1/* $Id: natpmp.c,v 1.6 2008/04/28 02:58:34 nanard Exp $ */
    22/* libnatpmp
    3  * Copyright (c) 2007, Thomas BERNARD <miniupnp@free.fr>
     3 * Copyright (c) 2007-2008, Thomas BERNARD <miniupnp@free.fr>
     4 * http://miniupnp.free.fr/libnatpmp.html
    45 *
    56 * Permission to use, copy, modify, and/or distribute this software for any
     
    1415 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    1516 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
     17#include <string.h>
     18#include <time.h>
     19#include <sys/time.h>
     20#ifdef WIN32
     21#include <winsock2.h>
     22#include <Ws2tcpip.h>
     23#include <io.h>
     24#else
    1625#include <errno.h>
    17 #include <string.h>
    1826#include <unistd.h>
    1927#include <fcntl.h>
    20 #include <time.h>
    21 #include <sys/time.h>
    2228#include <sys/types.h>
    2329#include <sys/socket.h>
     30#endif
    2431#include "natpmp.h"
    2532#include "getgateway.h"
     
    248255}
    249256
     257#ifdef ENABLE_STRNATPMPERR
     258const char * strnatpmperr(int r)
     259{
     260        const char * s;
     261        switch(r) {
     262        case NATPMP_ERR_INVALIDARGS:
     263                s = "invalid arguments";
     264                break;
     265        case NATPMP_ERR_SOCKETERROR:
     266                s = "socket() failed";
     267                break;
     268        case NATPMP_ERR_CANNOTGETGATEWAY:
     269                s = "cannot get default gateway ip address";
     270                break;
     271        case NATPMP_ERR_CLOSEERR:
     272                s = "close() failed";
     273                break;
     274        case NATPMP_ERR_RECVFROM:
     275                s = "recvfrom() failed";
     276                break;
     277        case NATPMP_ERR_NOPENDINGREQ:
     278                s = "no pending request";
     279                break;
     280        case NATPMP_ERR_NOGATEWAYSUPPORT:
     281                s = "the gateway does not support nat-pmp";
     282                break;
     283        case NATPMP_ERR_CONNECTERR:
     284                s = "connect() failed";
     285                break;
     286        case NATPMP_ERR_WRONGPACKETSOURCE:
     287                s = "packet not received from the default gateway";
     288                break;
     289        case NATPMP_ERR_SENDERR:
     290                s = "send() failed";
     291                break;
     292        case NATPMP_ERR_FCNTLERROR:
     293                s = "fcntl() failed";
     294                break;
     295        case NATPMP_ERR_GETTIMEOFDAYERR:
     296                s = "gettimeofday() failed";
     297                break;
     298        case NATPMP_ERR_UNSUPPORTEDVERSION:
     299                s = "unsupported nat-pmp version error from server";
     300                break;
     301        case NATPMP_ERR_UNSUPPORTEDOPCODE:
     302                s = "unsupported nat-pmp opcode error from server";
     303                break;
     304        case NATPMP_ERR_UNDEFINEDERROR:
     305                s = "undefined nat-pmp server error";
     306                break;
     307        case NATPMP_ERR_NOTAUTHORIZED:
     308                s = "not authorized";
     309                break;
     310        case NATPMP_ERR_NETWORKFAILURE:
     311                s = "network failure";
     312                break;
     313        case NATPMP_ERR_OUTOFRESOURCES:
     314                s = "nat-pmp server out of resources";
     315                break;
     316        default:
     317                s = "Unknown libnatpmp error";
     318        }
     319        return s;
     320}
     321#endif
     322
  • trunk/third-party/libnatpmp/natpmp.h

    r4151 r5743  
    1 /* $Id: natpmp.h,v 1.6 2007/12/13 14:55:16 nanard Exp $ */
     1/* $Id: natpmp.h,v 1.8 2008/04/28 02:58:34 nanard Exp $ */
    22/* libnatpmp
    3  * Copyright (c) 2007, Thomas BERNARD <miniupnp@free.fr>
     3 * Copyright (c) 2007-2008, Thomas BERNARD <miniupnp@free.fr>
     4 * http://miniupnp.free.fr/libnatpmp.html
    45 *
    56 * Permission to use, copy, modify, and/or distribute this software for any
     
    2223#include <time.h>
    2324#include <sys/time.h>
     25#ifdef WIN32
     26#include <winsock2.h>
     27#else
    2428#include <netinet/in.h>
     29#endif
    2530
    2631typedef struct {
     
    172177int readnatpmpresponseorretry(natpmp_t * p, natpmpresp_t * response);
    173178
     179#ifdef ENABLE_STRNATPMPERR
     180const char * strnatpmperr(int t);
    174181#endif
     182
     183#endif
  • trunk/third-party/miniupnp/README

    r5094 r5743  
    11MiniUPnP is written by Thomas Bernard.
    22Its homepage is http://miniupnp.free.fr/
    3 This is from version 1.0 of miniupnpc
     3This is from the miniupnp-20080428 snapshot
  • trunk/third-party/miniupnp/igd_desc_parse.c

    r3731 r5743  
    1 /* $Id: igd_desc_parse.c,v 1.7 2006/11/19 22:32:33 nanard Exp $ */
     1/* $Id: igd_desc_parse.c,v 1.8 2008/04/23 11:51:06 nanard Exp $ */
    22/* Project : miniupnp
    33 * http://miniupnp.free.fr/
    44 * Author : Thomas Bernard
    5  * Copyright (c) 2005 Thomas Bernard
     5 * Copyright (c) 2005-2008 Thomas Bernard
    66 * This software is subject to the conditions detailed in the
    77 * LICENCE file provided in this distribution.
     
    1010#include <stdio.h>
    1111#include <string.h>
     12
     13/* TODO : rewrite this code so it correctly handle descriptions with
     14 * both WANIPConnection and/or WANPPPConnection */
    1215
    1316/* Start element handler :
     
    1922        datas->cureltname[l] = '\0';
    2023        datas->level++;
     24        if( (l==7) && !memcmp(name, "service", l) ) {
     25                datas->controlurl_tmp[0] = '\0';
     26                datas->eventsuburl_tmp[0] = '\0';
     27                datas->scpdurl_tmp[0] = '\0';
     28                datas->servicetype_tmp[0] = '\0';
     29        }
    2130}
    2231
     
    3140        if( (l==7) && !memcmp(name, "service", l) )
    3241        {
    33                 /*datas->state++; */
    3442                /*
    3543                if( datas->state < 1
     
    3947                        datas->state ++;
    4048                */
    41                 if(0==strcmp(datas->servicetype_CIF,
    42                                 "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1"))
    43                         datas->state = 2;
    44                 if(0==strcmp(datas->servicetype,
    45                                 "urn:schemas-upnp-org:service:WANIPConnection:1") )
    46                         datas->state = 3;
    47 /*              if(0==strcmp(datas->servicetype,
    48                                 "urn:schemas-upnp-org:service:WANPPPConnection:1") )
    49                         datas->state = 4; */
     49                if(0==strcmp(datas->servicetype_tmp,
     50                                "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1")) {
     51                        memcpy(datas->controlurl_CIF, datas->controlurl_tmp, MINIUPNPC_URL_MAXSIZE);
     52                        memcpy(datas->eventsuburl_CIF, datas->eventsuburl_tmp, MINIUPNPC_URL_MAXSIZE);
     53                        memcpy(datas->scpdurl_CIF, datas->scpdurl_tmp, MINIUPNPC_URL_MAXSIZE);
     54                        memcpy(datas->servicetype_CIF, datas->servicetype_tmp, MINIUPNPC_URL_MAXSIZE);
     55                } else if(0==strcmp(datas->servicetype_tmp,
     56                                "urn:schemas-upnp-org:service:WANIPConnection:1")
     57                                 || 0==strcmp(datas->servicetype_tmp,
     58                                "urn:schemas-upnp-org:service:WANPPPConnection:1") ) {
     59                        memcpy(datas->controlurl, datas->controlurl_tmp, MINIUPNPC_URL_MAXSIZE);
     60                        memcpy(datas->eventsuburl, datas->eventsuburl_tmp, MINIUPNPC_URL_MAXSIZE);
     61                        memcpy(datas->scpdurl, datas->scpdurl_tmp, MINIUPNPC_URL_MAXSIZE);
     62                        memcpy(datas->servicetype, datas->servicetype_tmp, MINIUPNPC_URL_MAXSIZE);
     63                }
    5064        }
    5165}
     
    6175        if( !strcmp(datas->cureltname, "URLBase") )
    6276                dstmember = datas->urlbase;
    63         else if(datas->state<=1)
    64         {
    65                 if( !strcmp(datas->cureltname, "serviceType") )
    66                         dstmember = datas->servicetype_CIF;
    67                 else if( !strcmp(datas->cureltname, "controlURL") )
    68                         dstmember = datas->controlurl_CIF;
    69                 else if( !strcmp(datas->cureltname, "eventSubURL") )
    70                         dstmember = datas->eventsuburl_CIF;
    71                 else if( !strcmp(datas->cureltname, "SCPDURL") )
    72                         dstmember = datas->scpdurl_CIF;
    73                 else if( !strcmp(datas->cureltname, "deviceType") )
    74                         dstmember = datas->devicetype_CIF;
    75         }
    76         else if(datas->state==2)
    77         {
    78                 if( !strcmp(datas->cureltname, "serviceType") )
    79                         dstmember = datas->servicetype;
    80                 else if( !strcmp(datas->cureltname, "controlURL") )
    81                         dstmember = datas->controlurl;
    82                 else if( !strcmp(datas->cureltname, "eventSubURL") )
    83                         dstmember = datas->eventsuburl;
    84                 else if( !strcmp(datas->cureltname, "SCPDURL") )
    85                         dstmember = datas->scpdurl;
    86                 else if( !strcmp(datas->cureltname, "deviceType") )
    87                         dstmember = datas->devicetype;
    88         }
     77        else if( !strcmp(datas->cureltname, "serviceType") )
     78                dstmember = datas->servicetype_tmp;
     79        else if( !strcmp(datas->cureltname, "controlURL") )
     80                dstmember = datas->controlurl_tmp;
     81        else if( !strcmp(datas->cureltname, "eventSubURL") )
     82                dstmember = datas->eventsuburl_tmp;
     83        else if( !strcmp(datas->cureltname, "SCPDURL") )
     84                dstmember = datas->scpdurl_tmp;
     85/*      else if( !strcmp(datas->cureltname, "deviceType") )
     86                dstmember = datas->devicetype_tmp;*/
    8987        if(dstmember)
    9088        {
     
    10098        printf("urlbase = %s\n", d->urlbase);
    10199        printf("WAN Device (Common interface config) :\n");
    102         printf(" deviceType = %s\n", d->devicetype_CIF);
     100        /*printf(" deviceType = %s\n", d->devicetype_CIF);*/
    103101        printf(" serviceType = %s\n", d->servicetype_CIF);
    104102        printf(" controlURL = %s\n", d->controlurl_CIF);
    105103        printf(" eventSubURL = %s\n", d->eventsuburl_CIF);
    106104        printf(" SCPDURL = %s\n", d->scpdurl_CIF);
    107         printf("WAN Connection Device :\n");
    108         printf(" deviceType = %s\n", d->devicetype);
     105        printf("WAN Connection Device (IP or PPP Connection):\n");
     106        /*printf(" deviceType = %s\n", d->devicetype);*/
    109107        printf(" servicetype = %s\n", d->servicetype);
    110108        printf(" controlURL = %s\n", d->controlurl);
  • trunk/third-party/miniupnp/igd_desc_parse.h

    r3731 r5743  
    1 /* $Id: igd_desc_parse.h,v 1.5 2007/04/11 15:21:09 nanard Exp $ */
     1/* $Id: igd_desc_parse.h,v 1.6 2008/04/23 11:51:07 nanard Exp $ */
    22/* Project : miniupnp
    33 * http://miniupnp.free.fr/
    44 * Author : Thomas Bernard
    5  * Copyright (c) 2005 Thomas Bernard
     5 * Copyright (c) 2005-2008 Thomas Bernard
    66 * This software is subject to the conditions detailed in the
    77 * LICENCE file provided in this distribution.
     
    1717        char urlbase[MINIUPNPC_URL_MAXSIZE];
    1818        int level;
    19         int state;
     19        /*int state;*/
     20        /* "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1" */
    2021        char controlurl_CIF[MINIUPNPC_URL_MAXSIZE];
    2122        char eventsuburl_CIF[MINIUPNPC_URL_MAXSIZE];
    2223        char scpdurl_CIF[MINIUPNPC_URL_MAXSIZE];
    2324        char servicetype_CIF[MINIUPNPC_URL_MAXSIZE];
    24         char devicetype_CIF[MINIUPNPC_URL_MAXSIZE];
     25        /*char devicetype_CIF[MINIUPNPC_URL_MAXSIZE];*/
     26        /* "urn:schemas-upnp-org:service:WANIPConnection:1"
     27         * "urn:schemas-upnp-org:service:WANPPPConnection:1" */
    2528        char controlurl[MINIUPNPC_URL_MAXSIZE];
    2629        char eventsuburl[MINIUPNPC_URL_MAXSIZE];
    2730        char scpdurl[MINIUPNPC_URL_MAXSIZE];
    2831        char servicetype[MINIUPNPC_URL_MAXSIZE];
    29         char devicetype[MINIUPNPC_URL_MAXSIZE];
     32        /*char devicetype[MINIUPNPC_URL_MAXSIZE];*/
     33        /* tmp */
     34        char controlurl_tmp[MINIUPNPC_URL_MAXSIZE];
     35        char eventsuburl_tmp[MINIUPNPC_URL_MAXSIZE];
     36        char scpdurl_tmp[MINIUPNPC_URL_MAXSIZE];
     37        char servicetype_tmp[MINIUPNPC_URL_MAXSIZE];
     38        /*char devicetype_tmp[MINIUPNPC_URL_MAXSIZE];*/
    3039};
    3140
Note: See TracChangeset for help on using the changeset viewer.