• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * @file
3  * lwIP Error codes
4  */
5 /*
6  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without modification,
10  * are permitted provided that the following conditions are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright notice,
13  *    this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  *    this list of conditions and the following disclaimer in the documentation
16  *    and/or other materials provided with the distribution.
17  * 3. The name of the author may not be used to endorse or promote products
18  *    derived from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
21  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
23  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
25  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
28  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
29  * OF SUCH DAMAGE.
30  *
31  * This file is part of the lwIP TCP/IP stack.
32  *
33  * Author: Adam Dunkels <adam@sics.se>
34  *
35  */
36 #ifndef LWIP_HDR_ERR_H
37 #define LWIP_HDR_ERR_H
38 
39 #include "lwip/opt.h"
40 #include "lwip/arch.h"
41 
42 #if defined (__cplusplus) && __cplusplus
43 extern "C" {
44 #endif
45 
46 /**
47  * @defgroup infrastructure_errors Error codes
48  * @ingroup infrastructure
49  * @{
50  */
51 
52 /** Define LWIP_ERR_T in cc.h if you want to use
53  *  a different type for your platform (must be signed). */
54 #ifdef LWIP_ERR_T
55 typedef LWIP_ERR_T err_t;
56 #else /* LWIP_ERR_T */
57 typedef s32_t err_t;
58 #endif /* LWIP_ERR_T*/
59 
60 /** @cond liteosdebug
61 * Definitions for error constants. */
62 typedef enum {
63   /** No error, everything OK. */
64   ERR_OK         = 0,
65   /** Out of memory error.     */
66   ERR_MEM        = -1,
67   /** Buffer error.            */
68   ERR_BUF        = -2,
69   /** Timeout.                 */
70   ERR_TIMEOUT    = -3,
71   /** Routing problem.         */
72   ERR_RTE        = -4,
73   /** Operation in progress    */
74   ERR_INPROGRESS = -5,
75   /** Illegal value.           */
76   ERR_VAL        = -6,
77   /** Operation would block.   */
78   ERR_WOULDBLOCK = -7,
79   /** Address in use.          */
80   ERR_USE        = -8,
81   /** Already connecting.      */
82   ERR_ALREADY    = -9,
83   /** Conn already established. */
84   ERR_ISCONN     = -10,
85   /** Not connected.           */
86   ERR_CONN       = -11,
87   /** Low-level netif error    */
88   ERR_IF         = -12,
89   /** Message too long.        */
90   ERR_MSGSIZE    = -13,
91   /** No such device.          */
92   ERR_NODEV      = -14,
93   /** No such device or address. */
94   ERR_NODEVADDR  = -15,
95   /** socket is not connection-mode & no peer address is set */
96   ERR_NODEST     = -16,
97   /** Network is down           */
98   ERR_NETDOWN    = -17,
99   /** Address family not supported by protocol */
100   ERR_AFNOSUPP   = -18,
101   /** No such address */
102   ERR_NOADDR = -19,
103   /** Operation not supported on transport endpoint */
104   ERR_OPNOTSUPP = -20,
105 
106   ERR_NETUNREACH = -21,
107 
108   /** connection request timedout */
109   ERR_CONNECTIMEOUT = -22,
110   /** Error pipe */
111   ERR_PIPE       = -23,
112   /** AF not supported */
113   ERR_AFNOSUPPORT = -24,
114   /** Protocol not available */
115   ERR_NOPROTOOPT = -25,
116 
117   ERR_ACCESS   = -26,
118   ERR_NFILE   = -27,
119   ERR_RESERVE3   = -28,
120   ERR_RESERVE4   = -29,
121   ERR_RESERVE5   = -30,
122   ERR_RESERVE6   = -31,
123   ERR_FATAL_START = -32,
124 
125   /** Connection aborted.      */
126   ERR_ABRT       = -33,
127   /** Connection reset.        */
128   ERR_RST        = -34,
129   /** Connection closed.       */
130   ERR_CLSD       = -35,
131   /** Illegal argument.       @endcond */
132   ERR_ARG        = -36,
133 
134   ERR_CONNREFUSED = -37,
135 
136   /** User can't overwrite the existing neighbor entry */
137   ERR_NBR_OVERWRITEFORBIDDEN = -38,
138 
139   /** Neighbor information not found */
140   ERR_NBR_NOTFOUND = -39,
141 
142   /** Default router information not found */
143   ERR_DEFAULT_ROUTER_NOTFOUND = -40,
144 
145   /** IPv6 Prefix information not found */
146   ERR_PREFIX_NOT_FOUND = -41,
147 
148   /** No free memory available */
149   ERR_NO_FREE_ENTRY = -42,
150 
151   /** Default route entry already exists */
152   ERR_DEFAULT_ROUTE_EXISTS = -43,
153 
154   /** Prefix entry already exists */
155   ERR_PREFIX_EXISTS = -44,
156 
157   /** 6lowpan context infomation not found */
158   ERR_LOWPAN_CTX_NOTFOUND = -45,
159 
160   /** Neighbor restriction related error code */
161   ERR_NBR_NOMORE_DCHILD = -46,
162 
163   ERR_DROP_NEW_NBR = -47,
164 
165   ERR_MAX_VAL = -48
166 } err_enum_t;
167 
168 
169 #define ERR_IS_FATAL(e) ((e) < ERR_FATAL_START)
170 #ifdef LWIP_DEBUG
171 extern const char *lwip_strerr(err_t err);
172 #else
173 #define lwip_strerr(x) ""
174 #endif /* LWIP_DEBUG */
175 
176 
177 #if defined (__cplusplus) && __cplusplus
178 }
179 #endif
180 
181 #endif /* LWIP_HDR_ERR_H */
182