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;
203#define PDU_CL_CANCEL 8
205#define PDU_CANCEL_ACK 10
207#define PDU_BIND_ACK 12
208#define PDU_BIND_NAK 13
210#define PDU_ALTER_ACK 15
212#define PDU_SHUTDOWN 17
213#define PDU_CO_CANCEL 18
214#define PDU_ORPHANED 19
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);
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);
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);
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);
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);
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);
255unsigned dissect_dcerpc_uuid_t (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
256 proto_tree *tree, uint8_t *drep,
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);
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);
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);
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);
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);
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);
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);
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);
304unsigned dissect_ndr_uuid_t (tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
305 proto_tree *tree, dcerpc_info *di, uint8_t *drep,
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);
311#define FT_UINT1632 FT_UINT32
312typedef uint32_t uint1632_t;
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);
319typedef uint64_t uint3264_t;
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);
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);
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);
331#define NDR_POINTER_REF 1
332#define NDR_POINTER_UNIQUE 2
333#define NDR_POINTER_PTR 3
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);
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,
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,
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,
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);
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);
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);
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);
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);
380unsigned dissect_ndr_byte_array(tvbuff_t *tvb,
unsigned offset,
packet_info *pinfo,
381 proto_tree *tree, dcerpc_info *di, uint8_t *drep);
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,
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);
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,
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);
408 dcerpc_dissect_fnct_t *dissect_rqst;
409 dcerpc_dissect_fnct_t *dissect_resp;
410} dcerpc_sub_dissector;
414void dcerpc_init_uuid (
int proto,
int ett,
e_guid_t *uuid, uint16_t ver,
const dcerpc_sub_dissector *procs,
int opnum_hf);
416const char *dcerpc_get_proto_name(
e_guid_t *uuid, uint16_t ver);
418int dcerpc_get_proto_hf_opnum(
e_guid_t *uuid, uint16_t ver);
420const dcerpc_sub_dissector *dcerpc_get_proto_sub_dissector(
e_guid_t *uuid, uint16_t ver);
424value_string *value_string_from_subdissectors(
const dcerpc_sub_dissector *sd);
431 const dcerpc_sub_dissector *procs;
437typedef tvbuff_t *(dcerpc_decode_data_fnct_t)(tvbuff_t *header_tvb,
438 tvbuff_t *payload_tvb,
439 tvbuff_t *trailer_tvb,
442 dcerpc_auth_info *auth_info);
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;
456 dcerpc_decode_data_fnct_t *req_data_fn;
457 dcerpc_decode_data_fnct_t *resp_data_fn;
459} dcerpc_auth_subdissector_fns;
461void register_dcerpc_auth_subdissector(uint8_t auth_level, uint8_t auth_type,
462 dcerpc_auth_subdissector_fns *fns);
474 uint64_t transport_salt;
479} decode_dcerpc_bind_values_t;
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);
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
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
514free_ndr_pointer_list(dcerpc_info *di);
516init_ndr_pointer_list(dcerpc_info *di);
533#define PIDL_POLHND_OPEN 0x80000000
534#define PIDL_POLHND_CLOSE 0x40000000
535#define PIDL_POLHND_USE 0x00000000
537#define PIDL_STR_SAVE 0x20000000
539#define PIDL_SET_COL_INFO 0x10000000
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
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
557 uint32_t open_frame, close_frame;
558 uint32_t first_frame;
565extern int hf_dcerpc_drep_byteorder;
566extern int hf_dcerpc_ndr_padding;
568#define FAKE_DCERPC_INFO_STRUCTURE \
571 dcerpc_call_value call_data; \
573 di.conformant_run = false; \
574 di.no_align = true; \
577 call_data.flags = 0; \
578 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: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 packet-dcerpc.h:555
struct _value_string value_string
Mapping between a 32-bit integer value and its string representation.