'\" te .\" Copyright 2014 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH RPCBIND 3NSL "Jul 25, 2015" .SH NAME rpcbind, rpcb_getmaps, rpcb_getaddr, rpcb_gettime, rpcb_rmtcall, rpcb_set, rpcb_unset \- library routines for RPC bind service .SH SYNOPSIS .LP .nf #include \fBstruct rpcblist *\fR\fBrpcb_getmaps\fR(\fBconst struct netconfig *\fR\fInetconf\fR, \fBconst char *\fR\fIhost\fR); .fi .LP .nf \fBbool_t\fR \fBrpcb_getaddr\fR(\fBconst rpcprog_t\fR \fIprognum\fR, \fBconst rpcvers_t\fR \fIversnum\fR, \fBconst struct netconfig *\fR\fInetconf\fR, \fBstruct netbuf *\fR\fIsvcaddr\fR, \fBconst char *\fR\fIhost\fR); .fi .LP .nf \fBbool_t\fR \fBrpcb_gettime\fR(\fBconst char *\fR\fIhost\fR, \fBtime_t *\fR\fItimep\fR); .fi .LP .nf \fBenum clnt_stat\fR \fBrpcb_rmtcall\fR(\fBconst struct netconfig *\fR\fInetconf\fR, \fBconst char *\fR\fIhost\fR, \fBconst rpcprog_t\fR \fIprognum\fR, \fBconst rpcvers_t\fR \fIversnum\fR, \fBconst rpcproc_t\fR \fIprocnum\fR, \fBconst xdrproc_t\fR \fIinproc\fR, \fBconst caddr_t\fR \fIin\fR, \fBconst xdrproc_t\fR \fIoutproc\fR \fBcaddr_t\fR \fIout\fR, \fBconst struct timeval\fR \fItout\fR, \fBstruct netbuf *\fR\fIsvcaddr\fR); .fi .LP .nf \fBbool_t\fR \fBrpcb_set\fR(\fBconst rpcprog_t\fR \fIprognum\fR, \fBconst rpcvers_t\fR \fIversnum\fR, \fBconst struct netconfig *\fR\fInetconf\fR, \fBconst struct netbuf *\fR\fIsvcaddr\fR); .fi .LP .nf \fBbool_t\fR \fBrpcb_unset\fR(\fBconst rpcprog_t\fR \fIprognum\fR, \fBconst rpcvers_t\fR \fIversnum\fR, \fBconst struct netconfig *\fR\fInetconf\fR); .fi .SH DESCRIPTION .LP These routines allow client C programs to make procedure calls to the RPC binder service. \fBrpcbind\fR maintains a list of mappings between programs and their universal addresses. See \fBrpcbind\fR(8). .SS "Routines" .ne 2 .na \fB\fBrpcb_getmaps()\fR\fR .ad .RS 18n An interface to the \fBrpcbind\fR service, which returns a list of the current \fBRPC\fR program-to-address mappings on \fIhost\fR. It uses the transport specified through \fInetconf\fR to contact the remote \fBrpcbind\fR service on \fIhost\fR. This routine will return \fBNULL,\fR if the remote \fBrpcbind\fR could not be contacted. .RE .sp .ne 2 .na \fB\fBrpcb_getaddr()\fR\fR .ad .RS 18n An interface to the \fBrpcbind\fR service, which finds the address of the service on \fIhost\fR that is registered with program number \fIprognum\fR, version \fIversnum\fR, and speaks the transport protocol associated with \fInetconf\fR. The address found is returned in \fIsvcaddr\fR. \fIsvcaddr\fR should be preallocated. This routine returns \fBTRUE\fR if it succeeds. A return value of \fBFALSE\fR means that the mapping does not exist or that the \fBRPC\fR system failed to contact the remote \fBrpcbind\fR service. In the latter case, the global variable \fBrpc_createerr\fR contains the \fBRPC\fR status. See \fBrpc_clnt_create\fR(3NSL). .RE .sp .ne 2 .na \fB\fBrpcb_gettime()\fR\fR .ad .RS 18n This routine returns the time on \fIhost\fR in \fItimep\fR. If \fIhost\fR is \fINULL\fR, \fBrpcb_gettime()\fR returns the time on its own machine. This routine returns \fBTRUE\fR if it succeeds, \fBFALSE\fR if it fails. \fBrpcb_gettime()\fR can be used to synchronize the time between the client and the remote server. This routine is particularly useful for secure RPC. .RE .sp .ne 2 .na \fB\fBrpcb_rmtcall()\fR\fR .ad .RS 18n An interface to the \fBrpcbind\fR service, which instructs \fBrpcbind\fR on \fIhost\fR to make an \fBRPC\fR call on your behalf to a procedure on that host. The \fBnetconfig\fR structure should correspond to a connectionless transport. The parameter \fB*\fR\fIsvcaddr\fR will be modified to the server's address if the procedure succeeds. See \fBrpc_call()\fR and \fBclnt_call()\fR in \fBrpc_clnt_calls\fR(3NSL) for the definitions of other parameters. .sp This procedure should normally be used for a "ping" and nothing else. This routine allows programs to do lookup and call, all in one step. .sp Note: Even if the server is not running \fBrpcbind\fR does not return any error messages to the caller. In such a case, the caller times out. .sp Note: \fBrpcb_rmtcall()\fR is only available for connectionless transports. .RE .sp .ne 2 .na \fB\fBrpcb_set()\fR\fR .ad .RS 18n An interface to the \fBrpcbind\fR service, which establishes a mapping between the triple [\fIprognum\fR, \fIversnum\fR, \fInetconf\fR->\fInc_netid]\fR and \fIsvcaddr\fR on the machine's \fBrpcbind\fR service. The value of \fInc_netid\fR must correspond to a network identifier that is defined by the netconfig database. This routine returns \fBTRUE\fR if it succeeds, \fBFALSE\fR otherwise. See also \fBsvc_reg()\fR in \fBrpc_svc_reg\fR(3NSL). If there already exists such an entry with \fBrpcbind\fR, \fBrpcb_set()\fR will fail. .RE .sp .ne 2 .na \fB\fBrpcb_unset()\fR\fR .ad .RS 18n An interface to the \fBrpcbind\fR service, which destroys the mapping between the triple [\fIprognum\fR, \fIversnum\fR, \fInetconf\fR->\fInc_netid]\fR and the address on the machine's \fBrpcbind\fR service. If \fInetconf\fR is \fINULL\fR, \fBrpcb_unset()\fR destroys all mapping between the triple [\fIprognum\fR, \fIversnum\fR, \fIall-transports\fR] and the addresses on the machine's \fBrpcbind\fR service. This routine returns \fBTRUE\fR if it succeeds, \fBFALSE\fR otherwise. Only the owner of the service or the super-user can destroy the mapping. See also \fBsvc_unreg()\fR in \fBrpc_svc_reg\fR(3NSL). .RE .SH ATTRIBUTES .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .sp .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE _ MT-Level MT-Safe .TE .SH SEE ALSO .LP .BR rpc_clnt_calls (3NSL), .BR rpc_clnt_create (3NSL), .BR rpc_svc_calls (3NSL), .BR attributes (7), .BR rpcbind (8), .BR rpcinfo (8)