mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 14:33:09 +00:00
lib: Add an api is_ipv6_global_unicast
Add api is_ipv6_global_unicast to identify whether a given ipv6 address is global unicast or not. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
This commit is contained in:
parent
f21ba4fbae
commit
3a0d338bc9
@ -594,6 +594,15 @@ static inline int is_default_host_route(const struct prefix *p)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool is_ipv6_global_unicast(const struct in6_addr *p)
|
||||||
|
{
|
||||||
|
if (IN6_IS_ADDR_UNSPECIFIED(p) || IN6_IS_ADDR_LOOPBACK(p) ||
|
||||||
|
IN6_IS_ADDR_LINKLOCAL(p) || IN6_IS_ADDR_MULTICAST(p))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/* IPv6 scope values, usable for IPv4 too (cf. below) */
|
/* IPv6 scope values, usable for IPv4 too (cf. below) */
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
enum {
|
enum {
|
||||||
|
Loading…
Reference in New Issue
Block a user