34 |
|
|
35 |
#include "lwip/arch.h" |
#include "lwip/arch.h" |
36 |
|
|
37 |
#define IP_ADDR_ANY (&ip_addr_any) |
/** IP_ADDR_ can be used as a fixed IP address |
38 |
#define IP_ADDR_BROADCAST (&ip_addr_broadcast) |
* for the wildcard and the broadcast address |
39 |
|
*/ |
40 |
|
#define IP_ADDR_ANY ((struct ip_addr *)&ip_addr_any) |
41 |
|
#define IP_ADDR_BROADCAST ((struct ip_addr *)&ip_addr_broadcast) |
42 |
|
|
43 |
#ifdef PACK_STRUCT_USE_INCLUDES |
#ifdef PACK_STRUCT_USE_INCLUDES |
44 |
# include "arch/bpstruct.h" |
# include "arch/bpstruct.h" |
52 |
# include "arch/epstruct.h" |
# include "arch/epstruct.h" |
53 |
#endif |
#endif |
54 |
|
|
55 |
extern struct ip_addr ip_addr_any; |
extern const struct ip_addr ip_addr_any; |
56 |
extern struct ip_addr ip_addr_broadcast; |
extern const struct ip_addr ip_addr_broadcast; |
57 |
|
|
58 |
#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) | \ |
59 |
((u32_t)(c & 0xff) << 8) | (u32_t)(d & 0xff)) |
((u32_t)(c & 0xff) << 8) | (u32_t)(d & 0xff)) |
60 |
|
|
61 |
#define ip_addr_set(dest, src) (dest)->addr = ((struct ip_addr *)src)->addr |
#define ip_addr_set(dest, src) (dest)->addr = \ |
62 |
|
((src) == NULL? 0:\ |
63 |
|
((struct ip_addr *)src)->addr) |
64 |
#define ip_addr_maskcmp(addr1, addr2, mask) (((addr1)->addr & \ |
#define ip_addr_maskcmp(addr1, addr2, mask) (((addr1)->addr & \ |
65 |
(mask)->addr) == \ |
(mask)->addr) == \ |
66 |
((addr2)->addr & \ |
((addr2)->addr & \ |