Changeset 13258


Ignore:
Timestamp:
Mar 21, 2012, 2:25:11 AM (10 years ago)
Author:
livings124
Message:

#4825 update miniupnp to miniupnpc-1.6.20120320

Location:
trunk/third-party/miniupnp
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/third-party/miniupnp/Changelog.txt

    r12593 r13258  
    1 $Id: Changelog.txt,v 1.152 2011/07/25 18:02:11 nanard Exp $
     1$Id: Changelog.txt,v 1.163 2012/03/15 01:02:02 nanard Exp $
    22miniUPnP client Changelog.
     3
     42012/03/15:
     5  upnperrors.c returns valid error string for unrecognized error codes
     6
     72012/03/08:
     8  make minihttptestserver listen on loopback interface instead of 0.0.0.0
     9
     102012/01/25:
     11  Maven installation thanks to Alexey Kuznetsov
     12
     132012/01/21:
     14  Replace WIN32 macro by _WIN32
     15
     162012/01/19:
     17  Fixes in java wrappers thanks to Alexey Kuznetsov :
     18    https://github.com/axet/miniupnp/tree/fix-javatest/miniupnpc
     19  Make and install .deb packages (python) thanks to Alexey Kuznetsov :
     20    https://github.com/axet/miniupnp/tree/feature-debbuild/miniupnpc
     21
     222012/01/07:
     23  The multicast interface can now be specified by name with IPv4.
     24
     252012/01/02:
     26  Install man page
     27
     282011/11/25:
     29  added header to Port Mappings list in upnpc.c
     30
     312011/10/09:
     32  Makefile : make clean now removes jnaerator generated files.
     33  MINIUPNPC_VERSION in miniupnpc.h (updated by make)
     34
     352011/09/12:
     36  added rootdescURL to UPNPUrls structure.
    337
    438VERSION 1.6 : released 2011/07/25
  • trunk/third-party/miniupnp/LICENSE

    r12593 r13258  
    11MiniUPnPc
    2 Copyright (c) 2005-2011, Thomas BERNARD 
     2Copyright (c) 2005-2011, Thomas BERNARD
    33All rights reserved.
    44
  • trunk/third-party/miniupnp/README

    r12593 r13258  
    4444* Python module *
    4545
    46 you can build a python module with 'make pythonmodule' 
     46you can build a python module with 'make pythonmodule'
    4747and install it with 'make installpythonmodule'.
    4848setup.py (and setupmingw32.py) are included in the distribution.
  • trunk/third-party/miniupnp/bsdqueue.h

    r3731 r13258  
    3737
    3838/*
    39  * This file defines five types of data structures: singly-linked lists, 
     39 * This file defines five types of data structures: singly-linked lists,
    4040 * lists, simple queues, tail queues, and circular queues.
    4141 *
     
    9696        struct type *slh_first; /* first element */                     \
    9797}
    98  
     98
    9999#define SLIST_HEAD_INITIALIZER(head)                                    \
    100100        { NULL }
     
    108108        struct type *sle_next;  /* next element */                      \
    109109}
    110  
     110
    111111/*
    112112 * Singly-linked List access methods.
     
    323323}
    324324
    325 /* 
    326  * tail queue access methods 
     325/*
     326 * tail queue access methods
    327327 */
    328328#define TAILQ_FIRST(head)               ((head)->tqh_first)
     
    431431
    432432/*
    433  * Circular queue access methods 
     433 * Circular queue access methods
    434434 */
    435435#define CIRCLEQ_FIRST(head)             ((head)->cqh_first)
  • trunk/third-party/miniupnp/codelength.h

    r6967 r13258  
    1 /* $Id: codelength.h,v 1.1 2008/10/06 22:04:06 nanard Exp $ */
     1/* $Id: codelength.h,v 1.3 2011/07/30 13:10:05 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas BERNARD
    4  * copyright (c) 2005-2008 Thomas Bernard
     4 * copyright (c) 2005-2011 Thomas Bernard
    55 * This software is subjet to the conditions detailed in the
    66 * provided LICENCE file. */
     
    1313#define DECODELENGTH(n, p) n = 0; \
    1414                           do { n = (n << 7) | (*p & 0x7f); } \
    15                            while(*(p++)&0x80);
     15                           while((*(p++)&0x80) && (n<(1<<25)));
     16
     17#define DECODELENGTH_CHECKLIMIT(n, p, p_limit) \
     18        n = 0; \
     19        do { \
     20                if((p) >= (p_limit)) break; \
     21                n = (n << 7) | (*(p) & 0x7f); \
     22        } while((*((p)++)&0x80) && (n<(1<<25)));
    1623
    1724#define CODELENGTH(n, p) if(n>=268435456) *(p++) = (n >> 28) | 0x80; \
  • trunk/third-party/miniupnp/connecthostport.c

    r12593 r13258  
    1 /* $Id: connecthostport.c,v 1.5 2011/04/09 08:49:50 nanard Exp $ */
     1/* $Id: connecthostport.c,v 1.7 2012/03/05 19:42:46 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas Bernard
    4  * Copyright (c) 2010-2011 Thomas Bernard
     4 * Copyright (c) 2010-2012 Thomas Bernard
    55 * This software is subject to the conditions detailed in the
    66 * LICENCE file provided in this distribution. */
     
    1414#include <string.h>
    1515#include <stdio.h>
    16 #ifdef WIN32
     16#ifdef _WIN32
    1717#include <winsock2.h>
    1818#include <ws2tcpip.h>
     
    2222#define herror
    2323#define socklen_t int
    24 #else /* #ifdef WIN32 */
     24#else /* #ifdef _WIN32 */
    2525#include <unistd.h>
    2626#include <sys/param.h>
     
    3535#include <sys/socket.h>
    3636#endif /* #ifndef USE_GETHOSTBYNAME */
    37 #endif /* #else WIN32 */
     37#endif /* #else _WIN32 */
    3838
    3939/* definition of PRINT_SOCKET_ERROR */
    40 #ifdef WIN32
     40#ifdef _WIN32
    4141#define PRINT_SOCKET_ERROR(x)    printf("Socket error: %s, %d\n", x, WSAGetLastError());
    4242#else
     
    6868        struct timeval timeout;
    6969#endif /* #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT */
    70        
     70
    7171#ifdef USE_GETHOSTBYNAME
    7272        hp = gethostbyname(host);
     
    161161        if(n != 0)
    162162        {
    163 #ifdef WIN32
     163#ifdef _WIN32
    164164                fprintf(stderr, "getaddrinfo() error : %d\n", n);
    165165#else
  • trunk/third-party/miniupnp/declspec.h

    r6848 r13258  
    22#define __DECLSPEC_H__
    33
    4 #if defined(WIN32) && !defined(STATICLIB)
     4#if defined(_WIN32) && !defined(STATICLIB)
    55        #ifdef MINIUPNP_EXPORTS
    66                #define LIBSPEC __declspec(dllexport)
  • trunk/third-party/miniupnp/minisoap.c

    r12593 r13258  
    1 /* $Id: minisoap.c,v 1.21 2011/03/22 19:15:35 nanard Exp $ */
     1/* $Id: minisoap.c,v 1.22 2012/01/21 13:30:31 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas Bernard
    4  * Copyright (c) 2005-2009 Thomas Bernard
     4 * Copyright (c) 2005-2012 Thomas Bernard
    55 * This software is subject to the conditions detailed in the
    66 * LICENCE file provided in this distribution.
     
    1010#include <stdio.h>
    1111#include <string.h>
    12 #ifdef WIN32
     12#ifdef _WIN32
    1313#include <io.h>
    1414#include <winsock2.h>
     
    2525#include <stdlib.h>
    2626
    27 #ifdef WIN32
     27#ifdef _WIN32
    2828#define PRINT_SOCKET_ERROR(x)    printf("Socket error: %s, %d\n", x, WSAGetLastError());
    2929#else
     
    5858        /* draytek routers dont seems to like that... */
    5959#if 0
    60 #ifdef WIN32
     60#ifdef _WIN32
    6161        if(shutdown(fd, SD_SEND)<0) {
    6262#else
  • trunk/third-party/miniupnp/minissdpc.c

    r11510 r13258  
    1 /* $Id: minissdpc.c,v 1.14 2010/11/25 09:57:25 nanard Exp $ */
     1/* $Id: minissdpc.c,v 1.16 2012/03/05 19:42:46 nanard Exp $ */
    22/* Project : miniupnp
     3 * Web : http://miniupnp.free.fr/
    34 * Author : Thomas BERNARD
    4  * copyright (c) 2005-2009 Thomas Bernard
     5 * copyright (c) 2005-2012 Thomas Bernard
    56 * This software is subjet to the conditions detailed in the
    67 * provided LICENCE file. */
     
    1112#include <unistd.h>
    1213#include <sys/types.h>
    13 #if defined(WIN32) || defined(__amigaos__) || defined(__amigaos4__)
    14 #ifdef WIN32
     14#if defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__)
     15#ifdef _WIN32
    1516#include <winsock2.h>
    1617#include <ws2tcpip.h>
     
    120121                tmp->buffer[urlsize+1+stsize] = '\0';
    121122                devlist = tmp;
    122                 /* added for compatibility with recent versions of MiniSSDPd 
     123                /* added for compatibility with recent versions of MiniSSDPd
    123124                 * >= 2007/12/19 */
    124125                DECODELENGTH(usnsize, p);
  • trunk/third-party/miniupnp/miniupnpc.c

    r12593 r13258  
    1 /* $Id: miniupnpc.c,v 1.95 2011/05/15 21:42:26 nanard Exp $ */
     1/* $Id: miniupnpc.c,v 1.103 2012/03/05 19:42:46 nanard Exp $ */
    22/* Project : miniupnp
     3 * Web : http://miniupnp.free.fr/
    34 * Author : Thomas BERNARD
    4  * copyright (c) 2005-2011 Thomas Bernard
     5 * copyright (c) 2005-2012 Thomas Bernard
    56 * This software is subjet to the conditions detailed in the
    67 * provided LICENSE file. */
     
    1718#endif
    1819
     20#if !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(MACOSX) && !defined(_WIN32)
     21#define HAS_IP_MREQN
     22#endif
     23
    1924#include <stdlib.h>
    2025#include <stdio.h>
    2126#include <string.h>
    22 #ifdef WIN32
     27#ifdef _WIN32
    2328/* Win32 Specific includes and defines */
    2429#include <winsock2.h>
     
    3540#endif /* #ifndef strncasecmp */
    3641#define MAXHOSTNAMELEN 64
    37 #else /* #ifdef WIN32 */
     42#else /* #ifdef _WIN32 */
    3843/* Standard POSIX includes */
    3944#include <unistd.h>
     
    5762#include <errno.h>
    5863#define closesocket close
    59 #endif /* #else WIN32 */
     64#endif /* #else _WIN32 */
    6065#ifdef MINIUPNPC_SET_SOCKET_TIMEOUT
    6166#include <sys/time.h>
     
    7580#include "receivedata.h"
    7681
    77 #ifdef WIN32
     82#ifdef _WIN32
    7883#define PRINT_SOCKET_ERROR(x)    printf("Socket error: %s, %d\n", x, WSAGetLastError());
    7984#else
     
    324329        struct UPNPDev * devlist = 0;
    325330        int opt = 1;
    326         static const char MSearchMsgFmt[] = 
     331        static const char MSearchMsgFmt[] =
    327332        "M-SEARCH * HTTP/1.1\r\n"
    328333        "HOST: %s:" XSTR(PORT) "\r\n"
     
    354359        struct addrinfo hints, *servinfo, *p;
    355360#endif
    356 #ifdef WIN32
     361#ifdef _WIN32
    357362        MIB_IPFORWARDROW ip_forward;
    358363#endif
     
    361366        if(error)
    362367                *error = UPNPDISCOVER_UNKNOWN_ERROR;
    363 #if !defined(WIN32) && !defined(__amigaos__) && !defined(__amigaos4__)
     368#if !defined(_WIN32) && !defined(__amigaos__) && !defined(__amigaos4__)
    364369        /* first try to get infos from minissdpd ! */
    365370        if(!minissdpdsock)
     
    379384#endif
    380385        /* fallback to direct discovery */
    381 #ifdef WIN32
     386#ifdef _WIN32
    382387        sudp = socket(ipv6 ? PF_INET6 : PF_INET, SOCK_DGRAM, IPPROTO_UDP);
    383388#else
     
    406411                p->sin_addr.s_addr = INADDR_ANY;
    407412        }
    408 #ifdef WIN32
    409 /* This code could help us to use the right Network interface for 
     413#ifdef _WIN32
     414/* This code could help us to use the right Network interface for
    410415 * SSDP multicast traffic */
    411416/* Get IP associated with the index given in the ip_forward struct
     
    466471#endif
    467472
    468 #ifdef WIN32
     473#ifdef _WIN32
    469474        if (setsockopt(sudp, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof (opt)) < 0)
    470475#else
     
    481486        {
    482487                if(ipv6) {
    483 #if !defined(WIN32)
     488#if !defined(_WIN32)
    484489                        /* according to MSDN, if_nametoindex() is supported since
    485490                         * MS Windows Vista and MS Windows Server 2008.
     
    498503                        struct in_addr mc_if;
    499504                        mc_if.s_addr = inet_addr(multicastif); /* ex: 192.168.x.x */
    500                         ((struct sockaddr_in *)&sockudp_r)->sin_addr.s_addr = mc_if.s_addr;
    501                         if(setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_IF, (const char *)&mc_if, sizeof(mc_if)) < 0)
     505                        if(mc_if.s_addr != INADDR_NONE)
    502506                        {
    503                                 PRINT_SOCKET_ERROR("setsockopt");
     507                                ((struct sockaddr_in *)&sockudp_r)->sin_addr.s_addr = mc_if.s_addr;
     508                                if(setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_IF, (const char *)&mc_if, sizeof(mc_if)) < 0)
     509                                {
     510                                        PRINT_SOCKET_ERROR("setsockopt");
     511                                }
     512                        } else {
     513#ifdef HAS_IP_MREQN
     514                                /* was not an ip address, try with an interface name */
     515                                struct ip_mreqn reqn;   /* only defined with -D_BSD_SOURCE or -D_GNU_SOURCE */
     516                                memset(&reqn, 0, sizeof(struct ip_mreqn));
     517                                reqn.imr_ifindex = if_nametoindex(multicastif);
     518                                if(setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_IF, (const char *)&reqn, sizeof(reqn)) < 0)
     519                                {
     520                                        PRINT_SOCKET_ERROR("setsockopt");
     521                                }
     522#else
     523#ifdef DEBUG
     524                                printf("Setting of multicast interface not supported with interface name.\n");
     525#endif
     526#endif
    504527                        }
    505528                }
     
    573596                        if(error)
    574597                                *error = UPNPDISCOVER_SOCKET_ERROR;
    575 #ifdef WIN32
     598#ifdef _WIN32
    576599                    fprintf(stderr, "getaddrinfo() failed: %d\n", rv);
    577600#else
     
    707730        char * p;
    708731        int n1, n2, n3, n4;
     732
    709733        n1 = strlen(data->urlbase);
    710734        if(n1==0)
     
    717741        n4 += strlen(data->IPv6FC.controlurl);
    718742
     743        /* allocate memory to store URLs */
    719744        urls->ipcondescURL = (char *)malloc(n1);
    720745        urls->controlURL = (char *)malloc(n2);
    721746        urls->controlURL_CIF = (char *)malloc(n3);
    722747        urls->controlURL_6FC = (char *)malloc(n4);
    723         /* maintenant on chope la desc du WANIPConnection */
     748
     749        /* strdup descURL */
     750        urls->rootdescURL = strdup(descURL);
     751
     752        /* get description of WANIPConnection */
    724753        if(data->urlbase[0] != '\0')
    725754                strncpy(urls->ipcondescURL, data->urlbase, n1);
     
    731760        strncpy(urls->controlURL_CIF, urls->ipcondescURL, n3);
    732761        strncpy(urls->controlURL_6FC, urls->ipcondescURL, n4);
    733        
     762
    734763        url_cpy_or_cat(urls->ipcondescURL, data->first.scpdurl, n1);
    735764
     
    765794        free(urls->controlURL_6FC);
    766795        urls->controlURL_6FC = 0;
     796        free(urls->rootdescURL);
     797        urls->rootdescURL = 0;
    767798}
    768799
  • trunk/third-party/miniupnp/miniupnpc.h

    r12593 r13258  
    1 /* $Id: miniupnpc.h,v 1.23 2011/04/11 08:21:46 nanard Exp $ */
     1/* $Id: miniupnpc.h,v 1.25 2011/10/09 16:17:29 nanard Exp $ */
    22/* Project: miniupnp
    33 * http://miniupnp.free.fr/
     
    1717#define UPNPDISCOVER_SOCKET_ERROR (-101)
    1818#define UPNPDISCOVER_MEMORY_ERROR (-102)
     19
     20/* versions : */
     21#define MINIUPNPC_VERSION       "1.6.20120320"
     22#define MINIUPNPC_API_VERSION   8
    1923
    2024#ifdef __cplusplus
     
    7579        char * controlURL_CIF;
    7680        char * controlURL_6FC;
     81        char * rootdescURL;
    7782};
    7883
  • trunk/third-party/miniupnp/miniwget.c

    r12593 r13258  
    1 /* $Id: miniwget.c,v 1.52 2011/06/17 22:59:42 nanard Exp $ */
     1/* $Id: miniwget.c,v 1.55 2012/03/05 19:42:47 nanard Exp $ */
    22/* Project : miniupnp
     3 * Website : http://miniupnp.free.fr/
    34 * Author : Thomas Bernard
    4  * Copyright (c) 2005-2011 Thomas Bernard
     5 * Copyright (c) 2005-2012 Thomas Bernard
    56 * This software is subject to the conditions detailed in the
    67 * LICENCE file provided in this distribution. */
    7  
     8
    89#include <stdio.h>
    910#include <stdlib.h>
    1011#include <string.h>
    1112#include <ctype.h>
    12 #ifdef WIN32
     13#ifdef _WIN32
    1314#include <winsock2.h>
    1415#include <ws2tcpip.h>
     
    2526#endif /* defined(_MSC_VER) && (_MSC_VER >= 1400) */
    2627#endif /* #ifndef strncasecmp */
    27 #else /* #ifdef WIN32 */
     28#else /* #ifdef _WIN32 */
    2829#include <unistd.h>
    2930#include <sys/param.h>
     
    3435#endif /* #else defined(__amigaos__) && !defined(__amigaos4__) */
    3536#include <sys/socket.h>
     37#include <netinet/in.h>
    3638#include <arpa/inet.h>
    3739#include <netdb.h>
     
    4042 * during the connect() call */
    4143#define MINIUPNPC_IGNORE_EINTR
    42 #endif /* #else WIN32 */
     44#endif /* #else _WIN32 */
    4345#if defined(__sun) || defined(sun)
    4446#define MIN(x,y) (((x)<(y))?(x):(y))
     
    161163                                        colon = linestart;
    162164                                        valuestart = 0;
    163                                 } 
     165                                }
    164166                        }
    165167                        /* copy the remaining of the received data back to buf */
     
    230232                                                        content_buf_len = content_buf_used + (int)bytestocopy;
    231233                                                }
    232                                                 content_buf = (char *)realloc((void *)content_buf, 
     234                                                content_buf = (char *)realloc((void *)content_buf,
    233235                                                                              content_buf_len);
    234236                                        }
     
    254256                                                content_buf_len = content_buf_used + n;
    255257                                        }
    256                                         content_buf = (char *)realloc((void *)content_buf, 
     258                                        content_buf = (char *)realloc((void *)content_buf,
    257259                                                                      content_buf_len);
    258260                                }
     
    344346                                        NI_NUMERICHOST | NI_NUMERICSERV);
    345347                        if(n != 0) {
    346 #ifdef WIN32
     348#ifdef _WIN32
    347349                                fprintf(stderr, "getnameinfo() failed : %d\n", n);
    348350#else
     
    418420 *   hostname : hostname destination string (size of MAXHOSTNAMELEN+1)
    419421 *   port :             port (destination)
    420  *   path :             pointer to the path part of the URL 
     422 *   path :             pointer to the path part of the URL
    421423 *
    422424 * Return values :
     
    508510        unsigned short port;
    509511        char * path;
    510         /* protocol://host:port/chemin */
     512        /* protocol://host:port/path */
    511513        char hostname[MAXHOSTNAMELEN+1];
    512514        *size = 0;
  • trunk/third-party/miniupnp/minixml.c

    r12593 r13258  
    1 /* $Id: minixml.c,v 1.9 2011/02/07 13:44:57 nanard Exp $ */
     1/* $Id: minixml.c,v 1.10 2012/03/05 19:42:47 nanard Exp $ */
    22/* minixml.c : the minimum size a xml parser can be ! */
    33/* Project : miniupnp
     
    55 * Author : Thomas Bernard
    66
    7 Copyright (c) 2005-2011, Thomas BERNARD 
     7Copyright (c) 2005-2011, Thomas BERNARD
    88All rights reserved.
    99
     
    150150                                        }
    151151                                        if(memcmp(p->xml, "<![CDATA[", 9) == 0)
    152                                         { 
     152                                        {
    153153                                                /* CDATA handling */
    154154                                                p->xml += 9;
  • trunk/third-party/miniupnp/portlistingparse.c

    r12593 r13258  
    1 /* $Id: portlistingparse.c,v 1.4 2011/03/18 11:02:17 nanard Exp $ */
     1/* $Id: portlistingparse.c,v 1.5 2012/03/05 19:42:47 nanard Exp $ */
    22/* MiniUPnP project
    33 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
    4  * (c) 2011 Thomas Bernard 
     4 * (c) 2011 Thomas Bernard
    55 * This software is subject to the conditions detailed
    66 * in the LICENCE file provided within the distribution */
  • trunk/third-party/miniupnp/portlistingparse.h

    r12593 r13258  
    1 /* $Id: portlistingparse.h,v 1.4 2011/02/15 23:03:56 nanard Exp $ */
     1/* $Id: portlistingparse.h,v 1.6 2012/03/05 19:42:47 nanard Exp $ */
    22/* MiniUPnP project
    33 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
    4  * (c) 2011 Thomas Bernard
     4 * (c) 2011-2012 Thomas Bernard
    55 * This software is subject to the conditions detailed
    66 * in the LICENCE file provided within the distribution */
     
    1212#include "miniupnpctypes.h"
    1313
    14 #if defined(NO_SYS_QUEUE_H) || defined(WIN32) || defined(__HAIKU__)
     14#if defined(NO_SYS_QUEUE_H) || defined(_WIN32) || defined(__HAIKU__)
    1515#include "bsdqueue.h"
    1616#else
     
    3838       NewExternalPort, NewProtocol,
    3939       NewInternalPort, NewInternalClient,
    40        NewEnabled, NewDescription, 
     40       NewEnabled, NewDescription,
    4141       NewLeaseTime } portMappingElt;
    4242
  • trunk/third-party/miniupnp/receivedata.c

    r12593 r13258  
    1 /* $Id: receivedata.c,v 1.1 2011/04/11 08:21:47 nanard Exp $ */
     1/* $Id: receivedata.c,v 1.3 2012/03/05 19:42:47 nanard Exp $ */
    22/* Project : miniupnp
     3 * Website : http://miniupnp.free.fr/
    34 * Author : Thomas Bernard
    4  * Copyright (c) 2011 Thomas Bernard
     5 * Copyright (c) 2011-2012 Thomas Bernard
    56 * This software is subject to the conditions detailed in the
    67 * LICENCE file provided in this distribution. */
    78
    89#include <stdio.h>
    9 #ifdef WIN32
     10#ifdef _WIN32
    1011#include <winsock2.h>
    1112#include <ws2tcpip.h>
     
    2526#endif
    2627
    27 #ifdef WIN32
     28#ifdef _WIN32
    2829#define PRINT_SOCKET_ERROR(x)    printf("Socket error: %s, %d\n", x, WSAGetLastError());
    2930#else
     
    3738{
    3839    int n;
    39 #if !defined(WIN32) && !defined(__amigaos__) && !defined(__amigaos4__)
     40#if !defined(_WIN32) && !defined(__amigaos__) && !defined(__amigaos4__)
    4041        /* using poll */
    4142    struct pollfd fds[1]; /* for the poll */
     
    5657        return 0;
    5758    }
    58 #else /* !defined(WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) */
    59         /* using select under WIN32 and amigaos */
     59#else /* !defined(_WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) */
     60        /* using select under _WIN32 and amigaos */
    6061    fd_set socketSet;
    6162    TIMEVAL timeval;
     
    7071    } else if(n == 0) {
    7172        return 0;
    72     }   
     73    }
    7374#endif
    7475        n = recv(socket, data, length, 0);
  • trunk/third-party/miniupnp/receivedata.h

    r12593 r13258  
    1 /* $Id: receivedata.h,v 1.1 2011/04/11 08:21:47 nanard Exp $ */
     1/* $Id: receivedata.h,v 1.2 2012/03/05 19:42:47 nanard Exp $ */
    22/* Project: miniupnp
    33 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
     
    99#define __RECEIVEDATA_H__
    1010
    11 /* Reads data from the specified socket. 
    12  * Returns the number of bytes read if successful, zero if no bytes were 
     11/* Reads data from the specified socket.
     12 * Returns the number of bytes read if successful, zero if no bytes were
    1313 * read or if we timed out. Returns negative if there was an error. */
    1414int receivedata(int socket, char * data, int length, int timeout);
  • trunk/third-party/miniupnp/upnpcommands.c

    r12593 r13258  
    1 /* $Id: upnpcommands.c,v 1.37 2011/06/04 15:56:23 nanard Exp $ */
     1/* $Id: upnpcommands.c,v 1.38 2012/03/05 19:42:47 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas Bernard
     
    120120UPNP_GetStatusInfo(const char * controlURL,
    121121                                const char * servicetype,
    122                                 char * status, 
     122                                char * status,
    123123                                unsigned int * uptime,
    124124                                char * lastconnerror)
     
    222222/* UPNP_GetLinkLayerMaxBitRate() call the corresponding UPNP method.
    223223 * Returns 2 values: Downloadlink bandwidth and Uplink bandwidth.
    224  * One of the values can be null 
    225  * Note : GetLinkLayerMaxBitRates belongs to WANPPPConnection:1 only 
     224 * One of the values can be null
     225 * Note : GetLinkLayerMaxBitRates belongs to WANPPPConnection:1 only
    226226 * We can use the GetCommonLinkProperties from WANCommonInterfaceConfig:1 */
    227227LIBSPEC int
     
    286286 * if the third arg is not null the value is copied to it.
    287287 * at least 16 bytes must be available
    288  * 
     288 *
    289289 * Return values :
    290290 * 0 : SUCCESS
     
    747747}
    748748
    749 /* IGD:2, functions for service WANIPv6FirewallControl:1 */ 
     749/* IGD:2, functions for service WANIPv6FirewallControl:1 */
    750750LIBSPEC int
    751751UPNP_GetFirewallStatus(const char * controlURL,
    752752                                const char * servicetype,
    753                                 int * firewallEnabled, 
     753                                int * firewallEnabled,
    754754                                int * inboundPinholeAllowed)
    755755{
     
    913913        if(resVal)
    914914        {
    915                 //printf("AddPortMapping errorCode = '%s'\n", resVal); 
     915                //printf("AddPortMapping errorCode = '%s'\n", resVal);
    916916                ret = UPNPCOMMAND_UNKNOWN_ERROR;
    917917                sscanf(resVal, "%d", &ret);
  • trunk/third-party/miniupnp/upnpcommands.h

    r12593 r13258  
    1 /* $Id: upnpcommands.h,v 1.23 2011/04/11 09:14:00 nanard Exp $ */
     1/* $Id: upnpcommands.h,v 1.24 2012/03/05 19:42:47 nanard Exp $ */
    22/* Miniupnp project : http://miniupnp.free.fr/
    33 * Author : Thomas Bernard
     
    6363/* UPNP_GetExternalIPAddress() call the corresponding UPNP method.
    6464 * if the third arg is not null the value is copied to it.
    65  * at least 16 bytes must be available 
     65 * at least 16 bytes must be available
    6666 *
    6767 * Return values :
    6868 * 0 : SUCCESS
    6969 * NON ZERO : ERROR Either an UPnP error code or an unknown error.
    70  * 
     70 *
    7171 * possible UPnP Errors :
    7272 * 402 Invalid Args - See UPnP Device Architecture section on Control.
     
    9696 * 0 : SUCCESS
    9797 * NON ZERO : ERROR. Either an UPnP error code or an unknown error.
    98  * 
     98 *
    9999 * List of possible UPnP errors for AddPortMapping :
    100100 * errorCode errorDescription (short) - Description (long)
     
    107107 *                     with a mapping assigned previously to another client
    108108 * 724 SamePortValuesRequired - Internal and External port values
    109  *                              must be the same 
     109 *                              must be the same
    110110 * 725 OnlyPermanentLeasesSupported - The NAT implementation only supports
    111111 *                  permanent lease times on port mappings
     
    222222                           struct PortMappingParserData * data);
    223223
    224 /* IGD:2, functions for service WANIPv6FirewallControl:1 */ 
     224/* IGD:2, functions for service WANIPv6FirewallControl:1 */
    225225LIBSPEC int
    226226UPNP_GetFirewallStatus(const char * controlURL,
    227227                                const char * servicetype,
    228                                 int * firewallEnabled, 
     228                                int * firewallEnabled,
    229229                                int * inboundPinholeAllowed);
    230230
  • trunk/third-party/miniupnp/upnpreplyparse.c

    r12593 r13258  
    1 /* $Id: upnpreplyparse.c,v 1.11 2011/02/07 16:17:06 nanard Exp $ */
     1/* $Id: upnpreplyparse.c,v 1.12 2012/03/05 19:42:48 nanard Exp $ */
    22/* MiniUPnP project
    33 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
    4  * (c) 2006-2011 Thomas Bernard 
     4 * (c) 2006-2011 Thomas Bernard
    55 * This software is subject to the conditions detailed
    66 * in the LICENCE file provided within the distribution */
     
    9191}
    9292
    93 char * 
     93char *
    9494GetValueFromNameValueList(struct NameValueParserData * pdata,
    9595                          const char * Name)
     
    132132#endif
    133133
    134 /* debug all-in-one function 
     134/* debug all-in-one function
    135135 * do parsing then display to stdout */
    136136#ifdef DEBUG
  • trunk/third-party/miniupnp/upnpreplyparse.h

    r12593 r13258  
    1 /* $Id: upnpreplyparse.h,v 1.11 2011/02/07 16:17:06 nanard Exp $ */
     1/* $Id: upnpreplyparse.h,v 1.13 2012/03/05 19:42:48 nanard Exp $ */
    22/* MiniUPnP project
    33 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
    4  * (c) 2006-2011 Thomas Bernard
     4 * (c) 2006-2012 Thomas Bernard
    55 * This software is subject to the conditions detailed
    66 * in the LICENCE file provided within the distribution */
     
    99#define __UPNPREPLYPARSE_H__
    1010
    11 #if defined(NO_SYS_QUEUE_H) || defined(WIN32) || defined(__HAIKU__)
     11#if defined(NO_SYS_QUEUE_H) || defined(_WIN32) || defined(__HAIKU__)
    1212#include "bsdqueue.h"
    1313#else
Note: See TracChangeset for help on using the changeset viewer.