Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-rpc.h
1/* packet-rpc.h
2 *
3 * (c) 1999 Uwe Girlich
4 *
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <[email protected]>
7 * Copyright 1998 Gerald Combs
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 */
11
12#ifndef __PACKET_RPC_H__
13#define __PACKET_RPC_H__
14
15#include <epan/packet.h>
16#include "ws_symbol_export.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif /* __cplusplus */
21
22#define RPC_CALL 0
23#define RPC_REPLY 1
24
25#define AUTH_NULL 0
26#define AUTH_UNIX 1
27#define AUTH_SHORT 2
28#define AUTH_DES 3
29#define AUTH_KRB4 4
30#define AUTH_RSA 5
31#define RPCSEC_GSS 6
32#define AUTH_TLS 7
33#define AUTH_GSSAPI 300001
34/* Pseudo-flavors used for security mechanisms while using
35 * RPCSEC_GSS
36 */
37#define RPCSEC_GSS_KRB5 390003
38#define RPCSEC_GSS_KRB5I 390004
39#define RPCSEC_GSS_KRB5P 390005
40#define RPCSEC_GSS_LIPKEY 390006
41#define RPCSEC_GSS_LIPKEY_I 390007
42#define RPCSEC_GSS_LIPKEY_P 390008
43#define RPCSEC_GSS_SPKM3 390009
44#define RPCSEC_GSS_SPKM3I 390010
45#define RPCSEC_GSS_SPKM3P 390011
46/* GlusterFS requested an RPC-AUTH number from IANA,
47 * until a number has been granted 390039 is used.
48 * See also: http://review.gluster.com/3230
49 */
50#define AUTH_GLUSTERFS 390039
51#define AUTH_GLUSTERFS_V3 390040
52
53#define MSG_ACCEPTED 0
54#define MSG_DENIED 1
55
56#define SUCCESS 0
57#define PROG_UNAVAIL 1
58#define PROG_MISMATCH 2
59#define PROC_UNAVAIL 3
60#define GARBAGE_ARGS 4
61#define SYSTEM_ERROR 5
62
63#define RPC_MISMATCH 0
64#define AUTH_ERROR 1
65
66#define AUTH_BADCRED 1
67#define AUTH_REJECTEDCRED 2
68#define AUTH_BADVERF 3
69#define AUTH_REJECTEDVERF 4
70#define AUTH_TOOWEAK 5
71#define RPCSEC_GSSCREDPROB 13
72#define RPCSEC_GSSCTXPROB 14
73
74#define RPCSEC_GSS_DATA 0
75#define RPCSEC_GSS_INIT 1
76#define RPCSEC_GSS_CONTINUE_INIT 2
77#define RPCSEC_GSS_DESTROY 3
78
79#define AUTH_GSSAPI_EXIT 0
80#define AUTH_GSSAPI_INIT 1
81#define AUTH_GSSAPI_CONTINUE_INIT 2
82#define AUTH_GSSAPI_MSG 3
83#define AUTH_GSSAPI_DESTROY 4
84
85#define RPCSEC_GSS_SVC_NONE 1
86#define RPCSEC_GSS_SVC_INTEGRITY 2
87#define RPCSEC_GSS_SVC_PRIVACY 3
88
89#define AUTHDES_NAMEKIND_FULLNAME 0
90#define AUTHDES_NAMEKIND_NICKNAME 1
91
92#define RPC_STRING_EMPTY "<EMPTY>"
93#define RPC_STRING_DATA "<DATA>"
94#define RPC_STRING_TRUNCATED "<TRUNCATED>"
95
96#define RPC_RM_LASTFRAG 0x80000000U
97#define RPC_RM_FRAGLEN 0x7fffffffU
98
99extern const value_string rpc_authgss_svc[];
100typedef enum {
101 FLAVOR_UNKNOWN, /* authentication flavor unknown */
102 FLAVOR_NOT_GSSAPI, /* flavor isn't GSSAPI */
103 FLAVOR_GSSAPI_NO_INFO, /* flavor is GSSAPI, procedure & service unknown */
104 FLAVOR_GSSAPI, /* flavor is GSSAPI, procedure & service known */
105 FLAVOR_AUTHGSSAPI, /* AUTH_GSSAPI flavor */
106 FLAVOR_AUTHGSSAPI_MSG /* AUTH_GSSAPI flavor, AUTH_GSSAPI message */
107} flavor_t;
108
109typedef struct _rpc_call_info_value {
110 uint32_t req_num; /* frame number of first request seen */
111 uint32_t rep_num; /* frame number of first reply seen */
112 uint32_t prog;
113 uint32_t vers;
114 uint32_t proc;
115 uint32_t xid;
116 flavor_t flavor;
117 uint32_t gss_proc;
118 uint32_t gss_svc;
119 bool request; /* Is this a request or not ?*/
120 nstime_t req_time;
121 void *private_data;
123
124
125typedef int (dissect_function_t)(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree, void* data);
126
127/*
128 * Information about a particular version of a program.
129 */
130typedef struct _vsff {
131 uint32_t value;
132 const char *strptr;
133 dissector_t dissect_call;
134 dissector_t dissect_reply;
135} vsff;
136
137typedef struct _rpc_proc_list {
138 unsigned vers;
139 const vsff *proc_table;
140 int *procedure_hf;
142
143extern const value_string rpc_auth_flavor[];
144
145WS_DLL_PUBLIC void rpc_init_prog(int proto, uint32_t prog, int ett, size_t nvers,
146 const rpc_prog_vers_info *versions);
147WS_DLL_PUBLIC const char *rpc_proc_name(wmem_allocator_t *allocator, uint32_t prog, uint32_t vers, uint32_t proc);
148WS_DLL_PUBLIC int rpc_prog_hf(uint32_t prog, uint32_t vers);
149
150WS_DLL_PUBLIC unsigned int rpc_roundup(unsigned int a);
151WS_DLL_PUBLIC int dissect_rpc_void(tvbuff_t *tvb,
152 packet_info *pinfo, proto_tree *tree, void *data);
153WS_DLL_PUBLIC int dissect_rpc_unknown(tvbuff_t *tvb,
154 packet_info *pinfo, proto_tree *tree, void *data);
155WS_DLL_PUBLIC int dissect_rpc_bool(tvbuff_t *tvb,
156 proto_tree *tree, int hfindex, int offset);
157WS_DLL_PUBLIC int dissect_rpc_string(tvbuff_t *tvb, packet_info* pinfo,
158 proto_tree *tree, int hfindex, int offset, const char **string_buffer_ret);
159WS_DLL_PUBLIC
160int dissect_rpc_opaque_data(tvbuff_t *tvb, int offset,
161 proto_tree *tree,
162 packet_info *pinfo,
163 int hfindex,
164 bool fixed_length, uint32_t length,
165 bool string_data, const char **string_buffer_ret,
166 dissect_function_t *dissect_it);
167WS_DLL_PUBLIC int dissect_rpc_data(tvbuff_t *tvb, packet_info* pinfo,
168 proto_tree *tree, int hfindex, int offset);
169WS_DLL_PUBLIC int dissect_rpc_bytes(tvbuff_t *tvb, packet_info* pinfo,
170 proto_tree *tree, int hfindex, int offset, uint32_t length,
171 bool string_data, const char **string_buffer_ret);
172WS_DLL_PUBLIC int dissect_rpc_list(tvbuff_t *tvb, packet_info *pinfo,
173 proto_tree *tree, int offset, dissect_function_t *rpc_list_dissector,
174 void *data);
175WS_DLL_PUBLIC int dissect_rpc_array(tvbuff_t *tvb, packet_info *pinfo,
176 proto_tree *tree, int offset, dissect_function_t *rpc_array_dissector,
177 int hfindex);
178WS_DLL_PUBLIC int dissect_rpc_uint32(tvbuff_t *tvb,
179 proto_tree *tree, int hfindex, int offset);
180WS_DLL_PUBLIC int dissect_rpc_uint64(tvbuff_t *tvb,
181 proto_tree *tree, int hfindex, int offset);
182
183WS_DLL_PUBLIC int dissect_rpc_indir_call(tvbuff_t *tvb, packet_info *pinfo,
184 proto_tree *tree, int offset, int args_id, uint32_t prog, uint32_t vers,
185 uint32_t proc);
186WS_DLL_PUBLIC int dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo,
187 proto_tree *tree, int offset, int result_id, int prog_id, int vers_id,
188 int proc_id);
189WS_DLL_PUBLIC int dissect_rpc_opaque_auth(tvbuff_t* tvb, proto_tree* tree,
190 int offset, packet_info *pinfo);
191
192typedef struct _rpc_prog_info_value {
193 protocol_t *proto;
194 int proto_id;
195 int ett;
196 const char* progname;
197 wmem_array_t* procedure_hfs; /* int */
199
200typedef struct _rpc_proc_info_key {
201 uint32_t prog;
202 uint32_t vers;
203 uint32_t proc;
205
206typedef struct rpcstat_tap_data
207{
208 const char *prog;
209 uint32_t program;
210 uint32_t version;
211 int num_procedures;
213
214#ifdef __cplusplus
215}
216#endif /* __cplusplus */
217
218#endif /* packet-rpc.h */
Definition packet_info.h:43
Definition proto.h:907
Definition proto.c:382
Definition packet-rpc.h:109
Definition packet-rpc.h:200
Definition packet-rpc.h:137
Definition packet-rpc.h:192
Mapping between a 32-bit integer value and its string representation.
Definition value_string.h:33
Definition packet-rpc.h:130
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
Definition wmem_array.c:27
Definition nstime.h:26
Definition packet-rpc.h:207
Definition tvbuff-int.h:35