47 #define FNET_IP4_ADDR_INIT(a, b, c, d) ((fnet_ip4_addr_t)(FNET_NTOHL((((fnet_uint32_t)(a)&0xFFUL)<< 24U) + (((fnet_uint32_t)(b)&0xFFUL)<< 16U) + (((fnet_uint32_t)(c)&0xFFUL)<< 8U ) + ((fnet_uint32_t)(d)&0xFFUL)))) 57 #define FNET_IP4_ADDR_STR_SIZE sizeof("255.255.255.255") 60 #define FNET_IP4_ADDR_LINK_LOCAL_PREFIX FNET_IP4_ADDR_INIT(169,254,0,0) 63 #define FNET_IP4_ADDR_LINK_LOCAL_BROADCAST FNET_IP4_ADDR_INIT(169,254,255,255) 68 #define FNET_IP4_TOS_NORMAL (0x0U) 69 #define FNET_IP4_TOS_LOWDELAY (0x10U) 70 #define FNET_IP4_TOS_THROUGHPUT (0x08U) 71 #define FNET_IP4_TOS_RELIABILITY (0x04U) 76 #define FNET_IP4_CLASS_A(i) (((fnet_ip4_addr_t)(i) & FNET_HTONL(0x80000000U)) == 0U) 77 #define FNET_IP4_CLASS_A_NET FNET_HTONL(0xff000000U) 79 #define FNET_IP4_CLASS_B(i) (((fnet_ip4_addr_t)(i) & FNET_HTONL(0xc0000000U)) == FNET_HTONL(0x80000000U)) 80 #define FNET_IP4_CLASS_B_NET FNET_HTONL(0xffff0000U) 82 #define FNET_IP4_CLASS_C(i) (((fnet_ip4_addr_t)(i) & FNET_HTONL(0xe0000000U)) == FNET_HTONL(0xc0000000U)) 83 #define FNET_IP4_CLASS_C_NET FNET_HTONL(0xffffff00U) 85 #define FNET_IP4_CLASS_D(i) (((fnet_ip4_addr_t)(i) & FNET_HTONL(0xf0000000U)) == FNET_HTONL(0xe0000000U)) 86 #define FNET_IP4_CLASS_D_NET FNET_HTONL(0xf0000000U) 88 #define FNET_IP4_ADDR_IS_MULTICAST(addr) (FNET_IP4_CLASS_D(addr)?FNET_TRUE:FNET_FALSE) 90 #define FNET_IP4_ADDR_IS_UNSPECIFIED(addr) (((addr) == INADDR_ANY)?FNET_TRUE:FNET_FALSE) 92 #define FNET_IP4_CLASS_E(i) (((fnet_ip4_addr_t)(i) & FNET_HTONL(0xf0000000U)) == FNET_HTONL(0xf0000000U)) 93 #define FNET_IP4_EXPERIMENTAL(i) FNET_IP4_CLASS_E(i) 94 #define FNET_IP4_BADCLASS(i) FNET_IP4_CLASS_E(i) 96 #define FNET_IP4_ADDR1(ipaddr) ((fnet_uint8_t)(fnet_ntohl(ipaddr) >> 24U) & 0xffU) 97 #define FNET_IP4_ADDR2(ipaddr) ((fnet_uint8_t)(fnet_ntohl(ipaddr) >> 16U) & 0xffU) 98 #define FNET_IP4_ADDR3(ipaddr) ((fnet_uint8_t)(fnet_ntohl(ipaddr) >> 8U) & 0xffU) 99 #define FNET_IP4_ADDR4(ipaddr) ((fnet_uint8_t)(fnet_ntohl(ipaddr)) & 0xffU) fnet_uint32_t fnet_ip4_addr_t
32-bit IPv4 address type.