Lines Matching refs:rpc

32 #include <rpc/rpc.h>
112 free_rpcent(struct rpcent *rpc)
116 ATF_REQUIRE(rpc != NULL);
118 free(rpc->r_name);
120 for (cp = rpc->r_aliases; *cp; ++cp)
122 free(rpc->r_aliases);
166 sdump_rpcent(struct rpcent *rpc, char *buffer, size_t buflen)
172 rpc->r_name, rpc->r_number);
178 if (rpc->r_aliases != NULL) {
179 if (*(rpc->r_aliases) != NULL) {
180 for (cp = rpc->r_aliases; *cp; ++cp) {
197 rpcent_read_snapshot_func(struct rpcent *rpc, char *line)
208 memset(rpc, 0, sizeof(struct rpcent));
212 rpc->r_name = strdup(s);
213 ATF_REQUIRE(rpc->r_name != NULL);
217 rpc->r_number = (int)strtol(s, &ts, 10);
219 free(rpc->r_name);
248 free(rpc->r_name);
249 memset(rpc, 0, sizeof(struct rpcent));
254 rpc->r_aliases = sl->sl_str;
275 struct rpcent *rpc;
278 while ((rpc = getrpcent()) != NULL) {
279 if (rpcent_test_correctness(rpc, NULL) == 0)
280 TEST_DATA_APPEND(rpcent, td, rpc);
290 rpcent_test_correctness(struct rpcent *rpc, void *mdata __unused)
294 dump_rpcent(rpc);
296 if (rpc == NULL)
299 if (rpc->r_name == NULL)
302 if (rpc->r_number < 0)
305 if (rpc->r_aliases == NULL)
317 /* rpcent_check_ambiguity() is needed when one port+rpc is associated with
319 * /etc/peices. This functions is needed also when one piece+rpc is
321 * to make sure that rpc really exists and correct */
323 rpcent_check_ambiguity(struct rpcent_test_data *td, struct rpcent *rpc)
326 return (TEST_DATA_FIND(rpcent, td, rpc, compare_rpcent,
334 struct rpcent *rpc;
339 rpc = getrpcbyname(rpc_model->r_name);
340 if (rpcent_test_correctness(rpc, NULL) != 0)
343 if ((compare_rpcent(rpc, rpc_model, NULL) != 0) &&
344 (rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc)
349 rpc = getrpcbyname(*alias);
351 if (rpcent_test_correctness(rpc, NULL) != 0)
354 if ((compare_rpcent(rpc, rpc_model, NULL) != 0) &&
356 (struct rpcent_test_data *)mdata, rpc) != 0))
372 struct rpcent *rpc;
377 rpc = getrpcbynumber(rpc_model->r_number);
378 if (rpcent_test_correctness(rpc, NULL) != 0 ||
379 (compare_rpcent(rpc, rpc_model, NULL) != 0 &&
380 rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc)
391 rpcent_test_getrpcent(struct rpcent *rpc, void *mdata __unused)
398 return (rpcent_test_correctness(rpc, NULL));