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