Embedded TCP/IP stack  4.7.0
fnet_error.h
1 /**************************************************************************
2 *
3 * Copyright 2008-2018 by Andrey Butok. FNET Community.
4 *
5 ***************************************************************************
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ***************************************************************************
20 *
21 * Socket error API definitions.
22 *
23 ***************************************************************************/
24 #ifndef _FNET_ERROR_H_
25 
26 #define _FNET_ERROR_H_
27 
37 /**************************************************************************/
41 typedef enum
42 {
43  FNET_ERR_OK = (0),
50  FNET_ERR_NOMEM = (-3),
54  FNET_ERR_AGAIN = (-4),
66  FNET_ERR_INVAL = (-6),
134  FNET_ERR_ISCONN = (-19),
180 } fnet_error_t;
181 
182 #if defined(__cplusplus)
183 extern "C" {
184 #endif
185 
186 /***************************************************************************/
206 
207 /***************************************************************************/
222 void fnet_error_set( fnet_error_t error );
223 
224 #if defined(__cplusplus)
225 }
226 #endif
227 
230 #endif
Network subsystem is unavailable. The stack is not initialized.
Definition: fnet_error.h:160
The socket has not been bound with fnet_socket_bind(). A socket must be bound to an address before c...
Definition: fnet_error.h:62
The action is in progress. An operation was attempted on a socket that already had an operation in p...
Definition: fnet_error.h:147
Cannot allocate the memory. The error is indicating a lack of required memory resources.
Definition: fnet_error.h:50
fnet_error_t fnet_error_get(void)
Returns the last error that occurred.
No more socket descriptors are available. An application has opened too many sockets. The maximum number of available socket descriptors is defined by the FNET_CFG_SOCKET_MAX.
Definition: fnet_error.h:45
Connection reset by peer. A connection was forcibly closed by the remote host. This normally result...
Definition: fnet_error.h:124
Protocol not supported. This error occurs if an application attempts to call fnet_socket() and the r...
Definition: fnet_error.h:84
Socket is not connected. A request to send or receive data was not allowed because the socket is not...
Definition: fnet_error.h:138
Invalid argument. An invalid argument was supplied.
Definition: fnet_error.h:66
Software caused the connection abort. An established connection was aborted due to a data transmissi...
Definition: fnet_error.h:120
Operation not supported. The attempted operation is not supported for the type of socket referenced...
Definition: fnet_error.h:89
void fnet_error_set(fnet_error_t error)
Sets the error code.
Destination address required. A required address was omitted from an operation on a socket...
Definition: fnet_error.h:69
Cannot assign the requested address. The requested address is not valid in its context. It normally results from an attempt to fnet_socket_bind() to an address that is not valid for the local machine. This may also result from fnet_socket_connect(), when the remote address or port is not valid for a remote machine (for example address or port is 0).
Definition: fnet_error.h:108
Address family not supported by the protocol family. The stack supports only the AF_INET family...
Definition: fnet_error.h:95
Socket is already connected. A fnet_socket_connect() or fnet_socket_listen() request was made on an ...
Definition: fnet_error.h:134
The connection has timed out. A connection attempt failed because the connected party did not proper...
Definition: fnet_error.h:153
Message too long. A message sent on a datagram socket was larger than the internal message buffer...
Definition: fnet_error.h:74
Connection closed by peer. The final (FIN) segment arrived and there is no data in the socket recei...
Definition: fnet_error.h:163
Address already in use. This error occurs, if an application attempts to fnet_socket_bind() or fnet_...
Definition: fnet_error.h:101
There is no error.
Definition: fnet_error.h:43
fnet_error_t
Possible socket error codes, returned by the fnet_error_get(), or used by the SO_ERROR option...
Definition: fnet_error.h:41
The socket has been shut down. A request to send or receive data was not allowed because the socket ...
Definition: fnet_error.h:142
No route to a host. A socket operation was attempted to an unreachable host.
Definition: fnet_error.h:157
Bad protocol option. An unknown, invalid, or unsupported option or level was specified in the fnet_...
Definition: fnet_error.h:79
Try again, a retry at some time later may be successful. This error is returned from operations on s...
Definition: fnet_error.h:54
Bad socket descriptor. An operation was attempted on a socket descriptor that does not refer to a va...
Definition: fnet_error.h:176
IP operation is disabled. It happens when Duplicate Address Detection fails for interface link-loca...
Definition: fnet_error.h:171
The network is unreachable. This error occurs, if socket cannot function at this time...
Definition: fnet_error.h:115

© 2005-2020 by Andrej Butok. http://fnet.sourceforge.net