Synopsis
typedef enum {
  CTL_NET_CONFIGURATION_ERROR,
  CTL_NET_NOT_UP,
  CTL_NET_UNREACHABLE,
  CTL_DNS_HOST_NAME_ERROR,
  CTL_DNS_RESOLVE_IN_PROGRESS,
  CTL_DNS_OUT_OF_MEMORY,
  CTL_DNS_NAME_UNKNOWN,
  CTL_DNS_NO_DNS_SERVER,
  CTL_UDP_TOO_MANY_PORTS,
  CTL_UDP_PORT_IN_USE,
  CTL_TCP_PORT_ACTIVE,
  CTL_UDP_BAD_PORT,
  CTL_TCP_TOO_MANY_PORTS,
  CTL_TCP_BAD_PORT,
  CTL_TCP_PORT_NOT_BOUND,
  CTL_TCP_PORT_IN_USE,
  CTL_TCP_BAD_SOCKET,
  CTL_TCP_TOO_MANY_OPEN_SOCKETS,
  CTL_TCP_SOCKET_CLOSED,
  CTL_NET_ERR_WOULD_BLOCK,
  CTL_NET_ERR_ALREADY,
  CTL_NET_ERR_NOTSOCK,
  CTL_NET_ERR_OPNOTSUPP,
  CTL_NET_ERR_NETDOWN,
  CTL_NET_ERR_NETUNREACH,
  CTL_NET_ERR_CONNABORTED,
  CTL_NET_ERR_CONNRESET,
  CTL_NET_ERR_NOTCONN,
  CTL_NET_ERR_TIMEDOUT,
  CTL_NET_ERR_CONNREFUSED,
  CTL_NET_ERR_HOSTUNREACH,
  CTL_NET_ERR_NOTEMPTY,
  CTL_NET_ERR_DISCON
} CTL_NET_ERROR_t;
Description

CTL_NET_ERROR_t enumerates the errors that the TCP/IP Library generates.

CTL_NET_CONFIGURATION_ERROR
Indicates that the network library is not configured correctly. As delivered, the CTL network library is correctly configured and tested, so this error should not be seen by users. If you do see this error, please check your configuration.
CTL_NET_NOT_UP
Indicates that a call to ctl_dns_get_host_by_name timed out without the network stack coming up.
CTL_NET_UNREACHABLE
Indicates that a network packet needs to be delivered to an IP address that has no route. This can happen, for instance, when the packet has a non-local IP address which must be delivered to the gateway and no gateway has been configured either statically or by DHCP.
CTL_DNS_HOST_NAME_ERROR
Indicates that a host name is invalid, for instance it has a trailing period (foo.bar. is invalid), or the host name has more than 47 characters.
CTL_DNS_RESOLVE_IN_PROGRESS
Indicates that the requested host name is already being resolved. Typically, this status is returned by ctl_dns_get_host_by_name when a non-zero timeout is specified and the name did not resolve before the timeout.
CTL_DNS_OUT_OF_MEMORY
Indicates that the DNS resolver could not allocate memory using the DNS memory allocator when queuing a DNS request.
CTL_DNS_NAME_UNKNOWN
Indicates that the DNS resolver could not resolve the host name.
CTL_DNS_NO_DNS_SERVER
Indicates that no DNS server has been defined in order to resolve requests.
CTL_UDP_TOO_MANY_PORTS
Indicates that all UDP ports are bound and no unused port exists when using ctl_udp_bind.
CTL_UDP_PORT_IN_USE
Indicates that the client tried to bind a port using ctl_udp_bind but that port has already been bound.
CTL_UDP_BAD_PORT
Indicates that the port passed to ctl_udp_unbind is invalid or is not currently bound.
CTL_TCP_TOO_MANY_PORTS
Indicates that you have requested to bind a TCP ports using ctl_tcp_bind but there are no TCP ports left in the TCP port pool. You will need to increase the number of ports when calling ctl_tcp_init to initialize the TCP subsystem.
CTL_TCP_PORT_ACTIVE
Indicates that there are active, open sockets associated with a port when the port is unbound with ctl_tcp_unbind.
CTL_TCP_BAD_PORT
Indicates that an invalid TCP port has been provided as a parameter. Port numbers in API calls must be in network byte order and must specify a valid TCP port number, usually between 1 and 65535.
CTL_TCP_PORT_NOT_BOUND
Indicates that an unbound port parameter has been passed to an API call that requires a bound TCP port. Many API calls require bound ports, and you try to operate on a port that has not been bound using ctl_tcp_bind you will receive this error.
CTL_TCP_PORT_IN_USE
Indicates that a call to ctl_tcp_bind failed because the port provided is already being listened to. In order to specify a different listener for a port, the port must be first be unbound using ctl_tcp_unbind.
CTL_TCP_BAD_SOCKET
Indicates that the socket provided to a network API call is invalid because the socket has been closed (either by the client or by the network library), or has never been open.
CTL_TCP_TOO_MANY_SOCKETS
Indicates that an API call could not allocate a socket using ctl_tcp_socket. The number of sockets that the application can open is determined by the number of streams that the CTL library supports—one socket requires one stream, and other components, such as the mass storage library, will consume shared streams when you use them.
CTL_TCP_SOCKET_CLOSED
Indicates that the other TCP closed the socket whilst the client was waiting for data from the socket. In some cases the network library will return CTL_TCP_BAD_SOCKET for the same conditions if, on entry to the API call, the socket is already closed.

For socket-related errors, see ctl_tcp_get_socket_error.