40 |
#define IP_ADDR_ANY ((struct ip_addr *)&ip_addr_any) |
#define IP_ADDR_ANY ((struct ip_addr *)&ip_addr_any) |
41 |
#define IP_ADDR_BROADCAST ((struct ip_addr *)&ip_addr_broadcast) |
#define IP_ADDR_BROADCAST ((struct ip_addr *)&ip_addr_broadcast) |
42 |
|
|
43 |
|
#define INADDR_NONE ((u32_t) 0xffffffff) /* 255.255.255.255 */ |
44 |
|
#define INADDR_LOOPBACK ((u32_t) 0x7f000001) /* 127.0.0.1 */ |
45 |
|
|
46 |
|
/* Definitions of the bits in an Internet address integer. |
47 |
|
|
48 |
|
On subnets, host and network parts are found according to |
49 |
|
the subnet mask, not these masks. */ |
50 |
|
|
51 |
|
#define IN_CLASSA(a) ((((u32_t)(a)) & 0x80000000) == 0) |
52 |
|
#define IN_CLASSA_NET 0xff000000 |
53 |
|
#define IN_CLASSA_NSHIFT 24 |
54 |
|
#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET) |
55 |
|
#define IN_CLASSA_MAX 128 |
56 |
|
|
57 |
|
#define IN_CLASSB(a) ((((u32_t)(a)) & 0xc0000000) == 0x80000000) |
58 |
|
#define IN_CLASSB_NET 0xffff0000 |
59 |
|
#define IN_CLASSB_NSHIFT 16 |
60 |
|
#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) |
61 |
|
#define IN_CLASSB_MAX 65536 |
62 |
|
|
63 |
|
#define IN_CLASSC(a) ((((u32_t)(a)) & 0xe0000000) == 0xc0000000) |
64 |
|
#define IN_CLASSC_NET 0xffffff00 |
65 |
|
#define IN_CLASSC_NSHIFT 8 |
66 |
|
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) |
67 |
|
|
68 |
|
#define IN_CLASSD(a) (((u32_t)(a) & 0xf0000000) == 0xe0000000) |
69 |
|
#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ |
70 |
|
#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ |
71 |
|
#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ |
72 |
|
#define IN_MULTICAST(a) IN_CLASSD(a) |
73 |
|
|
74 |
|
#define IN_EXPERIMENTAL(a) (((u32_t)(a) & 0xf0000000) == 0xf0000000) |
75 |
|
#define IN_BADCLASS(a) (((u32_t)(a) & 0xf0000000) == 0xf0000000) |
76 |
|
|
77 |
|
#define IN_LOOPBACKNET 127 /* official! */ |
78 |
|
|
79 |
#ifdef PACK_STRUCT_USE_INCLUDES |
#ifdef PACK_STRUCT_USE_INCLUDES |
80 |
# include "arch/bpstruct.h" |
# include "arch/bpstruct.h" |
81 |
#endif |
#endif |