]> git.proxmox.com Git - mirror_ovs.git/blame - datapath/linux-2.6/compat-2.6/include/linux/in.h
ovsdb: Synchronize comments and code in ovsdb_file_commit().
[mirror_ovs.git] / datapath / linux-2.6 / compat-2.6 / include / linux / in.h
CommitLineData
db12f2fc
JG
1#ifndef __LINUX_IN_WRAPPER_H
2#define __LINUX_IN_WRAPPER_H 1
3
4#include_next <linux/in.h>
5
8f3a29be 6#ifndef HAVE_IPV4_IS_MULTICAST
db12f2fc 7
82ff0d0a
JG
8static inline bool ipv4_is_loopback(__be32 addr)
9{
10 return (addr & htonl(0xff000000)) == htonl(0x7f000000);
11}
12
db12f2fc
JG
13static inline bool ipv4_is_multicast(__be32 addr)
14{
15 return (addr & htonl(0xf0000000)) == htonl(0xe0000000);
16}
17
82ff0d0a
JG
18static inline bool ipv4_is_local_multicast(__be32 addr)
19{
20 return (addr & htonl(0xffffff00)) == htonl(0xe0000000);
21}
22
23static inline bool ipv4_is_lbcast(__be32 addr)
24{
25 /* limited broadcast */
26 return addr == htonl(INADDR_BROADCAST);
27}
28
29static inline bool ipv4_is_zeronet(__be32 addr)
30{
31 return (addr & htonl(0xff000000)) == htonl(0x00000000);
32}
33
8f3a29be 34#endif /* !HAVE_IPV4_IS_MULTICAST */
db12f2fc
JG
35
36#endif