version 1.1.1.1, 2017/08/22 12:33:54
|
version 1.1.1.2, 2021/03/17 19:50:23
|
Line 67 typedef struct ip4_addr {
|
Line 67 typedef struct ip4_addr {
|
|
|
typedef u32 ip4_addr; |
typedef u32 ip4_addr; |
|
|
#define _MI4(x) (x) | #define _MI4(x) ((u32) (x)) |
#define _I(x) (x) |
#define _I(x) (x) |
|
|
#endif |
#endif |
Line 99 typedef ip6_addr ip_addr;
|
Line 99 typedef ip6_addr ip_addr;
|
#define ipa_to_u32(x) ip4_to_u32(ipa_to_ip4(x)) |
#define ipa_to_u32(x) ip4_to_u32(ipa_to_ip4(x)) |
|
|
#define ipa_is_ip4(a) ip6_is_v4mapped(a) |
#define ipa_is_ip4(a) ip6_is_v4mapped(a) |
|
#define ipa_is_ip6(a) (! ip6_is_v4mapped(a)) |
|
|
#else |
#else |
|
|
Line 115 typedef ip4_addr ip_addr;
|
Line 116 typedef ip4_addr ip_addr;
|
#define ipa_to_u32(x) ip4_to_u32(ipa_to_ip4(x)) |
#define ipa_to_u32(x) ip4_to_u32(ipa_to_ip4(x)) |
|
|
#define ipa_is_ip4(a) 1 |
#define ipa_is_ip4(a) 1 |
|
#define ipa_is_ip6(a) 0 |
|
|
#endif |
#endif |
|
|
Line 308 static inline int ip6_is_v4mapped(ip6_addr a)
|
Line 310 static inline int ip6_is_v4mapped(ip6_addr a)
|
#define ipa_classify(x) ip4_classify(x) |
#define ipa_classify(x) ip4_classify(x) |
#define ipa_is_link_local(x) 0 |
#define ipa_is_link_local(x) 0 |
#endif |
#endif |
|
|
|
static inline int ip4_is_unicast(ip4_addr a) |
|
{ return _I(a) < 0xe0000000; } |
|
|
static inline int ipa_classify_net(ip_addr a) |
static inline int ipa_classify_net(ip_addr a) |
{ return ipa_zero2(a) ? (IADDR_HOST | SCOPE_UNIVERSE) : ipa_classify(a); } |
{ return ipa_zero2(a) ? (IADDR_HOST | SCOPE_UNIVERSE) : ipa_classify(a); } |