]>
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.2 1999/10/14 21:56:54 wsanchez Exp $
59 * rpc message definition
61 * Copyright (C) 1984, Sun Microsystems, Inc.
67 #define RPC_MSG_VERSION ((u_long) 2)
68 #define RPC_SERVICE_PORT ((u_short) 2048)
71 * Bottom up definition of an rpc message.
72 * NOTE: call and reply use the same overall stuct but
73 * different parts of unions within it.
101 * Reply part of an rpc exchange
105 * Reply to an rpc request that was accepted by the server.
106 * Note: there could be an error even though the request was
109 struct accepted_reply
{
110 struct opaque_auth ar_verf
;
111 enum accept_stat ar_stat
;
121 /* and many other null cases */
123 #define ar_results ru.AR_results
124 #define ar_vers ru.AR_versions
128 * Reply to an rpc request that was rejected by the server.
130 struct rejected_reply
{
131 enum reject_stat rj_stat
;
137 enum auth_stat RJ_why
; /* why authentication did not work */
139 #define rj_vers ru.RJ_versions
140 #define rj_why ru.RJ_why
144 * Body of a reply to an rpc request.
147 enum reply_stat rp_stat
;
149 struct accepted_reply RP_ar
;
150 struct rejected_reply RP_dr
;
152 #define rp_acpt ru.RP_ar
153 #define rp_rjct ru.RP_dr
157 * Body of an rpc request call.
160 u_long cb_rpcvers
; /* must be equal to two */
164 struct opaque_auth cb_cred
;
165 struct opaque_auth cb_verf
; /* protocol specific - provided by client */
173 enum msg_type rm_direction
;
175 struct call_body RM_cmb
;
176 struct reply_body RM_rmb
;
178 #define rm_call ru.RM_cmb
179 #define rm_reply ru.RM_rmb
181 #define acpted_rply ru.RM_rmb.ru.RP_ar
182 #define rjcted_rply ru.RM_rmb.ru.RP_dr
186 * XDR routine to handle a rpc message.
187 * xdr_callmsg(xdrs, cmsg)
189 * struct rpc_msg *cmsg;
191 extern bool_t xdr_callmsg
__P((XDR
*, struct rpc_msg
*));
194 * XDR routine to pre-serialize the static part of a rpc message.
195 * xdr_callhdr(xdrs, cmsg)
197 * struct rpc_msg *cmsg;
199 extern bool_t xdr_callhdr
__P((XDR
*, struct rpc_msg
*));
202 * XDR routine to handle a rpc reply.
203 * xdr_replymsg(xdrs, rmsg)
205 * struct rpc_msg *rmsg;
207 extern bool_t xdr_replymsg
__P((XDR
*, struct rpc_msg
*));
210 * Fills in the error part of a reply message.
211 * _seterr_reply(msg, error)
212 * struct rpc_msg *msg;
213 * struct rpc_err *error;
215 extern void _seterr_reply
__P((struct rpc_msg
*, struct rpc_err
*));
218 #endif /* !_RPC_RPCMSG_H */