mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
Work on bug #48730: Enums should be used instead of multiple defines (where applicable)
This commit is contained in:
parent
36b9caed23
commit
6dcb2b2415
@ -205,10 +205,12 @@ static u16_t dns_txid;
|
|||||||
#define DNS_FLAG2_ERR_NAME 0x03
|
#define DNS_FLAG2_ERR_NAME 0x03
|
||||||
|
|
||||||
/* DNS protocol states */
|
/* DNS protocol states */
|
||||||
#define DNS_STATE_UNUSED 0
|
typedef enum {
|
||||||
#define DNS_STATE_NEW 1
|
DNS_STATE_UNUSED = 0,
|
||||||
#define DNS_STATE_ASKING 2
|
DNS_STATE_NEW = 1,
|
||||||
#define DNS_STATE_DONE 3
|
DNS_STATE_ASKING = 2,
|
||||||
|
DNS_STATE_DONE = 3
|
||||||
|
} dns_state_enum_t;
|
||||||
|
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
# include "arch/bpstruct.h"
|
# include "arch/bpstruct.h"
|
||||||
|
@ -57,44 +57,46 @@ typedef LWIP_ERR_T err_t;
|
|||||||
typedef s8_t err_t;
|
typedef s8_t err_t;
|
||||||
#endif /* LWIP_ERR_T*/
|
#endif /* LWIP_ERR_T*/
|
||||||
|
|
||||||
/* Definitions for error constants. */
|
/** Definitions for error constants. */
|
||||||
|
typedef enum {
|
||||||
/** No error, everything OK. */
|
/** No error, everything OK. */
|
||||||
#define ERR_OK 0
|
ERR_OK = 0,
|
||||||
/** Out of memory error. */
|
/** Out of memory error. */
|
||||||
#define ERR_MEM -1
|
ERR_MEM = -1,
|
||||||
/** Buffer error. */
|
/** Buffer error. */
|
||||||
#define ERR_BUF -2
|
ERR_BUF = -2,
|
||||||
/** Timeout. */
|
/** Timeout. */
|
||||||
#define ERR_TIMEOUT -3
|
ERR_TIMEOUT = -3,
|
||||||
/** Routing problem. */
|
/** Routing problem. */
|
||||||
#define ERR_RTE -4
|
ERR_RTE = -4,
|
||||||
/** Operation in progress */
|
/** Operation in progress */
|
||||||
#define ERR_INPROGRESS -5
|
ERR_INPROGRESS = -5,
|
||||||
/** Illegal value. */
|
/** Illegal value. */
|
||||||
#define ERR_VAL -6
|
ERR_VAL = -6,
|
||||||
/** Operation would block. */
|
/** Operation would block. */
|
||||||
#define ERR_WOULDBLOCK -7
|
ERR_WOULDBLOCK = -7,
|
||||||
/** Address in use. */
|
/** Address in use. */
|
||||||
#define ERR_USE -8
|
ERR_USE = -8,
|
||||||
/** Already connecting. */
|
/** Already connecting. */
|
||||||
#define ERR_ALREADY -9
|
ERR_ALREADY = -9,
|
||||||
/** Conn already established.*/
|
/** Conn already established.*/
|
||||||
#define ERR_ISCONN -10
|
ERR_ISCONN = -10,
|
||||||
/** Not connected. */
|
/** Not connected. */
|
||||||
#define ERR_CONN -11
|
ERR_CONN = -11,
|
||||||
/** Low-level netif error */
|
/** Low-level netif error */
|
||||||
#define ERR_IF -12
|
ERR_IF = -12,
|
||||||
|
|
||||||
|
/** Connection aborted. */
|
||||||
|
ERR_ABRT = -13,
|
||||||
|
/** Connection reset. */
|
||||||
|
ERR_RST = -14,
|
||||||
|
/** Connection closed. */
|
||||||
|
ERR_CLSD = -15,
|
||||||
|
/** Illegal argument. */
|
||||||
|
ERR_ARG = -16
|
||||||
|
} err_enum_t;
|
||||||
|
|
||||||
#define ERR_IS_FATAL(e) ((e) <= ERR_ABRT)
|
#define ERR_IS_FATAL(e) ((e) <= ERR_ABRT)
|
||||||
/** Connection aborted. */
|
|
||||||
#define ERR_ABRT -13
|
|
||||||
/** Connection reset. */
|
|
||||||
#define ERR_RST -14
|
|
||||||
/** Connection closed. */
|
|
||||||
#define ERR_CLSD -15
|
|
||||||
/** Illegal argument. */
|
|
||||||
#define ERR_ARG -16
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
Loading…
Reference in New Issue
Block a user