diff options
Diffstat (limited to 'lib/libc/rpc/rpcb_clnt.c')
-rw-r--r-- | lib/libc/rpc/rpcb_clnt.c | 103 |
1 files changed, 37 insertions, 66 deletions
diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c index a0d840e..d53d908 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; @@ -198,10 +194,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; @@ -286,10 +280,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; @@ -435,7 +426,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; @@ -531,13 +522,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; @@ -594,10 +585,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; @@ -634,9 +622,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; @@ -667,7 +653,7 @@ got_entry(relp, nconf) * local transport. */ static bool_t -__rpcbind_is_up() +__rpcbind_is_up(void) { struct netconfig *nconf; struct sockaddr_un sun; @@ -722,13 +708,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; @@ -1037,12 +1019,8 @@ 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; +rpcb_getaddr(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, + struct netbuf *address, const char *host) { struct netbuf *na; @@ -1073,9 +1051,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; @@ -1123,19 +1099,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; @@ -1206,9 +1183,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; @@ -1267,9 +1242,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; @@ -1301,9 +1274,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; |