Home | History | Annotate | Download | only in Src

Lines Matching refs:hp

526 	struct hostent *hp;
563 hp = getipnodebyname(hostname, pai->ai_family, AI_ADDRCONFIG, &h_error);
566 hp = gethostbyname2(hostname, pai->ai_family);
570 hp = gethostbyname(hostname);
579 if (hp == NULL) {
594 } else if ((hp->h_name == NULL) || (hp->h_name[0] == 0)
595 || (hp->h_addr_list[0] == NULL)) {
597 freehostent(hp);
599 hp = NULL;
603 if (hp == NULL)
607 aplist = hp->h_addr_list;
610 * hp will be overwritten if we use gethostbyname2().
613 for (naddrs = 0; hp->h_addr_list[naddrs] != NULL; naddrs++)
617 apbuf = (char *)malloc(hp->h_length * naddrs);
624 if (hp->h_addr_list[i] == NULL) {
628 memcpy(&apbuf[i * hp->h_length], hp->h_addr_list[i],
629 hp->h_length);
630 aplist[i] = &apbuf[i * hp->h_length];
635 af = hp->h_addrtype;
676 if (hp)
677 freehostent(hp);
925 struct hostent *hp = NULL;
932 hp = getipnodebyaddr(addr, afd->a_addrlen, afd->a_af, &h_error);
934 hp = gethostbyaddr(addr, afd->a_addrlen, afd->a_af);
936 if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {
938 GET_AI(cur, afd, hp->h_addr_list[0]);
940 GET_CANONNAME(cur, hp->h_name);
942 /* hp will be damaged if we use gethostbyaddr() */
943 if ((ap = (char *)malloc(hp->h_length)) == NULL) {
947 memcpy(ap, hp->h_addr_list[0], hp->h_length);
948 if ((cn = strdup(hp->h_name)) == NULL) {
965 if (hp)
966 freehostent(hp);
978 if (hp)
979 freehostent(hp);