Changeset 5743
- Timestamp:
- May 4, 2008, 10:09:33 PM (14 years ago)
- Location:
- trunk/third-party
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/third-party/libnatpmp/README
r4151 r5743 1 1 libnatpmp is written by Thomas Bernard. 2 2 Its homepage is http://miniupnp.tuxfamily.org/libnatpmp.html 3 This code is from the libnatpmp-200 71213snapshot3 This code is from the libnatpmp-20080428 snapshot 4 4 -
trunk/third-party/libnatpmp/natpmp.c
r4095 r5743 1 /* $Id: natpmp.c,v 1. 4 2007/12/02 00:12:47nanard Exp $ */1 /* $Id: natpmp.c,v 1.6 2008/04/28 02:58:34 nanard Exp $ */ 2 2 /* 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 4 5 * 5 6 * Permission to use, copy, modify, and/or distribute this software for any … … 14 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 16 * 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 16 25 #include <errno.h> 17 #include <string.h>18 26 #include <unistd.h> 19 27 #include <fcntl.h> 20 #include <time.h>21 #include <sys/time.h>22 28 #include <sys/types.h> 23 29 #include <sys/socket.h> 30 #endif 24 31 #include "natpmp.h" 25 32 #include "getgateway.h" … … 248 255 } 249 256 257 #ifdef ENABLE_STRNATPMPERR 258 const 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:16nanard Exp $ */1 /* $Id: natpmp.h,v 1.8 2008/04/28 02:58:34 nanard Exp $ */ 2 2 /* 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 4 5 * 5 6 * Permission to use, copy, modify, and/or distribute this software for any … … 22 23 #include <time.h> 23 24 #include <sys/time.h> 25 #ifdef WIN32 26 #include <winsock2.h> 27 #else 24 28 #include <netinet/in.h> 29 #endif 25 30 26 31 typedef struct { … … 172 177 int readnatpmpresponseorretry(natpmp_t * p, natpmpresp_t * response); 173 178 179 #ifdef ENABLE_STRNATPMPERR 180 const char * strnatpmperr(int t); 174 181 #endif 182 183 #endif -
trunk/third-party/miniupnp/README
r5094 r5743 1 1 MiniUPnP is written by Thomas Bernard. 2 2 Its homepage is http://miniupnp.free.fr/ 3 This is from version 1.0 of miniupnpc3 This 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:33nanard Exp $ */1 /* $Id: igd_desc_parse.c,v 1.8 2008/04/23 11:51:06 nanard Exp $ */ 2 2 /* Project : miniupnp 3 3 * http://miniupnp.free.fr/ 4 4 * Author : Thomas Bernard 5 * Copyright (c) 2005 Thomas Bernard5 * Copyright (c) 2005-2008 Thomas Bernard 6 6 * This software is subject to the conditions detailed in the 7 7 * LICENCE file provided in this distribution. … … 10 10 #include <stdio.h> 11 11 #include <string.h> 12 13 /* TODO : rewrite this code so it correctly handle descriptions with 14 * both WANIPConnection and/or WANPPPConnection */ 12 15 13 16 /* Start element handler : … … 19 22 datas->cureltname[l] = '\0'; 20 23 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 } 21 30 } 22 31 … … 31 40 if( (l==7) && !memcmp(name, "service", l) ) 32 41 { 33 /*datas->state++; */34 42 /* 35 43 if( datas->state < 1 … … 39 47 datas->state ++; 40 48 */ 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 } 50 64 } 51 65 } … … 61 75 if( !strcmp(datas->cureltname, "URLBase") ) 62 76 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;*/ 89 87 if(dstmember) 90 88 { … … 100 98 printf("urlbase = %s\n", d->urlbase); 101 99 printf("WAN Device (Common interface config) :\n"); 102 printf(" deviceType = %s\n", d->devicetype_CIF);100 /*printf(" deviceType = %s\n", d->devicetype_CIF);*/ 103 101 printf(" serviceType = %s\n", d->servicetype_CIF); 104 102 printf(" controlURL = %s\n", d->controlurl_CIF); 105 103 printf(" eventSubURL = %s\n", d->eventsuburl_CIF); 106 104 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);*/ 109 107 printf(" servicetype = %s\n", d->servicetype); 110 108 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:09nanard Exp $ */1 /* $Id: igd_desc_parse.h,v 1.6 2008/04/23 11:51:07 nanard Exp $ */ 2 2 /* Project : miniupnp 3 3 * http://miniupnp.free.fr/ 4 4 * Author : Thomas Bernard 5 * Copyright (c) 2005 Thomas Bernard5 * Copyright (c) 2005-2008 Thomas Bernard 6 6 * This software is subject to the conditions detailed in the 7 7 * LICENCE file provided in this distribution. … … 17 17 char urlbase[MINIUPNPC_URL_MAXSIZE]; 18 18 int level; 19 int state; 19 /*int state;*/ 20 /* "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1" */ 20 21 char controlurl_CIF[MINIUPNPC_URL_MAXSIZE]; 21 22 char eventsuburl_CIF[MINIUPNPC_URL_MAXSIZE]; 22 23 char scpdurl_CIF[MINIUPNPC_URL_MAXSIZE]; 23 24 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" */ 25 28 char controlurl[MINIUPNPC_URL_MAXSIZE]; 26 29 char eventsuburl[MINIUPNPC_URL_MAXSIZE]; 27 30 char scpdurl[MINIUPNPC_URL_MAXSIZE]; 28 31 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];*/ 30 39 }; 31 40
Note: See TracChangeset
for help on using the changeset viewer.