Lines Matching refs:family
39 static int name_from_null(struct address buf[static 2], const char *name, int family, int flags)
44 if (family != AF_INET6)
45 buf[cnt++] = (struct address){ .family = AF_INET };
46 if (family != AF_INET)
47 buf[cnt++] = (struct address){ .family = AF_INET6 };
49 if (family != AF_INET6)
50 buf[cnt++] = (struct address){ .family = AF_INET, .addr = { 127,0,0,1 } };
51 if (family != AF_INET)
52 buf[cnt++] = (struct address){ .family = AF_INET6, .addr = { [15] = 1 } };
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)
102 switch (name_from_numeric(buf+cnt, line, family)) {
150 int family;
163 family = AF_INET;
167 family = AF_INET6;
170 ctx->addrs[ctx->cnt].family = family;
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)
231 if (!IsIpv6Enable(netid) || (family == AF_INET)) {
232 if (family == AF_INET6) {
251 if (family != afrr[i].af) {
299 static int name_from_dns_search(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, int netid)
350 int cnt = name_from_dns(buf, canon, canon, family, &conf, netid);
356 return name_from_dns(buf, canon, name, family, &conf, netid);
434 int family, int flags, int netid)
456 * flag set is like a request for unspecified family, followed
459 if (family == AF_INET6) family = AF_UNSPEC;
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);
482 for (i=0; i<cnt && buf[i].family != AF_INET6; i++);
485 if (buf[i].family == AF_INET6)
493 if (buf[i].family != AF_INET) continue;
496 buf[i].family = AF_INET6;
502 if (cnt<2 || family==AF_INET) return cnt;
503 for (i=0; i<cnt; i++) if (buf[i].family != AF_INET) break;
515 int family = buf[i].family;
528 if (family == AF_INET6) {
548 int fd = socket(family, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP);
553 if (family == AF_INET) memcpy(
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)
832 if (__lookup_ipliteral(buf+cnt, pinfo->ip, family) == 1) {