MCPcopy Create free account
hub / github.com/F-Stack/f-stack / in6_addrscope

Function in6_addrscope

freebsd/netinet6/scope6.c:228–247  ·  view source on GitHub ↗

* Get a scope of the address. Node-local, link-local, site-local or global. */

Source from the content-addressed store, hash-verified

226 * Get a scope of the address. Node-local, link-local, site-local or global.
227 */
228int
229in6_addrscope(const struct in6_addr *addr)
230{
231
232 if (IN6_IS_ADDR_MULTICAST(addr)) {
233 /*
234 * Addresses with reserved value F must be treated as
235 * global multicast addresses.
236 */
237 if (IPV6_ADDR_MC_SCOPE(addr) == 0x0f)
238 return (IPV6_ADDR_SCOPE_GLOBAL);
239 return (IPV6_ADDR_MC_SCOPE(addr));
240 }
241 if (IN6_IS_ADDR_LINKLOCAL(addr) ||
242 IN6_IS_ADDR_LOOPBACK(addr))
243 return (IPV6_ADDR_SCOPE_LINKLOCAL);
244 if (IN6_IS_ADDR_SITELOCAL(addr))
245 return (IPV6_ADDR_SCOPE_SITELOCAL);
246 return (IPV6_ADDR_SCOPE_GLOBAL);
247}
248
249/*
250 * ifp - note that this might be NULL

Callers 9

in6_ifawithifpFunction · 0.85
nd6_lle_eventFunction · 0.85
scope6_addr2defaultFunction · 0.85
in6_setscopeFunction · 0.85
sa6_checkzoneFunction · 0.85
sa6_checkzone_ifpFunction · 0.85
in6_selectsrcFunction · 0.85
ni6_addrsFunction · 0.85
ni6_store_addrsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected