Go to the documentation of this file.
22 #include <linux/errno.h>
25 static inline int proto_ports_offset(
int proto)
42 static inline bool ipv4_is_loopback(
__be32 addr)
44 return (addr &
htonl(0xff000000)) ==
htonl(0x7f000000);
47 static inline bool ipv4_is_multicast(
__be32 addr)
49 return (addr &
htonl(0xf0000000)) ==
htonl(0xe0000000);
52 static inline bool ipv4_is_local_multicast(
__be32 addr)
54 return (addr &
htonl(0xffffff00)) ==
htonl(0xe0000000);
57 static inline bool ipv4_is_lbcast(
__be32 addr)
63 static inline bool ipv4_is_zeronet(
__be32 addr)
65 return (addr &
htonl(0xff000000)) ==
htonl(0x00000000);
70 static inline bool ipv4_is_private_10(
__be32 addr)
72 return (addr &
htonl(0xff000000)) ==
htonl(0x0a000000);
75 static inline bool ipv4_is_private_172(
__be32 addr)
77 return (addr &
htonl(0xfff00000)) ==
htonl(0xac100000);
80 static inline bool ipv4_is_private_192(
__be32 addr)
82 return (addr &
htonl(0xffff0000)) ==
htonl(0xc0a80000);
85 static inline bool ipv4_is_linklocal_169(
__be32 addr)
87 return (addr &
htonl(0xffff0000)) ==
htonl(0xa9fe0000);
90 static inline bool ipv4_is_anycast_6to4(
__be32 addr)
92 return (addr &
htonl(0xffffff00)) ==
htonl(0xc0586300);
95 static inline bool ipv4_is_test_192(
__be32 addr)
97 return (addr &
htonl(0xffffff00)) ==
htonl(0xc0000200);
100 static inline bool ipv4_is_test_198(
__be32 addr)
102 return (addr &
htonl(0xfffe0000)) ==
htonl(0xc6120000);