ReactOS
0.4.16-dev-2-g02a6913
rpc_msg.h
Go to the documentation of this file.
1
/* $NetBSD: rpc_msg.h,v 1.11 2000/06/02 22:57:56 fvdl Exp $ */
2
3
/*
4
* Copyright (c) 2009, Sun Microsystems, Inc.
5
* All rights reserved.
6
*
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions are met:
9
* - Redistributions of source code must retain the above copyright notice,
10
* this list of conditions and the following disclaimer.
11
* - Redistributions in binary form must reproduce the above copyright notice,
12
* this list of conditions and the following disclaimer in the documentation
13
* and/or other materials provided with the distribution.
14
* - Neither the name of Sun Microsystems, Inc. nor the names of its
15
* contributors may be used to endorse or promote products derived
16
* from this software without specific prior written permission.
17
*
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
* POSSIBILITY OF SUCH DAMAGE.
29
*
30
* from: @(#)rpc_msg.h 1.7 86/07/16 SMI
31
* from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC
32
* $FreeBSD: src/include/rpc/rpc_msg.h,v 1.15 2003/01/01 18:48:42 schweikh Exp $
33
*/
34
35
/*
36
* rpc_msg.h
37
* rpc message definition
38
*
39
* Copyright (C) 1984, Sun Microsystems, Inc.
40
*/
41
42
/* NFSv4.1 client for Windows
43
* Copyright © 2012 The Regents of the University of Michigan
44
*
45
* Olga Kornievskaia <aglo@umich.edu>
46
* Casey Bodley <cbodley@umich.edu>
47
*
48
* This library is free software; you can redistribute it and/or modify it
49
* under the terms of the GNU Lesser General Public License as published by
50
* the Free Software Foundation; either version 2.1 of the License, or (at
51
* your option) any later version.
52
*
53
* This library is distributed in the hope that it will be useful, but
54
* without any warranty; without even the implied warranty of merchantability
55
* or fitness for a particular purpose. See the GNU Lesser General Public
56
* License for more details.
57
*
58
* You should have received a copy of the GNU Lesser General Public License
59
* along with this library; if not, write to the Free Software Foundation,
60
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA
61
*/
62
63
#ifndef _TIRPC_RPC_MSG_H
64
#define _TIRPC_RPC_MSG_H
65
66
#define RPC_MSG_VERSION ((u_int32_t) 2)
67
#define RPC_SERVICE_PORT ((u_short) 2048)
68
69
#include <
rpc/auth.h
>
70
71
/*
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.
75
*/
76
77
enum
msg_type
{
78
CALL
=0,
79
REPLY
=1
80
};
81
82
enum
reply_stat
{
83
MSG_ACCEPTED
=0,
84
MSG_DENIED
=1
85
};
86
87
enum
accept_stat
{
88
SUCCESS
=0,
89
PROG_UNAVAIL
=1,
90
PROG_MISMATCH
=2,
91
PROC_UNAVAIL
=3,
92
GARBAGE_ARGS
=4,
93
SYSTEM_ERR
=5
94
};
95
96
enum
reject_stat
{
97
RPC_MISMATCH
=0,
98
AUTH_ERROR
=1
99
};
100
101
/*
102
* Reply part of an rpc exchange
103
*/
104
105
/*
106
* Reply to an rpc request that was accepted by the server.
107
* Note: there could be an error even though the request was
108
* accepted.
109
*/
110
struct
accepted_reply
{
111
struct
opaque_auth
ar_verf
;
112
enum
accept_stat
ar_stat
;
113
union
{
114
struct
{
115
rpcvers_t
low
;
116
rpcvers_t
high
;
117
} AR_versions;
118
struct
{
119
caddr_t
where
;
120
xdrproc_t
proc
;
121
} AR_results;
122
/* and many other null cases */
123
}
ru
;
124
#define ar_results ru.AR_results
125
#define ar_vers ru.AR_versions
126
};
127
128
/*
129
* Reply to an rpc request that was rejected by the server.
130
*/
131
struct
rejected_reply
{
132
enum
reject_stat
rj_stat
;
133
union
{
134
struct
{
135
rpcvers_t
low
;
136
rpcvers_t
high
;
137
}
RJ_versions
;
138
enum
auth_stat
RJ_why
;
/* why authentication did not work */
139
}
ru
;
140
#define rj_vers ru.RJ_versions
141
#define rj_why ru.RJ_why
142
};
143
144
/*
145
* Body of a reply to an rpc request.
146
*/
147
struct
reply_body
{
148
enum
reply_stat
rp_stat
;
149
union
{
150
struct
accepted_reply
RP_ar
;
151
struct
rejected_reply
RP_dr
;
152
}
ru
;
153
#define rp_acpt ru.RP_ar
154
#define rp_rjct ru.RP_dr
155
};
156
157
/*
158
* Body of an rpc request call.
159
*/
160
struct
call_body
{
161
rpcvers_t
cb_rpcvers
;
/* must be equal to two */
162
rpcprog_t
cb_prog
;
163
rpcvers_t
cb_vers
;
164
rpcproc_t
cb_proc
;
165
struct
opaque_auth
cb_cred
;
166
struct
opaque_auth
cb_verf
;
/* protocol specific - provided by client */
167
};
168
169
/*
170
* The rpc message
171
*/
172
struct
rpc_msg
{
173
u_int32_t
rm_xid
;
174
enum
msg_type
rm_direction
;
175
union
{
176
struct
call_body
RM_cmb
;
177
struct
reply_body
RM_rmb
;
178
}
ru
;
179
#define rm_call ru.RM_cmb
180
#define rm_reply ru.RM_rmb
181
};
182
#define acpted_rply ru.RM_rmb.ru.RP_ar
183
#define rjcted_rply ru.RM_rmb.ru.RP_dr
184
185
__BEGIN_DECLS
186
/*
187
* XDR routine to handle a rpc message.
188
* xdr_callmsg(xdrs, cmsg)
189
* XDR *xdrs;
190
* struct rpc_msg *cmsg;
191
*/
192
extern
bool_t
xdr_callmsg
(
XDR
*,
struct
rpc_msg
*);
193
194
/*
195
* XDR routine to pre-serialize the static part of a rpc message.
196
* xdr_callhdr(xdrs, cmsg)
197
* XDR *xdrs;
198
* struct rpc_msg *cmsg;
199
*/
200
extern
bool_t
xdr_callhdr
(
XDR
*,
struct
rpc_msg
*);
201
202
/*
203
* XDR routine to handle a rpc reply.
204
* xdr_replymsg(xdrs, rmsg)
205
* XDR *xdrs;
206
* struct rpc_msg *rmsg;
207
*/
208
extern
bool_t
xdr_replymsg
(
XDR
*,
struct
rpc_msg
*);
209
210
/*
211
* XDR routine to read just xid and direction, then union
212
* xdr_getxiddir(xdrs, rmsg)
213
* XDR *xdrs;
214
* struct rpc_msg *rmsg;
215
*/
216
extern
bool_t
xdr_getxiddir
(
XDR
*,
struct
rpc_msg
*);
217
extern
bool_t
xdr_getreplyunion
(
XDR
*,
struct
rpc_msg
*);
218
extern
bool_t
xdr_getcallbody
(
XDR
*,
struct
rpc_msg
*);
219
220
/*
221
* XDR routine to handle an accepted rpc reply.
222
* xdr_accepted_reply(xdrs, rej)
223
* XDR *xdrs;
224
* struct accepted_reply *rej;
225
*/
226
extern
bool_t
xdr_accepted_reply
(
XDR
*,
struct
accepted_reply
*);
227
228
/*
229
* XDR routine to handle a rejected rpc reply.
230
* xdr_rejected_reply(xdrs, rej)
231
* XDR *xdrs;
232
* struct rejected_reply *rej;
233
*/
234
extern
bool_t
xdr_rejected_reply
(
XDR
*,
struct
rejected_reply
*);
235
236
/*
237
* Fills in the error part of a reply message.
238
* _seterr_reply(msg, error)
239
* struct rpc_msg *msg;
240
* struct rpc_err *error;
241
*/
242
extern
void
_seterr_reply
(
struct
rpc_msg
*,
struct
rpc_err
*);
243
__END_DECLS
244
245
#endif
/* !_TIRPC_RPC_MSG_H */
auth.h
auth_stat
auth_stat
Definition:
auth.h:144
rpcprog_t
u_int32_t rpcprog_t
Definition:
types.h:104
bool_t
int32_t bool_t
Definition:
types.h:101
rpcvers_t
u_int32_t rpcvers_t
Definition:
types.h:105
rpcproc_t
u_int32_t rpcproc_t
Definition:
types.h:106
u_int32_t
unsigned int u_int32_t
Definition:
rosdhcp.h:35
caddr_t
char * caddr_t
Definition:
rosdhcp.h:36
xdr_getreplyunion
bool_t xdr_getreplyunion(XDR *, struct rpc_msg *)
Definition:
rpc_prot.c:221
xdr_replymsg
bool_t xdr_replymsg(XDR *, struct rpc_msg *)
Definition:
rpc_prot.c:188
reply_stat
reply_stat
Definition:
rpc_msg.h:82
MSG_DENIED
@ MSG_DENIED
Definition:
rpc_msg.h:84
MSG_ACCEPTED
@ MSG_ACCEPTED
Definition:
rpc_msg.h:83
msg_type
msg_type
Definition:
rpc_msg.h:77
REPLY
@ REPLY
Definition:
rpc_msg.h:79
CALL
@ CALL
Definition:
rpc_msg.h:78
xdr_accepted_reply
bool_t xdr_accepted_reply(XDR *, struct accepted_reply *)
Definition:
rpc_prot.c:117
xdr_callmsg
__BEGIN_DECLS bool_t xdr_callmsg(XDR *, struct rpc_msg *)
Definition:
rpc_callmsg.c:50
xdr_callhdr
bool_t xdr_callhdr(XDR *, struct rpc_msg *)
Definition:
rpc_prot.c:257
accept_stat
accept_stat
Definition:
rpc_msg.h:87
PROG_MISMATCH
@ PROG_MISMATCH
Definition:
rpc_msg.h:90
GARBAGE_ARGS
@ GARBAGE_ARGS
Definition:
rpc_msg.h:92
SUCCESS
@ SUCCESS
Definition:
rpc_msg.h:88
SYSTEM_ERR
@ SYSTEM_ERR
Definition:
rpc_msg.h:93
PROC_UNAVAIL
@ PROC_UNAVAIL
Definition:
rpc_msg.h:91
PROG_UNAVAIL
@ PROG_UNAVAIL
Definition:
rpc_msg.h:89
xdr_getcallbody
bool_t xdr_getcallbody(XDR *, struct rpc_msg *)
Definition:
rpc_prot.c:234
xdr_getxiddir
bool_t xdr_getxiddir(XDR *, struct rpc_msg *)
Definition:
rpc_prot.c:209
_seterr_reply
void _seterr_reply(struct rpc_msg *, struct rpc_err *)
Definition:
rpc_prot.c:348
xdr_rejected_reply
bool_t xdr_rejected_reply(XDR *, struct rejected_reply *)
Definition:
rpc_prot.c:153
reject_stat
reject_stat
Definition:
rpc_msg.h:96
RPC_MISMATCH
@ RPC_MISMATCH
Definition:
rpc_msg.h:97
AUTH_ERROR
@ AUTH_ERROR
Definition:
rpc_msg.h:98
__rpc_xdr
Definition:
xdr.h:103
accepted_reply
Definition:
rpc_msg.h:110
accepted_reply::where
caddr_t where
Definition:
rpc_msg.h:119
accepted_reply::ru
union accepted_reply::@194 ru
accepted_reply::ar_verf
struct opaque_auth ar_verf
Definition:
rpc_msg.h:111
accepted_reply::proc
xdrproc_t proc
Definition:
rpc_msg.h:120
accepted_reply::low
rpcvers_t low
Definition:
rpc_msg.h:115
accepted_reply::ar_stat
enum accept_stat ar_stat
Definition:
rpc_msg.h:112
accepted_reply::high
rpcvers_t high
Definition:
rpc_msg.h:116
call_body
Definition:
rpc_msg.h:160
call_body::cb_prog
rpcprog_t cb_prog
Definition:
rpc_msg.h:162
call_body::cb_vers
rpcvers_t cb_vers
Definition:
rpc_msg.h:163
call_body::cb_verf
struct opaque_auth cb_verf
Definition:
rpc_msg.h:166
call_body::cb_proc
rpcproc_t cb_proc
Definition:
rpc_msg.h:164
call_body::cb_cred
struct opaque_auth cb_cred
Definition:
rpc_msg.h:165
call_body::cb_rpcvers
rpcvers_t cb_rpcvers
Definition:
rpc_msg.h:161
opaque_auth
Definition:
auth.h:195
rejected_reply
Definition:
rpc_msg.h:131
rejected_reply::high
rpcvers_t high
Definition:
rpc_msg.h:136
rejected_reply::low
rpcvers_t low
Definition:
rpc_msg.h:135
rejected_reply::RJ_versions
struct rejected_reply::@197::@198 RJ_versions
rejected_reply::rj_stat
enum reject_stat rj_stat
Definition:
rpc_msg.h:132
rejected_reply::ru
union rejected_reply::@197 ru
rejected_reply::RJ_why
enum auth_stat RJ_why
Definition:
rpc_msg.h:138
reply_body
Definition:
rpc_msg.h:147
reply_body::RP_dr
struct rejected_reply RP_dr
Definition:
rpc_msg.h:151
reply_body::ru
union reply_body::@199 ru
reply_body::rp_stat
enum reply_stat rp_stat
Definition:
rpc_msg.h:148
reply_body::RP_ar
struct accepted_reply RP_ar
Definition:
rpc_msg.h:150
rpc_err
Definition:
clnt.h:95
rpc_msg
Definition:
rpc_msg.h:172
rpc_msg::rm_direction
enum msg_type rm_direction
Definition:
rpc_msg.h:174
rpc_msg::ru
union rpc_msg::@200 ru
rpc_msg::RM_cmb
struct call_body RM_cmb
Definition:
rpc_msg.h:176
rpc_msg::rm_xid
u_int32_t rm_xid
Definition:
rpc_msg.h:173
rpc_msg::RM_rmb
struct reply_body RM_rmb
Definition:
rpc_msg.h:177
__END_DECLS
#define __END_DECLS
Definition:
wintirpc.h:63
__BEGIN_DECLS
#define __BEGIN_DECLS
Definition:
wintirpc.h:62
xdrproc_t
bool_t(* xdrproc_t)(XDR *,...)
Definition:
xdr.h:144
dll
3rdparty
libtirpc
tirpc
rpc
rpc_msg.h
Generated on Thu Sep 12 2024 06:02:48 for ReactOS by
1.9.6