]> The Tcpdump Group git mirrors - tcpdump/blob - rpc_msg.h
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / rpc_msg.h
1 /*
2 * Copyright (c) 2009, Sun Microsystems, Inc.
3 * All rights reserved.
4 *
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.
15 *
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.
27 *
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 $
31 */
32
33 /*
34 * rpc_msg.h
35 * rpc message definition
36 *
37 * Copyright (C) 1984, Sun Microsystems, Inc.
38 */
39
40 #define SUNRPC_MSG_VERSION ((uint32_t) 2)
41
42 /*
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.
46 */
47
48 enum sunrpc_msg_type {
49 SUNRPC_CALL=0,
50 SUNRPC_REPLY=1
51 };
52
53 enum sunrpc_reply_stat {
54 SUNRPC_MSG_ACCEPTED=0,
55 SUNRPC_MSG_DENIED=1
56 };
57
58 enum sunrpc_accept_stat {
59 SUNRPC_SUCCESS=0,
60 SUNRPC_PROG_UNAVAIL=1,
61 SUNRPC_PROG_MISMATCH=2,
62 SUNRPC_PROC_UNAVAIL=3,
63 SUNRPC_GARBAGE_ARGS=4,
64 SUNRPC_SYSTEM_ERR=5
65 };
66
67 enum sunrpc_reject_stat {
68 SUNRPC_RPC_MISMATCH=0,
69 SUNRPC_AUTH_ERROR=1
70 };
71
72 /*
73 * Reply part of an rpc exchange
74 */
75
76 /*
77 * Reply to an rpc request that was rejected by the server.
78 */
79 struct sunrpc_rejected_reply {
80 nd_uint32_t rj_stat; /* enum reject_stat */
81 union {
82 struct {
83 nd_uint32_t low;
84 nd_uint32_t high;
85 } RJ_versions;
86 nd_uint32_t RJ_why; /* enum auth_stat - why authentication did not work */
87 } ru;
88 #define rj_vers ru.RJ_versions
89 #define rj_why ru.RJ_why
90 };
91
92 /*
93 * Body of a reply to an rpc request.
94 */
95 struct sunrpc_reply_body {
96 nd_uint32_t rp_stat; /* enum reply_stat */
97 struct sunrpc_rejected_reply rp_reject; /* if rejected */
98 };
99
100 /*
101 * Body of an rpc request call.
102 */
103 struct sunrpc_call_body {
104 nd_uint32_t cb_rpcvers; /* must be equal to two */
105 nd_uint32_t cb_prog;
106 nd_uint32_t cb_vers;
107 nd_uint32_t cb_proc;
108 struct sunrpc_opaque_auth cb_cred;
109 /* followed by opaque verifier */
110 };
111
112 /*
113 * The rpc message
114 */
115 struct sunrpc_msg {
116 nd_uint32_t rm_xid;
117 nd_uint32_t rm_direction; /* enum msg_type */
118 union {
119 struct sunrpc_call_body RM_cmb;
120 struct sunrpc_reply_body RM_rmb;
121 } ru;
122 #define rm_call ru.RM_cmb
123 #define rm_reply ru.RM_rmb
124 };
125 #define acpted_rply ru.RM_rmb.ru.RP_ar
126 #define rjcted_rply ru.RM_rmb.ru.RP_dr