MCPcopy Create free account
hub / github.com/OpenPrinting/cups / httpAddrLocalhost

Function httpAddrLocalhost

cups/http-addr.c:290–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288 */
289
290int /* O - 1 if local host, 0 otherwise */
291httpAddrLocalhost(
292 const http_addr_t *addr) /* I - Address to check */
293{
294 if (!addr)
295 return (1);
296
297#ifdef AF_INET6
298 if (addr->addr.sa_family == AF_INET6 &&
299 IN6_IS_ADDR_LOOPBACK(&(addr->ipv6.sin6_addr)))
300 return (1);
301#endif /* AF_INET6 */
302
303#ifdef AF_LOCAL
304 if (addr->addr.sa_family == AF_LOCAL)
305 return (1);
306#endif /* AF_LOCAL */
307
308 if (addr->addr.sa_family == AF_INET &&
309 (ntohl(addr->ipv4.sin_addr.s_addr) & 0xff000000) == 0x7f000000)
310 return (1);
311
312 return (0);
313}
314
315
316/*

Callers 15

cupsdNetIFUpdateFunction · 0.85
cupsdIsAuthorizedFunction · 0.85
cupsdAcceptClientFunction · 0.85
valid_hostFunction · 0.85
add_jobFunction · 0.85
get_printersFunction · 0.85
validate_jobFunction · 0.85
read_cupsd_confFunction · 0.85
dnssdUpdateDNSSDNameFunction · 0.85
cupsdStartListeningFunction · 0.85
_httpTLSStartFunction · 0.85
httpAddrLookupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected