Lines Matching full:ht

189 free_hostent(struct hostent *ht)  in free_hostent()  argument
193 ATF_REQUIRE(ht != NULL); in free_hostent()
195 free(ht->h_name); in free_hostent()
197 if (ht->h_aliases != NULL) { in free_hostent()
198 for (cp = ht->h_aliases; *cp; ++cp) in free_hostent()
200 free(ht->h_aliases); in free_hostent()
203 if (ht->h_addr_list != NULL) { in free_hostent()
204 for (cp = ht->h_addr_list; *cp; ++cp) in free_hostent()
206 free(ht->h_addr_list); in free_hostent()
401 sdump_hostent(struct hostent *ht, char *buffer, size_t buflen) in sdump_hostent() argument
408 ht->h_name, ht->h_addrtype, ht->h_length); in sdump_hostent()
414 if (ht->h_aliases != NULL) { in sdump_hostent()
415 if (*(ht->h_aliases) != NULL) { in sdump_hostent()
416 for (cp = ht->h_aliases; *cp; ++cp) { in sdump_hostent()
447 if (ht->h_addr_list != NULL) { in sdump_hostent()
448 if (*(ht->h_addr_list) != NULL) { in sdump_hostent()
449 for (cp = ht->h_addr_list; *cp; ++cp) { in sdump_hostent()
450 for (i = 0; i < (size_t)ht->h_length; ++i) { in sdump_hostent()
452 i + 1 != (size_t)ht->h_length ? in sdump_hostent()
547 hostent_read_snapshot_func(struct hostent *ht, char *line) in hostent_read_snapshot_func() argument
561 memset(ht, 0, sizeof(struct hostent)); in hostent_read_snapshot_func()
565 ht->h_name = strdup(s); in hostent_read_snapshot_func()
566 ATF_REQUIRE(ht->h_name != NULL); in hostent_read_snapshot_func()
570 ht->h_addrtype = (int)strtol(s, &ts, 10); in hostent_read_snapshot_func()
576 ht->h_length = (int)strtol(s, &ts, 10); in hostent_read_snapshot_func()
614 ts = calloc(1, ht->h_length); in hostent_read_snapshot_func()
618 ht->h_length); in hostent_read_snapshot_func()
624 ts = calloc(1, ht->h_length); in hostent_read_snapshot_func()
627 (unsigned char *)ts, ht->h_length); in hostent_read_snapshot_func()
644 ht->h_aliases = sl1->sl_str; in hostent_read_snapshot_func()
648 ht->h_addr_list = sl2->sl_str; in hostent_read_snapshot_func()
652 free_hostent(ht); in hostent_read_snapshot_func()
653 memset(ht, 0, sizeof(struct hostent)); in hostent_read_snapshot_func()
675 hostent_test_correctness(struct hostent *ht, void *mdata __unused) in hostent_test_correctness() argument
680 dump_hostent(ht); in hostent_test_correctness()
683 if (ht == NULL) in hostent_test_correctness()
686 if (ht->h_name == NULL) in hostent_test_correctness()
689 if (!((ht->h_addrtype >= 0) && (ht->h_addrtype < AF_MAX))) in hostent_test_correctness()
692 if ((ht->h_length != sizeof(struct in_addr)) && in hostent_test_correctness()
693 (ht->h_length != sizeof(struct in6_addr))) in hostent_test_correctness()
696 if (ht->h_aliases == NULL) in hostent_test_correctness()
699 if (ht->h_addr_list == NULL) in hostent_test_correctness()