api_msg.c, err.h, err.c, sockets.c, dns.c, dns.h: replace "enum dns_result" by err_t type. Add a new err_t code "ERR_INPROGRESS".

This commit is contained in:
fbernon
2007-12-13 23:06:49 +00:00
parent d2fa5c91a7
commit 2b54da5070
7 changed files with 73 additions and 91 deletions

View File

@@ -66,21 +66,6 @@
#define DNS_RRCLASS_HS 4 /* Hesiod [Dyer 87] */
#define DNS_RRCLASS_FLUSH 0x800 /* Flush bit */
/** enumerated list of possible result values returned by dns_gethostname() */
typedef enum dns_result {
/** dns_table is filled with queries, try again later */
DNS_ERR_MEM,
/** invalid hostname, hostname too long,
* invalid arguments or dns module not initialized */
DNS_QUERY_INVALID,
/** the hostname was enqueued for query,
* found callback will be called when resolved */
DNS_QUERY_QUEUED,
/** the hostname was found in the cache and was directly returned,
* found callback will not be called */
DNS_COMPLETE
} DNS_RESULT;
/** Callback which is invoked when a hostname is found.
* A function of this type must be implemented by the application using the DNS resolver.
* @param name pointer to the name that was looked up.
@@ -99,8 +84,8 @@ void dns_setserver(u8_t numdns, struct ip_addr *dnsserver);
struct ip_addr dns_getserver(u8_t numdns);
DNS_RESULT dns_gethostbyname(const char *hostname, struct ip_addr *addr,
dns_found_callback found, void *callback_arg);
err_t dns_gethostbyname(const char *hostname, struct ip_addr *addr,
dns_found_callback found, void *callback_arg);
#endif /* LWIP_DNS */

View File

@@ -42,28 +42,30 @@ typedef s8_t err_t;
/* Definitions for error constants. */
#define ERR_OK 0 /* No error, everything OK. */
#define ERR_MEM -1 /* Out of memory error. */
#define ERR_BUF -2 /* Buffer error. */
#define ERR_RTE -3 /* Routing problem. */
#define ERR_OK 0 /* No error, everything OK. */
#define ERR_MEM -1 /* Out of memory error. */
#define ERR_BUF -2 /* Buffer error. */
#define ERR_RTE -3 /* Routing problem. */
#define ERR_IS_FATAL(e) ((e) < ERR_RTE)
#define ERR_ABRT -4 /* Connection aborted. */
#define ERR_RST -5 /* Connection reset. */
#define ERR_CLSD -6 /* Connection closed. */
#define ERR_CONN -7 /* Not connected. */
#define ERR_ABRT -4 /* Connection aborted. */
#define ERR_RST -5 /* Connection reset. */
#define ERR_CLSD -6 /* Connection closed. */
#define ERR_CONN -7 /* Not connected. */
#define ERR_VAL -8 /* Illegal value. */
#define ERR_VAL -8 /* Illegal value. */
#define ERR_ARG -9 /* Illegal argument. */
#define ERR_ARG -9 /* Illegal argument. */
#define ERR_USE -10 /* Address in use. */
#define ERR_USE -10 /* Address in use. */
#define ERR_IF -11 /* Low-level netif error */
#define ERR_ISCONN -12 /* Already connected. */
#define ERR_IF -11 /* Low-level netif error */
#define ERR_ISCONN -12 /* Already connected. */
#define ERR_TIMEOUT -13 /* Timeout. */
#define ERR_TIMEOUT -13 /* Timeout. */
#define ERR_INPROGRESS -14 /* Operation in progress */
#ifdef LWIP_DEBUG