From 19884f40b8f86e541238250c6cfbcaafc5a16649 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Tue, 10 Feb 2009 20:44:51 +0000 Subject: [PATCH] Moved INADDR_* defines to inet.h; removing dependency from inet.h to ip_addr.h --- src/include/ipv4/lwip/inet.h | 7 +++++-- src/include/ipv4/lwip/ip_addr.h | 3 --- src/include/lwip/sockets.h | 3 --- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/include/ipv4/lwip/inet.h b/src/include/ipv4/lwip/inet.h index 24b75e13..6f30d0d1 100644 --- a/src/include/ipv4/lwip/inet.h +++ b/src/include/ipv4/lwip/inet.h @@ -34,8 +34,6 @@ #include "lwip/opt.h" -#include "lwip/ip_addr.h" - #ifdef __cplusplus extern "C" { #endif @@ -45,6 +43,11 @@ struct in_addr { u32_t s_addr; }; +#define INADDR_NONE ((u32_t)0xffffffffUL) /* 255.255.255.255 */ +#define INADDR_LOOPBACK ((u32_t)0x7f000001UL) /* 127.0.0.1 */ +#define INADDR_ANY ((u32_t)0x00000000UL) /* 0.0.0.0 */ +#define INADDR_BROADCAST ((u32_t)0xffffffffUL) /* 255.255.255.255 */ + u32_t inet_addr(const char *cp); int inet_aton(const char *cp, struct in_addr *addr); char *inet_ntoa(struct in_addr addr); /* returns ptr to static buffer; not reentrant! */ diff --git a/src/include/ipv4/lwip/ip_addr.h b/src/include/ipv4/lwip/ip_addr.h index 12e7eb03..6fe0b346 100644 --- a/src/include/ipv4/lwip/ip_addr.h +++ b/src/include/ipv4/lwip/ip_addr.h @@ -77,9 +77,6 @@ extern const struct ip_addr ip_addr_broadcast; #define IP_ADDR_ANY ((struct ip_addr *)&ip_addr_any) #define IP_ADDR_BROADCAST ((struct ip_addr *)&ip_addr_broadcast) -#define INADDR_NONE ((u32_t)0xffffffffUL) /* 255.255.255.255 */ -#define INADDR_LOOPBACK ((u32_t)0x7f000001UL) /* 127.0.0.1 */ - /* Definitions of the bits in an Internet address integer. On subnets, host and network parts are found according to diff --git a/src/include/lwip/sockets.h b/src/include/lwip/sockets.h index e261798f..46ad4748 100644 --- a/src/include/lwip/sockets.h +++ b/src/include/lwip/sockets.h @@ -124,9 +124,6 @@ struct linger { #define IPPROTO_UDP 17 #define IPPROTO_UDPLITE 136 -#define INADDR_ANY 0 -#define INADDR_BROADCAST 0xffffffff - /* Flags we can use with send and recv. */ #define MSG_PEEK 0x01 /* Peeks at an incoming message */ #define MSG_WAITALL 0x02 /* Unimplemented: Requests that the function block until the full amount of data requested can be returned */