/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
* 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]
*
* CDDL HEADER END
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* clnt.h - Client side remote procedure call interface.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
#ifndef _rpc_clnt_h
#define _rpc_clnt_h
/*
* 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.
*/
enum clnt_stat {
/*
* local errors
*/
/*
* remote errors
*/
/*
* callrpc & clnt_create errors
*/
/*
* _ create errors
*/
/*
* unspecified error
*/
};
/*
* Error info.
*/
struct rpc_err {
union {
struct {
} RE_vers;
struct { /* maybe meaningful if RPC_FAILED */
long s1;
long s2;
} ru;
};
/*
* Client rpc handle.
* Created by individual implementations, see e.g. rpc_udp.c.
* Client is responsible for initializing auth, see e.g. auth_none.c.
*/
typedef struct {
struct clnt_ops {
} *cl_ops;
} CLIENT;
/*
* client side rpc interface ops
*
* Parameter types are:
*
*/
/*
* enum clnt_stat
* CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
* CLIENT *rh;
* u_long proc;
* xdrproc_t xargs;
* caddr_t argsp;
* xdrproc_t xres;
* caddr_t resp;
* struct timeval timeout;
*/
/*
* void
* CLNT_ABORT(rh);
* CLIENT *rh;
*/
/*
* struct rpc_err
* CLNT_GETERR(rh);
* CLIENT *rh;
*/
/*
* bool_t
* CLNT_FREERES(rh, xres, resp);
* CLIENT *rh;
* xdrproc_t xres;
* caddr_t resp;
*/
/*
* bool_t
* CLNT_CONTROL(cl, request, info)
* CLIENT *cl;
* u_int request;
* char *info;
*/
/*
* control operations that apply to both udp and tcp transports
*/
/*
* udp only control operations
*/
/*
* void
* CLNT_DESTROY(rh);
* CLIENT *rh;
*/
/*
* RPCTEST is a test program which is accessable on every rpc
* 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.
*/
#ifndef KERNEL
/*
* Memory based rpc (for speed check and testing)
* CLIENT *
* clntraw_create(prog, vers)
* u_long prog;
* u_long vers;
*/
extern CLIENT *clntraw_create();
/*
* Generic client creation routine. Supported protocols are "udp" and "tcp"
*/
extern CLIENT *
char *host; -- hostname
u_long prog; -- program number
u_long vers; -- version number
char *prot; -- protocol
*/
/*
* Generic client creation routine. Supported protocols are "udp" and "tcp"
*/
extern CLIENT *
clnt_create_vers(/*host, prog, vers_out, vers_low, vers_high, prot*/);
/*
char *host; -- hostname
u_long prog; -- program number
u_long *vers_out; -- servers best version number
u_long vers_low; -- low version number
u_long vers_high; -- high version number
char *prot; -- protocol
*/
/*
* TCP based rpc
* CLIENT *
* clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
* struct sockaddr_in *raddr;
* u_long prog;
* u_long version;
* register int *sockp;
* u_int sendsz;
* u_int recvsz;
*/
extern CLIENT *clnttcp_create();
/*
* UDP based rpc.
* CLIENT *
* clntudp_create(raddr, program, version, wait, sockp)
* struct sockaddr_in *raddr;
* u_long program;
* u_long version;
* struct timeval wait;
* int *sockp;
*
* Same as above, but you specify max packet sizes.
* CLIENT *
* clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
* struct sockaddr_in *raddr;
* u_long program;
* u_long version;
* struct timeval wait;
* int *sockp;
* u_int sendsz;
* u_int recvsz;
*/
extern CLIENT *clntudp_create();
extern CLIENT *clntudp_bufcreate();
/*
* Print why creation failed
*/
/*
* Like clnt_perror(), but is more verbose in its output
*/
/*
* Print an English error message, given the client error code
*/
/*
* If a creation fails, the following allows the user to figure out why.
*/
struct rpc_createerr {
};
extern struct rpc_createerr rpc_createerr;
#endif /* !KERNEL */
/*
* Copy error message to buffer.
*/
#ifdef KERNEL
/*
* Kernel udp based rpc
* CLIENT *
* clntkudp_create(addr, pgm, vers)
* struct sockaddr_in *addr;
* u_long pgm;
* u_long vers;
*/
extern CLIENT *clntkudp_create();
#endif
/*
* Timers used for the pseudo-transport protocol when using datagrams
*/
struct rpc_timers {
};
/*
* Feedback values used for possible congestion and rate control
*/
#ifdef KERNEL
/*
* 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().
*/
#endif
#endif /*!_rpc_clnt_h*/