12#ifndef __PACKET_DCERPC_H__
13#define __PACKET_DCERPC_H__
16#include "ws_symbol_export.h"
22#define DCERPC_TABLE_NAME "dcerpc.uuid"
26#define DREP_LITTLE_ENDIAN 0x10
28#define DREP_EBCDIC 0x01
33#define DREP_ENC_INTEGER(drep) \
34 (((drep)[0] & DREP_LITTLE_ENDIAN) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN)
39#define DREP_ENC_CHAR(drep) \
40 (((drep)[0] & DREP_EBCDIC) ? ENC_EBCDIC|ENC_NA : ENC_ASCII|ENC_NA)
49#define DCERPC_UUID_NULL { 0,0,0, {0,0,0,0,0,0,0,0} }
52#define DCERPC_UUID_STR_LEN 36+1
61 uint8_t rpc_ver_minor;
68} e_dce_cn_common_hdr_t;
90} e_dce_dg_common_hdr_t;
98 uint32_t auth_context_id;
102 tvbuff_t *auth_hdr_tvb;
105 proto_tree *auth_tree;
114} dcerpcstat_tap_data_t;
150#define DCERPC_IS_NDR64 0x00000001
157 uint64_t transport_salt;
161 uint32_t conformant_eaten;
162 uint32_t array_max_count;
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;
169 dcerpc_call_value *call_data;
170 const char *dcerpc_procedure_name;
180 bool must_check_size;
209#define PDU_CL_CANCEL 8
211#define PDU_CANCEL_ACK 10
213#define PDU_BIND_ACK 12
214#define PDU_BIND_NAK 13
216#define PDU_ALTER_ACK 15
218#define PDU_SHUTDOWN 17
219#define PDU_CO_CANCEL 18
220#define PDU_ORPHANED 19
228uint16_t dcerpc_tvb_get_ntohs (tvbuff_t *tvb,
unsigned offset, uint8_t *drep);
229uint32_t dcerpc_tvb_get_ntohl (tvbuff_t *tvb,
unsigned offset, uint8_t *drep);
230void dcerpc_tvb_get_uuid (tvbuff_t *tvb,
unsigned offset, uint8_t *drep,
e_guid_t *uuid);
232unsigned dissect_dcerpc_char (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
233 proto_tree *tree, uint8_t *drep,
234 int hfindex, uint8_t *pdata);
236unsigned dissect_dcerpc_uint8 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
237 proto_tree *tree, uint8_t *drep,
238 int hfindex, uint8_t *pdata);
240unsigned dissect_dcerpc_uint16 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
241 proto_tree *tree, uint8_t *drep,
242 int hfindex, uint16_t *pdata);
244unsigned dissect_dcerpc_uint32 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
245 proto_tree *tree, uint8_t *drep,
246 int hfindex, uint32_t *pdata);
248unsigned dissect_dcerpc_uint64 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
249 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
250 int hfindex, uint64_t *pdata);
251unsigned dissect_dcerpc_float (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
252 proto_tree *tree, uint8_t *drep,
253 int hfindex,
float *pdata);
254unsigned dissect_dcerpc_double (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
255 proto_tree *tree, uint8_t *drep,
256 int hfindex,
double *pdata);
257unsigned dissect_dcerpc_time_t (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
258 proto_tree *tree, uint8_t *drep,
259 int hfindex, uint32_t *pdata);
261unsigned dissect_dcerpc_uuid_t (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
262 proto_tree *tree, uint8_t *drep,
269unsigned dissect_ndr_uint8 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
270 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
271 int hfindex, uint8_t *pdata);
272unsigned 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);
273unsigned 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);
275unsigned dissect_ndr_uint16 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
276 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
277 int hfindex, uint16_t *pdata);
278unsigned 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);
279unsigned 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);
281unsigned dissect_ndr_uint32 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
282 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
283 int hfindex, uint32_t *pdata);
284unsigned 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);
285unsigned 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);
287unsigned dissect_ndr_duint32 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
288 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
289 int hfindex, uint64_t *pdata);
291unsigned dissect_ndr_uint64 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
292 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
293 int hfindex, uint64_t *pdata);
294unsigned 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);
295unsigned 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);
297unsigned dissect_ndr_float (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
298 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
299 int hfindex,
float *pdata);
301unsigned dissect_ndr_double (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
302 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
303 int hfindex,
double *pdata);
306unsigned dissect_ndr_time_t (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
307 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
308 int hfindex, uint32_t *pdata);
310unsigned dissect_ndr_uuid_t (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
311 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
313unsigned dissect_ndr_ctx_hnd (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
314 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
315 int hfindex, e_ctx_hnd *pdata);
317#define FT_UINT1632 FT_UINT32
318typedef uint32_t uint1632_t;
321unsigned dissect_ndr_uint1632 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
322 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
323 int hfindex, uint1632_t *pdata);
325typedef uint64_t uint3264_t;
328unsigned dissect_ndr_uint3264 (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
329 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
330 int hfindex, uint3264_t *pdata);
332typedef unsigned (dcerpc_dissect_fnct_t)(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep);
333typedef 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);
335typedef 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);
337#define NDR_POINTER_REF 1
338#define NDR_POINTER_UNIQUE 2
339#define NDR_POINTER_PTR 3
341unsigned dissect_ndr_pointer_cb(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, dcerpc_callback_fnct_t *callback,
345 void *callback_args);
347unsigned dissect_ndr_pointer(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
348 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
349 dcerpc_dissect_fnct_t *fnct,
int type,
const char *text,
351unsigned dissect_deferred_pointers(
packet_info *pinfo, tvbuff_t *tvb,
unsigned offset, dcerpc_info *di, uint8_t *drep);
352unsigned dissect_ndr_embedded_pointer(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
353 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
354 dcerpc_dissect_fnct_t *fnct,
int type,
const char *text,
356unsigned dissect_ndr_toplevel_pointer(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
357 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
358 dcerpc_dissect_fnct_t *fnct,
int type,
const char *text,
362unsigned dissect_ndr_ucarray(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
363 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
364 dcerpc_dissect_fnct_t *fnct);
366unsigned dissect_ndr_ucarray_block(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
367 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
368 dcerpc_dissect_fnct_blk_t *fnct);
373unsigned dissect_ndr_ucvarray(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
374 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
375 dcerpc_dissect_fnct_t *fnct);
377unsigned dissect_ndr_ucvarray_block(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
378 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
379 dcerpc_dissect_fnct_blk_t *fnct);
382unsigned dissect_ndr_uvarray(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
383 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
384 dcerpc_dissect_fnct_t *fnct);
386unsigned dissect_ndr_byte_array(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
387 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
389unsigned dissect_ndr_cvstring(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
390 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
int size_is,
391 int hfinfo,
bool add_subtree,
393unsigned dissect_ndr_char_cvstring(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
394 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
395unsigned dissect_ndr_wchar_cvstring(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
396 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
397unsigned 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);
399unsigned dissect_ndr_cstring(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
400 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
int size_is,
401 int hfindex,
bool add_subtree,
char **data);
402unsigned dissect_ndr_vstring(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
403 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
int size_is,
404 int hfinfo,
bool add_subtree,
406unsigned dissect_ndr_char_vstring(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
407 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
408unsigned dissect_ndr_wchar_vstring(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
409 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
414 dcerpc_dissect_fnct_t *dissect_rqst;
415 dcerpc_dissect_fnct_t *dissect_resp;
416} dcerpc_sub_dissector;
420void dcerpc_init_uuid (
int proto,
int ett,
e_guid_t *uuid, uint16_t ver,
const dcerpc_sub_dissector *procs,
int opnum_hf);
422const char *dcerpc_get_proto_name(
e_guid_t *uuid, uint16_t ver);
424int dcerpc_get_proto_hf_opnum(
e_guid_t *uuid, uint16_t ver);
426const dcerpc_sub_dissector *dcerpc_get_proto_sub_dissector(
e_guid_t *uuid, uint16_t ver);
430value_string *value_string_from_subdissectors(
const dcerpc_sub_dissector *sd);
437 const dcerpc_sub_dissector *procs;
443typedef tvbuff_t *(dcerpc_decode_data_fnct_t)(tvbuff_t *header_tvb,
444 tvbuff_t *payload_tvb,
445 tvbuff_t *trailer_tvb,
448 dcerpc_auth_info *auth_info);
454 dcerpc_dissect_fnct_t *bind_fn;
455 dcerpc_dissect_fnct_t *bind_ack_fn;
456 dcerpc_dissect_fnct_t *auth3_fn;
457 dcerpc_dissect_fnct_t *req_verf_fn;
458 dcerpc_dissect_fnct_t *resp_verf_fn;
462 dcerpc_decode_data_fnct_t *req_data_fn;
463 dcerpc_decode_data_fnct_t *resp_data_fn;
465} dcerpc_auth_subdissector_fns;
467void register_dcerpc_auth_subdissector(uint8_t auth_level, uint8_t auth_type,
468 dcerpc_auth_subdissector_fns *fns);
480 uint64_t transport_salt;
485} decode_dcerpc_bind_values_t;
487WS_DLL_PUBLIC uint64_t dcerpc_get_transport_salt(
packet_info *pinfo);
488WS_DLL_PUBLIC
void dcerpc_set_transport_salt(uint64_t dcetransportsalt,
packet_info *pinfo);
498#define DCE_C_RPC_AUTHN_PROTOCOL_NONE 0
499#define DCE_C_RPC_AUTHN_PROTOCOL_KRB5 1
500#define DCE_C_RPC_AUTHN_PROTOCOL_SPNEGO 9
501#define DCE_C_RPC_AUTHN_PROTOCOL_NTLMSSP 10
502#define DCE_C_RPC_AUTHN_PROTOCOL_GSS_SCHANNEL 14
503#define DCE_C_RPC_AUTHN_PROTOCOL_GSS_KERBEROS 16
504#define DCE_C_RPC_AUTHN_PROTOCOL_DPA 17
505#define DCE_C_RPC_AUTHN_PROTOCOL_MSN 18
506#define DCE_C_RPC_AUTHN_PROTOCOL_DIGEST 21
507#define DCE_C_RPC_AUTHN_PROTOCOL_SEC_CHAN 68
508#define DCE_C_RPC_AUTHN_PROTOCOL_MQ 100
512#define DCE_C_AUTHN_LEVEL_NONE 1
513#define DCE_C_AUTHN_LEVEL_CONNECT 2
514#define DCE_C_AUTHN_LEVEL_CALL 3
515#define DCE_C_AUTHN_LEVEL_PKT 4
516#define DCE_C_AUTHN_LEVEL_PKT_INTEGRITY 5
517#define DCE_C_AUTHN_LEVEL_PKT_PRIVACY 6
520free_ndr_pointer_list(dcerpc_info *di);
522init_ndr_pointer_list(dcerpc_info *di);
539#define PIDL_POLHND_OPEN 0x80000000
540#define PIDL_POLHND_CLOSE 0x40000000
541#define PIDL_POLHND_USE 0x00000000
543#define PIDL_STR_SAVE 0x20000000
545#define PIDL_SET_COL_INFO 0x10000000
548#define PIDL_POLHND_TYPE_MASK 0x00ff0000
549#define PIDL_POLHND_TYPE_SAMR_USER 0x00010000
550#define PIDL_POLHND_TYPE_SAMR_CONNECT 0x00020000
551#define PIDL_POLHND_TYPE_SAMR_DOMAIN 0x00030000
552#define PIDL_POLHND_TYPE_SAMR_GROUP 0x00040000
553#define PIDL_POLHND_TYPE_SAMR_ALIAS 0x00050000
555#define PIDL_POLHND_TYPE_LSA_POLICY 0x00060000
556#define PIDL_POLHND_TYPE_LSA_ACCOUNT 0x00070000
557#define PIDL_POLHND_TYPE_LSA_SECRET 0x00080000
558#define PIDL_POLHND_TYPE_LSA_DOMAIN 0x00090000
563 uint32_t open_frame, close_frame;
564 uint32_t first_frame;
571extern int hf_dcerpc_drep_byteorder;
572extern int hf_dcerpc_ndr_padding;
574#define FAKE_DCERPC_INFO_STRUCTURE \
577 dcerpc_call_value call_data; \
579 di.conformant_run = false; \
580 di.no_align = true; \
583 call_data.flags = 0; \
584 di.call_data = &call_data;
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:927
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:450
Definition packet-dcerpc.h:128
Definition packet-dcerpc.h:154
Definition packet-dcerpc.h:411
Definition packet-dcerpc.h:432
Definition packet-dcerpc.h:54
Definition packet-dcerpc.h:59
Definition packet-dcerpc.h:70
Definition packet-dcerpc.h:109
Definition packet-dcerpc.h:471
Definition packet-dcerpc.h:561
struct _value_string value_string
Mapping between a 32-bit integer value and its string representation.