mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-25 15:42:56 +00:00
Fixed ip_addr_set() to deal with IP_ADDR_ANY. Added "ip_addr.h" include.
This commit is contained in:
parent
7abb278b60
commit
af8f280811
@ -72,6 +72,7 @@
|
|||||||
#include "lwip/udp.h"
|
#include "lwip/udp.h"
|
||||||
#include "lwip/netif.h"
|
#include "lwip/netif.h"
|
||||||
#include "lwip/inet.h"
|
#include "lwip/inet.h"
|
||||||
|
#include "lwip/ip_addr.h"
|
||||||
#include "netif/etharp.h"
|
#include "netif/etharp.h"
|
||||||
|
|
||||||
#include "lwip/sys.h"
|
#include "lwip/sys.h"
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
#include "lwip/def.h"
|
#include "lwip/def.h"
|
||||||
#include "lwip/mem.h"
|
#include "lwip/mem.h"
|
||||||
#include "lwip/netif.h"
|
#include "lwip/netif.h"
|
||||||
|
#include "lwip/ip_addr.h"
|
||||||
|
|
||||||
|
|
||||||
struct netif *netif_list = NULL;
|
struct netif *netif_list = NULL;
|
||||||
struct netif *netif_default = NULL;
|
struct netif *netif_default = NULL;
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include "lwip/netif.h"
|
#include "lwip/netif.h"
|
||||||
#include "lwip/udp.h"
|
#include "lwip/udp.h"
|
||||||
#include "lwip/icmp.h"
|
#include "lwip/icmp.h"
|
||||||
|
#include "lwip/ip_addr.h"
|
||||||
|
|
||||||
#include "lwip/stats.h"
|
#include "lwip/stats.h"
|
||||||
|
|
||||||
|
@ -49,14 +49,13 @@ PACK_STRUCT_END
|
|||||||
# include "arch/epstruct.h"
|
# include "arch/epstruct.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern struct ip_addr ip_addr_any;
|
||||||
extern struct ip_addr ip_addr_broadcast;
|
extern struct ip_addr ip_addr_broadcast;
|
||||||
|
|
||||||
#define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = htonl(((u32_t)(a & 0xff) << 24) | ((u32_t)(b & 0xff) << 16) | \
|
#define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = htonl(((u32_t)(a & 0xff) << 24) | ((u32_t)(b & 0xff) << 16) | \
|
||||||
((u32_t)(c & 0xff) << 8) | (u32_t)(d & 0xff))
|
((u32_t)(c & 0xff) << 8) | (u32_t)(d & 0xff))
|
||||||
|
|
||||||
#define ip_addr_set(dest, src) (dest)->addr = \
|
#define ip_addr_set(dest, src) (dest)->addr = ((struct ip_addr *)src)->addr
|
||||||
((src) == IP_ADDR_ANY? IP_ADDR_ANY:\
|
|
||||||
((struct ip_addr *)src)->addr)
|
|
||||||
#define ip_addr_maskcmp(addr1, addr2, mask) (((addr1)->addr & \
|
#define ip_addr_maskcmp(addr1, addr2, mask) (((addr1)->addr & \
|
||||||
(mask)->addr) == \
|
(mask)->addr) == \
|
||||||
((addr2)->addr & \
|
((addr2)->addr & \
|
||||||
|
Loading…
Reference in New Issue
Block a user