2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
27 * unrestricted use provided that this legend is included on all tape
28 * media and as a part of the software program in whole or part. Users
29 * may copy or modify Sun RPC without charge, but are not authorized
30 * to license or distribute it to anyone else except as part of a product or
31 * program developed by the user.
33 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
34 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
35 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
37 * Sun RPC is provided with no support and without any obligation on the
38 * part of Sun Microsystems, Inc. to assist in its use, correction,
39 * modification or enhancement.
41 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
42 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
43 * OR ANY PART THEREOF.
45 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
46 * or profits or other special, indirect and consequential damages, even if
47 * Sun has been advised of the possibility of such damages.
49 * Sun Microsystems, Inc.
51 * Mountain View, California 94043
53 * from: @(#)rpc_msg.h 1.7 86/07/16 SMI
54 * from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC
55 * $Id: rpc_msg.h,v 1.2 1999/10/14 21:56:54 wsanchez Exp $
60 * rpc message definition
62 * Copyright (C) 1984, Sun Microsystems, Inc.
68 #define RPC_MSG_VERSION ((u_long) 2)
69 #define RPC_SERVICE_PORT ((u_short) 2048)
72 * Bottom up definition of an rpc message.
73 * NOTE: call and reply use the same overall stuct but
74 * different parts of unions within it.
102 * Reply part of an rpc exchange
106 * Reply to an rpc request that was accepted by the server.
107 * Note: there could be an error even though the request was
110 struct accepted_reply
{
111 struct opaque_auth ar_verf
;
112 enum accept_stat ar_stat
;
122 /* and many other null cases */
124 #define ar_results ru.AR_results
125 #define ar_vers ru.AR_versions
129 * Reply to an rpc request that was rejected by the server.
131 struct rejected_reply
{
132 enum reject_stat rj_stat
;
138 enum auth_stat RJ_why
; /* why authentication did not work */
140 #define rj_vers ru.RJ_versions
141 #define rj_why ru.RJ_why
145 * Body of a reply to an rpc request.
148 enum reply_stat rp_stat
;
150 struct accepted_reply RP_ar
;
151 struct rejected_reply RP_dr
;
153 #define rp_acpt ru.RP_ar
154 #define rp_rjct ru.RP_dr
158 * Body of an rpc request call.
161 u_long cb_rpcvers
; /* must be equal to two */
165 struct opaque_auth cb_cred
;
166 struct opaque_auth cb_verf
; /* protocol specific - provided by client */
174 enum msg_type rm_direction
;
176 struct call_body RM_cmb
;
177 struct reply_body RM_rmb
;
179 #define rm_call ru.RM_cmb
180 #define rm_reply ru.RM_rmb
182 #define acpted_rply ru.RM_rmb.ru.RP_ar
183 #define rjcted_rply ru.RM_rmb.ru.RP_dr
187 * XDR routine to handle a rpc message.
188 * xdr_callmsg(xdrs, cmsg)
190 * struct rpc_msg *cmsg;
192 extern bool_t xdr_callmsg
__P((XDR
*, struct rpc_msg
*));
195 * XDR routine to pre-serialize the static part of a rpc message.
196 * xdr_callhdr(xdrs, cmsg)
198 * struct rpc_msg *cmsg;
200 extern bool_t xdr_callhdr
__P((XDR
*, struct rpc_msg
*));
203 * XDR routine to handle a rpc reply.
204 * xdr_replymsg(xdrs, rmsg)
206 * struct rpc_msg *rmsg;
208 extern bool_t xdr_replymsg
__P((XDR
*, struct rpc_msg
*));
211 * Fills in the error part of a reply message.
212 * _seterr_reply(msg, error)
213 * struct rpc_msg *msg;
214 * struct rpc_err *error;
216 extern void _seterr_reply
__P((struct rpc_msg
*, struct rpc_err
*));
219 #endif /* !_RPC_RPCMSG_H */