Changeset 10285
- Timestamp:
- Feb 25, 2010, 12:39:22 PM (13 years ago)
- 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:34nanard Exp $1 $Id: Changelog.txt,v 1.105 2010/01/06 10:03:53 nanard Exp $ 2 2 miniUPnP client Changelog. 3 4 2010/01/06: 5 #define _DARWIN_C_SOURCE for macosx 6 7 2009/12/19: 8 Improve MinGW32 build 9 10 2009/12/11: 11 adding a MSVC9 project to build the static library and executable 12 13 2009/12/10: 14 Fixing some compilation stuff for Windows/MinGW 15 16 2009/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 21 2009/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 26 2009/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 33 2009/11/26: 34 fixing updateminiupnpcstrings.sh to take into account 35 which command that does not return an error code. 36 37 VERSION 1.4 : released 2009/10/30 38 39 2009/10/16: 40 using Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS in python module. 3 41 4 42 2009/10/10: -
trunk/third-party/miniupnp/README
r8862 r10285 2 2 Project web page: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 3 3 Author: Thomas Bernard 4 Copyright (c) 2005-200 8Thomas Bernard4 Copyright (c) 2005-2009 Thomas Bernard 5 5 This software is subject to the conditions detailed in the 6 LICEN CE file provided within this distribution.6 LICENSE file provided within this distribution. 7 7 8 8 For the comfort of Win32 users, bsdqueue.h is included in the distribution. … … 12 12 * miniupnp Client * 13 13 14 To compile, simply run 'gmake' (could be 'make' ).14 To compile, simply run 'gmake' (could be 'make' on your system). 15 15 Under win32, to compile with MinGW, type "mingw32make.bat". 16 16 The compilation is known to work under linux, FreeBSD, 17 OpenBSD, MacOS X and cygwin. 17 OpenBSD, MacOS X, AmigaOS and cygwin. 18 The official AmigaOS4.1 SDK was used for AmigaOS4 and GeekGadgets for AmigaOS3. 19 18 20 To install the library and headers on the system use : 19 21 > su … … 26 28 upnpc.c is a sample client using the libminiupnpc. 27 29 To use the libminiupnpc in your application, link it with 28 libminiupnpc.a and use the following functions found in miniupnpc.h,30 libminiupnpc.a (or .so) and use the following functions found in miniupnpc.h, 29 31 upnpcommands.h and miniwget.h : 30 32 - 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 $ */ 2 2 /* Project : miniupnp 3 3 * http://miniupnp.free.fr/ … … 96 96 void printIGD(struct IGDdatas * d) 97 97 { 98 printf("urlbase = %s\n", d->urlbase);98 printf("urlbase = '%s'\n", d->urlbase); 99 99 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); 105 105 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); 111 111 } 112 112 -
trunk/third-party/miniupnp/minisoap.c
r7837 r10285 1 /* $Id: minisoap.c,v 1.1 6 2008/10/11 16:39:29nanard Exp $ */1 /* $Id: minisoap.c,v 1.18 2009/12/04 11:29:18 nanard Exp $ */ 2 2 /* Project : miniupnp 3 3 * Author : Thomas Bernard 4 * Copyright (c) 2005 Thomas Bernard4 * Copyright (c) 2005-2009 Thomas Bernard 5 5 * This software is subject to the conditions detailed in the 6 6 * LICENCE file provided in this distribution. … … 85 85 /* We are not using keep-alive HTTP connections. 86 86 * 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. */ 88 91 /* Connection: Close is normally there only in HTTP/1.1 but who knows */ 89 92 portstr[0] = '\0'; … … 91 94 snprintf(portstr, sizeof(portstr), ":%hu", port); 92 95 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" 95 98 "Host: %s%s\r\n" 96 99 "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.1 0 2009/09/21 12:57:42nanard Exp $ */1 /* $Id: minissdpc.c,v 1.13 2009/12/04 16:57:29 nanard Exp $ */ 2 2 /* Project : miniupnp 3 3 * Author : Thomas BERNARD … … 11 11 #include <unistd.h> 12 12 #include <sys/types.h> 13 #if defined(WIN32) || defined(__amigaos__) || defined(__amigaos4__) 13 14 #ifdef WIN32 14 15 #include <winsock2.h> 15 16 #include <ws2tcpip.h> 16 17 #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 17 25 /* Hack */ 18 26 #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:34nanard Exp $ */1 /* $Id: miniupnpc.c,v 1.74 2010/01/09 23:54:40 nanard Exp $ */ 2 2 /* Project : miniupnp 3 3 * Author : Thomas BERNARD 4 * copyright (c) 2005-20 09Thomas Bernard4 * copyright (c) 2005-2010 Thomas Bernard 5 5 * This software is subjet to the conditions detailed in the 6 * provided LICEN CE file. */6 * provided LICENSE file. */ 7 7 #define __EXTENSIONS__ 1 8 8 #if !defined(MACOSX) && !defined(__sun) … … 15 15 #define __BSD_VISIBLE 1 16 16 #endif 17 #endif 18 19 #ifdef __APPLE__ 20 #define _DARWIN_C_SOURCE 17 21 #endif 18 22 … … 25 29 #include <ws2tcpip.h> 26 30 #include <io.h> 31 /*#include <IPHlpApi.h>*/ 27 32 #define snprintf _snprintf 28 33 #if defined(_MSC_VER) && (_MSC_VER >= 1400) 29 34 #define strncasecmp _memicmp 30 #else 35 #else /* defined(_MSC_VER) && (_MSC_VER >= 1400) */ 31 36 #define strncasecmp memicmp 32 #endif 37 #endif /* defined(_MSC_VER) && (_MSC_VER >= 1400) */ 33 38 #define MAXHOSTNAMELEN 64 34 #else 39 #else /* #ifdef WIN32 */ 35 40 /* Standard POSIX includes */ 36 41 #include <unistd.h> 42 #if defined(__amigaos__) && !defined(__amigaos4__) 43 /* Amiga OS 3 specific stuff */ 44 #define socklen_t int 45 #else 37 46 #include <sys/select.h> 47 #endif 38 48 #include <sys/socket.h> 39 49 #include <sys/types.h> … … 41 51 #include <netinet/in.h> 42 52 #include <arpa/inet.h> 53 #if !defined(__amigaos__) && !defined(__amigaos4__) 43 54 #include <poll.h> 55 #endif 44 56 #include <netdb.h> 45 57 #include <strings.h> … … 47 59 #define closesocket close 48 60 #define MINIUPNPC_IGNORE_EINTR 49 #endif 61 #endif /* #else WIN32 */ 50 62 #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT 51 63 #include <sys/time.h> 52 64 #endif 65 #if defined(__amigaos__) || defined(__amigaos4__) 66 /* Amiga OS specific stuff */ 67 #define TIMEVAL struct timeval 68 #endif 69 53 70 #include "miniupnpc.h" 54 71 #include "minissdpc.h" … … 86 103 } 87 104 88 /* Content-length: nnn */ 105 /* getcontentlenfromline() : parse the Content-Length HTTP header line. 106 * Content-length: nnn */ 89 107 static int getcontentlenfromline(const char * p, int n) 90 108 { … … 121 139 } 122 140 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. */ 123 145 static void 124 146 getContentLengthAndHeaderLength(char * p, int n, … … 431 453 struct sockaddr_in sockudp_r, sockudp_w; 432 454 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__) 435 460 /* first try to get infos from minissdpd ! */ 436 461 if(!minissdpdsock) … … 468 493 sockudp_w.sin_port = htons(PORT); 469 494 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 470 534 471 535 #ifdef WIN32 … … 653 717 { 654 718 int n; 655 #if ndef WIN32719 #if !defined(WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) 656 720 struct pollfd fds[1]; /* for the poll */ 657 721 #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:31nanard Exp $ */1 /* $Id: miniupnpcstrings.h.in,v 1.2 2009/10/30 09:18:18 nanard Exp $ */ 2 2 /* Project: miniupnp 3 3 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ … … 10 10 11 11 #define OS_STRING "OS/version" 12 #define MINIUPNPC_VERSION_STRING "1. 3"12 #define MINIUPNPC_VERSION_STRING "1.4" 13 13 14 14 #endif -
trunk/third-party/miniupnp/miniwget.c
r9282 r10285 1 /* $Id: miniwget.c,v 1. 28 2009/10/10 19:15:35nanard Exp $ */1 /* $Id: miniwget.c,v 1.31 2009/12/04 11:29:19 nanard Exp $ */ 2 2 /* Project : miniupnp 3 3 * Author : Thomas Bernard … … 21 21 #include <unistd.h> 22 22 #include <sys/param.h> 23 #if defined(__amigaos__) && !defined(__amigaos4__) 24 #define socklen_t int 25 #else 23 26 #include <sys/select.h> 27 #endif 24 28 #include <sys/socket.h> 25 29 #include <netdb.h> … … 33 37 #if defined(__sun) || defined(sun) 34 38 #define MIN(x,y) (((x)<(y))?(x):(y)) 39 #endif 40 #if defined(__amigaos__) || defined(__amigaos4__) 41 #define herror(A) printf("%s\n", A) 35 42 #endif 36 43 … … 133 140 else 134 141 { 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__)) 138 143 /* using INT WINAPI WSAAddressToStringA(LPSOCKADDR, DWORD, LPWSAPROTOCOL_INFOA, LPSTR, LPDWORD); 139 144 * But his function make a string with the port : nn.nn.nn.nn:port */ … … 144 149 }*/ 145 150 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); 146 153 #endif 147 154 } … … 152 159 153 160 len = snprintf(buf, sizeof(buf), 154 "GET %s HTTP/1. 1\r\n"161 "GET %s HTTP/1.0\r\n" 155 162 "Host: %s:%d\r\n" 156 163 "Connection: Close\r\n" … … 176 183 } 177 184 { 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. */ 178 188 int headers=1; 179 189 char * respbuffer = NULL;
Note: See TracChangeset
for help on using the changeset viewer.