Lines Matching defs:name
39 static int name_from_null(struct address buf[static 2], const char *name, int family, int flags)
42 if (name) return 0;
57 static int name_from_numeric(struct address buf[static 1], const char *name, int family)
59 return __lookup_ipliteral(buf, name, family);
83 static int name_from_hosts(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family)
86 size_t l = strlen(name);
95 for(p=line+1; (p=strstr(p, name)) &&
115 /* Extract first name as canonical name */
214 static int name_from_dns(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, const struct resolvconf *conf, int netid)
246 const char *queryName = name;
299 static int name_from_dns_search(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, int netid)
319 /* Count dots, suppress search when >=ndots or name ends in
321 for (dots=l=0; name[l]; l++) if (name[l]=='.') dots++;
322 if (dots >= conf.ndots || name[l-1]=='.') *search = 0;
325 if (name[l-1]=='.') l--;
326 if (!l || name[l-1]=='.') {
337 * provides the desired default canonical name (if the requested
338 * name is not a CNAME record) and serves as a buffer for passing
339 * the full requested name to name_from_dns. */
340 memcpy(canon, name, l);
356 return name_from_dns(buf, canon, name, family, &conf, netid);
433 int lookup_name_ext(struct address buf[static MAXADDRS], char canon[static 256], const char *name,
443 if (name) {
444 /* reject empty name and check len so it fits into temp bufs */
445 size_t l = strnlen(name, 255);
448 MUSL_LOGE("%{public}s: %{public}d: Illegal name length: %{public}zu", __func__, __LINE__, l);
452 memcpy(canon, name, l+1);
464 cnt = name_from_null(buf, name, family, flags);
465 if (!cnt) cnt = name_from_numeric(buf, name, family);
472 cnt = predefined_host_name_from_hosts(buf, canon, name, family);
473 if (!cnt) cnt = name_from_hosts(buf, canon, name, family);
474 if (!cnt) cnt = name_from_dns_search(buf, canon, name, family, netid);
579 int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, int flags)
581 return lookup_name_ext(buf, canon, name, family, flags, 0);
822 char canon[static 256], const char *name, int family)
831 if (strcmp(pinfo->host, name) == 0) {
841 memcpy(canon, name, size);