Lines Matching refs:ai
52 static int do_protocol(const char *name, const struct addrinfo *ai);
53 static void trying(const struct addrinfo *ai);
60 struct addrinfo *ai, *ai0; in netfinger() local
88 for (ai = ai0; ai != NULL; ai = ai->ai_next) { in netfinger()
90 trying(ai); in netfinger()
92 error = do_protocol(name, ai); in netfinger()
101 do_protocol(const char *name, const struct addrinfo *ai) in do_protocol() argument
111 s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); in do_protocol()
113 warn("socket(%d, %d, %d)", ai->ai_family, ai->ai_socktype, in do_protocol()
114 ai->ai_protocol); in do_protocol()
118 msg.msg_name = (void *)ai->ai_addr; in do_protocol()
119 msg.msg_namelen = ai->ai_addrlen; in do_protocol()
137 if (connect(s, ai->ai_addr, ai->ai_addrlen) < 0) { in do_protocol()
212 trying(const struct addrinfo *ai) in trying() argument
216 if (getnameinfo(ai->ai_addr, ai->ai_addrlen, buf, sizeof buf, in trying()