#include <rpc/rpc.h> #include <rpc/rpcent.h> #include <rpc/nettype.h>struct rpcent *getrpcent(void);
struct rpcent *getrpcbyname(char *name);
struct rpcent *getrpcbynumber(int number);
int setrpcent(int stayopen);
int endrpcent(void);
char *r_name; /* name of server for this rpc program */ char **r_aliases; /* alias list */ int r_number; /* rpc program number */The members of this structure are:
r_name
r_aliases
r_number
getrpcent reads the next line of the file, opening the file if necessary.
getrpcbyname and getrpcbynumber sequentially search from the beginning of the file until a matching name or number is found, or until an EOF is encountered.
setrpcent opens and rewinds the file. If the stayopen flag is non-zero, the rpc data base will not be closed after each call to getrpcent (either directly, or indirectly through one of the other getrpc calls).
endrpcent closes the file.
The Network Information Service (NIS) will be used to obtain RPC server entries when its installed and running. Otherwise, entries will be read from /etc/rpc.