Lines Matching refs:pai
158 if (pai->ai_flags & AI_CANONNAME) {\
173 memcpy(ai, pai, sizeof(struct addrinfo));\
188 memcpy(ai, pai, sizeof(struct addrinfo));\
245 struct addrinfo *pai; in getaddrinfo() local
265 pai = &ai; in getaddrinfo()
266 pai->ai_flags = 0; in getaddrinfo()
267 pai->ai_family = PF_UNSPEC; in getaddrinfo()
268 pai->ai_socktype = GAI_ANY; in getaddrinfo()
269 pai->ai_protocol = GAI_ANY; in getaddrinfo()
270 pai->ai_addrlen = 0; in getaddrinfo()
271 pai->ai_canonname = NULL; in getaddrinfo()
272 pai->ai_addr = NULL; in getaddrinfo()
273 pai->ai_next = NULL; in getaddrinfo()
295 memcpy(pai, hints, sizeof(*pai)); in getaddrinfo()
296 switch (pai->ai_socktype) { in getaddrinfo()
298 switch (pai->ai_protocol) { in getaddrinfo()
302 pai->ai_socktype = SOCK_DGRAM; in getaddrinfo()
305 pai->ai_socktype = SOCK_STREAM; in getaddrinfo()
308 pai->ai_socktype = SOCK_RAW; in getaddrinfo()
315 if (pai->ai_protocol != IPPROTO_UDP && in getaddrinfo()
316 pai->ai_protocol != GAI_ANY) in getaddrinfo()
318 pai->ai_protocol = IPPROTO_UDP; in getaddrinfo()
321 if (pai->ai_protocol != IPPROTO_TCP && in getaddrinfo()
322 pai->ai_protocol != GAI_ANY) in getaddrinfo()
324 pai->ai_protocol = IPPROTO_TCP; in getaddrinfo()
337 if (pai->ai_socktype == GAI_ANY) { in getaddrinfo()
339 pai->ai_socktype = SOCK_DGRAM; in getaddrinfo()
340 pai->ai_protocol = IPPROTO_UDP; in getaddrinfo()
348 switch (pai->ai_socktype) { in getaddrinfo()
365 if (pai->ai_socktype == GAI_ANY) { in getaddrinfo()
367 pai->ai_socktype = SOCK_DGRAM; in getaddrinfo()
368 pai->ai_protocol = IPPROTO_UDP; in getaddrinfo()
370 pai->ai_socktype = SOCK_STREAM; in getaddrinfo()
371 pai->ai_protocol = IPPROTO_TCP; in getaddrinfo()
387 if (!(pai->ai_family == PF_UNSPEC in getaddrinfo()
388 || pai->ai_family == gai_afd->a_af)) { in getaddrinfo()
392 if (pai->ai_flags & AI_PASSIVE) { in getaddrinfo()
426 pai->ai_flags &= ~AI_CANONNAME; in getaddrinfo()
429 pai->ai_flags &= ~AI_CANONNAME; in getaddrinfo()
435 pai->ai_flags &= ~AI_CANONNAME; in getaddrinfo()
440 if (pai->ai_family == gai_afdl[i].a_af || in getaddrinfo()
441 pai->ai_family == PF_UNSPEC) { in getaddrinfo()
442 if (! (pai->ai_flags & AI_CANONNAME)) { in getaddrinfo()
455 get_name(pton, &gai_afdl[i], &top, pton, pai, port); in getaddrinfo()
462 if (pai->ai_flags & AI_NUMERICHOST) in getaddrinfo()
466 error = get_addr(hostname, pai->ai_family, &top, pai, port); in getaddrinfo()
484 get_name(addr, gai_afd, res, numaddr, pai, port0) in get_name() argument
489 struct addrinfo *pai;
530 get_addr(hostname, af, res, pai, port0) in get_addr() argument
534 struct addrinfo *pai;