xref: /minix3/lib/libc/rpc/rpc_clnt_create.3 (revision f14fb602092e015ff630df58e17c2a9cd57d29b3)
12fe8fb19SBen Gras.\" @(#)rpc_clnt_create.3n 1.36 93/08/31 SMI; from SVr4
22fe8fb19SBen Gras.\" Copyright 1989 AT&T
32fe8fb19SBen Gras.\" @(#)rpc_clnt_create 1.5 89/07/24 SMI;
42fe8fb19SBen Gras.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
5*f14fb602SLionel Sambuc.\"	$NetBSD: rpc_clnt_create.3,v 1.12 2011/05/17 03:35:39 enami Exp $
62fe8fb19SBen Gras.Dd May 23, 2009
72fe8fb19SBen Gras.Dt RPC_CLNT_CREATE 3
82fe8fb19SBen Gras.Os
92fe8fb19SBen Gras.Sh NAME
102fe8fb19SBen Gras.Nm rpc_clnt_create ,
112fe8fb19SBen Gras.Nm clnt_control ,
122fe8fb19SBen Gras.Nm clnt_create ,
132fe8fb19SBen Gras.Nm clnt_create_vers ,
142fe8fb19SBen Gras.Nm clnt_destroy ,
152fe8fb19SBen Gras.Nm clnt_dg_create ,
162fe8fb19SBen Gras.Nm clnt_pcreateerror ,
172fe8fb19SBen Gras.Nm clnt_raw_create ,
182fe8fb19SBen Gras.Nm clnt_spcreateerror ,
192fe8fb19SBen Gras.Nm clnt_tli_create ,
202fe8fb19SBen Gras.Nm clnt_tp_create ,
212fe8fb19SBen Gras.Nm clnt_vc_create ,
222fe8fb19SBen Gras.Nm rpc_createerr
232fe8fb19SBen Gras.Nd "library routines for dealing with creation and manipulation of CLIENT handles"
242fe8fb19SBen Gras.Sh LIBRARY
252fe8fb19SBen Gras.Lb libc
262fe8fb19SBen Gras.Sh SYNOPSIS
272fe8fb19SBen Gras.In rpc/rpc.h
282fe8fb19SBen Gras.Ft bool_t
292fe8fb19SBen Gras.Fn clnt_control "CLIENT *clnt" "const u_int req" "char *info"
302fe8fb19SBen Gras.Ft "CLIENT *"
312fe8fb19SBen Gras.Fn clnt_create "const char * host" "const rpcprog_t prognum" "const rpcvers_t versnum" "const char *nettype"
322fe8fb19SBen Gras.Ft "CLIENT *"
332fe8fb19SBen Gras.Fn clnt_create_vers "const char * host" "const rpcprog_t prognum" "rpcvers_t *vers_outp" "const rpcvers_t vers_low" "const rpcvers_t vers_high" "char *nettype"
342fe8fb19SBen Gras.Ft void
352fe8fb19SBen Gras.Fn clnt_destroy "CLIENT * clnt"
362fe8fb19SBen Gras.Ft "CLIENT *"
372fe8fb19SBen Gras.Fn clnt_dg_create "const int fildes" "const struct netbuf *svcaddr" "const rpcprog_t prognum" "const rpcvers_t versnum" "const u_int sendsz" "const u_int recvsz"
382fe8fb19SBen Gras.Ft void
392fe8fb19SBen Gras.Fn clnt_pcreateerror "const char *s"
402fe8fb19SBen Gras.Ft "char *"
412fe8fb19SBen Gras.Fn clnt_spcreateerror "const char *s"
422fe8fb19SBen Gras.Ft "CLIENT *"
432fe8fb19SBen Gras.Fn clnt_raw_create "const rpcprog_t prognum" "const rpcvers_t versnum"
442fe8fb19SBen Gras.Ft "CLIENT *"
452fe8fb19SBen Gras.Fn clnt_tli_create "const int fildes" "const struct netconfig *netconf" "const struct netbuf *svcaddr" "const rpcprog_t prognum" "const rpcvers_t versnum" "const u_int sendsz" "const u_int recvsz"
462fe8fb19SBen Gras.Ft "CLIENT *"
472fe8fb19SBen Gras.Fn clnt_tp_create "const char * host" "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf"
482fe8fb19SBen Gras.Ft "CLIENT *"
492fe8fb19SBen Gras.Fn clnt_vc_create "const int fildes" "const struct netbuf *svcaddr" "const rpcprog_t prognum" "const rpcvers_t versnum" "const u_int sendsz" "const u_int recvsz"
502fe8fb19SBen Gras.Sh DESCRIPTION
512fe8fb19SBen GrasRPC library routines allow C language programs to make procedure
522fe8fb19SBen Grascalls on other machines across the network.
532fe8fb19SBen GrasFirst a
542fe8fb19SBen Gras.Dv CLIENT
552fe8fb19SBen Grashandle is created and then the client calls a procedure to send a
562fe8fb19SBen Grasrequest to the server.
572fe8fb19SBen GrasOn receipt of the request, the server calls a dispatch routine
582fe8fb19SBen Grasto perform the requested service, and then sends a reply.
592fe8fb19SBen Gras.Sh ROUTINES
602fe8fb19SBen Gras.Bl -tag -width YYYYYYY
612fe8fb19SBen Gras.It Fn clnt_control
622fe8fb19SBen GrasA function macro to change or retrieve various information
632fe8fb19SBen Grasabout a client object.
642fe8fb19SBen Gras.Fa req
652fe8fb19SBen Grasindicates the type of operation, and
662fe8fb19SBen Gras.Fa info
672fe8fb19SBen Grasis a pointer to the information.
682fe8fb19SBen GrasFor both connectionless and connection-oriented transports,
692fe8fb19SBen Grasthe supported values of
702fe8fb19SBen Gras.Fa req
712fe8fb19SBen Grasand their argument types and what they do are:
722fe8fb19SBen Gras.Bl -column "CLSET_FD_NCLOSE" "struct timeval *" "set total timeout"
732fe8fb19SBen Gras.It Dv CLSET_TIMEOUT Ta "struct timeval *" Ta "set total timeout"
742fe8fb19SBen Gras.It Dv CLGET_TIMEOUT Ta "struct timeval *" Ta "get total timeout"
752fe8fb19SBen Gras.El
762fe8fb19SBen Gras.Pp
772fe8fb19SBen GrasNote:
782fe8fb19SBen Grasif you set the timeout using
792fe8fb19SBen Gras.Fn clnt_control ,
802fe8fb19SBen Grasthe timeout argument passed by
812fe8fb19SBen Gras.Fn clnt_call
822fe8fb19SBen Grasis ignored in all subsequent calls.
832fe8fb19SBen Gras.Pp
842fe8fb19SBen GrasNote:
852fe8fb19SBen GrasIf you set the timeout value to 0
862fe8fb19SBen Gras.Fn clnt_control
87*f14fb602SLionel Sambucimmediately returns an error
88*f14fb602SLionel Sambuc.Pq Dv RPC_TIMEDOUT .
892fe8fb19SBen GrasSet the timeout parameter to 0 for batching calls.
902fe8fb19SBen Gras.Bl -column CLSET_FD_NCLOSE "struct timeval *" "do not close fd on destroy"
912fe8fb19SBen Gras.It Dv CLGET_SVC_ADDR Ta "struct netbuf *" Ta "get servers address"
922fe8fb19SBen Gras.It Dv CLGET_FD Ta "int *" Ta "get fd from handle"
932fe8fb19SBen Gras.It Dv CLSET_FD_CLOSE Ta "void" Ta "close fd on destroy"
942fe8fb19SBen Gras.It Dv CLSET_FD_NCLOSE Ta void Ta "don't close fd on destroy"
952fe8fb19SBen Gras.It Dv CLGET_VERS Ta "unsigned long *" Ta "get RPC program version"
962fe8fb19SBen Gras.It Dv CLSET_VERS Ta "unsigned long *" Ta "set RPC program version"
972fe8fb19SBen Gras.It Dv CLGET_XID Ta "unsigned long *" Ta "get XID of previous call"
982fe8fb19SBen Gras.It Dv CLSET_XID Ta "unsigned long *" Ta "set XID of next call"
992fe8fb19SBen Gras.El
1002fe8fb19SBen Gras.Pp
1012fe8fb19SBen GrasThe following operations are valid for connectionless transports only:
1022fe8fb19SBen Gras.Bl -column CLSET_RETRY_TIMEOUT "struct timeval *" "set total timeout"
1032fe8fb19SBen Gras.It Dv CLSET_RETRY_TIMEOUT Ta "struct timeval *" Ta "set the retry timeout"
1042fe8fb19SBen Gras.It Dv CLGET_RETRY_TIMEOUT Ta "struct timeval *" Ta "get the retry timeout"
1052fe8fb19SBen Gras.El
1062fe8fb19SBen Gras.Pp
1072fe8fb19SBen GrasThe retry timeout is the time that RPC
1082fe8fb19SBen Graswaits for the server to reply before retransmitting the request.
1092fe8fb19SBen Gras.Fn clnt_control
1102fe8fb19SBen Grasreturns
1112fe8fb19SBen Gras.Dv TRUE
1122fe8fb19SBen Grason success and
1132fe8fb19SBen Gras.Dv FALSE
1142fe8fb19SBen Grason failure.
1152fe8fb19SBen Gras.Pp
1162fe8fb19SBen Gras.It Fn clnt_create
1172fe8fb19SBen GrasGeneric client creation routine for program
1182fe8fb19SBen Gras.Fa prognum
1192fe8fb19SBen Grasand version
1202fe8fb19SBen Gras.Fa versnum .
1212fe8fb19SBen Gras.Fa host
1222fe8fb19SBen Grasidentifies the name of the remote host where the server
1232fe8fb19SBen Grasis located.
1242fe8fb19SBen Gras.Fa nettype
1252fe8fb19SBen Grasindicates the class of transport protocol to use.
1262fe8fb19SBen GrasThe transports are tried in left to right order in
1272fe8fb19SBen Gras.Ev NETPATH
1282fe8fb19SBen Grasenvironment variable or in top to bottom order in
1292fe8fb19SBen Grasthe netconfig database.
1302fe8fb19SBen Gras.Fn clnt_create
1312fe8fb19SBen Grastries all the transports of the
1322fe8fb19SBen Gras.Fa nettype
1332fe8fb19SBen Grasclass available from the
1342fe8fb19SBen Gras.Ev NETPATH
1352fe8fb19SBen Grasenvironment variable and the netconfig database,
1362fe8fb19SBen Grasand chooses the first successful one.
1372fe8fb19SBen GrasA default timeout is set and can be modified using
1382fe8fb19SBen Gras.Fn clnt_control .
1392fe8fb19SBen GrasThis routine returns
1402fe8fb19SBen Gras.Dv NULL
1412fe8fb19SBen Grasif it fails.
1422fe8fb19SBen GrasThe
1432fe8fb19SBen Gras.Fn clnt_pcreateerror
1442fe8fb19SBen Grasroutine can be used to print the reason for failure.
1452fe8fb19SBen Gras.Pp
1462fe8fb19SBen GrasNote:
1472fe8fb19SBen Gras.Fn clnt_create
1482fe8fb19SBen Grasreturns a valid client handle even
1492fe8fb19SBen Grasif the particular version number supplied to
1502fe8fb19SBen Gras.Fn clnt_create
1512fe8fb19SBen Grasis not registered with the
1522fe8fb19SBen Gras.Xr rpcbind 8
1532fe8fb19SBen Grasservice.
1542fe8fb19SBen GrasThis mismatch will be discovered by a
1552fe8fb19SBen Gras.Fn clnt_call
1562fe8fb19SBen Graslater (see
1572fe8fb19SBen Gras.Xr rpc_clnt_calls 3 ) .
1582fe8fb19SBen Gras.Pp
1592fe8fb19SBen Gras.It Fn clnt_create_vers
1602fe8fb19SBen GrasGeneric client creation routine which is similar to
1612fe8fb19SBen Gras.Fn clnt_create
1622fe8fb19SBen Grasbut which also checks for the
1632fe8fb19SBen Grasversion availability.
1642fe8fb19SBen Gras.Fa host
1652fe8fb19SBen Grasidentifies the name of the remote host where the server
1662fe8fb19SBen Grasis located.
1672fe8fb19SBen Gras.Fa nettype
1682fe8fb19SBen Grasindicates the class transport protocols to be used.
1692fe8fb19SBen GrasIf the routine is successful it returns a client handle created for
1702fe8fb19SBen Grasthe highest version between
1712fe8fb19SBen Gras.Fa vers_low
1722fe8fb19SBen Grasand
1732fe8fb19SBen Gras.Fa vers_high
1742fe8fb19SBen Grasthat is supported by the server.
1752fe8fb19SBen Gras.Fa vers_outp
1762fe8fb19SBen Grasis set to this value.
1772fe8fb19SBen GrasThat is, after a successful return
1782fe8fb19SBen Gras.Fa vers_low
1792fe8fb19SBen Gras\*[Le]
1802fe8fb19SBen Gras.Fa *vers_outp
1812fe8fb19SBen Gras\*[Le]
1822fe8fb19SBen Gras.Fa vers_high .
1832fe8fb19SBen GrasIf no version between
1842fe8fb19SBen Gras.Fa vers_low
1852fe8fb19SBen Grasand
1862fe8fb19SBen Gras.Fa vers_high
1872fe8fb19SBen Grasis supported by the server then the routine fails and returns
1882fe8fb19SBen Gras.Dv NULL .
1892fe8fb19SBen GrasA default timeout is set and can be modified using
1902fe8fb19SBen Gras.Fn clnt_control .
1912fe8fb19SBen GrasThis routine returns
1922fe8fb19SBen Gras.Dv NULL
1932fe8fb19SBen Grasif it fails.
1942fe8fb19SBen GrasThe
1952fe8fb19SBen Gras.Fn clnt_pcreateerror
1962fe8fb19SBen Grasroutine can be used to print the reason for failure.
1972fe8fb19SBen GrasNote:
1982fe8fb19SBen Gras.Fn clnt_create
1992fe8fb19SBen Grasreturns a valid client handle even
2002fe8fb19SBen Grasif the particular version number supplied to
2012fe8fb19SBen Gras.Fn clnt_create
2022fe8fb19SBen Grasis not registered with the
2032fe8fb19SBen Gras.Xr rpcbind 8
2042fe8fb19SBen Grasservice.
2052fe8fb19SBen GrasThis mismatch will be discovered by a
2062fe8fb19SBen Gras.Fn clnt_call
2072fe8fb19SBen Graslater (see
2082fe8fb19SBen Gras.Xr rpc_clnt_calls 3 ) .
2092fe8fb19SBen GrasHowever,
2102fe8fb19SBen Gras.Fn clnt_create_vers
2112fe8fb19SBen Grasdoes this for you and returns a valid handle
2122fe8fb19SBen Grasonly if a version within
2132fe8fb19SBen Grasthe range supplied is supported by the server.
2142fe8fb19SBen Gras.Pp
2152fe8fb19SBen Gras.It Fn clnt_destroy
2162fe8fb19SBen GrasA function macro that destroys the client's RPC handle.
2172fe8fb19SBen GrasDestruction usually involves deallocation
2182fe8fb19SBen Grasof private data structures, including
2192fe8fb19SBen Gras.Fa clnt
2202fe8fb19SBen Grasitself.
2212fe8fb19SBen GrasUse of
2222fe8fb19SBen Gras.Fa clnt
2232fe8fb19SBen Grasis undefined after calling
2242fe8fb19SBen Gras.Fn clnt_destroy .
2252fe8fb19SBen GrasIf the RPC library opened the associated file descriptor, or
2262fe8fb19SBen Gras.Dv CLSET_FD_CLOSE
2272fe8fb19SBen Graswas set using
2282fe8fb19SBen Gras.Fn clnt_control ,
2292fe8fb19SBen Grasthe file descriptor will be closed.
2302fe8fb19SBen GrasThe caller should call
2312fe8fb19SBen Gras.Fn auth_destroy "clnt-\*[Gt]cl_auth"
2322fe8fb19SBen Gras(before calling
2332fe8fb19SBen Gras.Fn clnt_destroy )
2342fe8fb19SBen Grasto destroy the associated
2352fe8fb19SBen Gras.Dv AUTH
2362fe8fb19SBen Grasstructure (see
2372fe8fb19SBen Gras.Xr rpc_clnt_auth 3 ) .
2382fe8fb19SBen Gras.Pp
2392fe8fb19SBen Gras.It Fn clnt_dg_create
2402fe8fb19SBen GrasThis routine creates an RPC client for the remote program
2412fe8fb19SBen Gras.Fa prognum
2422fe8fb19SBen Grasand version
2432fe8fb19SBen Gras.Fa versnum ;
2442fe8fb19SBen Grasthe client uses a connectionless transport.
2452fe8fb19SBen GrasThe remote program is located at address
2462fe8fb19SBen Gras.Fa svcaddr .
2472fe8fb19SBen GrasThe parameter
2482fe8fb19SBen Gras.Fa fildes
2492fe8fb19SBen Grasis an open and bound file descriptor.
2502fe8fb19SBen GrasThis routine will resend the call message in intervals of
2512fe8fb19SBen Gras15 seconds until a response is received or until the
2522fe8fb19SBen Grascall times out.
2532fe8fb19SBen GrasThe total time for the call to time out is specified by
2542fe8fb19SBen Gras.Fn clnt_call
2552fe8fb19SBen Gras(see
2562fe8fb19SBen Gras.Fn clnt_call
2572fe8fb19SBen Grasin
2582fe8fb19SBen Gras.Xr rpc_clnt_calls 3 ) .
2592fe8fb19SBen GrasThe retry time out and the total time out periods can
2602fe8fb19SBen Grasbe changed using
2612fe8fb19SBen Gras.Fn clnt_control .
2622fe8fb19SBen GrasThe user may set the size of the send and receive
2632fe8fb19SBen Grasbuffers with the parameters
2642fe8fb19SBen Gras.Fa sendsz
2652fe8fb19SBen Grasand
2662fe8fb19SBen Gras.Fa recvsz ;
2672fe8fb19SBen Grasvalues of 0 choose suitable defaults.
2682fe8fb19SBen GrasThis routine returns
2692fe8fb19SBen Gras.Dv NULL
2702fe8fb19SBen Grasif it fails.
2712fe8fb19SBen Gras.Pp
2722fe8fb19SBen Gras.It Fn clnt_pcreateerror
2732fe8fb19SBen GrasPrint a message to standard error indicating
2742fe8fb19SBen Graswhy a client RPC handle could not be created.
2752fe8fb19SBen GrasThe message is prepended with the string
2762fe8fb19SBen Gras.Fa s
2772fe8fb19SBen Grasand a colon, and appended with a newline.
2782fe8fb19SBen Gras.Pp
2792fe8fb19SBen Gras.It Fn clnt_spcreateerror
2802fe8fb19SBen GrasLike
2812fe8fb19SBen Gras.Fn clnt_pcreateerror ,
2822fe8fb19SBen Grasexcept that it returns a string
2832fe8fb19SBen Grasinstead of printing to the standard error.
2842fe8fb19SBen GrasA newline is not appended to the message in this case.
2852fe8fb19SBen GrasWarning:
2862fe8fb19SBen Grasreturns a pointer to a buffer that is overwritten
2872fe8fb19SBen Grason each call.
2882fe8fb19SBen Gras.Pp
2892fe8fb19SBen Gras.It Fn clnt_raw_create
2902fe8fb19SBen GrasThis routine creates an RPC
2912fe8fb19SBen Grasclient handle for the remote program
2922fe8fb19SBen Gras.Fa prognum
2932fe8fb19SBen Grasand version
2942fe8fb19SBen Gras.Fa versnum .
2952fe8fb19SBen GrasThe transport used to pass messages to the service is
2962fe8fb19SBen Grasa buffer within the process's address space,
2972fe8fb19SBen Grasso the corresponding RPC
2982fe8fb19SBen Grasserver should live in the same address space;
2992fe8fb19SBen Gras(see
3002fe8fb19SBen Gras.Fn svc_raw_create
3012fe8fb19SBen Grasin
3022fe8fb19SBen Gras.Xr rpc_svc_create 3 ) .
3032fe8fb19SBen GrasThis allows simulation of RPC and measurement of
3042fe8fb19SBen GrasRPC overheads, such as round trip times,
3052fe8fb19SBen Graswithout any kernel or networking interference.
3062fe8fb19SBen GrasThis routine returns
3072fe8fb19SBen Gras.Dv NULL
3082fe8fb19SBen Grasif it fails.
3092fe8fb19SBen Gras.Fn clnt_raw_create
3102fe8fb19SBen Grasshould be called after
3112fe8fb19SBen Gras.Fn svc_raw_create .
3122fe8fb19SBen Gras.Pp
3132fe8fb19SBen Gras.It Fn clnt_tli_create
3142fe8fb19SBen GrasThis routine creates an RPC
3152fe8fb19SBen Grasclient handle for the remote program
3162fe8fb19SBen Gras.Fa prognum
3172fe8fb19SBen Grasand version
3182fe8fb19SBen Gras.Fa versnum .
3192fe8fb19SBen GrasThe remote program is located at address
3202fe8fb19SBen Gras.Fa svcaddr .
3212fe8fb19SBen GrasIf
3222fe8fb19SBen Gras.Fa svcaddr
3232fe8fb19SBen Grasis
3242fe8fb19SBen Gras.Dv NULL
3252fe8fb19SBen Grasand it is connection-oriented, it is assumed that the file descriptor
3262fe8fb19SBen Grasis connected.
3272fe8fb19SBen GrasFor connectionless transports, if
3282fe8fb19SBen Gras.Fa svcaddr
3292fe8fb19SBen Grasis
3302fe8fb19SBen Gras.Dv NULL ,
3312fe8fb19SBen Gras.Dv RPC_UNKNOWNADDR
3322fe8fb19SBen Graserror is set.
3332fe8fb19SBen Gras.Fa fildes
3342fe8fb19SBen Grasis a file descriptor which may be open, bound and connected.
3352fe8fb19SBen GrasIf it is
3362fe8fb19SBen Gras.Dv RPC_ANYFD ,
3372fe8fb19SBen Grasit opens a file descriptor on the transport specified by
3382fe8fb19SBen Gras.Fa netconf .
3392fe8fb19SBen GrasIf
3402fe8fb19SBen Gras.Fa fildes
3412fe8fb19SBen Grasis
3422fe8fb19SBen Gras.Dv RPC_ANYFD
3432fe8fb19SBen Grasand
3442fe8fb19SBen Gras.Fa netconf
3452fe8fb19SBen Grasis
3462fe8fb19SBen Gras.Dv NULL ,
3472fe8fb19SBen Grasa
3482fe8fb19SBen Gras.Dv RPC_UNKNOWNPROTO
3492fe8fb19SBen Graserror is set.
3502fe8fb19SBen GrasIf
3512fe8fb19SBen Gras.Fa fildes
3522fe8fb19SBen Grasis unbound, then it will attempt to bind the descriptor.
3532fe8fb19SBen GrasThe user may specify the size of the buffers with the parameters
3542fe8fb19SBen Gras.Fa sendsz
3552fe8fb19SBen Grasand
3562fe8fb19SBen Gras.Fa recvsz ;
3572fe8fb19SBen Grasvalues of 0 choose suitable defaults.
3582fe8fb19SBen GrasDepending upon the type of the transport (connection-oriented
3592fe8fb19SBen Grasor connectionless),
3602fe8fb19SBen Gras.Fn clnt_tli_create
3612fe8fb19SBen Grascalls appropriate client creation routines.
3622fe8fb19SBen GrasThis routine returns
3632fe8fb19SBen Gras.Dv NULL
3642fe8fb19SBen Grasif it fails.
3652fe8fb19SBen GrasThe
3662fe8fb19SBen Gras.Fn clnt_pcreateerror
3672fe8fb19SBen Grasroutine can be used to print the reason for failure.
3682fe8fb19SBen GrasThe remote rpcbind
3692fe8fb19SBen Grasservice (see
3702fe8fb19SBen Gras.Xr rpcbind 8 )
3712fe8fb19SBen Grasis not consulted for the address of the remote
3722fe8fb19SBen Grasservice.
3732fe8fb19SBen Gras.Pp
3742fe8fb19SBen Gras.It Fn clnt_tp_create
3752fe8fb19SBen GrasLike
3762fe8fb19SBen Gras.Fn clnt_create
3772fe8fb19SBen Grasexcept
3782fe8fb19SBen Gras.Fn clnt_tp_create
3792fe8fb19SBen Grastries only one transport specified through
3802fe8fb19SBen Gras.Fa netconf .
3812fe8fb19SBen Gras.Fn clnt_tp_create
3822fe8fb19SBen Grascreates a client handle for the program
3832fe8fb19SBen Gras.Fa prognum ,
3842fe8fb19SBen Grasthe version
3852fe8fb19SBen Gras.Fa versnum ,
3862fe8fb19SBen Grasand for the transport specified by
3872fe8fb19SBen Gras.Fa netconf .
3882fe8fb19SBen GrasDefault options are set,
3892fe8fb19SBen Graswhich can be changed using
3902fe8fb19SBen Gras.Fn clnt_control
3912fe8fb19SBen Grascalls.
3922fe8fb19SBen GrasThe remote rpcbind service on the host
3932fe8fb19SBen Gras.Fa host
3942fe8fb19SBen Grasis consulted for the address of the remote service.
3952fe8fb19SBen GrasThis routine returns
3962fe8fb19SBen Gras.Dv NULL
3972fe8fb19SBen Grasif it fails.
3982fe8fb19SBen GrasThe
3992fe8fb19SBen Gras.Fn clnt_pcreateerror
4002fe8fb19SBen Grasroutine can be used to print the reason for failure.
4012fe8fb19SBen Gras.Pp
4022fe8fb19SBen Gras.It Fn clnt_vc_create
4032fe8fb19SBen GrasThis routine creates an RPC
4042fe8fb19SBen Grasclient for the remote program
4052fe8fb19SBen Gras.Fa prognum
4062fe8fb19SBen Grasand version
4072fe8fb19SBen Gras.Fa versnum ;
4082fe8fb19SBen Grasthe client uses a connection-oriented transport.
4092fe8fb19SBen GrasThe remote program is located at address
4102fe8fb19SBen Gras.Fa svcaddr .
4112fe8fb19SBen GrasThe parameter
4122fe8fb19SBen Gras.Fa fildes
4132fe8fb19SBen Grasis an open and bound file descriptor.
4142fe8fb19SBen GrasThe user may specify the size of the send and receive buffers
4152fe8fb19SBen Graswith the parameters
4162fe8fb19SBen Gras.Fa sendsz
4172fe8fb19SBen Grasand
4182fe8fb19SBen Gras.Fa recvsz ;
4192fe8fb19SBen Grasvalues of 0 choose suitable defaults.
4202fe8fb19SBen GrasThis routine returns
4212fe8fb19SBen Gras.Dv NULL
4222fe8fb19SBen Grasif it fails.
4232fe8fb19SBen GrasThe address
4242fe8fb19SBen Gras.Fa svcaddr
4252fe8fb19SBen Grasshould not be
4262fe8fb19SBen Gras.Dv NULL
4272fe8fb19SBen Grasand should point to the actual address of the remote program.
4282fe8fb19SBen Gras.Fn clnt_vc_create
4292fe8fb19SBen Grasdoes not consult the remote rpcbind service for this information.
4302fe8fb19SBen Gras.Pp
4312fe8fb19SBen Gras.It struct rpc_createerr rpc_createerr;
4322fe8fb19SBen GrasA global variable whose value is set by any RPC
4332fe8fb19SBen Grasclient handle creation routine
4342fe8fb19SBen Grasthat fails.
4352fe8fb19SBen GrasIt is used by the routine
4362fe8fb19SBen Gras.Fn clnt_pcreateerror
4372fe8fb19SBen Grasto print the reason for the failure.
4382fe8fb19SBen Gras.El
4392fe8fb19SBen Gras.Sh SEE ALSO
4402fe8fb19SBen Gras.Xr rpc 3 ,
4412fe8fb19SBen Gras.Xr rpc_clnt_auth 3 ,
4422fe8fb19SBen Gras.Xr rpc_clnt_calls 3 ,
4432fe8fb19SBen Gras.Xr rpcbind 8
444