4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
22 #pragma ident "%Z%%M% %I% %E% SMI"
25 * rpc message definition
27 * Copyright (C) 1984, Sun Microsystems, Inc.
30 #ifndef _rpc_rpc_msg_h
31 #define _rpc_rpc_msg_h
33 #define RPC_MSG_VERSION ((u_long) 2)
34 #define RPC_SERVICE_PORT ((u_short) 2048)
37 * Bottom up definition of an rpc message.
38 * NOTE: call and reply use the same overall stuct but
39 * different parts of unions within it.
67 * Reply part of an rpc exchange
71 * Reply to an rpc request that was accepted by the server.
72 * Note: there could be an error even though the request was
75 struct accepted_reply
{
76 struct opaque_auth ar_verf
;
77 enum accept_stat ar_stat
;
87 /* and many other null cases */
89 #define ar_results ru.AR_results
90 #define ar_vers ru.AR_versions
94 * Reply to an rpc request that was rejected by the server.
96 struct rejected_reply
{
97 enum reject_stat rj_stat
;
103 enum auth_stat RJ_why
; /* why authentication did not work */
105 #define rj_vers ru.RJ_versions
106 #define rj_why ru.RJ_why
110 * Body of a reply to an rpc request.
113 enum reply_stat rp_stat
;
115 struct accepted_reply RP_ar
;
116 struct rejected_reply RP_dr
;
118 #define rp_acpt ru.RP_ar
119 #define rp_rjct ru.RP_dr
123 * Body of an rpc request call.
126 u_long cb_rpcvers
; /* must be equal to two */
130 struct opaque_auth cb_cred
;
131 struct opaque_auth cb_verf
; /* protocol specific - provided by client */
139 enum msg_type rm_direction
;
141 struct call_body RM_cmb
;
142 struct reply_body RM_rmb
;
144 #define rm_call ru.RM_cmb
145 #define rm_reply ru.RM_rmb
147 #define acpted_rply ru.RM_rmb.ru.RP_ar
148 #define rjcted_rply ru.RM_rmb.ru.RP_dr
152 * XDR routine to handle a rpc message.
153 * xdr_callmsg(xdrs, cmsg)
155 * struct rpc_msg *cmsg;
157 extern bool_t
xdr_callmsg();
160 * XDR routine to pre-serialize the static part of a rpc message.
161 * xdr_callhdr(xdrs, cmsg)
163 * struct rpc_msg *cmsg;
165 extern bool_t
xdr_callhdr();
168 * XDR routine to handle a rpc reply.
169 * xdr_replymsg(xdrs, rmsg)
171 * struct rpc_msg *rmsg;
173 extern bool_t
xdr_replymsg();
176 * Fills in the error part of a reply message.
177 * _seterr_reply(msg, error)
178 * struct rpc_msg *msg;
179 * struct rpc_err *error;
181 extern void _seterr_reply();
183 #endif /*!_rpc_rpc_msg_h*/