Lines Matching refs:cnt
28 int cnt = 0; in name_from_null() local
32 buf[cnt++] = (struct address){ .family = AF_INET }; in name_from_null()
34 buf[cnt++] = (struct address){ .family = AF_INET6 }; in name_from_null()
37 buf[cnt++] = (struct address){ .family = AF_INET, .addr = { 127,0,0,1 } }; in name_from_null()
39 buf[cnt++] = (struct address){ .family = AF_INET6, .addr = { [15] = 1 } }; in name_from_null()
41 return cnt; in name_from_null()
53 int cnt = 0, badfam = 0, have_canon = 0; in name_from_hosts() local
64 while (fgets(line, sizeof line, f) && cnt < MAXADDRS) { in name_from_hosts()
75 switch (name_from_numeric(buf+cnt, line, family)) { in name_from_hosts()
77 cnt++; in name_from_hosts()
98 return cnt ? cnt : badfam; in name_from_hosts()
104 int cnt; member
115 if (ctx->cnt >= MAXADDRS) return -1; in dns_parse_callback()
119 ctx->addrs[ctx->cnt].family = AF_INET; in dns_parse_callback()
120 ctx->addrs[ctx->cnt].scopeid = 0; in dns_parse_callback()
121 memcpy(ctx->addrs[ctx->cnt++].addr, data, 4); in dns_parse_callback()
125 ctx->addrs[ctx->cnt].family = AF_INET6; in dns_parse_callback()
126 ctx->addrs[ctx->cnt].scopeid = 0; in dns_parse_callback()
127 memcpy(ctx->addrs[ctx->cnt++].addr, data, 16); in dns_parse_callback()
177 if (ctx.cnt) return ctx.cnt; in name_from_dns()
216 int cnt = name_from_dns(buf, canon, canon, family, &conf); in name_from_dns_search() local
217 if (cnt) return cnt; in name_from_dns_search()
301 int cnt = 0, i, j; in __lookup_name() local
321 cnt = name_from_null(buf, name, family, flags); in __lookup_name()
322 if (!cnt) cnt = name_from_numeric(buf, name, family); in __lookup_name()
323 if (!cnt && !(flags & AI_NUMERICHOST)) { in __lookup_name()
324 cnt = name_from_hosts(buf, canon, name, family); in __lookup_name()
325 if (!cnt) cnt = name_from_dns_search(buf, canon, name, family); in __lookup_name()
327 if (cnt<=0) return cnt ? cnt : EAI_NONAME; in __lookup_name()
333 for (i=0; i<cnt && buf[i].family != AF_INET6; i++); in __lookup_name()
334 if (i<cnt) { in __lookup_name()
335 for (j=0; i<cnt; i++) { in __lookup_name()
339 cnt = i = j; in __lookup_name()
343 for (i=0; i<cnt; i++) { in __lookup_name()
353 if (cnt<2 || family==AF_INET) return cnt; in __lookup_name()
354 for (i=0; i<cnt; i++) if (buf[i].family != AF_INET) break; in __lookup_name()
355 if (i==cnt) return cnt; in __lookup_name()
365 for (i=0; i<cnt; i++) { in __lookup_name()
423 qsort(buf, cnt, sizeof *buf, addrcmp); in __lookup_name()
427 return cnt; in __lookup_name()