Lines Matching refs:addrinfo
22 * If the operating system does not provide a struct addrinfo, the
26 * struct addrinfo {
34 * struct addrinfo *ai_next; // next structure in linked list
39 * hints is an optional pointer to a struct addrinfo. This structure can
64 * ai_canonname of the first addrinfo structure returned. Setting
85 * All other elements of the struct addrinfo passed via hints must be
88 * A hints of NULL is treated as if the caller provided a struct addrinfo
92 * linked list of one or more addrinfo structures. Each struct addrinfo
95 * and ai_protocol in each returned addrinfo structure contain the
96 * corresponding arguments for a call to socket(2). For each addrinfo
101 * allocated: the addrinfo structures, and the socket address structures
105 * ai is a pointer to a struct addrinfo created by a call to getaddrinfo().
154 /*! \struct addrinfo
156 static struct addrinfo
157 *ai_concat(struct addrinfo *ai1, struct addrinfo *ai2),
158 *ai_reverse(struct addrinfo *oai),
159 *ai_clone(struct addrinfo *oai, int family),
162 static int get_local(const char *name, int socktype, struct addrinfo **res);
167 struct addrinfo **aip, int socktype, int port);
169 static int add_ipv4(const char *hostname, int flags, struct addrinfo **aip,
171 static int add_ipv6(const char *hostname, int flags, struct addrinfo **aip,
173 static void set_order(int, int (**)(const char *, int, struct addrinfo **,
175 static void _freeaddrinfo(struct addrinfo *ai);
188 const struct addrinfo *hints, struct addrinfo **res)
193 struct addrinfo *ai, *ai_list;
196 int (*net_order[FOUND_MAX+1])(const char *, int, struct addrinfo **,
506 struct addrinfo ai_sentinel;
730 /* Parse the response and construct the addrinfo chain */
760 struct addrinfo *ai;
895 struct addrinfo **aip, int socktype, int port)
991 struct addrinfo *sentinel4 = NULL;
992 struct addrinfo *sentinel6 = NULL;
1077 set_order(int family, int (**net_order)(const char *, int, struct addrinfo **,
1127 add_ipv4(const char *hostname, int flags, struct addrinfo **aip,
1130 struct addrinfo *ai;
1150 add_ipv6(const char *hostname, int flags, struct addrinfo **aip,
1153 struct addrinfo *ai;
1172 freeaddrinfo(struct addrinfo *ai) {
1177 _freeaddrinfo(struct addrinfo *ai) {
1178 struct addrinfo *ai_next;
1193 get_local(const char *name, int socktype, struct addrinfo **res) {
1194 struct addrinfo *ai;
1219 * Allocate an addrinfo structure, and a sockaddr structure
1228 static struct addrinfo *
1230 struct addrinfo *ai;
1232 ai = (struct addrinfo *)calloc(1, sizeof(*ai));
1250 static struct addrinfo *
1251 ai_clone(struct addrinfo *oai, int family) {
1252 struct addrinfo *ai;
1270 static struct addrinfo *
1271 ai_reverse(struct addrinfo *oai) {
1272 struct addrinfo *nai, *tai;
1292 static struct addrinfo *
1293 ai_concat(struct addrinfo *ai1, struct addrinfo *ai2) {
1294 struct addrinfo *ai_tmp;