2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-11 13:57:52 +00:00
Files
openvswitch/datapath/linux/compat/include/linux/in.h
Jesse Gross 22bcc0e70b datapath: Rename linux-2.6 and compat-2.6 directories.
The linux-2.6 and compat-2.6 directories apply equally to the upcoming
Linux 3.0 release, so this drops the 2.6 suffix and updates Makefiles.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2011-06-24 14:37:49 -07:00

37 lines
735 B
C

#ifndef __LINUX_IN_WRAPPER_H
#define __LINUX_IN_WRAPPER_H 1
#include_next <linux/in.h>
#ifndef HAVE_IPV4_IS_MULTICAST
static inline bool ipv4_is_loopback(__be32 addr)
{
return (addr & htonl(0xff000000)) == htonl(0x7f000000);
}
static inline bool ipv4_is_multicast(__be32 addr)
{
return (addr & htonl(0xf0000000)) == htonl(0xe0000000);
}
static inline bool ipv4_is_local_multicast(__be32 addr)
{
return (addr & htonl(0xffffff00)) == htonl(0xe0000000);
}
static inline bool ipv4_is_lbcast(__be32 addr)
{
/* limited broadcast */
return addr == htonl(INADDR_BROADCAST);
}
static inline bool ipv4_is_zeronet(__be32 addr)
{
return (addr & htonl(0xff000000)) == htonl(0x00000000);
}
#endif /* !HAVE_IPV4_IS_MULTICAST */
#endif