1 #ifndef __LINUX_IN_WRAPPER_H
2 #define __LINUX_IN_WRAPPER_H 1
4 #include_next <linux/in.h>
6 #ifndef HAVE_IPV4_IS_MULTICAST
8 static inline bool ipv4_is_loopback(__be32 addr)
10 return (addr & htonl(0xff000000)) == htonl(0x7f000000);
13 static inline bool ipv4_is_multicast(__be32 addr)
15 return (addr & htonl(0xf0000000)) == htonl(0xe0000000);
18 static inline bool ipv4_is_local_multicast(__be32 addr)
20 return (addr & htonl(0xffffff00)) == htonl(0xe0000000);
23 static inline bool ipv4_is_lbcast(__be32 addr)
25 /* limited broadcast */
26 return addr == htonl(INADDR_BROADCAST);
29 static inline bool ipv4_is_zeronet(__be32 addr)
31 return (addr & htonl(0xff000000)) == htonl(0x00000000);
34 #endif /* !HAVE_IPV4_IS_MULTICAST */