summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/rpcb_clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/rpc/rpcb_clnt.c')
-rw-r--r--lib/libc/rpc/rpcb_clnt.c105
1 files changed, 38 insertions, 67 deletions
diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c
index da7f014..f9d89c1 100644
--- a/lib/libc/rpc/rpcb_clnt.c
+++ b/lib/libc/rpc/rpcb_clnt.c
@@ -109,9 +109,7 @@ static struct netbuf *got_entry(rpcb_entry_list_ptr, const struct netconfig *);
* These are private routines that may not be provided in future releases.
*/
bool_t
-__rpc_control(request, info)
- int request;
- void *info;
+__rpc_control(int request, void *info)
{
switch (request) {
case CLCR_GET_RPCB_TIMEOUT:
@@ -150,8 +148,7 @@ __rpc_control(request, info)
*/
static struct address_cache *
-check_cache(host, netid)
- const char *host, *netid;
+check_cache(const char *host, const char *netid)
{
struct address_cache *cptr;
@@ -171,8 +168,7 @@ check_cache(host, netid)
}
static void
-delete_cache(addr)
- struct netbuf *addr;
+delete_cache(struct netbuf *addr)
{
struct address_cache *cptr, *prevptr = NULL;
@@ -197,10 +193,8 @@ delete_cache(addr)
}
static void
-add_cache(host, netid, taddr, uaddr)
- const char *host, *netid;
- char *uaddr;
- struct netbuf *taddr;
+add_cache(const char *host, const char *netid, struct netbuf *taddr,
+ char *uaddr)
{
struct address_cache *ad_cache, *cptr, *prevptr;
@@ -280,10 +274,7 @@ out:
* On error, returns NULL and free's everything.
*/
static CLIENT *
-getclnthandle(host, nconf, targaddr)
- const char *host;
- const struct netconfig *nconf;
- char **targaddr;
+getclnthandle(const char *host, const struct netconfig *nconf, char **targaddr)
{
CLIENT *client;
struct netbuf *addr, taddr;
@@ -429,7 +420,7 @@ getclnthandle(host, nconf, targaddr)
* rpcbind. Returns NULL on error and free's everything.
*/
static CLIENT *
-local_rpcb()
+local_rpcb(void)
{
CLIENT *client;
static struct netconfig *loopnconf;
@@ -525,13 +516,13 @@ try_nconf:
/*
* Set a mapping between program, version and address.
* Calls the rpcbind service to do the mapping.
+ *
+ * nconf - Network structure of transport
+ * address - Services netconfig address
*/
bool_t
-rpcb_set(program, version, nconf, address)
- rpcprog_t program;
- rpcvers_t version;
- const struct netconfig *nconf; /* Network structure of transport */
- const struct netbuf *address; /* Services netconfig address */
+rpcb_set(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf,
+ const struct netbuf *address)
{
CLIENT *client;
bool_t rslt = FALSE;
@@ -588,10 +579,7 @@ rpcb_set(program, version, nconf, address)
* only for the given transport.
*/
bool_t
-rpcb_unset(program, version, nconf)
- rpcprog_t program;
- rpcvers_t version;
- const struct netconfig *nconf;
+rpcb_unset(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf)
{
CLIENT *client;
bool_t rslt = FALSE;
@@ -628,9 +616,7 @@ rpcb_unset(program, version, nconf)
* From the merged list, find the appropriate entry
*/
static struct netbuf *
-got_entry(relp, nconf)
- rpcb_entry_list_ptr relp;
- const struct netconfig *nconf;
+got_entry(rpcb_entry_list_ptr relp, const struct netconfig *nconf)
{
struct netbuf *na = NULL;
rpcb_entry_list_ptr sp;
@@ -661,7 +647,7 @@ got_entry(relp, nconf)
* local transport.
*/
static bool_t
-__rpcbind_is_up()
+__rpcbind_is_up(void)
{
struct netconfig *nconf;
struct sockaddr_un sun;
@@ -716,13 +702,9 @@ __rpcbind_is_up()
* starts working properly. Also look under clnt_vc.c.
*/
struct netbuf *
-__rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
- rpcprog_t program;
- rpcvers_t version;
- const struct netconfig *nconf;
- const char *host;
- CLIENT **clpp;
- struct timeval *tp;
+__rpcb_findaddr_timed(rpcprog_t program, rpcvers_t version,
+ const struct netconfig *nconf, const char *host,
+ CLIENT **clpp, struct timeval *tp)
{
static bool_t check_rpcbind = TRUE;
CLIENT *client = NULL;
@@ -1028,13 +1010,9 @@ done:
*
* Assuming that the address is all properly allocated
*/
-int
-rpcb_getaddr(program, version, nconf, address, host)
- rpcprog_t program;
- rpcvers_t version;
- const struct netconfig *nconf;
- struct netbuf *address;
- const char *host;
+bool_t
+rpcb_getaddr(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf,
+ struct netbuf *address, const char *host)
{
struct netbuf *na;
@@ -1065,9 +1043,7 @@ rpcb_getaddr(program, version, nconf, address, host)
* It returns NULL on failure.
*/
rpcblist *
-rpcb_getmaps(nconf, host)
- const struct netconfig *nconf;
- const char *host;
+rpcb_getmaps(const struct netconfig *nconf, const char *host)
{
rpcblist_ptr head = NULL;
CLIENT *client;
@@ -1115,19 +1091,20 @@ done:
* which will look up a service program in the address maps, and then
* remotely call that routine with the given parameters. This allows
* programs to do a lookup and call in one step.
-*/
+ *
+ * nconf -Netconfig structure
+ * host - Remote host name
+ * proc - Remote proc identifiers
+ * xdrargs, xdrres; XDR routines
+ * argsp, resp - Argument and Result
+ * tout - Timeout value for this call
+ * addr_ptr - Preallocated netbuf address
+ */
enum clnt_stat
-rpcb_rmtcall(nconf, host, prog, vers, proc, xdrargs, argsp,
- xdrres, resp, tout, addr_ptr)
- const struct netconfig *nconf; /* Netconfig structure */
- const char *host; /* Remote host name */
- rpcprog_t prog;
- rpcvers_t vers;
- rpcproc_t proc; /* Remote proc identifiers */
- xdrproc_t xdrargs, xdrres; /* XDR routines */
- caddr_t argsp, resp; /* Argument and Result */
- struct timeval tout; /* Timeout value for this call */
- const struct netbuf *addr_ptr; /* Preallocated netbuf address */
+rpcb_rmtcall(const struct netconfig *nconf, const char *host, rpcprog_t prog,
+ rpcvers_t vers, rpcproc_t proc, xdrproc_t xdrargs, caddr_t argsp,
+ xdrproc_t xdrres, caddr_t resp, struct timeval tout,
+ const struct netbuf *addr_ptr)
{
CLIENT *client;
enum clnt_stat stat;
@@ -1198,9 +1175,7 @@ error:
* Returns 1 if succeeds else 0.
*/
bool_t
-rpcb_gettime(host, timep)
- const char *host;
- time_t *timep;
+rpcb_gettime(const char *host, time_t *timep)
{
CLIENT *client = NULL;
void *handle;
@@ -1259,9 +1234,7 @@ rpcb_gettime(host, timep)
* really be called because local n2a libraries are always provided.
*/
char *
-rpcb_taddr2uaddr(nconf, taddr)
- struct netconfig *nconf;
- struct netbuf *taddr;
+rpcb_taddr2uaddr(struct netconfig *nconf, struct netbuf *taddr)
{
CLIENT *client;
char *uaddr = NULL;
@@ -1293,9 +1266,7 @@ rpcb_taddr2uaddr(nconf, taddr)
* really be called because local n2a libraries are always provided.
*/
struct netbuf *
-rpcb_uaddr2taddr(nconf, uaddr)
- struct netconfig *nconf;
- char *uaddr;
+rpcb_uaddr2taddr(struct netconfig *nconf, char *uaddr)
{
CLIENT *client;
struct netbuf *taddr;
OpenPOWER on IntegriCloud