in-addr-util: introduce in4_addr_is_local_multicast()
This commit is contained in:
parent
5643cfc0d9
commit
ccea244865
|
@ -76,6 +76,12 @@ int in_addr_is_multicast(int family, const union in_addr_union *u) {
|
||||||
return -EAFNOSUPPORT;
|
return -EAFNOSUPPORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool in4_addr_is_local_multicast(const struct in_addr *a) {
|
||||||
|
assert(a);
|
||||||
|
|
||||||
|
return (be32toh(a->s_addr) & UINT32_C(0xffffff00)) == UINT32_C(0xe0000000);
|
||||||
|
}
|
||||||
|
|
||||||
bool in4_addr_is_localhost(const struct in_addr *a) {
|
bool in4_addr_is_localhost(const struct in_addr *a) {
|
||||||
assert(a);
|
assert(a);
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ bool in6_addr_is_link_local_all_nodes(const struct in6_addr *a);
|
||||||
bool in4_addr_is_localhost(const struct in_addr *a);
|
bool in4_addr_is_localhost(const struct in_addr *a);
|
||||||
int in_addr_is_localhost(int family, const union in_addr_union *u);
|
int in_addr_is_localhost(int family, const union in_addr_union *u);
|
||||||
|
|
||||||
|
bool in4_addr_is_local_multicast(const struct in_addr *a);
|
||||||
bool in4_addr_is_non_local(const struct in_addr *a);
|
bool in4_addr_is_non_local(const struct in_addr *a);
|
||||||
|
|
||||||
bool in4_addr_equal(const struct in_addr *a, const struct in_addr *b);
|
bool in4_addr_equal(const struct in_addr *a, const struct in_addr *b);
|
||||||
|
|
Loading…
Reference in a new issue