Changeset 10285


Ignore:
Timestamp:
Feb 25, 2010, 12:39:22 PM (12 years ago)
Author:
livings124
Message:

update miniupnp to 1.4

Location:
trunk/third-party/miniupnp
Files:
2 added
1 deleted
8 edited

Legend:

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

    r9282 r10285  
    1 $Id: Changelog.txt,v 1.93 2009/10/10 19:15:34 nanard Exp $
     1$Id: Changelog.txt,v 1.105 2010/01/06 10:03:53 nanard Exp $
    22miniUPnP client Changelog.
     3
     42010/01/06:
     5  #define _DARWIN_C_SOURCE for macosx
     6
     72009/12/19:
     8  Improve MinGW32 build
     9
     102009/12/11:
     11  adding a MSVC9 project to build the static library and executable
     12
     132009/12/10:
     14  Fixing some compilation stuff for Windows/MinGW
     15
     162009/12/07:
     17  adaptations in Makefile and updateminiupnpcstring.sh for AmigaOS
     18  some fixes for Windows when using virtual ethernet adapters (it is the
     19  case with VMWare installed).
     20
     212009/12/04:
     22  some fixes for AmigaOS compilation
     23  Changed HTTP version to HTTP/1.0 for Soap too (to prevent chunked
     24  transfer encoding)
     25
     262009/12/03:
     27  updating printIDG and testigddescparse.c for debug.
     28  modifications to compile under AmigaOS
     29  adding a testminiwget program
     30  Changed miniwget to advertise itself as HTTP/1.0 to prevent chunked
     31  transfer encoding
     32
     332009/11/26:
     34  fixing updateminiupnpcstrings.sh to take into account
     35  which command that does not return an error code.
     36
     37VERSION 1.4 : released 2009/10/30
     38
     392009/10/16:
     40  using Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS in python module.
    341
    4422009/10/10:
  • trunk/third-party/miniupnp/README

    r8862 r10285  
    22Project web page: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
    33Author: Thomas Bernard
    4 Copyright (c) 2005-2008 Thomas Bernard
     4Copyright (c) 2005-2009 Thomas Bernard
    55This software is subject to the conditions detailed in the
    6 LICENCE file provided within this distribution.
     6LICENSE file provided within this distribution.
    77
    88For the comfort of Win32 users, bsdqueue.h is included in the distribution.
     
    1212* miniupnp Client *
    1313
    14 To compile, simply run 'gmake' (could be 'make').
     14To compile, simply run 'gmake' (could be 'make' on your system).
    1515Under win32, to compile with MinGW, type "mingw32make.bat".
    1616The compilation is known to work under linux, FreeBSD,
    17 OpenBSD, MacOS X and cygwin.
     17OpenBSD, MacOS X, AmigaOS and cygwin.
     18The official AmigaOS4.1 SDK was used for AmigaOS4 and GeekGadgets for AmigaOS3.
     19
    1820To install the library and headers on the system use :
    1921> su
     
    2628upnpc.c is a sample client using the libminiupnpc.
    2729To use the libminiupnpc in your application, link it with
    28 libminiupnpc.a and use the following functions found in miniupnpc.h,
     30libminiupnpc.a (or .so) and use the following functions found in miniupnpc.h,
    2931upnpcommands.h and miniwget.h :
    3032- upnpDiscover()
  • trunk/third-party/miniupnp/igd_desc_parse.c

    r5743 r10285  
    1 /* $Id: igd_desc_parse.c,v 1.8 2008/04/23 11:51:06 nanard Exp $ */
     1/* $Id: igd_desc_parse.c,v 1.9 2009/12/03 13:50:06 nanard Exp $ */
    22/* Project : miniupnp
    33 * http://miniupnp.free.fr/
     
    9696void printIGD(struct IGDdatas * d)
    9797{
    98         printf("urlbase = %s\n", d->urlbase);
     98        printf("urlbase = '%s'\n", d->urlbase);
    9999        printf("WAN Device (Common interface config) :\n");
    100         /*printf(" deviceType = %s\n", d->devicetype_CIF);*/
    101         printf(" serviceType = %s\n", d->servicetype_CIF);
    102         printf(" controlURL = %s\n", d->controlurl_CIF);
    103         printf(" eventSubURL = %s\n", d->eventsuburl_CIF);
    104         printf(" SCPDURL = %s\n", d->scpdurl_CIF);
     100        /*printf(" deviceType = '%s'\n", d->devicetype_CIF);*/
     101        printf(" serviceType = '%s'\n", d->servicetype_CIF);
     102        printf(" controlURL = '%s'\n", d->controlurl_CIF);
     103        printf(" eventSubURL = '%s'\n", d->eventsuburl_CIF);
     104        printf(" SCPDURL = '%s'\n", d->scpdurl_CIF);
    105105        printf("WAN Connection Device (IP or PPP Connection):\n");
    106         /*printf(" deviceType = %s\n", d->devicetype);*/
    107         printf(" servicetype = %s\n", d->servicetype);
    108         printf(" controlURL = %s\n", d->controlurl);
    109         printf(" eventSubURL = %s\n", d->eventsuburl);
    110         printf(" SCPDURL = %s\n", d->scpdurl);
     106        /*printf(" deviceType = '%s'\n", d->devicetype);*/
     107        printf(" servicetype = '%s'\n", d->servicetype);
     108        printf(" controlURL = '%s'\n", d->controlurl);
     109        printf(" eventSubURL = '%s'\n", d->eventsuburl);
     110        printf(" SCPDURL = '%s'\n", d->scpdurl);
    111111}
    112112
  • trunk/third-party/miniupnp/minisoap.c

    r7837 r10285  
    1 /* $Id: minisoap.c,v 1.16 2008/10/11 16:39:29 nanard Exp $ */
     1/* $Id: minisoap.c,v 1.18 2009/12/04 11:29:18 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas Bernard
    4  * Copyright (c) 2005 Thomas Bernard
     4 * Copyright (c) 2005-2009 Thomas Bernard
    55 * This software is subject to the conditions detailed in the
    66 * LICENCE file provided in this distribution.
     
    8585        /* We are not using keep-alive HTTP connections.
    8686         * HTTP/1.1 needs the header Connection: close to do that.
    87          * This is the default with HTTP/1.0 */
     87         * This is the default with HTTP/1.0
     88         * Using HTTP/1.1 means we need to support chunked transfer-encoding :
     89         * When using HTTP/1.1, the router "BiPAC 7404VNOX" always use chunked
     90         * transfer encoding. */
    8891    /* Connection: Close is normally there only in HTTP/1.1 but who knows */
    8992        portstr[0] = '\0';
     
    9194                snprintf(portstr, sizeof(portstr), ":%hu", port);
    9295        headerssize = snprintf(headerbuf, sizeof(headerbuf),
    93                        "POST %s HTTP/1.1\r\n"
    94 /*                       "POST %s HTTP/1.0\r\n"*/
     96/*                       "POST %s HTTP/1.1\r\n" */
     97                       "POST %s HTTP/1.0\r\n"
    9598                           "Host: %s%s\r\n"
    9699                                           "User-Agent: " OS_STRING ", UPnP/1.0, MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n"
  • trunk/third-party/miniupnp/minissdpc.c

    r9166 r10285  
    1 /* $Id: minissdpc.c,v 1.10 2009/09/21 12:57:42 nanard Exp $ */
     1/* $Id: minissdpc.c,v 1.13 2009/12/04 16:57:29 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas BERNARD
     
    1111#include <unistd.h>
    1212#include <sys/types.h>
     13#if defined(WIN32) || defined(__amigaos__) || defined(__amigaos4__)
    1314#ifdef WIN32
    1415#include <winsock2.h>
    1516#include <ws2tcpip.h>
    1617#include <io.h>
     18#endif
     19#if defined(__amigaos__) || defined(__amigaos4__)
     20#include <sys/socket.h>
     21#endif
     22#if defined(__amigaos__)
     23#define uint16_t unsigned short
     24#endif
    1725/* Hack */
    1826#define UNIX_PATH_LEN   108
  • trunk/third-party/miniupnp/miniupnpc.c

    r9282 r10285  
    1 /* $Id: miniupnpc.c,v 1.66 2009/10/10 19:15:34 nanard Exp $ */
     1/* $Id: miniupnpc.c,v 1.74 2010/01/09 23:54:40 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas BERNARD
    4  * copyright (c) 2005-2009 Thomas Bernard
     4 * copyright (c) 2005-2010 Thomas Bernard
    55 * This software is subjet to the conditions detailed in the
    6  * provided LICENCE file. */
     6 * provided LICENSE file. */
    77#define __EXTENSIONS__ 1
    88#if !defined(MACOSX) && !defined(__sun)
     
    1515#define __BSD_VISIBLE 1
    1616#endif
     17#endif
     18
     19#ifdef __APPLE__
     20#define _DARWIN_C_SOURCE
    1721#endif
    1822
     
    2529#include <ws2tcpip.h>
    2630#include <io.h>
     31/*#include <IPHlpApi.h>*/
    2732#define snprintf _snprintf
    2833#if defined(_MSC_VER) && (_MSC_VER >= 1400)
    2934#define strncasecmp _memicmp
    30 #else
     35#else /* defined(_MSC_VER) && (_MSC_VER >= 1400) */
    3136#define strncasecmp memicmp
    32 #endif
     37#endif /* defined(_MSC_VER) && (_MSC_VER >= 1400) */
    3338#define MAXHOSTNAMELEN 64
    34 #else
     39#else /* #ifdef WIN32 */
    3540/* Standard POSIX includes */
    3641#include <unistd.h>
     42#if defined(__amigaos__) && !defined(__amigaos4__)
     43/* Amiga OS 3 specific stuff */
     44#define socklen_t int
     45#else
    3746#include <sys/select.h>
     47#endif
    3848#include <sys/socket.h>
    3949#include <sys/types.h>
     
    4151#include <netinet/in.h>
    4252#include <arpa/inet.h>
     53#if !defined(__amigaos__) && !defined(__amigaos4__)
    4354#include <poll.h>
     55#endif
    4456#include <netdb.h>
    4557#include <strings.h>
     
    4759#define closesocket close
    4860#define MINIUPNPC_IGNORE_EINTR
    49 #endif
     61#endif /* #else WIN32 */
    5062#ifdef MINIUPNPC_SET_SOCKET_TIMEOUT
    5163#include <sys/time.h>
    5264#endif
     65#if defined(__amigaos__) || defined(__amigaos4__)
     66/* Amiga OS specific stuff */
     67#define TIMEVAL struct timeval
     68#endif
     69
    5370#include "miniupnpc.h"
    5471#include "minissdpc.h"
     
    86103}
    87104
    88 /* Content-length: nnn */
     105/* getcontentlenfromline() : parse the Content-Length HTTP header line.
     106 * Content-length: nnn */
    89107static int getcontentlenfromline(const char * p, int n)
    90108{
     
    121139}
    122140
     141/* getContentLengthAndHeaderLength()
     142 * retrieve header length and content length from an HTTP response
     143 * TODO : retrieve Transfer-Encoding: header value, in order to support
     144 *        HTTP/1.1, chunked transfer encoding must be supported. */
    123145static void
    124146getContentLengthAndHeaderLength(char * p, int n,
     
    431453        struct sockaddr_in sockudp_r, sockudp_w;
    432454        unsigned int mx;
    433 
    434 #ifndef WIN32
     455#ifdef WIN32
     456        /*MIB_IPFORWARDROW ip_forward;*/
     457#endif
     458
     459#if !defined(WIN32) && !defined(__amigaos__) && !defined(__amigaos4__)
    435460        /* first try to get infos from minissdpd ! */
    436461        if(!minissdpdsock)
     
    468493    sockudp_w.sin_port = htons(PORT);
    469494    sockudp_w.sin_addr.s_addr = inet_addr(UPNP_MCAST_ADDR);
     495#ifdef WIN32
     496/* This code could help us to use the right Network interface for
     497 * SSDP multicast traffic */
     498/* TODO : Get IP associated with the index given in the ip_forward struct
     499 * in order to give this ip to setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_IF) */
     500 /*
     501        if(GetBestRoute(inet_addr("223.255.255.255"), 0, &ip_forward) == NO_ERROR) {
     502                DWORD dwRetVal = 0;
     503                PMIB_IPADDRTABLE pIPAddrTable;
     504    DWORD dwSize = 0;
     505    IN_ADDR IPAddr;
     506    int i;
     507    printf("ifIndex=%lu nextHop=%lx \n", ip_forward.dwForwardIfIndex, ip_forward.dwForwardNextHop);
     508    pIPAddrTable = (MIB_IPADDRTABLE *) malloc(sizeof (MIB_IPADDRTABLE));
     509    if (GetIpAddrTable(pIPAddrTable, &dwSize, 0) == ERROR_INSUFFICIENT_BUFFER) {
     510            free(pIPAddrTable);
     511      pIPAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize);
     512    }
     513    if(pIPAddrTable) {
     514        dwRetVal = GetIpAddrTable( pIPAddrTable, &dwSize, 0 );
     515        printf("\tNum Entries: %ld\n", pIPAddrTable->dwNumEntries);
     516        for (i=0; i < (int) pIPAddrTable->dwNumEntries; i++) {
     517        printf("\n\tInterface Index[%d]:\t%ld\n", i, pIPAddrTable->table[i].dwIndex);
     518        IPAddr.S_un.S_addr = (u_long) pIPAddrTable->table[i].dwAddr;
     519        printf("\tIP Address[%d]:     \t%s\n", i, inet_ntoa(IPAddr) );
     520        IPAddr.S_un.S_addr = (u_long) pIPAddrTable->table[i].dwMask;
     521        printf("\tSubnet Mask[%d]:    \t%s\n", i, inet_ntoa(IPAddr) );
     522        IPAddr.S_un.S_addr = (u_long) pIPAddrTable->table[i].dwBCastAddr;
     523        printf("\tBroadCast[%d]:      \t%s (%ld)\n", i, inet_ntoa(IPAddr), pIPAddrTable->table[i].dwBCastAddr);
     524        printf("\tReassembly size[%d]:\t%ld\n", i, pIPAddrTable->table[i].dwReasmSize);
     525        printf("\tType and State[%d]:", i);
     526        printf("\n");
     527        }
     528                        free(pIPAddrTable);
     529        pIPAddrTable = NULL;
     530    }
     531        }
     532*/
     533#endif
    470534
    471535#ifdef WIN32
     
    653717{
    654718    int n;
    655 #ifndef WIN32
     719#if !defined(WIN32) && !defined(__amigaos__) && !defined(__amigaos4__)
    656720    struct pollfd fds[1]; /* for the poll */
    657721#ifdef MINIUPNPC_IGNORE_EINTR
  • trunk/third-party/miniupnp/miniupnpcstrings.h.in

    r8801 r10285  
    1 /* $Id: miniupnpcstrings.h.in,v 1.1 2009/07/09 16:13:31 nanard Exp $ */
     1/* $Id: miniupnpcstrings.h.in,v 1.2 2009/10/30 09:18:18 nanard Exp $ */
    22/* Project: miniupnp
    33 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
     
    1010
    1111#define OS_STRING "OS/version"
    12 #define MINIUPNPC_VERSION_STRING "1.3"
     12#define MINIUPNPC_VERSION_STRING "1.4"
    1313
    1414#endif
  • trunk/third-party/miniupnp/miniwget.c

    r9282 r10285  
    1 /* $Id: miniwget.c,v 1.28 2009/10/10 19:15:35 nanard Exp $ */
     1/* $Id: miniwget.c,v 1.31 2009/12/04 11:29:19 nanard Exp $ */
    22/* Project : miniupnp
    33 * Author : Thomas Bernard
     
    2121#include <unistd.h>
    2222#include <sys/param.h>
     23#if defined(__amigaos__) && !defined(__amigaos4__)
     24#define socklen_t int
     25#else
    2326#include <sys/select.h>
     27#endif
    2428#include <sys/socket.h>
    2529#include <netdb.h>
     
    3337#if defined(__sun) || defined(sun)
    3438#define MIN(x,y) (((x)<(y))?(x):(y))
     39#endif
     40#if defined(__amigaos__) || defined(__amigaos4__)
     41#define herror(A) printf("%s\n", A)
    3542#endif
    3643
     
    133140                else
    134141                {
    135 #ifndef WIN32
    136                         inet_ntop(AF_INET, &saddr.sin_addr, addr_str, addr_str_len);
    137 #else
     142#if defined(WIN32) || (defined(__amigaos__) && !defined(__amigaos4__))
    138143        /* using INT WINAPI WSAAddressToStringA(LPSOCKADDR, DWORD, LPWSAPROTOCOL_INFOA, LPSTR, LPDWORD);
    139144     * But his function make a string with the port :  nn.nn.nn.nn:port */
     
    144149                }*/
    145150                        strncpy(addr_str, inet_ntoa(saddr.sin_addr), addr_str_len);
     151#else
     152                        inet_ntop(AF_INET, &saddr.sin_addr, addr_str, addr_str_len);
    146153#endif
    147154                }
     
    152159
    153160        len = snprintf(buf, sizeof(buf),
    154                  "GET %s HTTP/1.1\r\n"
     161                 "GET %s HTTP/1.0\r\n"
    155162                             "Host: %s:%d\r\n"
    156163                                 "Connection: Close\r\n"
     
    176183        }
    177184        {
     185                /* TODO : in order to support HTTP/1.1, chunked transfer encoding
     186                 *        must be supported. That means parsing of headers must be
     187                 *        added.                                                   */
    178188                int headers=1;
    179189                char * respbuffer = NULL;
Note: See TracChangeset for help on using the changeset viewer.