2 * Copyright (c) 2009, Sun Microsystems, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * - Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 * - Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation
11 * and/or other materials provided with the distribution.
12 * - Neither the name of Sun Microsystems, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
28 * from: @(#)rpc_msg.h 1.7 86/07/16 SMI
29 * from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC
30 * $FreeBSD: src/include/rpc/rpc_msg.h,v 1.11.2.1 1999/08/29 14:39:07 peter Exp $
35 * rpc message definition
37 * Copyright (C) 1984, Sun Microsystems, Inc.
40 #define SUNRPC_MSG_VERSION ((uint32_t) 2)
43 * Bottom up definition of an rpc message.
44 * NOTE: call and reply use the same overall struct but
45 * different parts of unions within it.
48 enum sunrpc_msg_type
{
53 enum sunrpc_reply_stat
{
54 SUNRPC_MSG_ACCEPTED
=0,
58 enum sunrpc_accept_stat
{
60 SUNRPC_PROG_UNAVAIL
=1,
61 SUNRPC_PROG_MISMATCH
=2,
62 SUNRPC_PROC_UNAVAIL
=3,
63 SUNRPC_GARBAGE_ARGS
=4,
67 enum sunrpc_reject_stat
{
68 SUNRPC_RPC_MISMATCH
=0,
73 * Reply part of an rpc exchange
77 * Reply to an rpc request that was rejected by the server.
79 struct sunrpc_rejected_reply
{
80 nd_uint32_t rj_stat
; /* enum reject_stat */
86 nd_uint32_t RJ_why
; /* enum auth_stat - why authentication did not work */
88 #define rj_vers ru.RJ_versions
89 #define rj_why ru.RJ_why
93 * Body of a reply to an rpc request.
95 struct sunrpc_reply_body
{
96 nd_uint32_t rp_stat
; /* enum reply_stat */
97 struct sunrpc_rejected_reply rp_reject
; /* if rejected */
101 * Body of an rpc request call.
103 struct sunrpc_call_body
{
104 nd_uint32_t cb_rpcvers
; /* must be equal to two */
108 struct sunrpc_opaque_auth cb_cred
;
109 /* followed by opaque verifier */
117 nd_uint32_t rm_direction
; /* enum msg_type */
119 struct sunrpc_call_body RM_cmb
;
120 struct sunrpc_reply_body RM_rmb
;
122 #define rm_call ru.RM_cmb
123 #define rm_reply ru.RM_rmb
125 #define acpted_rply ru.RM_rmb.ru.RP_ar
126 #define rjcted_rply ru.RM_rmb.ru.RP_dr