2 * @(#)rpc_msg.h 2.1 97/10/23
4 /* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC */
6 * Copyright (c) 1992-1997,2001 by Standard Performance Evaluation Corporation
8 * Standard Performance Evaluation Corporation (SPEC)
9 * 6585 Merchant Place, Suite 100
12 * This product contains benchmarks acquired from several sources who
13 * understand and agree with SPEC's goal of creating fair and objective
14 * benchmarks to measure computer performance.
16 * This copyright notice is placed here only to protect SPEC in the
17 * event the source is misused in any manner that is contrary to the
18 * spirit, the goals and the intent of SPEC.
20 * The source code is provided to the user or company under the license
21 * agreement for the SPEC Benchmark Suite for this product.
24 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
25 * unrestricted use provided that this legend is included on all tape
26 * media and as a part of the software program in whole or part. Users
27 * may copy or modify Sun RPC without charge, but are not authorized
28 * to license or distribute it to anyone else except as part of a product or
29 * program developed by the user.
31 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
32 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
33 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
35 * Sun RPC is provided with no support and without any obligation on the
36 * part of Sun Microsystems, Inc. to assist in its use, correction,
37 * modification or enhancement.
39 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
40 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
41 * OR ANY PART THEREOF.
43 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
44 * or profits or other special, indirect and consequential damages, even if
45 * Sun has been advised of the possibility of such damages.
47 * Sun Microsystems, Inc.
49 * Mountain View, California 94043
51 /* @(#)rpc_msg.h 1.7 86/07/16 SMI */
55 * rpc message definition
57 * Copyright (C) 1984, Sun Microsystems, Inc.
63 #define RPC_MSG_VERSION ((uint32_t) 2)
64 #define RPC_SERVICE_PORT ((uint16_t) 2048)
67 * Bottom up definition of an rpc message.
68 * NOTE: call and reply use the same overall stuct but
69 * different parts of unions within it.
97 * Reply part of an rpc exchange
101 * Reply to an rpc request that was accepted by the server.
102 * Note: there could be an error even though the request was
105 struct accepted_reply {
106 struct opaque_auth ar_verf;
107 enum accept_stat ar_stat;
117 /* and many other null cases */
119 #define ar_results ru.AR_results
120 #define ar_vers ru.AR_versions
124 * Reply to an rpc request that was rejected by the server.
126 struct rejected_reply {
127 enum reject_stat rj_stat;
133 enum auth_stat RJ_why; /* why authentication did not work */
135 #define rj_vers ru.RJ_versions
136 #define rj_why ru.RJ_why
140 * Body of a reply to an rpc request.
143 enum reply_stat rp_stat;
145 struct accepted_reply RP_ar;
146 struct rejected_reply RP_dr;
148 #define rp_acpt ru.RP_ar
149 #define rp_rjct ru.RP_dr
153 * Body of an rpc request call.
156 uint32_t cb_rpcvers; /* must be equal to two */
160 struct opaque_auth cb_cred;
161 struct opaque_auth cb_verf; /* protocol specific - provided by client */
169 enum msg_type rm_direction;
171 struct call_body RM_cmb;
172 struct reply_body RM_rmb;
174 #define rm_call ru.RM_cmb
175 #define rm_reply ru.RM_rmb
177 #define acpted_rply ru.RM_rmb.ru.RP_ar
178 #define rjcted_rply ru.RM_rmb.ru.RP_dr
182 * XDR routine to handle a rpc message.
183 * xdr_callmsg(xdrs, cmsg)
185 * struct rpc_msg *cmsg;
187 extern bool_t xdr_callmsg(XDR *, struct rpc_msg *);
190 * XDR routine to pre-serialize the static part of a rpc message.
191 * xdr_callhdr(xdrs, cmsg)
193 * struct rpc_msg *cmsg;
195 extern bool_t xdr_callhdr(XDR *, struct rpc_msg *);
198 * XDR routine to handle a rpc reply.
199 * xdr_replymsg(xdrs, rmsg)
201 * struct rpc_msg *rmsg;
203 extern bool_t xdr_replymsg(XDR *, struct rpc_msg *);
206 * Fills in the error part of a reply message.
207 * _seterr_reply(msg, error)
208 * struct rpc_msg *msg;
209 * struct rpc_err *error;
211 extern void _seterr_reply(struct rpc_msg *, struct rpc_err *);
213 extern int _rpc_dtablesize(void);
214 extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *);
215 #endif /* __RPC_MSG_H */