Lines Matching refs:pai
126 if (pai->ai_flags & AI_CANONNAME) {\
149 memcpy(ai, pai, sizeof(struct addrinfo));\
210 struct addrinfo *pai;
216 pai = &ai;
217 pai->ai_flags = 0;
218 pai->ai_family = PF_UNSPEC;
219 pai->ai_socktype = ANY;
220 pai->ai_protocol = ANY;
221 pai->ai_addrlen = 0;
222 pai->ai_canonname = NULL;
223 pai->ai_addr = NULL;
224 pai->ai_next = NULL;
246 memcpy(pai, hints, sizeof(*pai));
247 switch (pai->ai_socktype) {
249 switch (pai->ai_protocol) {
253 pai->ai_socktype = SOCK_DGRAM;
256 pai->ai_socktype = SOCK_STREAM;
259 pai->ai_socktype = SOCK_RAW;
266 if (pai->ai_protocol != IPPROTO_UDP &&
267 pai->ai_protocol != ANY)
269 pai->ai_protocol = IPPROTO_UDP;
272 if (pai->ai_protocol != IPPROTO_TCP &&
273 pai->ai_protocol != ANY)
275 pai->ai_protocol = IPPROTO_TCP;
288 if (pai->ai_socktype == ANY) {
290 pai->ai_socktype = SOCK_DGRAM;
291 pai->ai_protocol = IPPROTO_UDP;
299 switch (pai->ai_socktype) {
316 if (pai->ai_socktype == ANY) {
318 pai->ai_socktype = SOCK_DGRAM;
319 pai->ai_protocol = IPPROTO_UDP;
321 pai->ai_socktype = SOCK_STREAM;
322 pai->ai_protocol = IPPROTO_TCP;
339 if (!(pai->ai_family == PF_UNSPEC
340 || pai->ai_family == afd->a_af)) {
353 if (pai->ai_flags & AI_PASSIVE) {
384 pai->ai_flags &= ~AI_CANONNAME;
387 pai->ai_flags &= ~AI_CANONNAME;
393 pai->ai_flags &= ~AI_CANONNAME;
398 if (pai->ai_family == afdl[i].a_af ||
399 pai->ai_family == PF_UNSPEC) {
400 if (! (pai->ai_flags & AI_CANONNAME)) {
413 get_name(pton, &afdl[i], &top, pton, pai, port);
420 if (pai->ai_flags & AI_NUMERICHOST)
424 error = get_addr(hostname, pai->ai_family, &top, pai, port);
442 get_name(addr, afd, res, numaddr, pai, port0)
447 struct addrinfo *pai;
473 get_addr(hostname, af, res0, pai, port0)
477 struct addrinfo *pai;
506 error = get_addr0(hostname, afdl[i].a_af, res, pai, port0);
537 get_addr0(hostname, af, res, pai, port0)
541 struct addrinfo *pai;