2 * Routines for DCOM generics
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
11 #ifndef __PACKET_DCOM_H
12 #define __PACKET_DCOM_H
14 #include "ws_symbol_export.h"
16 WS_DLL_PUBLIC
const value_string dcom_hresult_vals
[];
17 WS_DLL_PUBLIC
const value_string dcom_variant_type_vals
[];
18 extern const value_string dcom_protseq_vals
[];
20 extern int hf_dcom_iid
;
21 extern int hf_dcom_clsid
;
22 extern int hf_dcom_oxid
;
23 extern int hf_dcom_oid
;
24 extern int hf_dcom_ipid
;
26 extern GHashTable
*dcom_uuids
;
29 WS_DLL_PUBLIC
bool dcom_prefs_display_unmarshalling_details
;
32 typedef struct dcom_machine_s
{
39 typedef struct dcom_object_s
{
40 dcom_machine_t
*parent
;
49 typedef struct dcom_interface_s
{
50 dcom_object_t
*parent
;
55 e_guid_t ipid
; /* the DCE/RPC Object UUID */
58 typedef int (*dcom_dissect_fn_t
) (tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
59 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int size
);
61 typedef struct dcom_marshaler_s
{
62 dcom_object_t
*parent
;
66 dcom_dissect_fn_t routine
;
69 WS_DLL_PUBLIC dcom_interface_t
*dcom_interface_new(packet_info
*pinfo
, const address
*addr
, e_guid_t
*iid
, uint64_t oxid
, uint64_t oid
, e_guid_t
*ipid
);
70 WS_DLL_PUBLIC dcom_interface_t
*dcom_interface_find(packet_info
*pinfo
, const address
*addr
, e_guid_t
*ipid
);
72 extern void dcom_interface_dump(void);
74 extern int dcom_register_routine(dcom_dissect_fn_t routine
, e_guid_t
* uuid
);
75 extern void dcom_register_common_routines_(void);
77 extern dcom_dissect_fn_t
dcom_get_routine_by_uuid(const e_guid_t
* uuid
);
79 /* the essential DCOM this and that, starting every call */
81 dissect_dcom_this(tvbuff_t
*tvb
, int offset
,
82 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
84 dissect_dcom_that(tvbuff_t
*tvb
, int offset
,
85 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
88 /* dissection of somewhat more simple data types */
89 #define dissect_dcom_BOOLEAN dissect_ndr_uint8
90 #define dissect_dcom_BYTE dissect_ndr_uint8
91 #define dissect_dcom_WORD dissect_ndr_uint16
92 #define dissect_dcom_DWORD dissect_ndr_uint32
93 #define dissect_dcom_I8 dissect_ndr_uint64
94 #define dissect_dcom_ID dissect_ndr_duint32
95 #define dissect_dcom_FILETIME dissect_ndr_duint32 /* ToBeDone */
96 #define dissect_dcom_VARIANT_BOOL dissect_ndr_uint16
97 #define dissect_dcom_FLOAT dissect_ndr_float
98 #define dissect_dcom_DOUBLE dissect_ndr_double
99 #define dissect_dcom_DATE dissect_ndr_double
102 dissect_dcom_UUID(tvbuff_t
*tvb
, int offset
,
103 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
,
104 int hfindex
, e_guid_t
*uuid
);
107 dissect_dcom_append_UUID(tvbuff_t
*tvb
, int offset
,
108 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
,
109 int hfindex
, int field_index
, e_guid_t
*uuid
);
112 dissect_dcom_indexed_WORD(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
113 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
,
114 int hfindex
, uint16_t * pu16WORD
, int field_index
);
117 dissect_dcom_indexed_DWORD(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
118 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
,
119 int hfindex
, uint32_t * pu32DWORD
, int field_index
);
122 dissect_dcom_HRESULT(tvbuff_t
*tvb
, int offset
,
123 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, uint32_t * pu32hresult
);
126 dissect_dcom_HRESULT_item(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
127 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
,
128 uint32_t * pu32HResult
, int field_index
, proto_item
**item
);
131 dissect_dcom_indexed_HRESULT(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
132 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
,
133 uint32_t * pu32hresult
, int field_index
);
136 dissect_dcom_COMVERSION(tvbuff_t
*tvb
, int offset
,
137 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
,
138 uint16_t * pu16version_major
, uint16_t * pu16version_minor
);
140 typedef void (*sa_callback_t
) (tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
141 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
,
142 uint32_t u32VarType
, uint32_t u32ArraySize
);
145 dissect_dcom_SAFEARRAY(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
146 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex _U_
, sa_callback_t sacb
);
149 dissect_dcom_LPWSTR(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
150 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
,
151 char *psz_buffer
, uint32_t u32max_buffer
);
154 dissect_dcom_indexed_LPWSTR(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
155 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
,
156 char *pszStr
, uint32_t u32MaxStr
, int field_index
);
159 dissect_dcom_BSTR(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
160 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
,
161 char *psz_buffer
, uint32_t u32max_buffer
);
164 dissect_dcom_DUALSTRINGARRAY(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
165 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
, char *ip
);
168 dissect_dcom_STDOBJREF(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
169 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
,
170 uint64_t *oxid
, uint64_t *oid
, e_guid_t
*ipid
);
172 dissect_dcom_OBJREF(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
173 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
, dcom_interface_t
**interf
);
176 dissect_dcom_MInterfacePointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
177 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
, dcom_interface_t
**interf
);
179 dissect_dcom_PMInterfacePointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
180 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
, dcom_interface_t
**interf
);
183 dissect_dcom_VARTYPE(tvbuff_t
*tvb
, int offset
,
184 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
,
185 uint16_t *pu16Vartype
);
188 dissect_dcom_VARIANT(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
189 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
);
191 /* dcom "dcerpc internal" unmarshalling */
193 dissect_dcom_dcerpc_array_size(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
194 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, uint32_t *pu32array_size
);
197 dissect_dcom_dcerpc_pointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
198 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, uint32_t *pu32pointer
);
200 /* mark things as "to be done" */
202 dissect_dcom_tobedone_data(tvbuff_t
*tvb
, int offset
,
203 packet_info
*pinfo
, proto_tree
*tree
, uint8_t *drep
, int length
);
205 /* mark things "no specification available" */
207 dissect_dcom_nospec_data(tvbuff_t
*tvb
, int offset
,
208 packet_info
*pinfo
, proto_tree
*tree
, uint8_t *drep
, int length
);
210 /* very simple parameter-profiles dissectors (for very simple requests ;-) */
211 /* request: no parameters */
213 dissect_dcom_simple_rqst(tvbuff_t
*tvb
, int offset
,
214 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
215 /* response: only HRESULT */
217 dissect_dcom_simple_resp(tvbuff_t
*tvb
, int offset
,
218 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
220 #endif /* packet-dcom.h */