From a6bc4227291c633f0efe889614560dc844ecfbae Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Mon, 5 Dec 2016 21:53:43 +0100 Subject: [PATCH] Move declaration of struct ip4_addr_packed and ip4_addr_p_t to prot/ip4.h The types are used in structs declared in ip4.h. --- src/include/lwip/ip4_addr.h | 15 --------------- src/include/lwip/prot/ip4.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/include/lwip/ip4_addr.h b/src/include/lwip/ip4_addr.h index 166acfab..0181d87f 100644 --- a/src/include/lwip/ip4_addr.h +++ b/src/include/lwip/ip4_addr.h @@ -52,24 +52,9 @@ struct ip4_addr { u32_t addr; }; -/** This is the packed version of ip4_addr_t, - used in network headers that are itself packed */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip4_addr_packed { - PACK_STRUCT_FIELD(u32_t addr); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - /** ip4_addr_t uses a struct for convenience only, so that the same defines can * operate both on ip4_addr_t as well as on ip4_addr_p_t. */ typedef struct ip4_addr ip4_addr_t; -typedef struct ip4_addr_packed ip4_addr_p_t; /** * struct ipaddr2 is used in the definition of the ARP packet format in diff --git a/src/include/lwip/prot/ip4.h b/src/include/lwip/prot/ip4.h index c3c34038..bd442c68 100644 --- a/src/include/lwip/prot/ip4.h +++ b/src/include/lwip/prot/ip4.h @@ -44,6 +44,22 @@ extern "C" { #endif +/** This is the packed version of ip4_addr_t, + used in network headers that are itself packed */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ip4_addr_packed { + PACK_STRUCT_FIELD(u32_t addr); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +typedef struct ip4_addr_packed ip4_addr_p_t; + /* Size of the IPv4 header. Same as 'sizeof(struct ip_hdr)'. */ #define IP_HLEN 20