Lines Matching refs:pe

110 free_protoent(struct protoent *pe)  in free_protoent()  argument
114 assert(pe != NULL); in free_protoent()
116 free(pe->p_name); in free_protoent()
118 for (cp = pe->p_aliases; *cp; ++cp) in free_protoent()
120 free(pe->p_aliases); in free_protoent()
164 sdump_protoent(struct protoent *pe, char *buffer, size_t buflen) in sdump_protoent() argument
170 pe->p_name, pe->p_proto); in sdump_protoent()
176 if (pe->p_aliases != NULL) { in sdump_protoent()
177 if (*(pe->p_aliases) != NULL) { in sdump_protoent()
178 for (cp = pe->p_aliases; *cp; ++cp) { in sdump_protoent()
195 protoent_read_snapshot_func(struct protoent *pe, char *line) in protoent_read_snapshot_func() argument
206 memset(pe, 0, sizeof(struct protoent)); in protoent_read_snapshot_func()
210 pe->p_name = strdup(s); in protoent_read_snapshot_func()
211 assert(pe->p_name != NULL); in protoent_read_snapshot_func()
215 pe->p_proto = (int)strtol(s, &ts, 10); in protoent_read_snapshot_func()
217 free(pe->p_name); in protoent_read_snapshot_func()
246 free(pe->p_name); in protoent_read_snapshot_func()
247 memset(pe, 0, sizeof(struct protoent)); in protoent_read_snapshot_func()
252 pe->p_aliases = sl->sl_str; in protoent_read_snapshot_func()
273 struct protoent *pe; in protoent_fill_test_data() local
276 while ((pe = getprotoent()) != NULL) { in protoent_fill_test_data()
277 if (protoent_test_correctness(pe, NULL) == 0) in protoent_fill_test_data()
278 TEST_DATA_APPEND(protoent, td, pe); in protoent_fill_test_data()
288 protoent_test_correctness(struct protoent *pe, void *mdata __unused) in protoent_test_correctness() argument
291 dump_protoent(pe); in protoent_test_correctness()
293 if (pe == NULL) in protoent_test_correctness()
296 if (pe->p_name == NULL) in protoent_test_correctness()
299 if (pe->p_proto < 0) in protoent_test_correctness()
302 if (pe->p_aliases == NULL) in protoent_test_correctness()
320 protoent_check_ambiguity(struct protoent_test_data *td, struct protoent *pe) in protoent_check_ambiguity() argument
323 return (TEST_DATA_FIND(protoent, td, pe, compare_protoent, in protoent_check_ambiguity()
331 struct protoent *pe; in protoent_test_getprotobyname() local
336 pe = getprotobyname(pe_model->p_name); in protoent_test_getprotobyname()
337 if (protoent_test_correctness(pe, NULL) != 0) in protoent_test_getprotobyname()
340 if ((compare_protoent(pe, pe_model, NULL) != 0) && in protoent_test_getprotobyname()
341 (protoent_check_ambiguity((struct protoent_test_data *)mdata, pe) in protoent_test_getprotobyname()
346 pe = getprotobyname(*alias); in protoent_test_getprotobyname()
348 if (protoent_test_correctness(pe, NULL) != 0) in protoent_test_getprotobyname()
351 if ((compare_protoent(pe, pe_model, NULL) != 0) && in protoent_test_getprotobyname()
353 (struct protoent_test_data *)mdata, pe) != 0)) in protoent_test_getprotobyname()
369 struct protoent *pe; in protoent_test_getprotobynumber() local
374 pe = getprotobynumber(pe_model->p_proto); in protoent_test_getprotobynumber()
375 if ((protoent_test_correctness(pe, NULL) != 0) || in protoent_test_getprotobynumber()
376 ((compare_protoent(pe, pe_model, NULL) != 0) && in protoent_test_getprotobynumber()
377 (protoent_check_ambiguity((struct protoent_test_data *)mdata, pe) in protoent_test_getprotobynumber()
388 protoent_test_getprotoent(struct protoent *pe, void *mdata __unused) in protoent_test_getprotoent() argument
392 return (protoent_test_correctness(pe, NULL)); in protoent_test_getprotoent()