* 4.3 BSD under license from the Regents of the University of * clnt.h - Client side remote procedure call interface. * rpc calls return an enum clnt_stat. This should be looked at more, * since each implementation is required to live with this (implementation * independent) list of errors. * Following defines the multicast group address used by IPV6 enabled * client to do the broadcast. IPv6 doesn't have any broadcast support * as IPv4 provides, thus it used this reserved address which is joined * the following errors are in general unrecoverable. The caller * should give up rather than retry. /* Maximum rpc backoff time */ int RE_errno;
/* related system error */ struct {
/* maybe meaningful if RPC_FAILED */ }
RE_lb;
/* life boot & debugging only */ * Timers used for the pseudo-transport protocol when using datagrams * PSARC 2003/523 Contract Private Interface * Changes must be reviewed by Solaris File Sharing * Changes must be communicated to contract-2003-523@sun.com * Created by individual implementations * Client is responsible for initializing auth, see e.g. auth_none.c. /* call remote procedure */ /* get specific error code */ /* destroy this structure */ /* set rpc level timers */ /* send a one-way asynchronous call to remote procedure */ void (*
cl_geterr)();
/* get specific error code */ void (*
cl_destroy)();
/* destroy this structure */ char *
cl_tp;
/* device name */ * Feedback values used for possible congestion and rate control * The following defines the control routines #
define KNC_STRSIZE 128 /* maximum length of knetconfig strings */ * PSARC 2003/523 Contract Private Interface * Changes must be reviewed by Solaris File Sharing * Changes must be communicated to contract-2003-523@sun.com * Note that the knetconfig strings can either be dynamically allocated, or * they can be string literals. The code that sets up the knetconfig is * responsible for keeping track of this and freeing the strings if * necessary when the knetconfig is destroyed. * Bucket defined for the call table. Padded out to 64 bytes so that * false sharing won't be induced. * Define some macros for easy access into the call table structure * List of outstanding calls awaiting replies, for COTS, CLTS * Define macros for call table hashing * A simple hash function. Due to the way XID's get allocated, this may be * sufficient. This hash function provides round robin bucket selection so * that the next time a particular bucket gets picked is when there have * been N-1 calls. N is the number of buckets. * Alloc_xid presents an interface which kernel RPC clients * should use to allocate their XIDs. Its implementation * may change over time (for example, to allow sharing of * XIDs between the kernel and user-level applications, so * all XID allocation should be done by calling alloc_xid(). * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * kRPC internal function. Not for general use. Subject to rapid change. * client side rpc interface ops * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout) * struct timeval timeout; * PSARC 2003/523 Contract Private Interface * Changes must be reviewed by Solaris File Sharing * Changes must be communicated to contract-2003-523@sun.com * CLNT_SEND(rh, proc, xargs, argsp) * PSARC 2000/428 Contract Private Interface * CLNT_FREERES(rh, xres, resp); * CLNT_CONTROL(cl, request, info) * PSARC 2003/523 Contract Private Interface * Changes must be reviewed by Solaris File Sharing * Changes must be communicated to contract-2003-523@sun.com * control operations that apply to all transports #
define CLGET_FD 6 /* get connections file descriptor *//* 00-08-17 - NON STANDARD CONTROL PARAMETER */ #
define CLFLUSH 23 /* flush now (user wants it) */ /* (possibly blocking) */ * Connectionless only control operations * Connection oriented only control operation. /* has been sent but no reply */ /* connection setup error */ /* connection setup error */ * struct rpc_timers *all; * PSARC 2003/523 Contract Private Interface * Changes must be reviewed by Solaris File Sharing * Changes must be communicated to contract-2003-523@sun.com * RPCTEST is a test program which is accessable on every rpc * transport/port. It is used for testing, performance evaluation, * and network administration. * By convention, procedure 0 takes null arguments and returns them * Below are the client handle creation routines for the various * implementations of client side rpc. They can return NULL if a * creation failure occurs. * Generic client creation routine. Supported protocols are which belong * to the nettype name space * const char *hostname; -- hostname * const rpcprog_t prog; -- program number * const rpcvers_t vers; -- version number * const char *nettype; -- network type * Generic client creation routine. Just like clnt_create(), except * it takes an additional timeout parameter. * const char *hostname; -- hostname * const rpcprog_t prog; -- program number * const rpcvers_t vers; -- version number * const char *nettype; -- network type * const struct timeval *tp; -- timeout * Generic client creation routine. Supported protocols are which belong * to the nettype name space. * const char *host; -- hostname * const rpcprog_t prog; -- program number * rpcvers_t *vers_out; -- servers highest available version number * const rpcvers_t vers_low; -- low version number * const rpcvers_t vers_high; -- high version number * const char *nettype; -- network type * Generic client creation routine. Supported protocols are which belong * to the nettype name space. * const char *host; -- hostname * const rpcprog_t prog; -- program number * rpcvers_t *vers_out; -- servers highest available version number * const rpcvers_t vers_low; -- low version number * const prcvers_t vers_high; -- high version number * const char *nettype; -- network type * const struct timeval *tp -- timeout * Generic client creation routine. It takes a netconfig structure * const char *hostname; -- hostname * const rpcprog_t prog; -- program number * const rpcvers_t vers; -- version number * const struct netconfig *netconf; -- network config structure * Generic client creation routine. Just like clnt_tp_create(), except * it takes an additional timeout parameter. * const char *hostname; -- hostname * const rpcprog_t prog; -- program number * const rpcvers_t vers; -- version number * const struct netconfig *netconf; -- network config structure * const struct timeval *tp; -- timeout * Generic TLI create routine * const struct netconfig *nconf; -- netconfig structure * struct netbuf *svcaddr; -- servers address * const rpcprog_t prog; -- program number * const rpcvers_t vers; -- version number * const uint_t sendsz; -- send size * const uint_t recvsz; -- recv size * Low level clnt create routine for connectionful transports, e.g. tcp. * const int fd; -- open file descriptor * const struct netbuf *svcaddr; -- servers address * const rpcprog_t prog; -- program number * const rpcvers_t vers; -- version number * const uint_t sendsz; -- buffer recv size * const uint_t recvsz; -- buffer send size * Low level clnt create routine for connectionless transports, e.g. udp. * const int fd; -- open file descriptor * const struct netbuf *svcaddr; -- servers address * const rpcprog_t program; -- program number * const rpcvers_t version; -- version number * const uint_t sendsz; -- buffer recv size * const uint_t recvsz; -- buffer send size * Memory based rpc (for speed check and testing) * clnt_raw_create(prog, vers) * const rpcprog_t prog; -- program number * const rpcvers_t vers; -- version number * Client creation routine over doors transport. * const rpcprog_t prog; -- program number * const rpcvers_t vers; -- version number * const uint_t sendsz; -- max send size * internal function. Not for general use. Subject to rapid change. * Print why creation failed * Like clnt_perror(), but is more verbose in its output * Print an error message, given the client error code * If a creation fails, the following allows the user to figure out why. * The simplified interface: * rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype) * const rpcprog_t prognum; * const rpcvers_t versnum; * const rpcproc_t procnum; * const xdrproc_t inproc, outproc; * RPC broadcast interface * The call is broadcasted to all locally connected nets. * rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, * const rpcprog_t prog; -- program number * const rpcvers_t vers; -- version number * const rpcproc_t proc; -- procedure number * const xdrproc_t xargs; -- xdr routine for args * caddr_t argsp; -- pointer to args * const xdrproc_t xresults; -- xdr routine for results * caddr_t resultsp; -- pointer to results * const resultproc_t eachresult; -- call with each result * const char *nettype; -- Transport type * For each valid response received, the procedure eachresult is called. * done = eachresult(resp, raddr, nconf) * struct netconfig *nconf; * where resp points to the results of the call and raddr is the * address if the responder to the broadcast. nconf is the transport * on which the response was received. * rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, * eachresult, inittime, waittime, nettype) * const rpcprog_t prog; -- program number * const rpcvers_t vers; -- version number * const rpcproc_t proc; -- procedure number * const xdrproc_t xargs; -- xdr routine for args * caddr_t argsp; -- pointer to args * const xdrproc_t xresults; -- xdr routine for results * caddr_t resultsp; -- pointer to results * const resultproc_t eachresult; -- call with each result * const int inittime; -- how long to wait initially * const int waittime; -- maximum time to wait * const char *nettype; -- Transport type ...
/* for backward compatibility */ * Copy error message to buffer. * Print an error message, given the client error code * Client side rpc control routine for rpcbind. /* For backward compatibility */ #
endif /* !_RPC_CLNT_H */