]>
git.saurik.com Git - apple/libinfo.git/blob - rpc.subproj/rpc_msg.h
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
25 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
26 * unrestricted use provided that this legend is included on all tape
27 * media and as a part of the software program in whole or part. Users
28 * may copy or modify Sun RPC without charge, but are not authorized
29 * to license or distribute it to anyone else except as part of a product or
30 * program developed by the user.
32 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
33 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
34 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
36 * Sun RPC is provided with no support and without any obligation on the
37 * part of Sun Microsystems, Inc. to assist in its use, correction,
38 * modification or enhancement.
40 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
41 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
42 * OR ANY PART THEREOF.
44 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
45 * or profits or other special, indirect and consequential damages, even if
46 * Sun has been advised of the possibility of such damages.
48 * Sun Microsystems, Inc.
50 * Mountain View, California 94043
52 * from: @(#)rpc_msg.h 1.7 86/07/16 SMI
53 * from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC
54 * $Id: rpc_msg.h,v 1.3 2004/10/28 21:58:24 emoy Exp $
59 * rpc message definition
61 * Copyright (C) 1984, Sun Microsystems, Inc.
68 #define RPC_MSG_VERSION ((unsigned int) 2)
70 #define RPC_MSG_VERSION ((unsigned long) 2)
72 #define RPC_SERVICE_PORT ((unsigned short) 2048)
75 * Bottom up definition of an rpc message.
76 * NOTE: call and reply use the same overall stuct but
77 * different parts of unions within it.
105 * Reply part of an rpc exchange
109 * Reply to an rpc request that was accepted by the server.
110 * Note: there could be an error even though the request was
113 struct accepted_reply
{
114 struct opaque_auth ar_verf
;
115 enum accept_stat ar_stat
;
130 /* and many other null cases */
132 #define ar_results ru.AR_results
133 #define ar_vers ru.AR_versions
137 * Reply to an rpc request that was rejected by the server.
139 struct rejected_reply
{
140 enum reject_stat rj_stat
;
151 enum auth_stat RJ_why
; /* why authentication did not work */
153 #define rj_vers ru.RJ_versions
154 #define rj_why ru.RJ_why
158 * Body of a reply to an rpc request.
161 enum reply_stat rp_stat
;
163 struct accepted_reply RP_ar
;
164 struct rejected_reply RP_dr
;
166 #define rp_acpt ru.RP_ar
167 #define rp_rjct ru.RP_dr
171 * Body of an rpc request call.
175 unsigned int cb_rpcvers
; /* must be equal to two */
176 unsigned int cb_prog
;
177 unsigned int cb_vers
;
178 unsigned int cb_proc
;
180 unsigned long cb_rpcvers
; /* must be equal to two */
181 unsigned long cb_prog
;
182 unsigned long cb_vers
;
183 unsigned long cb_proc
;
185 struct opaque_auth cb_cred
;
186 struct opaque_auth cb_verf
; /* protocol specific - provided by client */
196 unsigned long rm_xid
;
198 enum msg_type rm_direction
;
200 struct call_body RM_cmb
;
201 struct reply_body RM_rmb
;
203 #define rm_call ru.RM_cmb
204 #define rm_reply ru.RM_rmb
206 #define acpted_rply ru.RM_rmb.ru.RP_ar
207 #define rjcted_rply ru.RM_rmb.ru.RP_dr
211 * XDR routine to handle a rpc message.
212 * xdr_callmsg(xdrs, cmsg)
214 * struct rpc_msg *cmsg;
216 extern bool_t xdr_callmsg
__P((XDR
*, struct rpc_msg
*));
219 * XDR routine to pre-serialize the static part of a rpc message.
220 * xdr_callhdr(xdrs, cmsg)
222 * struct rpc_msg *cmsg;
224 extern bool_t xdr_callhdr
__P((XDR
*, struct rpc_msg
*));
227 * XDR routine to handle a rpc reply.
228 * xdr_replymsg(xdrs, rmsg)
230 * struct rpc_msg *rmsg;
232 extern bool_t xdr_replymsg
__P((XDR
*, struct rpc_msg
*));
235 * Fills in the error part of a reply message.
236 * _seterr_reply(msg, error)
237 * struct rpc_msg *msg;
238 * struct rpc_err *error;
240 extern void _seterr_reply
__P((struct rpc_msg
*, struct rpc_err
*));
243 #endif /* !_RPC_RPCMSG_H */