ip.h, etharp.c: Fix warnings & errors about LWIP_NETIF_HWADDRHINT (perhaps compiler dependant)

This commit is contained in:
fbernon 2007-07-03 10:36:21 +00:00
parent fdc0d30337
commit 3a0ab861c2
3 changed files with 29 additions and 23 deletions

View File

@ -56,10 +56,10 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
#define IP_HLEN 20 #define IP_HLEN 20
#define IP_PROTO_ICMP 1 #define IP_PROTO_ICMP 1
#define IP_PROTO_UDP 17 #define IP_PROTO_UDP 17
#define IP_PROTO_UDPLITE 136 #define IP_PROTO_UDPLITE 136
#define IP_PROTO_TCP 6 #define IP_PROTO_TCP 6
/* This is passed as the destination address to ip_output_if (not /* This is passed as the destination address to ip_output_if (not
to ip_output), meaning that an IP header already is constructed to ip_output), meaning that an IP header already is constructed
@ -69,6 +69,11 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
#endif /* IP_HDRINCL */ #endif /* IP_HDRINCL */
#define IP_HDRINCL NULL #define IP_HDRINCL NULL
#if LWIP_NETIF_HWADDRHINT
#define IP_PCB_ADDRHINT ;u8_t addr_hint
#else
#define IP_PCB_ADDRHINT
#endif /* LWIP_NETIF_HWADDRHINT */
/* This is the common part of all PCB types. It needs to be at the /* This is the common part of all PCB types. It needs to be at the
beginning of a PCB type definition. It is located here so that beginning of a PCB type definition. It is located here so that
@ -83,27 +88,24 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
/* Type Of Service */ \ /* Type Of Service */ \
u8_t tos; \ u8_t tos; \
/* Time To Live */ \ /* Time To Live */ \
u8_t ttl; \ u8_t ttl \
#if LWIP_NETIF_HWADDRHINT
/* link layer address resolution hint */ \ /* link layer address resolution hint */ \
u8_t addr_hint IP_PCB_ADDRHINT
#endif /* LWIP_NETIF_HWADDRHINT */
/* /*
* Option flags per-socket. These are the same like SO_XXX. * Option flags per-socket. These are the same like SO_XXX.
*/ */
#define SOF_DEBUG (u16_t)0x0001U /* turn on debugging info recording */ #define SOF_DEBUG (u16_t)0x0001U /* turn on debugging info recording */
#define SOF_ACCEPTCONN (u16_t)0x0002U /* socket has had listen() */ #define SOF_ACCEPTCONN (u16_t)0x0002U /* socket has had listen() */
#define SOF_REUSEADDR (u16_t)0x0004U /* allow local address reuse */ #define SOF_REUSEADDR (u16_t)0x0004U /* allow local address reuse */
#define SOF_KEEPALIVE (u16_t)0x0008U /* keep connections alive */ #define SOF_KEEPALIVE (u16_t)0x0008U /* keep connections alive */
#define SOF_DONTROUTE (u16_t)0x0010U /* just use interface addresses */ #define SOF_DONTROUTE (u16_t)0x0010U /* just use interface addresses */
#define SOF_BROADCAST (u16_t)0x0020U /* permit sending of broadcast msgs */ #define SOF_BROADCAST (u16_t)0x0020U /* permit sending of broadcast msgs */
#define SOF_USELOOPBACK (u16_t)0x0040U /* bypass hardware when possible */ #define SOF_USELOOPBACK (u16_t)0x0040U /* bypass hardware when possible */
#define SOF_LINGER (u16_t)0x0080U /* linger on close if data present */ #define SOF_LINGER (u16_t)0x0080U /* linger on close if data present */
#define SOF_OOBINLINE (u16_t)0x0100U /* leave received OOB data in line */ #define SOF_OOBINLINE (u16_t)0x0100U /* leave received OOB data in line */
#define SOF_REUSEPORT (u16_t)0x0200U /* allow local address & port reuse */ #define SOF_REUSEPORT (u16_t)0x0200U /* allow local address & port reuse */
#ifdef PACK_STRUCT_USE_INCLUDES #ifdef PACK_STRUCT_USE_INCLUDES

View File

@ -45,10 +45,10 @@ extern "C" {
#define IP_HLEN 40 #define IP_HLEN 40
#define IP_PROTO_ICMP 58 #define IP_PROTO_ICMP 58
#define IP_PROTO_UDP 17 #define IP_PROTO_UDP 17
#define IP_PROTO_UDPLITE 136 #define IP_PROTO_UDPLITE 136
#define IP_PROTO_TCP 6 #define IP_PROTO_TCP 6
/* This is passed as the destination address to ip_output_if (not /* This is passed as the destination address to ip_output_if (not
to ip_output), meaning that an IP header already is constructed to ip_output), meaning that an IP header already is constructed
@ -58,6 +58,12 @@ extern "C" {
#endif /* IP_HDRINCL */ #endif /* IP_HDRINCL */
#define IP_HDRINCL NULL #define IP_HDRINCL NULL
#if LWIP_NETIF_HWADDRHINT
#define IP_PCB_ADDRHINT ;u8_t addr_hint
#else
#define IP_PCB_ADDRHINT
#endif /* LWIP_NETIF_HWADDRHINT */
/* This is the common part of all PCB types. It needs to be at the /* This is the common part of all PCB types. It needs to be at the
beginning of a PCB type definition. It is located here so that beginning of a PCB type definition. It is located here so that
changes to this common part are made in one location instead of changes to this common part are made in one location instead of
@ -70,10 +76,8 @@ extern "C" {
u8_t tos; \ u8_t tos; \
/* Time To Live */ \ /* Time To Live */ \
u8_t ttl; \ u8_t ttl; \
#if LWIP_NETIF_HWADDRHINT
/* link layer address resolution hint */ \ /* link layer address resolution hint */ \
u8_t addr_hint IP_PCB_ADDRHINT
#endif /* LWIP_NETIF_HWADDRHINT */
/* The IPv6 header. */ /* The IPv6 header. */

View File

@ -116,8 +116,8 @@ static u8_t etharp_cached_entry = 0;
#define ETHARP_FIND_ONLY 2 #define ETHARP_FIND_ONLY 2
#if LWIP_NETIF_HWADDRHINT #if LWIP_NETIF_HWADDRHINT
#define NETIF_SET_HINT(netif, hint) (((netif) != NULL) && ((netif)->addr_hint != NULL)) ? \ #define NETIF_SET_HINT(netif, hint) if (((netif) != NULL) && ((netif)->addr_hint != NULL)) \
*((netif)->addr_hint) = (hint) : LWIP_UNUSED_ARG(hint) ; *((netif)->addr_hint) = (hint);
static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags, struct netif *netif); static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags, struct netif *netif);
#else /* LWIP_NETIF_HWADDRHINT */ #else /* LWIP_NETIF_HWADDRHINT */
static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags); static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags);