lwip-1.4.1 (partial)

Dependents:   IGLOO_board

Committer:
ua1arn
Date:
Tue Jul 24 17:36:01 2018 +0000
Revision:
1:119c4f7144c8
Parent:
0:c2ca3c5ded62
lwip 1.4.1 with necessary servers

Who changed what in which revision?

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