mirror of
https://github.com/systemd/systemd.git
synced 2025-08-26 17:49:52 +03:00
in-addr-util: introduce in4_addr_is_local_multicast()
This commit is contained in:
@ -76,6 +76,12 @@ int in_addr_is_multicast(int family, const union in_addr_union *u) {
|
||||
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) {
|
||||
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);
|
||||
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_equal(const struct in_addr *a, const struct in_addr *b);
|
||||
|
Reference in New Issue
Block a user