Ignore:
Timestamp:
May 4, 2008, 10:09:33 PM (14 years ago)
Author:
charles
Message:

update to the miniupnpc-20080427 snapshot
update to the libnatpmp-20080428 snapshot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/third-party/libnatpmp/natpmp.c

    r4095 r5743  
    1 /* $Id: natpmp.c,v 1.4 2007/12/02 00:12:47 nanard Exp $ */
     1/* $Id: natpmp.c,v 1.6 2008/04/28 02:58:34 nanard Exp $ */
    22/* 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
    45 *
    56 * Permission to use, copy, modify, and/or distribute this software for any
     
    1415 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    1516 * 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
    1625#include <errno.h>
    17 #include <string.h>
    1826#include <unistd.h>
    1927#include <fcntl.h>
    20 #include <time.h>
    21 #include <sys/time.h>
    2228#include <sys/types.h>
    2329#include <sys/socket.h>
     30#endif
    2431#include "natpmp.h"
    2532#include "getgateway.h"
     
    248255}
    249256
     257#ifdef ENABLE_STRNATPMPERR
     258const 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
Note: See TracChangeset for help on using the changeset viewer.