32 #ifndef __LWIP_IP_ADDR_H__ 33 #define __LWIP_IP_ADDR_H__ 37 #ifdef PACK_STRUCT_USE_INCLUDES 38 # include "arch/bpstruct.h" 45 #ifdef PACK_STRUCT_USE_INCLUDES 46 # include "arch/epstruct.h" 49 #ifdef PACK_STRUCT_USE_INCLUDES 50 # include "arch/bpstruct.h" 57 #ifdef PACK_STRUCT_USE_INCLUDES 58 # include "arch/epstruct.h" 77 #define IP_ADDR_ANY ((struct ip_addr *)&ip_addr_any) 78 #define IP_ADDR_BROADCAST ((struct ip_addr *)&ip_addr_broadcast) 80 #define INADDR_NONE ((u32_t) 0xffffffff) 81 #define INADDR_LOOPBACK ((u32_t) 0x7f000001) 88 #define IN_CLASSA(a) ((((u32_t)(a)) & 0x80000000) == 0) 89 #define IN_CLASSA_NET 0xff000000 90 #define IN_CLASSA_NSHIFT 24 91 #define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET) 92 #define IN_CLASSA_MAX 128 94 #define IN_CLASSB(a) ((((u32_t)(a)) & 0xc0000000) == 0x80000000) 95 #define IN_CLASSB_NET 0xffff0000 96 #define IN_CLASSB_NSHIFT 16 97 #define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) 98 #define IN_CLASSB_MAX 65536 100 #define IN_CLASSC(a) ((((u32_t)(a)) & 0xe0000000) == 0xc0000000) 101 #define IN_CLASSC_NET 0xffffff00 102 #define IN_CLASSC_NSHIFT 8 103 #define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) 105 #define IN_CLASSD(a) (((u32_t)(a) & 0xf0000000) == 0xe0000000) 106 #define IN_CLASSD_NET 0xf0000000 107 #define IN_CLASSD_NSHIFT 28 108 #define IN_CLASSD_HOST 0x0fffffff 109 #define IN_MULTICAST(a) IN_CLASSD(a) 111 #define IN_EXPERIMENTAL(a) (((u32_t)(a) & 0xf0000000) == 0xf0000000) 112 #define IN_BADCLASS(a) (((u32_t)(a) & 0xf0000000) == 0xf0000000) 114 #define IN_LOOPBACKNET 127 117 #define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = htonl(((u32_t)(a & 0xff) << 24) | ((u32_t)(b & 0xff) << 16) | \ 118 ((u32_t)(c & 0xff) << 8) | (u32_t)(d & 0xff)) 120 #define ip_addr_set(dest, src) (dest)->addr = \ 131 #define ip_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \ 135 #define ip_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr) 137 #define ip_addr_isany(addr1) ((addr1) == NULL || (addr1)->addr == 0) 141 #define ip_addr_ismulticast(addr1) (((addr1)->addr & ntohl(0xf0000000)) == ntohl(0xe0000000)) 144 #define ip_addr_debug_print(debug, ipaddr) LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F, \ 145 ipaddr?(u16_t)(ntohl((ipaddr)->addr) >> 24) & 0xff:0, \ 146 ipaddr?(u16_t)(ntohl((ipaddr)->addr) >> 16) & 0xff:0, \ 147 ipaddr?(u16_t)(ntohl((ipaddr)->addr) >> 8) & 0xff:0, \ 148 ipaddr?(u16_t)ntohl((ipaddr)->addr) & 0xff:0U)) 152 #define ip4_addr1(ipaddr) ((u16_t)(ntohl((ipaddr)->addr) >> 24) & 0xff) 153 #define ip4_addr2(ipaddr) ((u16_t)(ntohl((ipaddr)->addr) >> 16) & 0xff) 154 #define ip4_addr3(ipaddr) ((u16_t)(ntohl((ipaddr)->addr) >> 8) & 0xff) 155 #define ip4_addr4(ipaddr) ((u16_t)(ntohl((ipaddr)->addr)) & 0xff) const struct ip_addr ip_addr_any
Definition: ip_addr.c:38
#define PACK_STRUCT_BEGIN
Definition: arch.h:46
const struct ip_addr ip_addr_broadcast
Definition: ip_addr.c:39
PACK_STRUCT_BEGIN struct ip_addr PACK_STRUCT_STRUCT
GLenum const GLvoid * addr
Definition: glext.h:10528
PACK_STRUCT_FIELD(u16_t addrw[2])
#define PACK_STRUCT_END
Definition: arch.h:50
u8 u8_t
Definition: cc.h:43
PACK_STRUCT_FIELD(u32_t addr)
u8_t ip_addr_isbroadcast(struct ip_addr *, struct netif *)
Definition: ip_addr.c:49
u32 u32_t
Definition: cc.h:47
u32_t s_addr
Definition: ip_addr.h:65
u16 u16_t
Definition: cc.h:45