Lines Matching defs:rpc

32 #include <rpc/rpc.h>
116 free_rpcent(struct rpcent *rpc)
120 assert(rpc != NULL);
122 free(rpc->r_name);
124 for (cp = rpc->r_aliases; *cp; ++cp)
126 free(rpc->r_aliases);
170 sdump_rpcent(struct rpcent *rpc, char *buffer, size_t buflen)
176 rpc->r_name, rpc->r_number);
182 if (rpc->r_aliases != NULL) {
183 if (*(rpc->r_aliases) != '\0') {
184 for (cp = rpc->r_aliases; *cp; ++cp) {
201 rpcent_read_snapshot_func(struct rpcent *rpc, char *line)
213 memset(rpc, 0, sizeof(struct rpcent));
217 rpc->r_name = strdup(s);
218 assert(rpc->r_name != NULL);
222 rpc->r_number = (int)strtol(s, &ts, 10);
224 free(rpc->r_name);
253 free(rpc->r_name);
254 memset(rpc, 0, sizeof(struct rpcent));
259 rpc->r_aliases = sl->sl_str;
280 struct rpcent *rpc;
283 while ((rpc = getrpcent()) != NULL) {
284 if (rpcent_test_correctness(rpc, NULL) == 0)
285 TEST_DATA_APPEND(rpcent, td, rpc);
295 rpcent_test_correctness(struct rpcent *rpc, void *mdata)
299 dump_rpcent(rpc);
302 if (rpc == NULL)
305 if (rpc->r_name == NULL)
308 if (rpc->r_number < 0)
311 if (rpc->r_aliases == NULL)
325 /* rpcent_check_ambiguity() is needed when one port+rpc is associated with
327 * /etc/peices. This functions is needed also when one peice+rpc is
329 * to make sure that rpc really exists and correct */
331 rpcent_check_ambiguity(struct rpcent_test_data *td, struct rpcent *rpc)
334 return (TEST_DATA_FIND(rpcent, td, rpc, compare_rpcent,
342 struct rpcent *rpc;
349 rpc = getrpcbyname(rpc_model->r_name);
350 if (rpcent_test_correctness(rpc, NULL) != 0)
353 if ((compare_rpcent(rpc, rpc_model, NULL) != 0) &&
354 (rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc)
359 rpc = getrpcbyname(*alias);
361 if (rpcent_test_correctness(rpc, NULL) != 0)
364 if ((compare_rpcent(rpc, rpc_model, NULL) != 0) &&
366 (struct rpcent_test_data *)mdata, rpc) != 0))
384 struct rpcent *rpc;
391 rpc = getrpcbynumber(rpc_model->r_number);
392 if ((rpcent_test_correctness(rpc, NULL) != 0) ||
393 ((compare_rpcent(rpc, rpc_model, NULL) != 0) &&
394 (rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc)
407 rpcent_test_getrpcent(struct rpcent *rpc, void *mdata)
411 return (rpcent_test_correctness(rpc, NULL));