]> The Tcpdump Group git mirrors - tcpdump/blob - rpc_msg.h
Don't dump core if a null "struct tok" array pointer is passed to
[tcpdump] / rpc_msg.h
1 /* @(#) $Header: /tcpdump/master/tcpdump/rpc_msg.h,v 1.1 2004-12-27 00:41:32 guy Exp $ (LBL) */
2 /*
3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4 * unrestricted use provided that this legend is included on all tape
5 * media and as a part of the software program in whole or part. Users
6 * may copy or modify Sun RPC without charge, but are not authorized
7 * to license or distribute it to anyone else except as part of a product or
8 * program developed by the user.
9 *
10 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
11 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
12 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 *
14 * Sun RPC is provided with no support and without any obligation on the
15 * part of Sun Microsystems, Inc. to assist in its use, correction,
16 * modification or enhancement.
17 *
18 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
19 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
20 * OR ANY PART THEREOF.
21 *
22 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
23 * or profits or other special, indirect and consequential damages, even if
24 * Sun has been advised of the possibility of such damages.
25 *
26 * Sun Microsystems, Inc.
27 * 2550 Garcia Avenue
28 * Mountain View, California 94043
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.11.2.1 1999/08/29 14:39:07 peter Exp $
33 */
34
35 /*
36 * rpc_msg.h
37 * rpc message definition
38 *
39 * Copyright (C) 1984, Sun Microsystems, Inc.
40 */
41
42 #ifndef __RPC_MSG_H_
43 #define __RPC_MSG_H_
44
45 #define SUNRPC_MSG_VERSION ((u_int32_t) 2)
46
47 /*
48 * Bottom up definition of an rpc message.
49 * NOTE: call and reply use the same overall stuct but
50 * different parts of unions within it.
51 */
52
53 enum sunrpc_msg_type {
54 SUNRPC_CALL=0,
55 SUNRPC_REPLY=1
56 };
57
58 enum sunrpc_reply_stat {
59 SUNRPC_MSG_ACCEPTED=0,
60 SUNRPC_MSG_DENIED=1
61 };
62
63 enum sunrpc_accept_stat {
64 SUNRPC_SUCCESS=0,
65 SUNRPC_PROG_UNAVAIL=1,
66 SUNRPC_PROG_MISMATCH=2,
67 SUNRPC_PROC_UNAVAIL=3,
68 SUNRPC_GARBAGE_ARGS=4,
69 SUNRPC_SYSTEM_ERR=5
70 };
71
72 enum sunrpc_reject_stat {
73 SUNRPC_RPC_MISMATCH=0,
74 SUNRPC_AUTH_ERROR=1
75 };
76
77 /*
78 * Reply part of an rpc exchange
79 */
80
81 /*
82 * Reply to an rpc request that was rejected by the server.
83 */
84 struct sunrpc_rejected_reply {
85 u_int32_t rj_stat; /* enum reject_stat */
86 union {
87 struct {
88 u_int32_t low;
89 u_int32_t high;
90 } RJ_versions;
91 u_int32_t RJ_why; /* enum auth_stat - why authentication did not work */
92 } ru;
93 #define rj_vers ru.RJ_versions
94 #define rj_why ru.RJ_why
95 };
96
97 /*
98 * Body of a reply to an rpc request.
99 */
100 struct sunrpc_reply_body {
101 u_int32_t rp_stat; /* enum reply_stat */
102 struct sunrpc_rejected_reply rp_reject; /* if rejected */
103 };
104
105 /*
106 * Body of an rpc request call.
107 */
108 struct sunrpc_call_body {
109 u_int32_t cb_rpcvers; /* must be equal to two */
110 u_int32_t cb_prog;
111 u_int32_t cb_vers;
112 u_int32_t cb_proc;
113 struct sunrpc_opaque_auth cb_cred;
114 /* followed by opaque verifier */
115 };
116
117 /*
118 * The rpc message
119 */
120 struct sunrpc_msg {
121 u_int32_t rm_xid;
122 u_int32_t rm_direction; /* enum msg_type */
123 union {
124 struct sunrpc_call_body RM_cmb;
125 struct sunrpc_reply_body RM_rmb;
126 } ru;
127 #define rm_call ru.RM_cmb
128 #define rm_reply ru.RM_rmb
129 };
130 #define acpted_rply ru.RM_rmb.ru.RP_ar
131 #define rjcted_rply ru.RM_rmb.ru.RP_dr
132
133 #endif /* !__RPC_MSG_H_ */