1 /* $OpenBSD: rpc_msg.h,v 1.2 1997/09/21 10:46:15 niklas Exp $ */
2 /* $NetBSD: rpc_msg.h,v 1.5 1995/04/29 05:28:00 cgd Exp $ */
5 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
6 * unrestricted use provided that this legend is included on all tape
7 * media and as a part of the software program in whole or part. Users
8 * may copy or modify Sun RPC without charge, but are not authorized
9 * to license or distribute it to anyone else except as part of a product or
10 * program developed by the user.
12 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
13 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
14 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 * Sun RPC is provided with no support and without any obligation on the
17 * part of Sun Microsystems, Inc. to assist in its use, correction,
18 * modification or enhancement.
20 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
21 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
22 * OR ANY PART THEREOF.
24 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
25 * or profits or other special, indirect and consequential damages, even if
26 * Sun has been advised of the possibility of such damages.
28 * Sun Microsystems, Inc.
30 * Mountain View, California 94043
32 * from: @(#)rpc_msg.h 1.7 86/07/16 SMI
33 * @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC
38 * rpc message definition
40 * Copyright (C) 1984, Sun Microsystems, Inc.
46 #define RPC_MSG_VERSION ((u_long) 2)
47 #define RPC_SERVICE_PORT ((u_short) 2048)
50 * Bottom up definition of an rpc message.
51 * NOTE: call and reply use the same overall stuct but
52 * different parts of unions within it.
80 * Reply part of an rpc exchange
84 * Reply to an rpc request that was accepted by the server.
85 * Note: there could be an error even though the request was
88 struct accepted_reply {
89 struct opaque_auth ar_verf;
90 enum accept_stat ar_stat;
100 /* and many other null cases */
102 #define ar_results ru.AR_results
103 #define ar_vers ru.AR_versions
107 * Reply to an rpc request that was rejected by the server.
109 struct rejected_reply {
110 enum reject_stat rj_stat;
116 enum auth_stat RJ_why; /* why authentication did not work */
118 #define rj_vers ru.RJ_versions
119 #define rj_why ru.RJ_why
123 * Body of a reply to an rpc request.
126 enum reply_stat rp_stat;
128 struct accepted_reply RP_ar;
129 struct rejected_reply RP_dr;
131 #define rp_acpt ru.RP_ar
132 #define rp_rjct ru.RP_dr
136 * Body of an rpc request call.
139 u_int32_t cb_rpcvers; /* must be equal to two */
143 struct opaque_auth cb_cred;
144 struct opaque_auth cb_verf; /* protocol specific - provided by client */
152 enum msg_type rm_direction;
154 struct call_body RM_cmb;
155 struct reply_body RM_rmb;
157 #define rm_call ru.RM_cmb
158 #define rm_reply ru.RM_rmb
160 #define acpted_rply ru.RM_rmb.ru.RP_ar
161 #define rjcted_rply ru.RM_rmb.ru.RP_dr
165 * XDR routine to handle a rpc message.
166 * xdr_callmsg(xdrs, cmsg)
168 * struct rpc_msg *cmsg;
170 extern bool_t xdr_callmsg __P((XDR *, struct rpc_msg *));
173 * XDR routine to pre-serialize the static part of a rpc message.
174 * xdr_callhdr(xdrs, cmsg)
176 * struct rpc_msg *cmsg;
178 extern bool_t xdr_callhdr __P((XDR *, struct rpc_msg *));
181 * XDR routine to handle a rpc reply.
182 * xdr_replymsg(xdrs, rmsg)
184 * struct rpc_msg *rmsg;
186 extern bool_t xdr_replymsg __P((XDR *, struct rpc_msg *));
189 * Fills in the error part of a reply message.
190 * _seterr_reply(msg, error)
191 * struct rpc_msg *msg;
192 * struct rpc_err *error;
194 extern void _seterr_reply __P((struct rpc_msg *, struct rpc_err *));
197 #endif /* !_RPC_RPCMSG_H */