Lines Matching defs:rpc

32 #include <rpc/rpc.h>
114 free_rpcent(struct rpcent *rpc)
118 ATF_REQUIRE(rpc != NULL);
120 free(rpc->r_name);
122 for (cp = rpc->r_aliases; *cp; ++cp)
124 free(rpc->r_aliases);
168 sdump_rpcent(struct rpcent *rpc, char *buffer, size_t buflen)
174 rpc->r_name, rpc->r_number);
180 if (rpc->r_aliases != NULL) {
181 if (*(rpc->r_aliases) != '\0') {
182 for (cp = rpc->r_aliases; *cp; ++cp) {
199 rpcent_read_snapshot_func(struct rpcent *rpc, char *line)
210 memset(rpc, 0, sizeof(struct rpcent));
214 rpc->r_name = strdup(s);
215 ATF_REQUIRE(rpc->r_name != NULL);
219 rpc->r_number = (int)strtol(s, &ts, 10);
221 free(rpc->r_name);
250 free(rpc->r_name);
251 memset(rpc, 0, sizeof(struct rpcent));
256 rpc->r_aliases = sl->sl_str;
277 struct rpcent *rpc;
280 while ((rpc = getrpcent()) != NULL) {
281 if (rpcent_test_correctness(rpc, NULL) == 0)
282 TEST_DATA_APPEND(rpcent, td, rpc);
292 rpcent_test_correctness(struct rpcent *rpc, void *mdata)
296 dump_rpcent(rpc);
298 if (rpc == NULL)
301 if (rpc->r_name == NULL)
304 if (rpc->r_number < 0)
307 if (rpc->r_aliases == NULL)
319 /* rpcent_check_ambiguity() is needed when one port+rpc is associated with
321 * /etc/peices. This functions is needed also when one peice+rpc is
323 * to make sure that rpc really exists and correct */
325 rpcent_check_ambiguity(struct rpcent_test_data *td, struct rpcent *rpc)
328 return (TEST_DATA_FIND(rpcent, td, rpc, compare_rpcent,
336 struct rpcent *rpc;
341 rpc = getrpcbyname(rpc_model->r_name);
342 if (rpcent_test_correctness(rpc, NULL) != 0)
345 if ((compare_rpcent(rpc, rpc_model, NULL) != 0) &&
346 (rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc)
351 rpc = getrpcbyname(*alias);
353 if (rpcent_test_correctness(rpc, NULL) != 0)
356 if ((compare_rpcent(rpc, rpc_model, NULL) != 0) &&
358 (struct rpcent_test_data *)mdata, rpc) != 0))
374 struct rpcent *rpc;
379 rpc = getrpcbynumber(rpc_model->r_number);
380 if (rpcent_test_correctness(rpc, NULL) != 0 ||
381 (compare_rpcent(rpc, rpc_model, NULL) != 0 &&
382 rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc)
393 rpcent_test_getrpcent(struct rpcent *rpc, void *mdata)
400 return (rpcent_test_correctness(rpc, NULL));