1 /* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC */
3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4 * unrestricted use provided that this legend is included on all tape
5 * media and as a part of the software program in whole or part. Users
6 * may copy or modify Sun RPC without charge, but are not authorized
7 * to license or distribute it to anyone else except as part of a product or
8 * program developed by the user.
10 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
11 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
12 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14 * Sun RPC is provided with no support and without any obligation on the
15 * part of Sun Microsystems, Inc. to assist in its use, correction,
16 * modification or enhancement.
18 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
19 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
20 * OR ANY PART THEREOF.
22 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
23 * or profits or other special, indirect and consequential damages, even if
24 * Sun has been advised of the possibility of such damages.
26 * Sun Microsystems, Inc.
28 * Mountain View, California 94043
30 /* @(#)rpc_msg.h 1.7 86/07/16 SMI */
35 #include <sys/cdefs.h>
42 * rpc message definition
44 * Copyright (C) 1984, Sun Microsystems, Inc.
47 #define RPC_MSG_VERSION ((u_long) 2)
48 #define RPC_SERVICE_PORT ((u_short) 2048)
53 * Bottom up definition of an rpc message.
54 * NOTE: call and reply use the same overall struct but
55 * different parts of unions within it.
83 * Reply part of an rpc exchange
87 * Reply to an rpc request that was accepted by the server.
88 * Note: there could be an error even though the request was
91 struct accepted_reply
{
92 struct opaque_auth ar_verf
;
93 enum accept_stat ar_stat
;
103 /* and many other null cases */
105 #define ar_results ru.AR_results
106 #define ar_vers ru.AR_versions
110 * Reply to an rpc request that was rejected by the server.
112 struct rejected_reply
{
113 enum reject_stat rj_stat
;
119 enum auth_stat RJ_why
; /* why authentication did not work */
121 #define rj_vers ru.RJ_versions
122 #define rj_why ru.RJ_why
126 * Body of a reply to an rpc request.
129 enum reply_stat rp_stat
;
131 struct accepted_reply RP_ar
;
132 struct rejected_reply RP_dr
;
134 #define rp_acpt ru.RP_ar
135 #define rp_rjct ru.RP_dr
139 * Body of an rpc request call.
142 u_long cb_rpcvers
; /* must be equal to two */
146 struct opaque_auth cb_cred
;
147 struct opaque_auth cb_verf
; /* protocol specific - provided by client */
155 enum msg_type rm_direction
;
157 struct call_body RM_cmb
;
158 struct reply_body RM_rmb
;
160 #define rm_call ru.RM_cmb
161 #define rm_reply ru.RM_rmb
163 #define acpted_rply ru.RM_rmb.ru.RP_ar
164 #define rjcted_rply ru.RM_rmb.ru.RP_dr
168 * XDR routine to handle a rpc message.
169 * xdr_callmsg(xdrs, cmsg)
171 * struct rpc_msg *cmsg;
173 extern bool_t
xdr_callmsg (XDR
*__xdrs
, struct rpc_msg
*__cmsg
) __THROW
;
174 libc_hidden_proto(xdr_callmsg
)
177 * XDR routine to pre-serialize the static part of a rpc message.
178 * xdr_callhdr(xdrs, cmsg)
180 * struct rpc_msg *cmsg;
182 extern bool_t
xdr_callhdr (XDR
*__xdrs
, struct rpc_msg
*__cmsg
) __THROW
;
183 libc_hidden_proto(xdr_callhdr
)
186 * XDR routine to handle a rpc reply.
187 * xdr_replymsg(xdrs, rmsg)
189 * struct rpc_msg *rmsg;
191 extern bool_t
xdr_replymsg (XDR
*__xdrs
, struct rpc_msg
*__rmsg
) __THROW
;
192 libc_hidden_proto(xdr_replymsg
)
195 * Fills in the error part of a reply message.
196 * _seterr_reply(msg, error)
197 * struct rpc_msg *msg;
198 * struct rpc_err *error;
200 extern void _seterr_reply (struct rpc_msg
*__msg
, struct rpc_err
*__error
)
202 libc_hidden_proto(_seterr_reply
)
206 * XDR routine to handle an accepted rpc reply.
207 * xdr_accepted_reply(xdrs, rej)
209 * struct accepted_reply *rej;
211 extern bool_t
xdr_accepted_reply(XDR
*__xdrs
, struct accepted_reply
*__ar
);
212 libc_hidden_proto(xdr_accepted_reply
)
215 * XDR routine to handle a rejected rpc reply.
216 * xdr_rejected_reply(xdrs, rej)
218 * struct rejected_reply *rej;
220 extern bool_t
xdr_rejected_reply(XDR
*__xdrs
, struct rejected_reply
*__rr
);
221 libc_hidden_proto(xdr_rejected_reply
)
226 #endif /* rpc/rpc_msg.h */