Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-dcerpc.h
1/* packet-dcerpc.h
2 * Copyright 2001, Todd Sabin <tas@webspan.net>
3 * Copyright 2003, Tim Potter <tpot@samba.org>
4 *
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 */
11
12#ifndef __PACKET_DCERPC_H__
13#define __PACKET_DCERPC_H__
14
15#include <epan/conversation.h>
16#include "ws_symbol_export.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif /* __cplusplus */
21
22#define DCERPC_TABLE_NAME "dcerpc.uuid"
23/*
24 * Data representation.
25 */
26#define DREP_LITTLE_ENDIAN 0x10
27
28#define DREP_EBCDIC 0x01
29
30/*
31 * Data representation to integer byte order.
32 */
33#define DREP_ENC_INTEGER(drep) \
34 (((drep)[0] & DREP_LITTLE_ENDIAN) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN)
35
36/*
37 * Data representation to (octet-string) character encoding.
38 */
39#define DREP_ENC_CHAR(drep) \
40 (((drep)[0] & DREP_EBCDIC) ? ENC_EBCDIC|ENC_NA : ENC_ASCII|ENC_NA)
41
42#ifdef PT_R4
43/* now glib always includes signal.h and on linux PPC
44 * signal.h defines PT_R4
45*/
46#undef PT_R4
47#endif
48
49#define DCERPC_UUID_NULL { 0,0,0, {0,0,0,0,0,0,0,0} }
50
51/* %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x */
52#define DCERPC_UUID_STR_LEN 36+1
53
54typedef struct _e_ctx_hnd {
55 uint32_t attributes;
56 e_guid_t uuid;
57} e_ctx_hnd;
58
59typedef struct _e_dce_cn_common_hdr_t {
60 uint8_t rpc_ver;
61 uint8_t rpc_ver_minor;
62 uint8_t ptype;
63 uint8_t flags;
64 uint8_t drep[4];
65 uint16_t frag_len;
66 uint16_t auth_len;
67 uint32_t call_id;
68} e_dce_cn_common_hdr_t;
69
70typedef struct _e_dce_dg_common_hdr_t {
71 uint8_t rpc_ver;
72 uint8_t ptype;
73 uint8_t flags1;
74 uint8_t flags2;
75 uint8_t drep[3];
76 uint8_t serial_hi;
77 e_guid_t obj_id;
78 e_guid_t if_id;
79 e_guid_t act_id;
80 uint32_t server_boot;
81 uint32_t if_ver;
82 uint32_t seqnum;
83 uint16_t opnum;
84 uint16_t ihint;
85 uint16_t ahint;
86 uint16_t frag_len;
87 uint16_t frag_num;
88 uint8_t auth_proto;
89 uint8_t serial_lo;
90} e_dce_dg_common_hdr_t;
91
93
94typedef struct _dcerpc_auth_info {
95 bool hdr_signing;
96 uint8_t auth_type;
97 uint8_t auth_level;
98 uint32_t auth_context_id;
99 uint8_t auth_pad_len;
100 uint32_t auth_size;
101 struct _dcerpc_auth_subdissector_fns *auth_fns;
102 tvbuff_t *auth_hdr_tvb;
103 tvbuff_t *auth_tvb;
104 proto_item *auth_item;
105 proto_tree *auth_tree;
106} dcerpc_auth_info;
107
109{
110 const char *prog;
111 e_guid_t uuid;
112 uint16_t ver;
113 int num_procedures;
114} dcerpcstat_tap_data_t;
115
116/* Private data passed to subdissectors from the main DCERPC dissector.
117 * One unique instance of this structure is created for each
118 * DCERPC request/response transaction when we see the initial request
119 * of the transaction.
120 * These instances are persistent and will remain available until the
121 * capture file is closed and a new one is read.
122 *
123 * For transactions where we never saw the request (missing from the trace)
124 * the dcerpc runtime will create a temporary "fake" such structure to pass
125 * to the response dissector. These fake structures are not persistent
126 * and can not be used to keep data hanging around.
127 */
128typedef struct _dcerpc_call_value {
129 e_guid_t uuid; /* interface UUID */
130 uint16_t ver; /* interface version */
131 e_guid_t object_uuid; /* optional object UUID (or DCERPC_UUID_NULL) */
132 uint16_t opnum;
133 uint32_t req_frame;
134 nstime_t req_time;
135 uint32_t rep_frame;
136 uint32_t max_ptr;
137 void *se_data; /* This holds any data with se allocation scope
138 * that we might want to keep
139 * for this request/response transaction.
140 * The pointer is initialized to NULL and must be
141 * checked before being dereferenced.
142 * This is useful for such things as when we
143 * need to pass persistent data from the request
144 * to the reply, such as LSA/OpenPolicy2() that
145 * uses this to pass the domain name from the
146 * request to the reply.
147 */
148 void *private_data; /* XXX This will later be renamed as ep_data */
149 e_ctx_hnd *pol; /* policy handle tracked between request/response*/
150#define DCERPC_IS_NDR64 0x00000001
151 uint32_t flags; /* flags for this transaction */
152} dcerpc_call_value;
153
154typedef struct _dcerpc_info {
155 conversation_t *conv; /* Which TCP stream we are in */
156 uint32_t call_id; /* Call ID for this call */
157 uint64_t transport_salt; /* e.g. FID for DCERPC over SMB */
158 uint8_t ptype; /* packet type: PDU_REQ, PDU_RESP, ... */
159 bool conformant_run;
160 bool no_align; /* are data aligned? (default yes) */
161 uint32_t conformant_eaten; /* how many bytes did the conformant run eat?*/
162 uint32_t array_max_count; /* max_count for conformant arrays */
163 uint32_t array_max_count_offset;
164 uint32_t array_offset;
165 uint32_t array_offset_offset;
166 uint32_t array_actual_count;
167 uint32_t array_actual_count_offset;
168 int hf_index;
169 dcerpc_call_value *call_data;
170 const char *dcerpc_procedure_name; /* Used by PIDL to store the name of the current dcerpc procedure */
171 struct _dcerpc_auth_info *auth_info;
172 void *private_data;
173
174 /* ndr pointer handling */
175 struct {
176 /*
177 * List of pointers encountered so far in the current level, the
178 * head of the level on top of list_list, or NULL to start a new
179 * level with the next pointer.
180 */
181 GSList *list;
182 GHashTable *hash;
183 /*
184 * Stack of levels of deferred pointers, the newest first. Each
185 * level holds the pointers found in one pointed-to object, so
186 * that they are dissected before the pointers that follow it.
187 */
188 GSList *list_list;
189
190 /* Boolean controlling whether pointers are top-level or embedded */
191 bool are_top_level;
192 } pointers;
193} dcerpc_info;
194
195#define PDU_REQ 0
196#define PDU_PING 1
197#define PDU_RESP 2
198#define PDU_FAULT 3
199#define PDU_WORKING 4
200#define PDU_NOCALL 5
201#define PDU_REJECT 6
202#define PDU_ACK 7
203#define PDU_CL_CANCEL 8
204#define PDU_FACK 9
205#define PDU_CANCEL_ACK 10
206#define PDU_BIND 11
207#define PDU_BIND_ACK 12
208#define PDU_BIND_NAK 13
209#define PDU_ALTER 14
210#define PDU_ALTER_ACK 15
211#define PDU_AUTH3 16
212#define PDU_SHUTDOWN 17
213#define PDU_CO_CANCEL 18
214#define PDU_ORPHANED 19
215#define PDU_RTS 20
216
217/*
218 * helpers for packet-dcerpc.c and packet-dcerpc-ndr.c
219 * If you're writing a subdissector, you almost certainly want the
220 * NDR functions below.
221 */
222uint16_t dcerpc_tvb_get_ntohs (tvbuff_t *tvb, unsigned offset, uint8_t *drep);
223uint32_t dcerpc_tvb_get_ntohl (tvbuff_t *tvb, unsigned offset, uint8_t *drep);
224void dcerpc_tvb_get_uuid (tvbuff_t *tvb, unsigned offset, uint8_t *drep, e_guid_t *uuid);
225WS_DLL_PUBLIC
226unsigned dissect_dcerpc_char (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
227 proto_tree *tree, uint8_t *drep,
228 int hfindex, uint8_t *pdata);
229WS_DLL_PUBLIC
230unsigned dissect_dcerpc_uint8 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
231 proto_tree *tree, uint8_t *drep,
232 int hfindex, uint8_t *pdata);
233WS_DLL_PUBLIC
234unsigned dissect_dcerpc_uint16 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
235 proto_tree *tree, uint8_t *drep,
236 int hfindex, uint16_t *pdata);
237WS_DLL_PUBLIC
238unsigned dissect_dcerpc_uint32 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
239 proto_tree *tree, uint8_t *drep,
240 int hfindex, uint32_t *pdata);
241WS_DLL_PUBLIC
242unsigned dissect_dcerpc_uint64 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
243 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
244 int hfindex, uint64_t *pdata);
245unsigned dissect_dcerpc_float (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
246 proto_tree *tree, uint8_t *drep,
247 int hfindex, float *pdata);
248unsigned dissect_dcerpc_double (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
249 proto_tree *tree, uint8_t *drep,
250 int hfindex, double *pdata);
251unsigned dissect_dcerpc_time_t (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
252 proto_tree *tree, uint8_t *drep,
253 int hfindex, uint32_t *pdata);
254WS_DLL_PUBLIC
255unsigned dissect_dcerpc_uuid_t (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
256 proto_tree *tree, uint8_t *drep,
257 int hfindex, e_guid_t *pdata);
258
259/*
260 * NDR routines for subdissectors.
261 */
262WS_DLL_PUBLIC
263unsigned dissect_ndr_uint8 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
264 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
265 int hfindex, uint8_t *pdata);
266unsigned PIDL_dissect_uint8 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep, int hfindex, uint32_t param);
267unsigned PIDL_dissect_uint8_val (tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep, int hfindex, uint32_t param, uint8_t *pval);
268WS_DLL_PUBLIC
269unsigned dissect_ndr_uint16 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
270 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
271 int hfindex, uint16_t *pdata);
272unsigned PIDL_dissect_uint16 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep, int hfindex, uint32_t param);
273unsigned PIDL_dissect_uint16_val (tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep, int hfindex, uint32_t param, uint16_t *pval);
274WS_DLL_PUBLIC
275unsigned dissect_ndr_uint32 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
276 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
277 int hfindex, uint32_t *pdata);
278unsigned PIDL_dissect_uint32 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep, int hfindex, uint32_t param);
279unsigned PIDL_dissect_uint32_val (tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep, int hfindex, uint32_t param, uint32_t *rval);
280WS_DLL_PUBLIC
281unsigned dissect_ndr_duint32 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
282 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
283 int hfindex, uint64_t *pdata);
284WS_DLL_PUBLIC
285unsigned dissect_ndr_uint64 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
286 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
287 int hfindex, uint64_t *pdata);
288unsigned PIDL_dissect_uint64 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep, int hfindex, uint32_t param);
289unsigned PIDL_dissect_uint64_val (tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep, int hfindex, uint32_t param, uint64_t *pval);
290WS_DLL_PUBLIC
291unsigned dissect_ndr_float (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
292 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
293 int hfindex, float *pdata);
294WS_DLL_PUBLIC
295unsigned dissect_ndr_double (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
296 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
297 int hfindex, double *pdata);
298
299WS_DLL_PUBLIC
300unsigned dissect_ndr_time_t (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
301 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
302 int hfindex, uint32_t *pdata);
303WS_DLL_PUBLIC
304unsigned dissect_ndr_uuid_t (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
305 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
306 int hfindex, e_guid_t *pdata);
307unsigned dissect_ndr_ctx_hnd (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
308 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
309 int hfindex, e_ctx_hnd *pdata);
310
311#define FT_UINT1632 FT_UINT32
312typedef uint32_t uint1632_t;
313
314WS_DLL_PUBLIC
315unsigned dissect_ndr_uint1632 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
316 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
317 int hfindex, uint1632_t *pdata);
318
319typedef uint64_t uint3264_t;
320
321WS_DLL_PUBLIC
322unsigned dissect_ndr_uint3264 (tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
323 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
324 int hfindex, uint3264_t *pdata);
325
326typedef unsigned (dcerpc_dissect_fnct_t)(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep);
327typedef unsigned (dcerpc_dissect_fnct_blk_t)(tvbuff_t *tvb, unsigned offset, unsigned length, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep);
328
329typedef void (dcerpc_callback_fnct_t)(packet_info *pinfo, proto_tree *tree, proto_item *item, dcerpc_info *di, tvbuff_t *tvb, unsigned start_offset, unsigned end_offset, void *callback_args);
330
331#define NDR_POINTER_REF 1
332#define NDR_POINTER_UNIQUE 2
333#define NDR_POINTER_PTR 3
334
335unsigned dissect_ndr_pointer_cb(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
336 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
337 dcerpc_dissect_fnct_t *fnct, int type, const char *text,
338 int hf_index, dcerpc_callback_fnct_t *callback,
339 void *callback_args);
340
341unsigned dissect_ndr_pointer(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
342 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
343 dcerpc_dissect_fnct_t *fnct, int type, const char *text,
344 int hf_index);
345unsigned dissect_deferred_pointers(packet_info *pinfo, tvbuff_t *tvb, unsigned offset, dcerpc_info *di, uint8_t *drep);
346unsigned dissect_ndr_embedded_pointer(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
347 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
348 dcerpc_dissect_fnct_t *fnct, int type, const char *text,
349 int hf_index);
350unsigned dissect_ndr_toplevel_pointer(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
351 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
352 dcerpc_dissect_fnct_t *fnct, int type, const char *text,
353 int hf_index);
354
355/* dissect a NDR unidimensional conformant array */
356unsigned dissect_ndr_ucarray(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
357 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
358 dcerpc_dissect_fnct_t *fnct);
359
360unsigned dissect_ndr_ucarray_block(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
361 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
362 dcerpc_dissect_fnct_blk_t *fnct);
363
364/* dissect a NDR unidimensional conformant and varying array
365 * each byte in the array is processed separately
366 */
367unsigned dissect_ndr_ucvarray(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
368 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
369 dcerpc_dissect_fnct_t *fnct);
370
371unsigned dissect_ndr_ucvarray_block(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
372 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
373 dcerpc_dissect_fnct_blk_t *fnct);
374
375/* dissect a NDR unidimensional varying array */
376unsigned dissect_ndr_uvarray(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
377 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
378 dcerpc_dissect_fnct_t *fnct);
379
380unsigned dissect_ndr_byte_array(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
381 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
382
383unsigned dissect_ndr_cvstring(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
384 proto_tree *tree, dcerpc_info *di, uint8_t *drep, int size_is,
385 int hfinfo, bool add_subtree,
386 char **data);
387unsigned dissect_ndr_char_cvstring(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
388 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
389unsigned dissect_ndr_wchar_cvstring(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
390 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
391unsigned PIDL_dissect_cvstring(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep, int chsize, int hfindex, uint32_t param);
392
393unsigned dissect_ndr_cstring(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
394 proto_tree *tree, dcerpc_info *di, uint8_t *drep, int size_is,
395 int hfindex, bool add_subtree, char **data);
396unsigned dissect_ndr_vstring(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
397 proto_tree *tree, dcerpc_info *di, uint8_t *drep, int size_is,
398 int hfinfo, bool add_subtree,
399 char **data);
400unsigned dissect_ndr_char_vstring(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
401 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
402unsigned dissect_ndr_wchar_vstring(tvbuff_t *tvb, unsigned offset, packet_info *pinfo,
403 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
404
405typedef struct _dcerpc_sub_dissector {
406 uint16_t num;
407 const char *name;
408 dcerpc_dissect_fnct_t *dissect_rqst;
409 dcerpc_dissect_fnct_t *dissect_resp;
410} dcerpc_sub_dissector;
411
412/* registration function for subdissectors */
413WS_DLL_PUBLIC
414void dcerpc_init_uuid (int proto, int ett, e_guid_t *uuid, uint16_t ver, const dcerpc_sub_dissector *procs, int opnum_hf);
415WS_DLL_PUBLIC
416const char *dcerpc_get_proto_name(e_guid_t *uuid, uint16_t ver);
417WS_DLL_PUBLIC
418int dcerpc_get_proto_hf_opnum(e_guid_t *uuid, uint16_t ver);
419WS_DLL_PUBLIC
420const dcerpc_sub_dissector *dcerpc_get_proto_sub_dissector(e_guid_t *uuid, uint16_t ver);
421
422/* Create a opnum, name value_string from a subdissector list */
423
424value_string *value_string_from_subdissectors(const dcerpc_sub_dissector *sd);
425
426typedef struct _dcerpc_uuid_value {
427 protocol_t *proto;
428 int proto_id;
429 int ett;
430 const char *name;
431 const dcerpc_sub_dissector *procs;
432 int opnum_hf;
433} dcerpc_uuid_value;
434
435/* Authenticated pipe registration functions and miscellanea */
436
437typedef tvbuff_t *(dcerpc_decode_data_fnct_t)(tvbuff_t *header_tvb,
438 tvbuff_t *payload_tvb,
439 tvbuff_t *trailer_tvb,
440 tvbuff_t *auth_tvb,
441 packet_info *pinfo,
442 dcerpc_auth_info *auth_info);
443
445
446 /* Dissect credentials and verifiers */
447
448 dcerpc_dissect_fnct_t *bind_fn;
449 dcerpc_dissect_fnct_t *bind_ack_fn;
450 dcerpc_dissect_fnct_t *auth3_fn;
451 dcerpc_dissect_fnct_t *req_verf_fn;
452 dcerpc_dissect_fnct_t *resp_verf_fn;
453
454 /* Decrypt encrypted requests/response PDUs */
455
456 dcerpc_decode_data_fnct_t *req_data_fn;
457 dcerpc_decode_data_fnct_t *resp_data_fn;
458
459} dcerpc_auth_subdissector_fns;
460
461void register_dcerpc_auth_subdissector(uint8_t auth_level, uint8_t auth_type,
462 dcerpc_auth_subdissector_fns *fns);
463
464/* all values needed to (re-)build a dcerpc binding */
466 /* values of a typical conversation */
467 address addr_a;
468 address addr_b;
469 port_type ptype;
470 uint32_t port_a;
471 uint32_t port_b;
472 /* dcerpc conversation specific */
473 uint16_t ctx_id;
474 uint64_t transport_salt;
475 /* corresponding "interface" */
476 GString *ifname;
477 e_guid_t uuid;
478 uint16_t ver;
479} decode_dcerpc_bind_values_t;
480
481WS_DLL_PUBLIC uint64_t dcerpc_get_transport_salt(packet_info *pinfo);
482WS_DLL_PUBLIC void dcerpc_set_transport_salt(uint64_t dcetransportsalt, packet_info *pinfo);
483
484/* Authentication services */
485
486/*
487 * For MS-specific SSPs (Security Service Provider), see
488 *
489 * https://docs.microsoft.com/en-us/windows/win32/rpc/authentication-level-constants
490 */
491
492#define DCE_C_RPC_AUTHN_PROTOCOL_NONE 0
493#define DCE_C_RPC_AUTHN_PROTOCOL_KRB5 1
494#define DCE_C_RPC_AUTHN_PROTOCOL_SPNEGO 9
495#define DCE_C_RPC_AUTHN_PROTOCOL_NTLMSSP 10
496#define DCE_C_RPC_AUTHN_PROTOCOL_GSS_SCHANNEL 14
497#define DCE_C_RPC_AUTHN_PROTOCOL_GSS_KERBEROS 16
498#define DCE_C_RPC_AUTHN_PROTOCOL_DPA 17
499#define DCE_C_RPC_AUTHN_PROTOCOL_MSN 18
500#define DCE_C_RPC_AUTHN_PROTOCOL_DIGEST 21
501#define DCE_C_RPC_AUTHN_PROTOCOL_SEC_CHAN 68
502#define DCE_C_RPC_AUTHN_PROTOCOL_MQ 100
503
504/* Protection levels */
505
506#define DCE_C_AUTHN_LEVEL_NONE 1
507#define DCE_C_AUTHN_LEVEL_CONNECT 2
508#define DCE_C_AUTHN_LEVEL_CALL 3
509#define DCE_C_AUTHN_LEVEL_PKT 4
510#define DCE_C_AUTHN_LEVEL_PKT_INTEGRITY 5
511#define DCE_C_AUTHN_LEVEL_PKT_PRIVACY 6
512
513void
514free_ndr_pointer_list(dcerpc_info *di);
515void
516init_ndr_pointer_list(dcerpc_info *di);
517
518
519
520/* These defines are used in the PIDL conformance files when using
521 * the PARAM_VALUE directive.
522 */
523/* Policy handle tracking. Describes in which function a handle is
524 * opened/closed. See "winreg.cnf" for example.
525 *
526 * The uint32_t param is divided up into multiple fields
527 *
528 * +--------+--------+--------+--------+
529 * | Flags | Type | | |
530 * +--------+--------+--------+--------+
531 */
532/* Flags : */
533#define PIDL_POLHND_OPEN 0x80000000
534#define PIDL_POLHND_CLOSE 0x40000000
535#define PIDL_POLHND_USE 0x00000000 /* just use, not open or cose */
536/* To "save" a pointer to the string in dcv->private_data */
537#define PIDL_STR_SAVE 0x20000000
538/* To make this value appear on the summary line for the packet */
539#define PIDL_SET_COL_INFO 0x10000000
540
541/* Type */
542#define PIDL_POLHND_TYPE_MASK 0x00ff0000
543#define PIDL_POLHND_TYPE_SAMR_USER 0x00010000
544#define PIDL_POLHND_TYPE_SAMR_CONNECT 0x00020000
545#define PIDL_POLHND_TYPE_SAMR_DOMAIN 0x00030000
546#define PIDL_POLHND_TYPE_SAMR_GROUP 0x00040000
547#define PIDL_POLHND_TYPE_SAMR_ALIAS 0x00050000
548
549#define PIDL_POLHND_TYPE_LSA_POLICY 0x00060000
550#define PIDL_POLHND_TYPE_LSA_ACCOUNT 0x00070000
551#define PIDL_POLHND_TYPE_LSA_SECRET 0x00080000
552#define PIDL_POLHND_TYPE_LSA_DOMAIN 0x00090000
553
554/* a structure we store for all policy handles we track */
555typedef struct pol_value {
556 struct pol_value *next; /* Next entry in hash bucket */
557 uint32_t open_frame, close_frame; /* Frame numbers for open/close */
558 uint32_t first_frame; /* First frame in which this instance was seen */
559 uint32_t last_frame; /* Last frame in which this instance was seen */
560 char *name; /* Name of policy handle */
561 uint32_t type; /* policy handle type */
562} pol_value;
563
564
565extern int hf_dcerpc_drep_byteorder;
566extern int hf_dcerpc_ndr_padding;
567
568#define FAKE_DCERPC_INFO_STRUCTURE \
569 /* Fake dcerpc_info structure */ \
570 dcerpc_info di; \
571 dcerpc_call_value call_data; \
572 \
573 di.conformant_run = false; \
574 di.no_align = true; \
575 \
576 /* we need di->call_data->flags.NDR64 == 0 */ \
577 call_data.flags = 0; \
578 di.call_data = &call_data;
579
580#ifdef __cplusplus
581}
582#endif /* __cplusplus */
583
584#endif /* packet-dcerpc.h */
struct _address address
Holds a network or link-layer address of any supported type.
port_type
Transport-layer port number types recognized by Wireshark.
Definition address.h:425
struct conversation conversation_t
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
struct _protocol protocol_t
Definition proto.h:100
proto_node proto_item
Definition proto.h:952
struct _e_guid_t e_guid_t
Represents a GUID/UUID value; may be larger than GUID_LEN so must not be used to directly overlay pac...
Definition packet-dcerpc.h:94
Definition packet-dcerpc.h:444
Definition packet-dcerpc.h:128
Definition packet-dcerpc.h:154
Definition packet-dcerpc.h:405
Definition packet-dcerpc.h:426
Definition packet-dcerpc.h:54
Definition packet-dcerpc.h:59
Definition packet-dcerpc.h:70
Definition packet-dcerpc.h:109
Definition packet-dcerpc.h:465
Definition nstime.h:26
Definition packet-dcerpc.h:555
struct _value_string value_string
Mapping between a 32-bit integer value and its string representation.