Lines Matching full:he
95 struct hostent *he; in IMPLEMENT_TEST_FILE_SNAPSHOT() local
100 he = getipnodebyname(name, af, ipnode_flags, &error); in IMPLEMENT_TEST_FILE_SNAPSHOT()
101 if (he == NULL) in IMPLEMENT_TEST_FILE_SNAPSHOT()
104 he = gethostbyname2(name, af); in IMPLEMENT_TEST_FILE_SNAPSHOT()
106 return (he); in IMPLEMENT_TEST_FILE_SNAPSHOT()
112 struct hostent *he; in __gethostbyaddr() local
117 he = getipnodebyaddr(addr, len, af, &error); in __gethostbyaddr()
118 if (he == NULL) in __gethostbyaddr()
121 he = gethostbyaddr(addr, len, af); in __gethostbyaddr()
123 return (he); in __gethostbyaddr()
127 __freehostent(struct hostent *he) in __freehostent() argument
130 /* NOTE: checking for he != NULL - just in case */ in __freehostent()
131 if (use_ipnode_functions && he != NULL) in __freehostent()
132 freehostent(he); in __freehostent()
369 is_hostent_equal(struct hostent *he, struct addrinfo *ai) in is_hostent_equal() argument
375 printf("checking equality of he and ai\n"); in is_hostent_equal()
378 rv = check_addrinfo_for_name(ai, he->h_name); in is_hostent_equal()
380 printf("not equal - he->h_name couldn't be found\n"); in is_hostent_equal()
384 for (cp = he->h_addr_list; *cp; ++cp) { in is_hostent_equal()
385 rv = check_addrinfo_for_addr(ai, *cp, he->h_length, in is_hostent_equal()
386 he->h_addrtype); in is_hostent_equal()
388 printf("not equal - one of he->h_addr_list couldn't be found\n"); in is_hostent_equal()
490 hostent_read_hostlist_func(struct hostent *he, char *line) in hostent_read_hostlist_func() argument
510 clone_hostent(he, result); in hostent_read_hostlist_func()
516 memset(he, 0, sizeof(struct hostent)); in hostent_read_hostlist_func()
517 he->h_name = strdup(line); in hostent_read_hostlist_func()
518 ATF_REQUIRE(he->h_name != NULL); in hostent_read_hostlist_func()
714 hostent_test_gethostbyaddr(struct hostent *he, void *mdata) in hostent_test_gethostbyaddr() argument
723 if (he->h_addr_list != NULL) { in hostent_test_gethostbyaddr()
725 for (cp = he->h_addr_list; *cp; ++cp) { in hostent_test_gethostbyaddr()
727 printf("doing reverse lookup for %s\n", he->h_name); in hostent_test_gethostbyaddr()
730 result = __gethostbyaddr(*cp, he->h_length, in hostent_test_gethostbyaddr()
731 he->h_addrtype); in hostent_test_gethostbyaddr()
735 "for %s: %s\n", __func__, he->h_name, in hostent_test_gethostbyaddr()
758 hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata __unused) in hostent_test_getaddrinfo_eq() argument
768 printf("using getaddrinfo() to resolve %s\n", he->h_name); in hostent_test_getaddrinfo_eq()
770 /* struct hostent *he was not resolved */ in hostent_test_getaddrinfo_eq()
771 if (he->h_addr_list == NULL) { in hostent_test_getaddrinfo_eq()
772 /* We can be sure that he->h_name is not NULL */ in hostent_test_getaddrinfo_eq()
773 rv = getaddrinfo(he->h_name, NULL, &hints, &ai); in hostent_test_getaddrinfo_eq()
780 rv = getaddrinfo(he->h_name, NULL, &hints, &ai); in hostent_test_getaddrinfo_eq()
786 rv = is_hostent_equal(he, ai); in hostent_test_getaddrinfo_eq()
799 hostent_test_getnameinfo_eq(struct hostent *he, void *mdata __unused) in hostent_test_getnameinfo_eq() argument
809 if (he->h_addr_list == NULL) in hostent_test_getnameinfo_eq()
812 for (cp = he->h_addr_list; *cp; ++cp) { in hostent_test_getnameinfo_eq()
814 printf("doing reverse lookup for %s\n", he->h_name); in hostent_test_getnameinfo_eq()
816 result = __gethostbyaddr(*cp, he->h_length, in hostent_test_getnameinfo_eq()
817 he->h_addrtype); in hostent_test_getnameinfo_eq()
826 "for %s: %s\n", __func__, he->h_name, in hostent_test_getnameinfo_eq()
829 switch (he->h_addrtype) { in hostent_test_getnameinfo_eq()
834 memcpy(&sin.sin_addr, *cp, he->h_length); in hostent_test_getnameinfo_eq()
842 memcpy(&sin6.sin6_addr, *cp, he->h_length); in hostent_test_getnameinfo_eq()
848 he->h_addrtype); in hostent_test_getnameinfo_eq()
914 "equal for %s\n", he->h_name); in hostent_test_getnameinfo_eq()