clnt.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* clnt.h - Client side remote procedure call interface.
* Stripped down sockets based client for boot.
*/
#ifndef _RPC_CLNT_H
#define _RPC_CLNT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <rpc/clnt_stat.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Error info.
*/
struct rpc_err {
union {
int RE_errno; /* realated system error */
} 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 __client {
struct clnt_ops {
/* call remote procedure */
/* abort a call */
void (*cl_abort)(/* various */);
/* get specific error code */
struct rpc_err *);
/* frees results */
caddr_t);
/* destroy this structure */
void (*cl_destroy)(struct __client *);
/* the ioctl() of rpc */
} *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;
* ulong_t 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;
* uint_t request;
* char *info;
*/
/*
* control operations that apply to both udp and tcp transports
*/
/*
* udp only control operations
*/
/*
* void
* CLNT_DESTROY(rh);
* CLIENT *rh;
*/
/*
* 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.
*/
/*
* UDP based rpc.
* CLIENT *
* clntbudp_create(raddr, program, version, wait, sockp)
* struct sockaddr_in *raddr;
* ulong_t program;
* ulong_t version;
* struct timeval wait;
* int *sockp;
*
* Same as above, but you specify max packet sizes.
* CLIENT *
* clntbudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
* struct sockaddr_in *raddr;
* ulong_t program;
* ulong_t version;
* struct timeval wait;
* int *sockp;
* uint_t sendsz;
* uint_t recvsz;
*/
int *sockp);
/*
* TCP based rpc.
* CLIENT *
* clntbtcp_create(raddr, program, version, wait, sockp, sendsz, recvsz)
* struct sockaddr_in *raddr;
* ulong_t program;
* ulong_t version;
* struct timeval wait;
* int *sockp;
* uint_t sendsz;
* uint_t recvsz;
*
*/
/*
* If a creation fails, the following allows the user to figure out why.
*/
struct rpc_createerr {
};
extern struct rpc_createerr rpc_createerr;
#ifdef __cplusplus
}
#endif
#endif /* !_RPC_CLNT_H */