2 * Routines for DCOM generics
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #ifndef __PACKET_DCERPC_DCOM_H
26 #define __PACKET_DCERPC_DCOM_H
29 extern const value_string dcom_hresult_vals[];
30 extern const value_string dcom_variant_type_vals[];
31 extern const value_string dcom_protseq_vals[];
33 extern int hf_dcom_iid;
34 extern int hf_dcom_clsid;
35 extern int hf_dcom_oxid;
36 extern int hf_dcom_oid;
37 extern int hf_dcom_ipid;
40 extern int dcom_prefs_display_unmarshalling_details;
43 typedef struct dcom_machine_s {
50 typedef struct dcom_object_s {
51 dcom_machine_t *parent;
60 typedef struct dcom_interface_s {
61 dcom_object_t *parent;
66 e_uuid_t ipid; /* the DCE/RPC Object UUID */
70 extern dcom_interface_t *dcom_interface_new(packet_info *pinfo, const guint8 *ip, e_uuid_t *iid, guint64 oxid, guint64 oid, e_uuid_t *ipid);
71 extern dcom_interface_t *dcom_interface_find(packet_info *pinfo, const guint8 *ip, e_uuid_t *ipid);
72 extern void dcom_interface_dump(void);
75 /* the essential DCOM this and that, starting every call */
77 dissect_dcom_this(tvbuff_t *tvb, int offset,
78 packet_info *pinfo, proto_tree *tree, guint8 *drep);
80 dissect_dcom_that(tvbuff_t *tvb, int offset,
81 packet_info *pinfo, proto_tree *tree, guint8 *drep);
84 /* dissection of somewhat more simple data types */
85 #define dissect_dcom_BOOLEAN dissect_ndr_uint8
86 #define dissect_dcom_BYTE dissect_ndr_uint8
87 #define dissect_dcom_WORD dissect_ndr_uint16
88 #define dissect_dcom_DWORD dissect_ndr_uint32
89 #define dissect_dcom_I8 dissect_ndr_uint64
90 #define dissect_dcom_ID dissect_ndr_duint32
91 #define dissect_dcom_UUID dissect_ndr_uuid_t
92 #define dissect_dcom_FILETIME dissect_ndr_duint32 /* ToBeDone */
93 #define dissect_dcom_VARIANT_BOOL dissect_ndr_uint16
94 #define dissect_dcom_FLOAT dissect_ndr_float
95 #define dissect_dcom_DOUBLE dissect_ndr_double
96 #define dissect_dcom_DATE dissect_ndr_double
99 dissect_dcom_append_UUID(tvbuff_t *tvb, int offset,
100 packet_info *pinfo, proto_tree *tree, guint8 *drep,
101 int hfindex, const gchar *field_name, int field_index, e_uuid_t *uuid);
102 extern const gchar* dcom_uuid_to_str(e_uuid_t *uuid);
105 dissect_dcom_indexed_WORD(tvbuff_t *tvb, int offset, packet_info *pinfo,
106 proto_tree *tree, guint8 *drep,
107 int hfindex, guint16 * pu16WORD, int field_index);
110 dissect_dcom_indexed_DWORD(tvbuff_t *tvb, int offset, packet_info *pinfo,
111 proto_tree *tree, guint8 *drep,
112 int hfindex, guint32 * pu32DWORD, int field_index);
115 dissect_dcom_HRESULT(tvbuff_t *tvb, int offset,
116 packet_info *pinfo, proto_tree *tree, guint8 *drep, guint32 * pu32hresult);
119 dissect_dcom_indexed_HRESULT(tvbuff_t *tvb, int offset, packet_info *pinfo,
120 proto_tree *tree, guint8 *drep,
121 guint32 * pu32hresult, int field_index);
124 dissect_dcom_COMVERSION(tvbuff_t *tvb, int offset,
125 packet_info *pinfo, proto_tree *tree, guint8 *drep,
126 guint16 * pu16version_major, guint16 * pu16version_minor);
129 dissect_dcom_LPWSTR(tvbuff_t *tvb, gint offset, packet_info *pinfo,
130 proto_tree *tree, guint8 *drep, int hfindex,
131 gchar *psz_buffer, guint32 u32max_buffer);
134 dissect_dcom_indexed_LPWSTR(tvbuff_t *tvb, gint offset, packet_info *pinfo,
135 proto_tree *tree, guint8 *drep, int hfindex,
136 gchar *pszStr, guint32 u32MaxStr, int field_index);
139 dissect_dcom_BSTR(tvbuff_t *tvb, gint offset, packet_info *pinfo,
140 proto_tree *tree, guint8 *drep, int hfindex,
141 gchar *psz_buffer, guint32 u32max_buffer);
144 dissect_dcom_DUALSTRINGARRAY(tvbuff_t *tvb, gint offset, packet_info *pinfo,
145 proto_tree *tree, guint8 *drep, int hfindex, gchar *ip);
148 dissect_dcom_STDOBJREF(tvbuff_t *tvb, gint offset, packet_info *pinfo,
149 proto_tree *tree, guint8 *drep, int hfindex,
150 guint64 *oxid, guint64 *oid, e_uuid_t *ipid);
152 dissect_dcom_OBJREF(tvbuff_t *tvb, gint offset, packet_info *pinfo,
153 proto_tree *tree, guint8 *drep, int hfindex, dcom_interface_t **interf);
156 dissect_dcom_MInterfacePointer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
157 proto_tree *tree, guint8 *drep, int hfindex, dcom_interface_t **interf);
159 dissect_dcom_PMInterfacePointer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
160 proto_tree *tree, guint8 *drep, int hfindex, dcom_interface_t **interf);
163 dissect_dcom_VARTYPE(tvbuff_t *tvb, int offset,
164 packet_info *pinfo, proto_tree *tree, guint8 *drep,
165 guint16 *pu16Vartype);
168 dissect_dcom_VARIANT(tvbuff_t *tvb, int offset, packet_info *pinfo,
169 proto_tree *tree, guint8 *drep, int hfindex);
171 /* dcom "dcerpc internal" unmarshalling */
173 dissect_dcom_dcerpc_array_size(tvbuff_t *tvb, gint offset, packet_info *pinfo,
174 proto_tree *tree, guint8 *drep, guint32 *pu32array_size);
177 dissect_dcom_dcerpc_pointer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
178 proto_tree *tree, guint8 *drep, guint32 *pu32pointer);
180 /* mark things to be done */
182 dissect_dcom_tobedone_data(tvbuff_t *tvb, int offset,
183 packet_info *pinfo, proto_tree *tree, guint8 *drep, int length);
185 /* very simple parameter-profiles dissectors (for very simple requests ;-) */
186 /* request: no parameters */
188 dissect_dcom_simple_rqst(tvbuff_t *tvb, int offset,
189 packet_info *pinfo, proto_tree *tree, guint8 *drep);
190 /* response: only HRESULT */
192 dissect_dcom_simple_resp(tvbuff_t *tvb, int offset,
193 packet_info *pinfo, proto_tree *tree, guint8 *drep);
195 void dcom_register_server_coclass(int proto, int ett,
196 e_uuid_t *uuid, guint16 ver,
197 dcerpc_sub_dissector *sub_dissectors, int opnum_hf);
199 #endif /* packet-dcerpc-dcom.h */