Home | History | Annotate | Download | only in libpcap

Lines Matching defs:addrinfo

263  * \param addrinfo: pointer to an addrinfo variable which will be used to
283 SOCKET sock_open(struct addrinfo *addrinfo, int server, int nconn, char *errbuf, int errbuflen)
287 sock = socket(addrinfo->ai_family, addrinfo->ai_socktype, addrinfo->ai_protocol);
305 if (addrinfo->ai_family == PF_INET6)
319 if (bind(sock, addrinfo->ai_addr, (int) addrinfo->ai_addrlen) != 0)
325 if (addrinfo->ai_socktype == SOCK_STREAM)
337 struct addrinfo *tempaddrinfo;
341 tempaddrinfo = addrinfo;
439 * \brief Checks that the address, port and flags given are valids and it returns an 'addrinfo' structure.
451 * \param hints: an addrinfo variable (passed by reference) containing the flags needed to create the
452 * addrinfo structure appropriately.
454 * \param addrinfo: it represents the true returning value. This is a pointer to an addrinfo variable
466 * in the 'errbuf' variable. The addrinfo variable that has to be used in the following sockets calls is
467 * returned into the addrinfo parameter.
469 * \warning The 'addrinfo' variable has to be deleted by the programmer by calling freeaddrinfo() when
477 struct addrinfo *hints, struct addrinfo **addrinfo, char *errbuf, int errbuflen)
481 retval = getaddrinfo(host, port, hints, addrinfo);
500 * addrinfo has more han one pointers
511 if (((*addrinfo)->ai_family != PF_INET) &&
512 ((*addrinfo)->ai_family != PF_INET6))
522 if (((*addrinfo)->ai_socktype == SOCK_STREAM) &&
523 (sock_ismcastaddr((*addrinfo)->ai_addr) == 0))
875 struct addrinfo *addrinfo, *ai_next;
892 /* it avoids a warning in the compilation ('addrinfo used but not initialized') */
893 addrinfo = NULL;
897 struct addrinfo hints;
900 addrinfo = NULL;
901 memset(&hints, 0, sizeof(struct addrinfo));
905 retval = getaddrinfo(token, "0", &hints, &addrinfo);
918 /* ai_next is required to preserve the content of addrinfo, in order to deallocate it properly */
919 ai_next = addrinfo;
935 freeaddrinfo(addrinfo);
936 addrinfo = NULL;
942 if (addrinfo)
944 freeaddrinfo(addrinfo);
945 addrinfo = NULL;
1204 struct addrinfo *addrinfo;
1205 struct addrinfo hints;
1211 if ((retval = sock_initaddress(address, "22222" /* fake port */, &hints, &addrinfo, errbuf, errbuflen)) == -1)
1214 if (addrinfo->ai_family == PF_INET)
1215 memcpy(sockaddr, addrinfo->ai_addr, sizeof(struct sockaddr_in));
1217 memcpy(sockaddr, addrinfo->ai_addr, sizeof(struct sockaddr_in6));
1219 if (addrinfo->ai_next != NULL)
1221 freeaddrinfo(addrinfo);
1228 freeaddrinfo(addrinfo);