Fix up a bunch of arguments to "dissect_ber_identifier()" to match its
[obnox/wireshark/wip.git] / epan / dissectors / packet-dcom.h
1 /* packet-dcom.h
2  * Routines for DCOM generics
3  *
4  * $Id$
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@ethereal.com>
8  * Copyright 1998 Gerald Combs
9  * 
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.
14  * 
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.
19  * 
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.
23  */
24
25 #ifndef __PACKET_DCERPC_DCOM_H
26 #define __PACKET_DCERPC_DCOM_H
27
28
29 extern const value_string dcom_hresult_vals[];
30 extern const value_string dcom_variant_type_vals[];
31
32 /* preferences */
33 extern int dcom_prefs_display_unmarshalling_details;
34
35
36 /* the essential DCOM this and that, starting every call */
37 extern int
38 dissect_dcom_this(tvbuff_t *tvb, int offset,
39         packet_info *pinfo, proto_tree *tree, guint8 *drep);
40 extern int
41 dissect_dcom_that(tvbuff_t *tvb, int offset,
42         packet_info *pinfo, proto_tree *tree, guint8 *drep);
43
44
45 /* dissection of somewhat more simple data types */
46 #define dissect_dcom_BOOLEAN            dissect_ndr_uint8
47 #define dissect_dcom_BYTE                       dissect_ndr_uint8
48 #define dissect_dcom_WORD                       dissect_ndr_uint16
49 #define dissect_dcom_DWORD                      dissect_ndr_uint32
50 #define dissect_dcom_I8                 dissect_ndr_uint64
51 #define dissect_dcom_ID                         dissect_ndr_duint32
52 #define dissect_dcom_UUID                       dissect_ndr_uuid_t
53 #define dissect_dcom_FILETIME           dissect_ndr_duint32 /* ToBeDone */
54 #define dissect_dcom_VARIANT_BOOL       dissect_ndr_uint16
55 #define dissect_dcom_FLOAT                      dissect_ndr_float
56 #define dissect_dcom_DOUBLE                     dissect_ndr_double
57 #define dissect_dcom_DATE                       dissect_ndr_double
58
59 extern int
60 dissect_dcom_append_UUID(tvbuff_t *tvb, int offset,
61         packet_info *pinfo, proto_tree *tree, guint8 *drep,
62         int hfindex, gchar *field_name, int field_index);
63 extern gchar* dcom_uuid_to_str(e_uuid_t *uuid);
64
65 extern int
66 dissect_dcom_indexed_WORD(tvbuff_t *tvb, int offset,    packet_info *pinfo,
67                                          proto_tree *tree, guint8 *drep, 
68                                          int hfindex, guint16 * pu16WORD, int field_index);
69
70 extern int
71 dissect_dcom_indexed_DWORD(tvbuff_t *tvb, int offset,   packet_info *pinfo,
72                                          proto_tree *tree, guint8 *drep, 
73                                          int hfindex, guint32 * pu32DWORD, int field_index);
74
75 extern int
76 dissect_dcom_HRESULT(tvbuff_t *tvb, int offset,
77         packet_info *pinfo, proto_tree *tree, guint8 *drep, guint32 * pu32hresult);
78
79 extern int
80 dissect_dcom_indexed_HRESULT(tvbuff_t *tvb, int offset, packet_info *pinfo,
81                                          proto_tree *tree, guint8 *drep, 
82                                          guint32 * pu32hresult, int field_index);
83
84 extern int
85 dissect_dcom_COMVERSION(tvbuff_t *tvb, int offset,
86         packet_info *pinfo, proto_tree *tree, guint8 *drep,
87         guint16 * pu16version_major, guint16 * pu16version_minor);
88
89 extern int
90 dissect_dcom_LPWSTR(tvbuff_t *tvb, gint offset, packet_info *pinfo,
91                        proto_tree *tree, guint8 *drep, int hfindex,
92                                            gchar *psz_buffer, guint32 u32max_buffer);
93
94 extern int
95 dissect_dcom_indexed_LPWSTR(tvbuff_t *tvb, gint offset, packet_info *pinfo,
96                        proto_tree *tree, guint8 *drep, int hfindex,
97                                            gchar *pszStr, guint32 u32MaxStr, int field_index);
98
99 extern int
100 dissect_dcom_BSTR(tvbuff_t *tvb, gint offset, packet_info *pinfo,
101                        proto_tree *tree, guint8 *drep, int hfindex,
102                                            gchar *psz_buffer, guint32 u32max_buffer);
103
104 extern int
105 dissect_dcom_DUALSTRINGARRAY(tvbuff_t *tvb, gint offset, packet_info *pinfo,
106                        proto_tree *tree, guint8 *drep, int hfindex);
107
108 extern int
109 dissect_dcom_STDOBJREF(tvbuff_t *tvb, gint offset, packet_info *pinfo,
110                        proto_tree *tree, guint8 *drep, int hfindex);
111
112 extern int
113 dissect_dcom_OBJREF(tvbuff_t *tvb, gint offset, packet_info *pinfo,
114                        proto_tree *tree, guint8 *drep, int hfindex);
115
116 extern int
117 dissect_dcom_MInterfacePointer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
118                        proto_tree *tree, guint8 *drep, int hfindex);
119 extern int
120 dissect_dcom_PMInterfacePointer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
121                        proto_tree *tree, guint8 *drep, int hfindex);
122
123 extern int
124 dissect_dcom_VARTYPE(tvbuff_t *tvb, int offset,
125         packet_info *pinfo, proto_tree *tree, guint8 *drep,
126         guint16 *pu16Vartype);
127
128 extern int
129 dissect_dcom_VARIANT(tvbuff_t *tvb, int offset, packet_info *pinfo, 
130                                          proto_tree *tree, guint8 *drep, int hfindex);
131
132 /* dcom "dcerpc internal" unmarshalling */
133 extern int
134 dissect_dcom_dcerpc_array_size(tvbuff_t *tvb, gint offset, packet_info *pinfo,
135                        proto_tree *tree, guint8 *drep, guint32 *pu32array_size);
136
137 extern int
138 dissect_dcom_dcerpc_pointer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
139                        proto_tree *tree, guint8 *drep, guint32 *pu32pointer);
140
141 /* mark things to be done */
142 extern int
143 dissect_dcom_tobedone_data(tvbuff_t *tvb, int offset,
144         packet_info *pinfo, proto_tree *tree, guint8 *drep, int length);
145
146 /* very simple parameter-profiles dissectors (for very simple requests ;-) */
147 /* request: no parameters */
148 extern int 
149 dissect_dcom_simple_rqst(tvbuff_t *tvb, int offset,
150         packet_info *pinfo, proto_tree *tree, guint8 *drep);
151 /* response: only HRESULT */
152 extern int 
153 dissect_dcom_simple_resp(tvbuff_t *tvb, int offset,
154         packet_info *pinfo, proto_tree *tree, guint8 *drep);
155
156 void dcom_register_server_coclass(int proto, int ett,
157         e_uuid_t *uuid, guint16 ver, 
158         dcerpc_sub_dissector *sub_dissectors, int opnum_hf);
159
160 #endif /* packet-dcerpc-dcom.h */