Convert state #defines in autoip.h and dhcp.h to enums. May be useful in *_state structs to simplify debugging in the future.

This commit is contained in:
Dirk Ziegelmeier 2016-08-11 21:04:39 +02:00
parent 6f62fe5998
commit b34baff546
2 changed files with 25 additions and 19 deletions

View File

@ -64,10 +64,12 @@ extern "C" {
#define DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */
/* AutoIP client states */
#define AUTOIP_STATE_OFF 0
#define AUTOIP_STATE_PROBING 1
#define AUTOIP_STATE_ANNOUNCING 2
#define AUTOIP_STATE_BOUND 3
typedef enum {
AUTOIP_STATE_OFF = 0,
AUTOIP_STATE_PROBING = 1,
AUTOIP_STATE_ANNOUNCING = 2,
AUTOIP_STATE_BOUND = 3
} autoip_state_enum_t;
#ifdef __cplusplus
}

View File

@ -98,23 +98,27 @@ PACK_STRUCT_END
/* DHCP client states */
#define DHCP_STATE_OFF 0
#define DHCP_STATE_REQUESTING 1
#define DHCP_STATE_INIT 2
#define DHCP_STATE_REBOOTING 3
#define DHCP_STATE_REBINDING 4
#define DHCP_STATE_RENEWING 5
#define DHCP_STATE_SELECTING 6
#define DHCP_STATE_INFORMING 7
#define DHCP_STATE_CHECKING 8
/* not yet implemented \#define DHCP_STATE_PERMANENT 9 */
#define DHCP_STATE_BOUND 10
/* not yet implemented \#define DHCP_STATE_RELEASING 11 */
#define DHCP_STATE_BACKING_OFF 12
typedef enum {
DHCP_STATE_OFF = 0,
DHCP_STATE_REQUESTING = 1,
DHCP_STATE_INIT = 2,
DHCP_STATE_REBOOTING = 3,
DHCP_STATE_REBINDING = 4,
DHCP_STATE_RENEWING = 5,
DHCP_STATE_SELECTING = 6,
DHCP_STATE_INFORMING = 7,
DHCP_STATE_CHECKING = 8,
DHCP_STATE_PERMANENT = 9, /* not yet implemented */
DHCP_STATE_BOUND = 10,
DHCP_STATE_RELEASING = 11, /* not yet implemented */
DHCP_STATE_BACKING_OFF = 12
} dhcp_state_enum_t;
/* AutoIP cooperation flags */
#define DHCP_AUTOIP_COOP_STATE_OFF 0
#define DHCP_AUTOIP_COOP_STATE_ON 1
typedef enum {
DHCP_AUTOIP_COOP_STATE_OFF = 0,
DHCP_AUTOIP_COOP_STATE_ON = 1
} dhcp_autoip_coop_state_enum_t;
/* DHCP op codes */
#define DHCP_BOOTREQUEST 1