diff --git a/src/core/dns.c b/src/core/dns.c index 6ad0b4b7..cc8dc852 100644 --- a/src/core/dns.c +++ b/src/core/dns.c @@ -183,6 +183,14 @@ struct dns_answer { /* maximum allowed size for the struct due to non-packed */ #define SIZEOF_DNS_ANSWER_ASSERT 12 +/* DNS table entry states */ +typedef enum { + DNS_STATE_UNUSED = 0, + DNS_STATE_NEW = 1, + DNS_STATE_ASKING = 2, + DNS_STATE_DONE = 3 +} dns_state_enum_t; + /** DNS table entry */ struct dns_table_entry { u32_t ttl; diff --git a/src/include/lwip/dhcp.h b/src/include/lwip/dhcp.h index f9bdb1ee..220342b3 100644 --- a/src/include/lwip/dhcp.h +++ b/src/include/lwip/dhcp.h @@ -58,6 +58,12 @@ extern "C" { #define DHCP_BOOT_FILE_LEN 128U +/* AutoIP cooperation flags (struct dhcp.autoip_coop_state) */ +typedef enum { + DHCP_AUTOIP_COOP_STATE_OFF = 0, + DHCP_AUTOIP_COOP_STATE_ON = 1 +} dhcp_autoip_coop_state_enum_t; + struct dhcp { /** transaction identifier of last sent request */ diff --git a/src/include/lwip/prot/dhcp.h b/src/include/lwip/prot/dhcp.h index c33aa04c..112953cb 100644 --- a/src/include/lwip/prot/dhcp.h +++ b/src/include/lwip/prot/dhcp.h @@ -114,12 +114,6 @@ typedef enum { DHCP_STATE_BACKING_OFF = 12 } dhcp_state_enum_t; -/* AutoIP cooperation flags */ -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 #define DHCP_BOOTREPLY 2 @@ -172,7 +166,7 @@ typedef enum { #define DHCP_OPTION_T2 59 /* T2 rebinding time */ #define DHCP_OPTION_US 60 #define DHCP_OPTION_CLIENT_ID 61 -#define DHCP_OPTION_TFTP_SERVERNAME 66 +#define DHCP_OPTION_TFTP_SERVERNAME 66 #define DHCP_OPTION_BOOTFILE 67 /* possible combinations of overloading the file and sname fields with options */ diff --git a/src/include/lwip/prot/dns.h b/src/include/lwip/prot/dns.h index 9998fb60..0a99ab0c 100644 --- a/src/include/lwip/prot/dns.h +++ b/src/include/lwip/prot/dns.h @@ -42,7 +42,7 @@ #include "lwip/arch.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -114,18 +114,9 @@ PACK_STRUCT_END # include "arch/epstruct.h" #endif #define SIZEOF_DNS_HDR 12 - -/* DNS protocol states */ -typedef enum { - DNS_STATE_UNUSED = 0, - DNS_STATE_NEW = 1, - DNS_STATE_ASKING = 2, - DNS_STATE_DONE = 3 -} dns_state_enum_t; -#ifdef __cplusplus +#ifdef __cplusplus } #endif -#endif /* LWIP_HDR_PROT_DNS_H */ - +#endif /* LWIP_HDR_PROT_DNS_H */ diff --git a/src/include/lwip/prot/icmp.h b/src/include/lwip/prot/icmp.h index b0005a6b..7d19385c 100644 --- a/src/include/lwip/prot/icmp.h +++ b/src/include/lwip/prot/icmp.h @@ -78,10 +78,9 @@ PACK_STRUCT_END # include "arch/epstruct.h" #endif +/* Compatibility defines, old versions used to combine type and code to an u16_t */ #define ICMPH_TYPE(hdr) ((hdr)->type) #define ICMPH_CODE(hdr) ((hdr)->code) - -/** Combines type and code to an u16_t */ #define ICMPH_TYPE_SET(hdr, t) ((hdr)->type = (t)) #define ICMPH_CODE_SET(hdr, c) ((hdr)->code = (c))