Changeset 8798
- Timestamp:
- Jul 13, 2009, 4:00:21 PM (14 years ago)
- Location:
- trunk/third-party
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/third-party/libnatpmp/README
r8735 r8798 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-20090 605snapshot3 This code is from the libnatpmp-20090713 snapshot 4 4 -
trunk/third-party/libnatpmp/getgateway.c
r8735 r8798 1 /* $Id: getgateway.c,v 1.1 4 2009/06/04 22:27:53nanard Exp $ */1 /* $Id: getgateway.c,v 1.15 2009/07/13 08:36:02 nanard Exp $ */ 2 2 /* libnatpmp 3 3 * Copyright (c) 2007-2008, Thomas BERNARD <miniupnp@free.fr> … … 66 66 #include <w32api/winbase.h> 67 67 #include <w32api/winreg.h> 68 #endif 69 70 #ifdef __HAIKU__ 71 #include <stdlib.h> 72 #include <unistd.h> 73 #include <net/if.h> 74 #include <sys/sockio.h> 75 #define USE_HAIKU_CODE 68 76 #endif 69 77 … … 433 441 #endif /* #ifdef USE_WIN32_CODE */ 434 442 443 #ifdef USE_HAIKU_CODE 444 int getdefaultgateway(in_addr_t *addr) 445 { 446 int fd, ret = -1; 447 struct ifconf config; 448 void *buffer = NULL; 449 struct ifreq *interface; 450 451 if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { 452 return -1; 453 } 454 if (ioctl(fd, SIOCGRTSIZE, &config, sizeof(config)) != 0) { 455 goto fail; 456 } 457 if (config.ifc_value < 1) { 458 goto fail; /* No routes */ 459 } 460 if ((buffer = malloc(config.ifc_value)) == NULL) { 461 goto fail; 462 } 463 config.ifc_len = config.ifc_value; 464 config.ifc_buf = buffer; 465 if (ioctl(fd, SIOCGRTTABLE, &config, sizeof(config)) != 0) { 466 goto fail; 467 } 468 for (interface = buffer; 469 (uint8_t *)interface < (uint8_t *)buffer + config.ifc_len; ) { 470 struct route_entry route = interface->ifr_route; 471 int intfSize; 472 if (route.flags & (RTF_GATEWAY | RTF_DEFAULT)) { 473 *addr = ((struct sockaddr_in *)route.gateway)->sin_addr.s_addr; 474 ret = 0; 475 break; 476 } 477 intfSize = sizeof(route) + IF_NAMESIZE; 478 if (route.destination != NULL) { 479 intfSize += route.destination->sa_len; 480 } 481 if (route.mask != NULL) { 482 intfSize += route.mask->sa_len; 483 } 484 if (route.gateway != NULL) { 485 intfSize += route.gateway->sa_len; 486 } 487 interface = (struct ifreq *)((uint8_t *)interface + intfSize); 488 } 489 fail: 490 free(buffer); 491 close(fd); 492 return ret; 493 } 494 #endif /* #ifdef USE_HAIKU_CODE */ 495 496 -
trunk/third-party/libnatpmp/natpmp.c
r8735 r8798 81 81 } 82 82 83 int sendpendingrequest(natpmp_t * p)83 static int sendpendingrequest(natpmp_t * p) 84 84 { 85 85 int r; … … 97 97 } 98 98 99 int sendnatpmprequest(natpmp_t * p)99 static int sendnatpmprequest(natpmp_t * p) 100 100 { 101 101 int n; -
trunk/third-party/miniupnp/Changelog.txt
r7837 r8798 1 $Id: Changelog.txt,v 1. 77 2008/12/18 17:47:32nanard Exp $1 $Id: Changelog.txt,v 1.82 2009/07/09 16:14:06 nanard Exp $ 2 2 miniUPnP client Changelog. 3 4 2009/07/09: 5 Compile under Haiku 6 generate miniupnpcstrings.h.in from miniupnpcstrings.h 7 8 2009/06/04: 9 patching to compile under CygWin and cross compile for minGW 10 11 2009/04/17: 12 updating python module 13 Use strtoull() when using C99 14 15 2009/02/28: 16 Fixed miniwget.c for compiling under sun 3 17 4 18 2008/12/18: -
trunk/third-party/miniupnp/README
r8735 r8798 1 1 MiniUPnP is written by Thomas Bernard. 2 2 Its homepage is http://miniupnp.free.fr/ 3 This is from miniupnpc-20090 605.tar.gz3 This is from miniupnpc-20090713.tar.gz -
trunk/third-party/miniupnp/miniupnpc.c
r7837 r8798 1 /* $Id: miniupnpc.c,v 1.5 7 2008/12/18 17:46:36 nanard Exp $ */1 /* $Id: miniupnpc.c,v 1.58 2009/07/09 15:59:46 nanard Exp $ */ 2 2 /* Project : miniupnp 3 3 * Author : Thomas BERNARD … … 11 11 /* Win32 Specific includes and defines */ 12 12 #include <winsock2.h> 13 #include < Ws2tcpip.h>13 #include <ws2tcpip.h> 14 14 #include <io.h> 15 15 #define snprintf _snprintf … … 50 50 51 51 /* root description parsing */ 52 void parserootdesc(const char * buffer, int bufsize, struct IGDdatas * data)52 LIBSPEC void parserootdesc(const char * buffer, int bufsize, struct IGDdatas * data) 53 53 { 54 54 struct xmlparser parser; … … 341 341 * It is up to the caller to free the chained list 342 342 * delay is in millisecond (poll) */ 343 struct UPNPDev * upnpDiscover(int delay, const char * multicastif,343 LIBSPEC struct UPNPDev * upnpDiscover(int delay, const char * multicastif, 344 344 const char * minissdpdsock, int sameport) 345 345 { … … 490 490 /* freeUPNPDevlist() should be used to 491 491 * free the chained list returned by upnpDiscover() */ 492 void freeUPNPDevlist(struct UPNPDev * devlist)492 LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist) 493 493 { 494 494 struct UPNPDev * next; … … 526 526 /* Prepare the Urls for usage... 527 527 */ 528 void GetUPNPUrls(struct UPNPUrls * urls, struct IGDdatas * data,528 LIBSPEC void GetUPNPUrls(struct UPNPUrls * urls, struct IGDdatas * data, 529 529 const char * descURL) 530 530 { … … 569 569 } 570 570 571 void571 LIBSPEC void 572 572 FreeUPNPUrls(struct UPNPUrls * urls) 573 573 { … … 627 627 } 628 628 629 int629 static int 630 630 UPNPIGD_IsConnected(struct UPNPUrls * urls, struct IGDdatas * data) 631 631 { … … 656 656 * free allocated memory. 657 657 */ 658 int658 LIBSPEC int 659 659 UPNP_GetValidIGD(struct UPNPDev * devlist, 660 660 struct UPNPUrls * urls, -
trunk/third-party/miniupnp/miniupnpcstrings.h
r8735 r8798 1 /* $Id: miniupnpcstrings.h ,v 1.3 2009/06/04 09:05:56nanard Exp $ */1 /* $Id: miniupnpcstrings.h.in,v 1.1 2009/07/09 16:13:31 nanard Exp $ */ 2 2 /* Project: miniupnp 3 3 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ … … 9 9 #define __MINIUPNPCSTRINGS_H__ 10 10 11 #define OS_STRING " OpenBSD/4.3"11 #define OS_STRING "RedHatEnterpriseClient/5.3" 12 12 #define MINIUPNPC_VERSION_STRING "1.3" 13 13 -
trunk/third-party/miniupnp/miniwget.c
r8263 r8798 32 32 33 33 #include "miniupnpcstrings.h" 34 #include "miniwget.h" 34 35 35 36 /* miniwget2() : -
trunk/third-party/miniupnp/minixml.c
r3731 r8798 36 36 * return 0 (false) in case of success and -1 (true) if the end 37 37 * of the xmlbuffer is reached. */ 38 int parseatt(struct xmlparser * p)38 static int parseatt(struct xmlparser * p) 39 39 { 40 40 const char * attname; … … 107 107 /* parseelt parse the xml stream and 108 108 * call the callback functions when needed... */ 109 void parseelt(struct xmlparser * p)109 static void parseelt(struct xmlparser * p) 110 110 { 111 111 int i; -
trunk/third-party/miniupnp/upnpcommands.c
r8263 r8798 1 /* $Id: upnpcommands.c,v 1.2 4 2009/04/17 21:21:19nanard Exp $ */1 /* $Id: upnpcommands.c,v 1.25 2009/07/09 16:00:42 nanard Exp $ */ 2 2 /* Project : miniupnp 3 3 * Author : Thomas Bernard … … 20 20 /* 21 21 * */ 22 UNSIGNED_INTEGER22 LIBSPEC UNSIGNED_INTEGER 23 23 UPNP_GetTotalBytesSent(const char * controlURL, 24 24 const char * servicetype) … … 40 40 /* 41 41 * */ 42 UNSIGNED_INTEGER42 LIBSPEC UNSIGNED_INTEGER 43 43 UPNP_GetTotalBytesReceived(const char * controlURL, 44 44 const char * servicetype) … … 60 60 /* 61 61 * */ 62 UNSIGNED_INTEGER62 LIBSPEC UNSIGNED_INTEGER 63 63 UPNP_GetTotalPacketsSent(const char * controlURL, 64 64 const char * servicetype) … … 80 80 /* 81 81 * */ 82 UNSIGNED_INTEGER82 LIBSPEC UNSIGNED_INTEGER 83 83 UPNP_GetTotalPacketsReceived(const char * controlURL, 84 84 const char * servicetype) … … 100 100 /* UPNP_GetStatusInfo() call the corresponding UPNP method 101 101 * returns the current status and uptime */ 102 int UPNP_GetStatusInfo(const char * controlURL, 103 const char * servicetype, 104 char * status, 105 unsigned int * uptime, 106 char * lastconnerror) 102 LIBSPEC int 103 UPNP_GetStatusInfo(const char * controlURL, 104 const char * servicetype, 105 char * status, 106 unsigned int * uptime, 107 char * lastconnerror) 107 108 { 108 109 struct NameValueParserData pdata; … … 160 161 /* UPNP_GetConnectionTypeInfo() call the corresponding UPNP method 161 162 * returns the connection type */ 162 int UPNP_GetConnectionTypeInfo(const char * controlURL, 163 const char * servicetype, 164 char * connectionType) 163 LIBSPEC int 164 UPNP_GetConnectionTypeInfo(const char * controlURL, 165 const char * servicetype, 166 char * connectionType) 165 167 { 166 168 struct NameValueParserData pdata; … … 199 201 * Note : GetLinkLayerMaxBitRates belongs to WANPPPConnection:1 only 200 202 * We can use the GetCommonLinkProperties from WANCommonInterfaceConfig:1 */ 201 int UPNP_GetLinkLayerMaxBitRates(const char * controlURL, const char * servicetype, unsigned int * bitrateDown, unsigned int* bitrateUp) 203 LIBSPEC int 204 UPNP_GetLinkLayerMaxBitRates(const char * controlURL, 205 const char * servicetype, 206 unsigned int * bitrateDown, 207 unsigned int* bitrateUp) 202 208 { 203 209 struct NameValueParserData pdata; … … 227 233 ret = UPNPCOMMAND_SUCCESS; 228 234 229 if(bitrateDown) 230 { 235 if(bitrateDown) { 231 236 if(down) 232 237 sscanf(down,"%u",bitrateDown); … … 235 240 } 236 241 237 if(bitrateUp) 238 { 242 if(bitrateUp) { 239 243 if(up) 240 244 sscanf(up,"%u",bitrateUp); … … 263 267 * 501 Action Failed - See UPnP Device Architecture section on Control. 264 268 */ 265 int UPNP_GetExternalIPAddress(const char * controlURL, 266 const char * servicetype, 267 char * extIpAdd) 269 LIBSPEC int 270 UPNP_GetExternalIPAddress(const char * controlURL, 271 const char * servicetype, 272 char * extIpAdd) 268 273 { 269 274 struct NameValueParserData pdata; … … 298 303 } 299 304 300 int305 LIBSPEC int 301 306 UPNP_AddPortMapping(const char * controlURL, const char * servicetype, 302 307 const char * extPort, … … 352 357 } 353 358 354 int359 LIBSPEC int 355 360 UPNP_DeletePortMapping(const char * controlURL, const char * servicetype, 356 361 const char * extPort, const char * proto, … … 392 397 } 393 398 394 int UPNP_GetGenericPortMappingEntry(const char * controlURL, 395 const char * servicetype, 396 const char * index, 397 char * extPort, 398 char * intClient, 399 char * intPort, 400 char * protocol, 401 char * desc, 402 char * enabled, 403 char * rHost, 404 char * duration) 399 LIBSPEC int 400 UPNP_GetGenericPortMappingEntry(const char * controlURL, 401 const char * servicetype, 402 const char * index, 403 char * extPort, 404 char * intClient, 405 char * intPort, 406 char * protocol, 407 char * desc, 408 char * enabled, 409 char * rHost, 410 char * duration) 405 411 { 406 412 struct NameValueParserData pdata; … … 481 487 } 482 488 483 int UPNP_GetPortMappingNumberOfEntries(const char * controlURL, const char * servicetype, unsigned int * numEntries) 489 LIBSPEC int 490 UPNP_GetPortMappingNumberOfEntries(const char * controlURL, 491 const char * servicetype, 492 unsigned int * numEntries) 484 493 { 485 494 struct NameValueParserData pdata; … … 514 523 * the result is returned in the intClient and intPort strings 515 524 * please provide 16 and 6 bytes of data */ 516 int525 LIBSPEC int 517 526 UPNP_GetSpecificPortMappingEntry(const char * controlURL, 518 527 const char * servicetype, -
trunk/third-party/miniupnp/upnpreplyparse.h
r5094 r8798 1 /* $Id: upnpreplyparse.h,v 1. 8 2008/02/21 13:05:27nanard Exp $ */1 /* $Id: upnpreplyparse.h,v 1.10 2009/07/09 16:01:50 nanard Exp $ */ 2 2 /* MiniUPnP project 3 3 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 * (c) 2006 Thomas Bernard4 * (c) 2006-2009 Thomas Bernard 5 5 * This software is subject to the conditions detailed 6 6 * in the LICENCE file provided within the distribution */ … … 9 9 #define __UPNPREPLYPARSE_H__ 10 10 11 #if defined(NO_SYS_QUEUE_H) || defined(WIN32) 11 #if defined(NO_SYS_QUEUE_H) || defined(WIN32) || defined(__HAIKU__) 12 12 #include "bsdqueue.h" 13 13 #else
Note: See TracChangeset
for help on using the changeset viewer.