7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 #ifndef __PACKET_RPC_H__
27 #define __PACKET_RPC_H__
30 #include <epan/packet.h>
31 #include <epan/conversation.h>
41 #define AUTH_GSSAPI 300001
43 #define MSG_ACCEPTED 0
47 #define PROG_UNAVAIL 1
48 #define PROG_MISMATCH 2
49 #define PROC_UNAVAIL 3
50 #define GARBAGE_ARGS 4
51 #define SYSTEM_ERROR 5
53 #define RPC_MISMATCH 0
56 #define AUTH_BADCRED 1
57 #define AUTH_REJECTEDCRED 2
58 #define AUTH_BADVERF 3
59 #define AUTH_REJECTEDVERF 4
60 #define AUTH_TOOWEAK 5
61 #define RPCSEC_GSSCREDPROB 13
62 #define RPCSEC_GSSCTXPROB 14
64 #define RPCSEC_GSS_DATA 0
65 #define RPCSEC_GSS_INIT 1
66 #define RPCSEC_GSS_CONTINUE_INIT 2
67 #define RPCSEC_GSS_DESTROY 3
69 #define AUTH_GSSAPI_EXIT 0
70 #define AUTH_GSSAPI_INIT 1
71 #define AUTH_GSSAPI_CONTINUE_INIT 2
72 #define AUTH_GSSAPI_MSG 3
73 #define AUTH_GSSAPI_DESTROY 4
75 #define RPCSEC_GSS_SVC_NONE 1
76 #define RPCSEC_GSS_SVC_INTEGRITY 2
77 #define RPCSEC_GSS_SVC_PRIVACY 3
79 #define AUTHDES_NAMEKIND_FULLNAME 0
80 #define AUTHDES_NAMEKIND_NICKNAME 1
82 extern value_string rpc_authgss_svc[];
84 FLAVOR_UNKNOWN, /* authentication flavor unknown */
85 FLAVOR_NOT_GSSAPI, /* flavor isn't GSSAPI */
86 FLAVOR_GSSAPI_NO_INFO, /* flavor is GSSAPI, procedure & service unknown */
87 FLAVOR_GSSAPI, /* flavor is GSSAPI, procedure & service known */
88 FLAVOR_AUTHGSSAPI, /* AUTH_GSSAPI flavor */
89 FLAVOR_AUTHGSSAPI_MSG /* AUTH_GSSAPI flavor, AUTH_GSSAPI message */
92 typedef struct _rpc_call_info_value {
93 guint32 req_num; /* frame number of first request seen */
94 guint32 rep_num; /* frame number of first reply seen */
102 struct _rpc_proc_info_value* proc_info;
103 gboolean request; /* Is this a request or not ?*/
106 } rpc_call_info_value;
109 typedef int (dissect_function_t)(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree);
111 typedef struct _vsff {
114 dissect_function_t *dissect_call;
115 dissect_function_t *dissect_reply;
118 extern const value_string rpc_auth_flavor[];
120 extern void rpc_init_proc_table(guint prog, guint vers, const vsff *proc_table,
122 extern void rpc_init_prog(int proto, guint32 prog, int ett);
123 extern const char *rpc_prog_name(guint32 prog);
124 extern const char *rpc_proc_name(guint32 prog, guint32 vers, guint32 proc);
125 extern int rpc_prog_hf(guint32 prog, guint32 vers);
127 extern unsigned int rpc_roundup(unsigned int a);
128 extern int dissect_rpc_bool(tvbuff_t *tvb,
129 proto_tree *tree, int hfindex, int offset);
130 extern int dissect_rpc_string(tvbuff_t *tvb,
131 proto_tree *tree, int hfindex, int offset, char **string_buffer_ret);
132 int dissect_rpc_opaque_data(tvbuff_t *tvb, int offset,
136 gboolean fixed_length, guint32 length,
137 gboolean string_data, char **string_buffer_ret,
138 dissect_function_t *dissect_it);
139 extern int dissect_rpc_data(tvbuff_t *tvb,
140 proto_tree *tree, int hfindex, int offset);
141 extern int dissect_rpc_bytes(tvbuff_t *tvb,
142 proto_tree *tree, int hfindex, int offset, guint32 length,
143 gboolean string_data, char **string_buffer_ret);
144 extern int dissect_rpc_list(tvbuff_t *tvb, packet_info *pinfo,
145 proto_tree *tree, int offset, dissect_function_t *rpc_list_dissector);
146 extern int dissect_rpc_array(tvbuff_t *tvb, packet_info *pinfo,
147 proto_tree *tree, int offset, dissect_function_t *rpc_array_dissector,
149 extern int dissect_rpc_uint32(tvbuff_t *tvb,
150 proto_tree *tree, int hfindex, int offset);
151 extern int dissect_rpc_uint64(tvbuff_t *tvb,
152 proto_tree *tree, int hfindex, int offset);
154 extern int dissect_rpc_indir_call(tvbuff_t *tvb, packet_info *pinfo,
155 proto_tree *tree, int offset, int args_id, guint32 prog, guint32 vers,
157 extern int dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo,
158 proto_tree *tree, int offset, int result_id, int prog_id, int vers_id,
162 typedef struct _rpc_prog_info_key {
166 typedef struct _rpc_prog_info_value {
170 const char* progname;
171 GArray *procedure_hfs;
172 } rpc_prog_info_value;
174 /* rpc_progs is also used in tap. With MSVC and a
175 * libwireshark.dll, we need a special declaration.
177 WS_VAR_IMPORT GHashTable *rpc_progs;
179 typedef struct _rpc_proc_info_key {
185 typedef struct _rpc_proc_info_value {
187 dissect_function_t *dissect_call;
188 dissect_function_t *dissect_reply;
189 } rpc_proc_info_value;
191 /* rpc_procs is also used in tap. With MSVC and a
192 * libwireshark.dll, we need a special declaration.
194 WS_VAR_IMPORT GHashTable *rpc_procs;
196 #endif /* packet-rpc.h */