2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 * Sun RPC is provided with no support and without any obligation on the
14 * part of Sun Microsystems, Inc. to assist in its use, correction,
15 * modification or enhancement.
17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 * OR ANY PART THEREOF.
21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 * or profits or other special, indirect and consequential damages, even if
23 * Sun has been advised of the possibility of such damages.
25 * Sun Microsystems, Inc.
27 * Mountain View, California 94043
29 * from: @(#)rpc_msg.h 1.7 86/07/16 SMI
30 * from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC
31 * $FreeBSD: src/include/rpc/rpc_msg.h,v 1.12 1999/08/27 23:45:05 peter Exp $
32 * $DragonFly: src/include/rpc/rpc_msg.h,v 1.4 2007/12/04 20:59:15 swildner Exp $
37 * rpc message definition
39 * Copyright (C) 1984, Sun Microsystems, Inc.
45 #define RPC_MSG_VERSION ((u_long) 2)
46 #define RPC_SERVICE_PORT ((u_short) 2048)
49 * Bottom up definition of an rpc message.
50 * NOTE: call and reply use the same overall stuct but
51 * different parts of unions within it.
79 * Reply part of an rpc exchange
83 * Reply to an rpc request that was accepted by the server.
84 * Note: there could be an error even though the request was
87 struct accepted_reply
{
88 struct opaque_auth ar_verf
;
89 enum accept_stat ar_stat
;
99 /* and many other null cases */
101 #define ar_results ru.AR_results
102 #define ar_vers ru.AR_versions
106 * Reply to an rpc request that was rejected by the server.
108 struct rejected_reply
{
109 enum reject_stat rj_stat
;
115 enum auth_stat RJ_why
; /* why authentication did not work */
117 #define rj_vers ru.RJ_versions
118 #define rj_why ru.RJ_why
122 * Body of a reply to an rpc request.
125 enum reply_stat rp_stat
;
127 struct accepted_reply RP_ar
;
128 struct rejected_reply RP_dr
;
130 #define rp_acpt ru.RP_ar
131 #define rp_rjct ru.RP_dr
135 * Body of an rpc request call.
138 u_int32_t cb_rpcvers
; /* must be equal to two */
142 struct opaque_auth cb_cred
;
143 struct opaque_auth cb_verf
; /* protocol specific - provided by client */
151 enum msg_type rm_direction
;
153 struct call_body RM_cmb
;
154 struct reply_body RM_rmb
;
156 #define rm_call ru.RM_cmb
157 #define rm_reply ru.RM_rmb
159 #define acpted_rply ru.RM_rmb.ru.RP_ar
160 #define rjcted_rply ru.RM_rmb.ru.RP_dr
164 * XDR routine to handle a rpc message.
165 * xdr_callmsg(xdrs, cmsg)
167 * struct rpc_msg *cmsg;
169 extern bool_t
xdr_callmsg (XDR
*, struct rpc_msg
*);
172 * XDR routine to pre-serialize the static part of a rpc message.
173 * xdr_callhdr(xdrs, cmsg)
175 * struct rpc_msg *cmsg;
177 extern bool_t
xdr_callhdr (XDR
*, struct rpc_msg
*);
180 * XDR routine to handle a rpc reply.
181 * xdr_replymsg(xdrs, rmsg)
183 * struct rpc_msg *rmsg;
185 extern bool_t
xdr_replymsg (XDR
*, struct rpc_msg
*);
188 * XDR routine to handle an accepted rpc reply.
189 * xdr_accepted_reply(xdrs, rej)
191 * struct accepted_reply *rej;
193 extern bool_t
xdr_accepted_reply(XDR
*, struct accepted_reply
*);
196 * XDR routine to handle a rejected rpc reply.
197 * xdr_rejected_reply(xdrs, rej)
199 * struct rejected_reply *rej;
201 extern bool_t
xdr_rejected_reply(XDR
*, struct rejected_reply
*);
204 * Fills in the error part of a reply message.
205 * _seterr_reply(msg, error)
206 * struct rpc_msg *msg;
207 * struct rpc_err *error;
210 extern void _seterr_reply (struct rpc_msg
*, struct rpc_err
*);
213 #endif /* !_RPC_RPCMSG_H */