Rename the main executable to "wireshark", along with more conversions:
[obnox/wireshark/wip.git] / epan / dissectors / pidl / packet-dcerpc-initshutdown.c
1 /* DO NOT EDIT
2         This filter was automatically generated
3         from initshutdown.idl and initshutdown.cnf.
4         
5         Pidl is a perl based IDL compiler for DCE/RPC idl files. 
6         It is maintained by the Samba team, not the Wireshark team.
7         Instructions on how to download and install Pidl can be 
8         found at http://wiki.wireshark.org/Pidl
9 */
10
11
12 #ifdef HAVE_CONFIG_H
13 #include "config.h"
14 #endif
15
16 #include <glib.h>
17 #include <string.h>
18 #include <epan/packet.h>
19
20 #include "packet-dcerpc.h"
21 #include "packet-dcerpc-nt.h"
22 #include "packet-windows-common.h"
23 #include "packet-dcerpc-initshutdown.h"
24
25 /* Ett declarations */
26 static gint ett_dcerpc_initshutdown = -1;
27 static gint ett_initshutdown_initshutdown_String_sub = -1;
28 static gint ett_initshutdown_initshutdown_String = -1;
29
30
31 /* Header field declarations */
32 static gint hf_initshutdown_initshutdown_String_name_len = -1;
33 static gint hf_initshutdown_opnum = -1;
34 static gint hf_initshutdown_initshutdown_Init_hostname = -1;
35 static gint hf_initshutdown_initshutdown_String_sub_name = -1;
36 static gint hf_initshutdown_initshutdown_String_sub_name_size = -1;
37 static gint hf_initshutdown_initshutdown_InitEx_reason = -1;
38 static gint hf_initshutdown_initshutdown_InitEx_force_apps = -1;
39 static gint hf_initshutdown_initshutdown_InitEx_timeout = -1;
40 static gint hf_initshutdown_initshutdown_Init_timeout = -1;
41 static gint hf_initshutdown_initshutdown_String_name_size = -1;
42 static gint hf_initshutdown_initshutdown_Init_force_apps = -1;
43 static gint hf_initshutdown_initshutdown_InitEx_hostname = -1;
44 static gint hf_initshutdown_initshutdown_Init_reboot = -1;
45 static gint hf_initshutdown_initshutdown_InitEx_reboot = -1;
46 static gint hf_initshutdown_initshutdown_Init_message = -1;
47 static gint hf_initshutdown_werror = -1;
48 static gint hf_initshutdown_initshutdown_InitEx_message = -1;
49 static gint hf_initshutdown_initshutdown_Abort_server = -1;
50 static gint hf_initshutdown_initshutdown_String_name = -1;
51
52 static gint proto_dcerpc_initshutdown = -1;
53 /* Version information */
54
55
56 static e_uuid_t uuid_dcerpc_initshutdown = {
57         0x894de0c0, 0x0d55, 0x11d3,
58         { 0xa3, 0x22, 0x00, 0xc0, 0x4f, 0xa3, 0x21, 0xa1 }
59 };
60 static guint16 ver_dcerpc_initshutdown = 1;
61
62 static int initshutdown_dissect_element_String_sub_name_size(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
63 static int initshutdown_dissect_element_String_sub_name(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
64 static int initshutdown_dissect_element_String_name_len(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
65 static int initshutdown_dissect_element_String_name_size(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
66 static int initshutdown_dissect_element_String_name(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
67 static int initshutdown_dissect_element_String_name_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
68 static int initshutdown_dissect_element_Init_hostname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
69 static int initshutdown_dissect_element_Init_hostname_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
70 static int initshutdown_dissect_element_Init_message(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
71 static int initshutdown_dissect_element_Init_message_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
72 static int initshutdown_dissect_element_Init_timeout(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
73 static int initshutdown_dissect_element_Init_force_apps(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
74 static int initshutdown_dissect_element_Init_reboot(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
75 static int initshutdown_dissect_element_Abort_server(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
76 static int initshutdown_dissect_element_Abort_server_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
77 static int initshutdown_dissect_element_InitEx_hostname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
78 static int initshutdown_dissect_element_InitEx_hostname_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
79 static int initshutdown_dissect_element_InitEx_message(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
80 static int initshutdown_dissect_element_InitEx_message_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
81 static int initshutdown_dissect_element_InitEx_timeout(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
82 static int initshutdown_dissect_element_InitEx_force_apps(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
83 static int initshutdown_dissect_element_InitEx_reboot(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
84 static int initshutdown_dissect_element_InitEx_reason(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);
85
86 /* IDL: typedef struct { */
87 /* IDL:         [value(strlen_m_term(name))] uint32 name_size; */
88 /* IDL:         [flag(LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_NOTERM)] string name; */
89 /* IDL: } initshutdown_String_sub; */
90
91 static int
92 initshutdown_dissect_element_String_sub_name_size(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
93 {
94         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_String_sub_name_size,NULL);
95
96         return offset;
97 }
98
99 static int
100 initshutdown_dissect_element_String_sub_name(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
101 {
102
103         return offset;
104 }
105
106 int
107 initshutdown_dissect_struct_String_sub(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
108 {
109         proto_item *item = NULL;
110         proto_tree *tree = NULL;
111         int old_offset;
112
113         ALIGN_TO_4_BYTES;
114
115         old_offset = offset;
116
117         if(parent_tree){
118                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
119                 tree = proto_item_add_subtree(item, ett_initshutdown_initshutdown_String_sub);
120         }
121         
122         offset = initshutdown_dissect_element_String_sub_name_size(tvb, offset, pinfo, tree, drep);
123
124         offset = initshutdown_dissect_element_String_sub_name(tvb, offset, pinfo, tree, drep);
125
126
127         proto_item_set_len(item, offset-old_offset);
128
129         return offset;
130 }
131
132 /* IDL: typedef struct { */
133 /* IDL:         [value(strlen_m(r->name->name)*2)] uint16 name_len; */
134 /* IDL:         [value(strlen_m_term(r->name->name)*2)] uint16 name_size; */
135 /* IDL:         [unique(1)] initshutdown_String_sub *name; */
136 /* IDL: } initshutdown_String; */
137
138 static int
139 initshutdown_dissect_element_String_name_len(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
140 {
141         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_String_name_len,NULL);
142
143         return offset;
144 }
145
146 static int
147 initshutdown_dissect_element_String_name_size(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
148 {
149         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_String_name_size,NULL);
150
151         return offset;
152 }
153
154 static int
155 initshutdown_dissect_element_String_name(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
156 {
157         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, initshutdown_dissect_element_String_name_, NDR_POINTER_UNIQUE, "Pointer to Name (initshutdown_String_sub)",hf_initshutdown_initshutdown_String_name);
158
159         return offset;
160 }
161
162 static int
163 initshutdown_dissect_element_String_name_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
164 {
165         offset = initshutdown_dissect_struct_String_sub(tvb,offset,pinfo,tree,drep,hf_initshutdown_initshutdown_String_name,0);
166
167         return offset;
168 }
169
170 int
171 initshutdown_dissect_struct_String(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
172 {
173         proto_item *item = NULL;
174         proto_tree *tree = NULL;
175         int old_offset;
176
177         ALIGN_TO_4_BYTES;
178
179         old_offset = offset;
180
181         if(parent_tree){
182                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
183                 tree = proto_item_add_subtree(item, ett_initshutdown_initshutdown_String);
184         }
185         
186         offset = initshutdown_dissect_element_String_name_len(tvb, offset, pinfo, tree, drep);
187
188         offset = initshutdown_dissect_element_String_name_size(tvb, offset, pinfo, tree, drep);
189
190         offset = initshutdown_dissect_element_String_name(tvb, offset, pinfo, tree, drep);
191
192
193         proto_item_set_len(item, offset-old_offset);
194
195         return offset;
196 }
197
198 static int
199 initshutdown_dissect_element_Init_hostname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
200 {
201         offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, initshutdown_dissect_element_Init_hostname_, NDR_POINTER_UNIQUE, "Pointer to Hostname (uint16)",hf_initshutdown_initshutdown_Init_hostname);
202
203         return offset;
204 }
205
206 static int
207 initshutdown_dissect_element_Init_hostname_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
208 {
209         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_Init_hostname,NULL);
210
211         return offset;
212 }
213
214 static int
215 initshutdown_dissect_element_Init_message(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
216 {
217         offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, initshutdown_dissect_element_Init_message_, NDR_POINTER_UNIQUE, "Pointer to Message (initshutdown_String)",hf_initshutdown_initshutdown_Init_message);
218
219         return offset;
220 }
221
222 static int
223 initshutdown_dissect_element_Init_message_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
224 {
225         offset = initshutdown_dissect_struct_String(tvb,offset,pinfo,tree,drep,hf_initshutdown_initshutdown_Init_message,0);
226
227         return offset;
228 }
229
230 static int
231 initshutdown_dissect_element_Init_timeout(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
232 {
233         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_Init_timeout,NULL);
234
235         return offset;
236 }
237
238 static int
239 initshutdown_dissect_element_Init_force_apps(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
240 {
241         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_Init_force_apps,NULL);
242
243         return offset;
244 }
245
246 static int
247 initshutdown_dissect_element_Init_reboot(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
248 {
249         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_Init_reboot,NULL);
250
251         return offset;
252 }
253
254 /* IDL: WERROR initshutdown_Init( */
255 /* IDL: [unique(1)] [in] uint16 *hostname, */
256 /* IDL: [unique(1)] [in] initshutdown_String *message, */
257 /* IDL: [in] uint32 timeout, */
258 /* IDL: [in] uint8 force_apps, */
259 /* IDL: [in] uint8 reboot */
260 /* IDL: ); */
261
262 static int
263 initshutdown_dissect_Init_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
264 {
265         guint32 status;
266
267         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_initshutdown_werror, &status);
268
269         if (status != 0 && check_col(pinfo->cinfo, COL_INFO))
270                 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, DOS_errors, "Unknown DOS error 0x%08x"));
271
272         return offset;
273 }
274
275 static int
276 initshutdown_dissect_Init_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
277 {
278         offset = initshutdown_dissect_element_Init_hostname(tvb, offset, pinfo, tree, drep);
279         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
280         offset = initshutdown_dissect_element_Init_message(tvb, offset, pinfo, tree, drep);
281         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
282         offset = initshutdown_dissect_element_Init_timeout(tvb, offset, pinfo, tree, drep);
283         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
284         offset = initshutdown_dissect_element_Init_force_apps(tvb, offset, pinfo, tree, drep);
285         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
286         offset = initshutdown_dissect_element_Init_reboot(tvb, offset, pinfo, tree, drep);
287         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
288         return offset;
289 }
290
291 static int
292 initshutdown_dissect_element_Abort_server(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
293 {
294         offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, initshutdown_dissect_element_Abort_server_, NDR_POINTER_UNIQUE, "Pointer to Server (uint16)",hf_initshutdown_initshutdown_Abort_server);
295
296         return offset;
297 }
298
299 static int
300 initshutdown_dissect_element_Abort_server_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
301 {
302         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_Abort_server,NULL);
303
304         return offset;
305 }
306
307 /* IDL: WERROR initshutdown_Abort( */
308 /* IDL: [unique(1)] [in] uint16 *server */
309 /* IDL: ); */
310
311 static int
312 initshutdown_dissect_Abort_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
313 {
314         guint32 status;
315
316         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_initshutdown_werror, &status);
317
318         if (status != 0 && check_col(pinfo->cinfo, COL_INFO))
319                 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, DOS_errors, "Unknown DOS error 0x%08x"));
320
321         return offset;
322 }
323
324 static int
325 initshutdown_dissect_Abort_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
326 {
327         offset = initshutdown_dissect_element_Abort_server(tvb, offset, pinfo, tree, drep);
328         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
329         return offset;
330 }
331
332 static int
333 initshutdown_dissect_element_InitEx_hostname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
334 {
335         offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, initshutdown_dissect_element_InitEx_hostname_, NDR_POINTER_UNIQUE, "Pointer to Hostname (uint16)",hf_initshutdown_initshutdown_InitEx_hostname);
336
337         return offset;
338 }
339
340 static int
341 initshutdown_dissect_element_InitEx_hostname_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
342 {
343         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_InitEx_hostname,NULL);
344
345         return offset;
346 }
347
348 static int
349 initshutdown_dissect_element_InitEx_message(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
350 {
351         offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, initshutdown_dissect_element_InitEx_message_, NDR_POINTER_UNIQUE, "Pointer to Message (initshutdown_String)",hf_initshutdown_initshutdown_InitEx_message);
352
353         return offset;
354 }
355
356 static int
357 initshutdown_dissect_element_InitEx_message_(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
358 {
359         offset = initshutdown_dissect_struct_String(tvb,offset,pinfo,tree,drep,hf_initshutdown_initshutdown_InitEx_message,0);
360
361         return offset;
362 }
363
364 static int
365 initshutdown_dissect_element_InitEx_timeout(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
366 {
367         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_InitEx_timeout,NULL);
368
369         return offset;
370 }
371
372 static int
373 initshutdown_dissect_element_InitEx_force_apps(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
374 {
375         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_InitEx_force_apps,NULL);
376
377         return offset;
378 }
379
380 static int
381 initshutdown_dissect_element_InitEx_reboot(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
382 {
383         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_InitEx_reboot,NULL);
384
385         return offset;
386 }
387
388 static int
389 initshutdown_dissect_element_InitEx_reason(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
390 {
391         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_initshutdown_initshutdown_InitEx_reason,NULL);
392
393         return offset;
394 }
395
396 /* IDL: WERROR initshutdown_InitEx( */
397 /* IDL: [unique(1)] [in] uint16 *hostname, */
398 /* IDL: [unique(1)] [in] initshutdown_String *message, */
399 /* IDL: [in] uint32 timeout, */
400 /* IDL: [in] uint8 force_apps, */
401 /* IDL: [in] uint8 reboot, */
402 /* IDL: [in] uint32 reason */
403 /* IDL: ); */
404
405 static int
406 initshutdown_dissect_InitEx_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
407 {
408         guint32 status;
409
410         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_initshutdown_werror, &status);
411
412         if (status != 0 && check_col(pinfo->cinfo, COL_INFO))
413                 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, DOS_errors, "Unknown DOS error 0x%08x"));
414
415         return offset;
416 }
417
418 static int
419 initshutdown_dissect_InitEx_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
420 {
421         offset = initshutdown_dissect_element_InitEx_hostname(tvb, offset, pinfo, tree, drep);
422         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
423         offset = initshutdown_dissect_element_InitEx_message(tvb, offset, pinfo, tree, drep);
424         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
425         offset = initshutdown_dissect_element_InitEx_timeout(tvb, offset, pinfo, tree, drep);
426         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
427         offset = initshutdown_dissect_element_InitEx_force_apps(tvb, offset, pinfo, tree, drep);
428         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
429         offset = initshutdown_dissect_element_InitEx_reboot(tvb, offset, pinfo, tree, drep);
430         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
431         offset = initshutdown_dissect_element_InitEx_reason(tvb, offset, pinfo, tree, drep);
432         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
433         return offset;
434 }
435
436
437 static dcerpc_sub_dissector initshutdown_dissectors[] = {
438         { 0, "Init",
439            initshutdown_dissect_Init_request, initshutdown_dissect_Init_response},
440         { 1, "Abort",
441            initshutdown_dissect_Abort_request, initshutdown_dissect_Abort_response},
442         { 2, "InitEx",
443            initshutdown_dissect_InitEx_request, initshutdown_dissect_InitEx_response},
444         { 0, NULL, NULL, NULL }
445 };
446
447 void proto_register_dcerpc_initshutdown(void)
448 {
449         static hf_register_info hf[] = {
450         { &hf_initshutdown_initshutdown_String_name_len, 
451           { "Name Len", "initshutdown.initshutdown_String.name_len", FT_UINT16, BASE_DEC, NULL, 0, "", HFILL }},
452         { &hf_initshutdown_opnum, 
453           { "Operation", "initshutdown.opnum", FT_UINT16, BASE_DEC, NULL, 0, "", HFILL }},
454         { &hf_initshutdown_initshutdown_Init_hostname, 
455           { "Hostname", "initshutdown.initshutdown_Init.hostname", FT_UINT16, BASE_DEC, NULL, 0, "", HFILL }},
456         { &hf_initshutdown_initshutdown_String_sub_name, 
457           { "Name", "initshutdown.initshutdown_String_sub.name", FT_NONE, BASE_HEX, NULL, 0, "", HFILL }},
458         { &hf_initshutdown_initshutdown_String_sub_name_size, 
459           { "Name Size", "initshutdown.initshutdown_String_sub.name_size", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
460         { &hf_initshutdown_initshutdown_InitEx_reason, 
461           { "Reason", "initshutdown.initshutdown_InitEx.reason", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
462         { &hf_initshutdown_initshutdown_InitEx_force_apps, 
463           { "Force Apps", "initshutdown.initshutdown_InitEx.force_apps", FT_UINT8, BASE_DEC, NULL, 0, "", HFILL }},
464         { &hf_initshutdown_initshutdown_InitEx_timeout, 
465           { "Timeout", "initshutdown.initshutdown_InitEx.timeout", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
466         { &hf_initshutdown_initshutdown_Init_timeout, 
467           { "Timeout", "initshutdown.initshutdown_Init.timeout", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
468         { &hf_initshutdown_initshutdown_String_name_size, 
469           { "Name Size", "initshutdown.initshutdown_String.name_size", FT_UINT16, BASE_DEC, NULL, 0, "", HFILL }},
470         { &hf_initshutdown_initshutdown_Init_force_apps, 
471           { "Force Apps", "initshutdown.initshutdown_Init.force_apps", FT_UINT8, BASE_DEC, NULL, 0, "", HFILL }},
472         { &hf_initshutdown_initshutdown_InitEx_hostname, 
473           { "Hostname", "initshutdown.initshutdown_InitEx.hostname", FT_UINT16, BASE_DEC, NULL, 0, "", HFILL }},
474         { &hf_initshutdown_initshutdown_Init_reboot, 
475           { "Reboot", "initshutdown.initshutdown_Init.reboot", FT_UINT8, BASE_DEC, NULL, 0, "", HFILL }},
476         { &hf_initshutdown_initshutdown_InitEx_reboot, 
477           { "Reboot", "initshutdown.initshutdown_InitEx.reboot", FT_UINT8, BASE_DEC, NULL, 0, "", HFILL }},
478         { &hf_initshutdown_initshutdown_Init_message, 
479           { "Message", "initshutdown.initshutdown_Init.message", FT_NONE, BASE_NONE, NULL, 0, "", HFILL }},
480         { &hf_initshutdown_werror, 
481           { "Windows Error", "initshutdown.werror", FT_UINT32, BASE_HEX, VALS(DOS_errors), 0, "", HFILL }},
482         { &hf_initshutdown_initshutdown_InitEx_message, 
483           { "Message", "initshutdown.initshutdown_InitEx.message", FT_NONE, BASE_NONE, NULL, 0, "", HFILL }},
484         { &hf_initshutdown_initshutdown_Abort_server, 
485           { "Server", "initshutdown.initshutdown_Abort.server", FT_UINT16, BASE_DEC, NULL, 0, "", HFILL }},
486         { &hf_initshutdown_initshutdown_String_name, 
487           { "Name", "initshutdown.initshutdown_String.name", FT_NONE, BASE_NONE, NULL, 0, "", HFILL }},
488         };
489
490
491         static gint *ett[] = {
492                 &ett_dcerpc_initshutdown,
493                 &ett_initshutdown_initshutdown_String_sub,
494                 &ett_initshutdown_initshutdown_String,
495         };
496
497         proto_dcerpc_initshutdown = proto_register_protocol("Init shutdown service", "INITSHUTDOWN", "initshutdown");
498         proto_register_field_array(proto_dcerpc_initshutdown, hf, array_length (hf));
499         proto_register_subtree_array(ett, array_length(ett));
500 }
501
502 void proto_reg_handoff_dcerpc_initshutdown(void)
503 {
504         dcerpc_init_uuid(proto_dcerpc_initshutdown, ett_dcerpc_initshutdown,
505                 &uuid_dcerpc_initshutdown, ver_dcerpc_initshutdown,
506                 initshutdown_dissectors, hf_initshutdown_opnum);
507 }