Lines Matching refs:addrinfo

398 	struct addrinfo *info;
435 static SOCKET sock_create_socket(struct addrinfo *addrinfo, char *errbuf,
443 sock = socket(addrinfo->ai_family, addrinfo->ai_socktype,
444 addrinfo->ai_protocol);
484 * \param addrinfo: pointer to an addrinfo variable which will be used to
504 SOCKET sock_open(const char *host, struct addrinfo *addrinfo, int server, int nconn, char *errbuf, int errbuflen)
516 sock = sock_create_socket(addrinfo, errbuf, errbuflen);
565 if (addrinfo->ai_family == PF_INET6)
580 if (bind(sock, addrinfo->ai_addr, (int) addrinfo->ai_addrlen) != 0)
587 if (addrinfo->ai_socktype == SOCK_STREAM)
602 struct addrinfo *tempaddrinfo;
616 for (tempaddrinfo = addrinfo; tempaddrinfo != NULL;
640 for (tempaddrinfo = addrinfo, i = 0; tempaddrinfo != NULL;
1046 * \brief Checks that the address, port and flags given are valids and it returns an 'addrinfo' structure.
1058 * \param hints: an addrinfo variable (passed by reference) containing the flags needed to create the
1059 * addrinfo structure appropriately.
1061 * \param addrinfo: it represents the true returning value. This is a pointer to an addrinfo variable
1073 * in the 'errbuf' variable. The addrinfo variable that has to be used in the following sockets calls is
1074 * returned into the addrinfo parameter.
1076 * \warning The 'addrinfo' variable has to be deleted by the programmer by calling freeaddrinfo() when
1084 struct addrinfo *hints, struct addrinfo **addrinfo, char *errbuf, int errbuflen)
1097 retval = getaddrinfo(host, port == NULL ? "0" : port, hints, addrinfo);
1111 addrinfo);
1120 freeaddrinfo(*addrinfo);
1145 * addrinfo has more han one pointers
1156 if (((*addrinfo)->ai_family != PF_INET) &&
1157 ((*addrinfo)->ai_family != PF_INET6))
1161 freeaddrinfo(*addrinfo);
1162 *addrinfo = NULL;
1169 if (((*addrinfo)->ai_socktype == SOCK_STREAM) &&
1170 (sock_ismcastaddr((*addrinfo)->ai_addr) == 0))
1174 freeaddrinfo(*addrinfo);
1175 *addrinfo = NULL;
1737 struct addrinfo *addrinfo, *ai_next;
1756 /* it avoids a warning in the compilation ('addrinfo used but not initialized') */
1757 addrinfo = NULL;
1761 struct addrinfo hints;
1764 addrinfo = NULL;
1765 memset(&hints, 0, sizeof(struct addrinfo));
1769 retval = getaddrinfo(token, NULL, &hints, &addrinfo);
1788 /* ai_next is required to preserve the content of addrinfo, in order to deallocate it properly */
1789 ai_next = addrinfo;
1795 freeaddrinfo(addrinfo);
1806 freeaddrinfo(addrinfo);
1807 addrinfo = NULL;
1813 if (addrinfo)
1815 freeaddrinfo(addrinfo);
1816 addrinfo = NULL;
2086 struct addrinfo *addrinfo;
2087 struct addrinfo hints;
2093 if ((retval = sock_initaddress(address, "22222" /* fake port */, &hints, &addrinfo, errbuf, errbuflen)) == -1)
2096 if (addrinfo->ai_family == PF_INET)
2097 memcpy(sockaddr, addrinfo->ai_addr, sizeof(struct sockaddr_in));
2099 memcpy(sockaddr, addrinfo->ai_addr, sizeof(struct sockaddr_in6));
2101 if (addrinfo->ai_next != NULL)
2103 freeaddrinfo(addrinfo);
2110 freeaddrinfo(addrinfo);