Donatien Garnier / LwIPNetworking

Dependencies:   DebugLib Socket lwip lwip-sys

Dependents:   EthernetInterface

Fork of NetworkingCoreLib by Donatien Garnier

Committer:
donatien
Date:
Thu May 24 14:49:40 2012 +0000
Revision:
0:013f5d54248c
Initial Commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
donatien 0:013f5d54248c 1 /**
donatien 0:013f5d54248c 2 * @file
donatien 0:013f5d54248c 3 * Error Management module
donatien 0:013f5d54248c 4 *
donatien 0:013f5d54248c 5 */
donatien 0:013f5d54248c 6
donatien 0:013f5d54248c 7 /*
donatien 0:013f5d54248c 8 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
donatien 0:013f5d54248c 9 * All rights reserved.
donatien 0:013f5d54248c 10 *
donatien 0:013f5d54248c 11 * Redistribution and use in source and binary forms, with or without modification,
donatien 0:013f5d54248c 12 * are permitted provided that the following conditions are met:
donatien 0:013f5d54248c 13 *
donatien 0:013f5d54248c 14 * 1. Redistributions of source code must retain the above copyright notice,
donatien 0:013f5d54248c 15 * this list of conditions and the following disclaimer.
donatien 0:013f5d54248c 16 * 2. Redistributions in binary form must reproduce the above copyright notice,
donatien 0:013f5d54248c 17 * this list of conditions and the following disclaimer in the documentation
donatien 0:013f5d54248c 18 * and/or other materials provided with the distribution.
donatien 0:013f5d54248c 19 * 3. The name of the author may not be used to endorse or promote products
donatien 0:013f5d54248c 20 * derived from this software without specific prior written permission.
donatien 0:013f5d54248c 21 *
donatien 0:013f5d54248c 22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
donatien 0:013f5d54248c 23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
donatien 0:013f5d54248c 24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
donatien 0:013f5d54248c 25 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
donatien 0:013f5d54248c 26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
donatien 0:013f5d54248c 27 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
donatien 0:013f5d54248c 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
donatien 0:013f5d54248c 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
donatien 0:013f5d54248c 30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
donatien 0:013f5d54248c 31 * OF SUCH DAMAGE.
donatien 0:013f5d54248c 32 *
donatien 0:013f5d54248c 33 * This file is part of the lwIP TCP/IP stack.
donatien 0:013f5d54248c 34 *
donatien 0:013f5d54248c 35 * Author: Adam Dunkels <adam@sics.se>
donatien 0:013f5d54248c 36 *
donatien 0:013f5d54248c 37 */
donatien 0:013f5d54248c 38
donatien 0:013f5d54248c 39 #include "lwip/err.h"
donatien 0:013f5d54248c 40
donatien 0:013f5d54248c 41 #ifdef LWIP_DEBUG
donatien 0:013f5d54248c 42
donatien 0:013f5d54248c 43 static const char *err_strerr[] = {
donatien 0:013f5d54248c 44 "Ok.", /* ERR_OK 0 */
donatien 0:013f5d54248c 45 "Out of memory error.", /* ERR_MEM -1 */
donatien 0:013f5d54248c 46 "Buffer error.", /* ERR_BUF -2 */
donatien 0:013f5d54248c 47 "Timeout.", /* ERR_TIMEOUT -3 */
donatien 0:013f5d54248c 48 "Routing problem.", /* ERR_RTE -4 */
donatien 0:013f5d54248c 49 "Operation in progress.", /* ERR_INPROGRESS -5 */
donatien 0:013f5d54248c 50 "Illegal value.", /* ERR_VAL -6 */
donatien 0:013f5d54248c 51 "Operation would block.", /* ERR_WOULDBLOCK -7 */
donatien 0:013f5d54248c 52 "Address in use.", /* ERR_USE -8 */
donatien 0:013f5d54248c 53 "Already connected.", /* ERR_ISCONN -9 */
donatien 0:013f5d54248c 54 "Connection aborted.", /* ERR_ABRT -10 */
donatien 0:013f5d54248c 55 "Connection reset.", /* ERR_RST -11 */
donatien 0:013f5d54248c 56 "Connection closed.", /* ERR_CLSD -12 */
donatien 0:013f5d54248c 57 "Not connected.", /* ERR_CONN -13 */
donatien 0:013f5d54248c 58 "Illegal argument.", /* ERR_ARG -14 */
donatien 0:013f5d54248c 59 "Low-level netif error.", /* ERR_IF -15 */
donatien 0:013f5d54248c 60 };
donatien 0:013f5d54248c 61
donatien 0:013f5d54248c 62 /**
donatien 0:013f5d54248c 63 * Convert an lwip internal error to a string representation.
donatien 0:013f5d54248c 64 *
donatien 0:013f5d54248c 65 * @param err an lwip internal err_t
donatien 0:013f5d54248c 66 * @return a string representation for err
donatien 0:013f5d54248c 67 */
donatien 0:013f5d54248c 68 const char *
donatien 0:013f5d54248c 69 lwip_strerr(err_t err)
donatien 0:013f5d54248c 70 {
donatien 0:013f5d54248c 71 return err_strerr[-err];
donatien 0:013f5d54248c 72
donatien 0:013f5d54248c 73 }
donatien 0:013f5d54248c 74
donatien 0:013f5d54248c 75 #endif /* LWIP_DEBUG */