Lines Matching refs:rpc
109 free_rpcent(struct rpcent *rpc) in free_rpcent() argument
113 ATF_REQUIRE(rpc != NULL); in free_rpcent()
115 free(rpc->r_name); in free_rpcent()
117 for (cp = rpc->r_aliases; *cp; ++cp) in free_rpcent()
119 free(rpc->r_aliases); in free_rpcent()
163 sdump_rpcent(struct rpcent *rpc, char *buffer, size_t buflen) in sdump_rpcent() argument
169 rpc->r_name, rpc->r_number); in sdump_rpcent()
175 if (rpc->r_aliases != NULL) { in sdump_rpcent()
176 if (*(rpc->r_aliases) != NULL) { in sdump_rpcent()
177 for (cp = rpc->r_aliases; *cp; ++cp) { in sdump_rpcent()
194 rpcent_read_snapshot_func(struct rpcent *rpc, char *line) in rpcent_read_snapshot_func() argument
205 memset(rpc, 0, sizeof(struct rpcent)); in rpcent_read_snapshot_func()
209 rpc->r_name = strdup(s); in rpcent_read_snapshot_func()
210 ATF_REQUIRE(rpc->r_name != NULL); in rpcent_read_snapshot_func()
214 rpc->r_number = (int)strtol(s, &ts, 10); in rpcent_read_snapshot_func()
216 free(rpc->r_name); in rpcent_read_snapshot_func()
245 free(rpc->r_name); in rpcent_read_snapshot_func()
246 memset(rpc, 0, sizeof(struct rpcent)); in rpcent_read_snapshot_func()
251 rpc->r_aliases = sl->sl_str; in rpcent_read_snapshot_func()
272 struct rpcent *rpc; in rpcent_fill_test_data() local
275 while ((rpc = getrpcent()) != NULL) { in rpcent_fill_test_data()
276 if (rpcent_test_correctness(rpc, NULL) == 0) in rpcent_fill_test_data()
277 TEST_DATA_APPEND(rpcent, td, rpc); in rpcent_fill_test_data()
287 rpcent_test_correctness(struct rpcent *rpc, void *mdata __unused) in rpcent_test_correctness() argument
291 dump_rpcent(rpc); in rpcent_test_correctness()
293 if (rpc == NULL) in rpcent_test_correctness()
296 if (rpc->r_name == NULL) in rpcent_test_correctness()
299 if (rpc->r_number < 0) in rpcent_test_correctness()
302 if (rpc->r_aliases == NULL) in rpcent_test_correctness()
320 rpcent_check_ambiguity(struct rpcent_test_data *td, struct rpcent *rpc) in rpcent_check_ambiguity() argument
323 return (TEST_DATA_FIND(rpcent, td, rpc, compare_rpcent, in rpcent_check_ambiguity()
331 struct rpcent *rpc; in rpcent_test_getrpcbyname() local
336 rpc = getrpcbyname(rpc_model->r_name); in rpcent_test_getrpcbyname()
337 if (rpcent_test_correctness(rpc, NULL) != 0) in rpcent_test_getrpcbyname()
340 if ((compare_rpcent(rpc, rpc_model, NULL) != 0) && in rpcent_test_getrpcbyname()
341 (rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc) in rpcent_test_getrpcbyname()
346 rpc = getrpcbyname(*alias); in rpcent_test_getrpcbyname()
348 if (rpcent_test_correctness(rpc, NULL) != 0) in rpcent_test_getrpcbyname()
351 if ((compare_rpcent(rpc, rpc_model, NULL) != 0) && in rpcent_test_getrpcbyname()
353 (struct rpcent_test_data *)mdata, rpc) != 0)) in rpcent_test_getrpcbyname()
369 struct rpcent *rpc; in rpcent_test_getrpcbynumber() local
374 rpc = getrpcbynumber(rpc_model->r_number); in rpcent_test_getrpcbynumber()
375 if (rpcent_test_correctness(rpc, NULL) != 0 || in rpcent_test_getrpcbynumber()
376 (compare_rpcent(rpc, rpc_model, NULL) != 0 && in rpcent_test_getrpcbynumber()
377 rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc) in rpcent_test_getrpcbynumber()
388 rpcent_test_getrpcent(struct rpcent *rpc, void *mdata __unused) in rpcent_test_getrpcent() argument
395 return (rpcent_test_correctness(rpc, NULL)); in rpcent_test_getrpcent()