Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-dcerpc-initshutdown.c
blob1b2015c457004763196ff351ec7e4711b661d074
1 /* DO NOT EDIT
2 This file was automatically generated by Pidl
3 from initshutdown.idl and initshutdown.cnf.
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 https://wiki.wireshark.org/Pidl
9 */
12 #include "config.h"
13 #include <string.h>
14 #include <wsutil/array.h>
15 #include <epan/packet.h>
16 #include <epan/tfs.h>
18 #include "packet-dcerpc.h"
19 #include "packet-dcerpc-nt.h"
20 #include "packet-windows-common.h"
21 #include "packet-dcerpc-initshutdown.h"
22 void proto_register_dcerpc_initshutdown(void);
23 void proto_reg_handoff_dcerpc_initshutdown(void);
25 /* Ett declarations */
26 static int ett_dcerpc_initshutdown;
27 static int ett_initshutdown_initshutdown_ReasonFlags;
30 /* Header field declarations */
31 static int hf_initshutdown_initshutdown_Abort_server;
32 static int hf_initshutdown_initshutdown_InitEx_do_reboot;
33 static int hf_initshutdown_initshutdown_InitEx_force_apps;
34 static int hf_initshutdown_initshutdown_InitEx_hostname;
35 static int hf_initshutdown_initshutdown_InitEx_message;
36 static int hf_initshutdown_initshutdown_InitEx_reason;
37 static int hf_initshutdown_initshutdown_InitEx_timeout;
38 static int hf_initshutdown_initshutdown_Init_do_reboot;
39 static int hf_initshutdown_initshutdown_Init_force_apps;
40 static int hf_initshutdown_initshutdown_Init_hostname;
41 static int hf_initshutdown_initshutdown_Init_message;
42 static int hf_initshutdown_initshutdown_Init_timeout;
43 static int hf_initshutdown_initshutdown_ReasonFlags_SHTDN_REASON_FLAG_PLANNED;
44 static int hf_initshutdown_initshutdown_ReasonFlags_SHTDN_REASON_FLAG_USER_DEFINED;
45 static int hf_initshutdown_opnum;
46 static int hf_initshutdown_werror;
48 static int proto_dcerpc_initshutdown;
49 /* Version information */
52 static e_guid_t uuid_dcerpc_initshutdown = {
53 0x894de0c0, 0x0d55, 0x11d3,
54 { 0xa3, 0x22, 0x00, 0xc0, 0x4f, 0xa3, 0x21, 0xa1 }
56 static uint16_t ver_dcerpc_initshutdown = 1;
58 const value_string initshutdown_initshutdown_ReasonMajor_vals[] = {
59 { SHTDN_REASON_MAJOR_OTHER, "SHTDN_REASON_MAJOR_OTHER" },
60 { SHTDN_REASON_MAJOR_HARDWARE, "SHTDN_REASON_MAJOR_HARDWARE" },
61 { SHTDN_REASON_MAJOR_OPERATINGSYSTEM, "SHTDN_REASON_MAJOR_OPERATINGSYSTEM" },
62 { SHTDN_REASON_MAJOR_SOFTWARE, "SHTDN_REASON_MAJOR_SOFTWARE" },
63 { SHTDN_REASON_MAJOR_APPLICATION, "SHTDN_REASON_MAJOR_APPLICATION" },
64 { SHTDN_REASON_MAJOR_SYSTEM, "SHTDN_REASON_MAJOR_SYSTEM" },
65 { SHTDN_REASON_MAJOR_POWER, "SHTDN_REASON_MAJOR_POWER" },
66 { SHTDN_REASON_MAJOR_LEGACY_API, "SHTDN_REASON_MAJOR_LEGACY_API" },
67 { 0, NULL }
69 const value_string initshutdown_initshutdown_ReasonMinor_vals[] = {
70 { SHTDN_REASON_MINOR_OTHER, "SHTDN_REASON_MINOR_OTHER" },
71 { SHTDN_REASON_MINOR_MAINTENANCE, "SHTDN_REASON_MINOR_MAINTENANCE" },
72 { SHTDN_REASON_MINOR_INSTALLATION, "SHTDN_REASON_MINOR_INSTALLATION" },
73 { SHTDN_REASON_MINOR_UPGRADE, "SHTDN_REASON_MINOR_UPGRADE" },
74 { SHTDN_REASON_MINOR_RECONFIG, "SHTDN_REASON_MINOR_RECONFIG" },
75 { SHTDN_REASON_MINOR_HUNG, "SHTDN_REASON_MINOR_HUNG" },
76 { SHTDN_REASON_MINOR_UNSTABLE, "SHTDN_REASON_MINOR_UNSTABLE" },
77 { SHTDN_REASON_MINOR_DISK, "SHTDN_REASON_MINOR_DISK" },
78 { SHTDN_REASON_MINOR_PROCESSOR, "SHTDN_REASON_MINOR_PROCESSOR" },
79 { SHTDN_REASON_MINOR_NETWORKCARD, "SHTDN_REASON_MINOR_NETWORKCARD" },
80 { SHTDN_REASON_MINOR_POWER_SUPPLY, "SHTDN_REASON_MINOR_POWER_SUPPLY" },
81 { SHTDN_REASON_MINOR_CORDUNPLUGGED, "SHTDN_REASON_MINOR_CORDUNPLUGGED" },
82 { SHTDN_REASON_MINOR_ENVIRONMENT, "SHTDN_REASON_MINOR_ENVIRONMENT" },
83 { SHTDN_REASON_MINOR_HARDWARE_DRIVER, "SHTDN_REASON_MINOR_HARDWARE_DRIVER" },
84 { SHTDN_REASON_MINOR_OTHERDRIVER, "SHTDN_REASON_MINOR_OTHERDRIVER" },
85 { SHTDN_REASON_MINOR_BLUESCREEN, "SHTDN_REASON_MINOR_BLUESCREEN" },
86 { SHTDN_REASON_MINOR_SERVICEPACK, "SHTDN_REASON_MINOR_SERVICEPACK" },
87 { SHTDN_REASON_MINOR_HOTFIX, "SHTDN_REASON_MINOR_HOTFIX" },
88 { SHTDN_REASON_MINOR_SECURITYFIX, "SHTDN_REASON_MINOR_SECURITYFIX" },
89 { SHTDN_REASON_MINOR_SECURITY, "SHTDN_REASON_MINOR_SECURITY" },
90 { SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY, "SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY" },
91 { SHTDN_REASON_MINOR_WMI, "SHTDN_REASON_MINOR_WMI" },
92 { SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL, "SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL" },
93 { SHTDN_REASON_MINOR_HOTFIX_UNINSTALL, "SHTDN_REASON_MINOR_HOTFIX_UNINSTALL" },
94 { SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL, "SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL" },
95 { SHTDN_REASON_MINOR_MMC, "SHTDN_REASON_MINOR_MMC" },
96 { SHTDN_REASON_MINOR_TERMSRV, "SHTDN_REASON_MINOR_TERMSRV" },
97 { 0, NULL }
99 static const true_false_string initshutdown_ReasonFlags_SHTDN_REASON_FLAG_USER_DEFINED_tfs = {
100 "SHTDN_REASON_FLAG_USER_DEFINED is SET",
101 "SHTDN_REASON_FLAG_USER_DEFINED is NOT SET",
103 static const true_false_string initshutdown_ReasonFlags_SHTDN_REASON_FLAG_PLANNED_tfs = {
104 "SHTDN_REASON_FLAG_PLANNED is SET",
105 "SHTDN_REASON_FLAG_PLANNED is NOT SET",
107 static int initshutdown_dissect_element_Init_hostname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
108 static int initshutdown_dissect_element_Init_hostname_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
109 static int initshutdown_dissect_element_Init_message(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
110 static int initshutdown_dissect_element_Init_message_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
111 static int initshutdown_dissect_element_Init_timeout(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
112 static int initshutdown_dissect_element_Init_force_apps(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
113 static int initshutdown_dissect_element_Init_do_reboot(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
114 static int initshutdown_dissect_element_Abort_server(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
115 static int initshutdown_dissect_element_Abort_server_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
116 static int initshutdown_dissect_element_InitEx_hostname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
117 static int initshutdown_dissect_element_InitEx_hostname_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
118 static int initshutdown_dissect_element_InitEx_message(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
119 static int initshutdown_dissect_element_InitEx_message_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
120 static int initshutdown_dissect_element_InitEx_timeout(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
121 static int initshutdown_dissect_element_InitEx_force_apps(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
122 static int initshutdown_dissect_element_InitEx_do_reboot(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
123 static int initshutdown_dissect_element_InitEx_reason(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
126 /* IDL: enum { */
127 /* IDL: SHTDN_REASON_MAJOR_OTHER=0x00000000, */
128 /* IDL: SHTDN_REASON_MAJOR_HARDWARE=0x00010000, */
129 /* IDL: SHTDN_REASON_MAJOR_OPERATINGSYSTEM=0x00020000, */
130 /* IDL: SHTDN_REASON_MAJOR_SOFTWARE=0x00030000, */
131 /* IDL: SHTDN_REASON_MAJOR_APPLICATION=0x00040000, */
132 /* IDL: SHTDN_REASON_MAJOR_SYSTEM=0x00050000, */
133 /* IDL: SHTDN_REASON_MAJOR_POWER=0x00060000, */
134 /* IDL: SHTDN_REASON_MAJOR_LEGACY_API=0x00070000, */
135 /* IDL: } */
138 initshutdown_dissect_enum_ReasonMajor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t *param _U_)
140 uint32_t parameter=0;
141 if (param) {
142 parameter = *param;
144 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
145 if (param) {
146 *param = parameter;
148 return offset;
152 /* IDL: enum { */
153 /* IDL: SHTDN_REASON_MINOR_OTHER=0x00000000, */
154 /* IDL: SHTDN_REASON_MINOR_MAINTENANCE=0x00000001, */
155 /* IDL: SHTDN_REASON_MINOR_INSTALLATION=0x00000002, */
156 /* IDL: SHTDN_REASON_MINOR_UPGRADE=0x00000003, */
157 /* IDL: SHTDN_REASON_MINOR_RECONFIG=0x00000004, */
158 /* IDL: SHTDN_REASON_MINOR_HUNG=0x00000005, */
159 /* IDL: SHTDN_REASON_MINOR_UNSTABLE=0x00000006, */
160 /* IDL: SHTDN_REASON_MINOR_DISK=0x00000007, */
161 /* IDL: SHTDN_REASON_MINOR_PROCESSOR=0x00000008, */
162 /* IDL: SHTDN_REASON_MINOR_NETWORKCARD=0x00000009, */
163 /* IDL: SHTDN_REASON_MINOR_POWER_SUPPLY=0x0000000a, */
164 /* IDL: SHTDN_REASON_MINOR_CORDUNPLUGGED=0x0000000b, */
165 /* IDL: SHTDN_REASON_MINOR_ENVIRONMENT=0x0000000c, */
166 /* IDL: SHTDN_REASON_MINOR_HARDWARE_DRIVER=0x0000000d, */
167 /* IDL: SHTDN_REASON_MINOR_OTHERDRIVER=0x0000000e, */
168 /* IDL: SHTDN_REASON_MINOR_BLUESCREEN=0x0000000f, */
169 /* IDL: SHTDN_REASON_MINOR_SERVICEPACK=0x00000010, */
170 /* IDL: SHTDN_REASON_MINOR_HOTFIX=0x00000011, */
171 /* IDL: SHTDN_REASON_MINOR_SECURITYFIX=0x00000012, */
172 /* IDL: SHTDN_REASON_MINOR_SECURITY=0x00000013, */
173 /* IDL: SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY=0x00000014, */
174 /* IDL: SHTDN_REASON_MINOR_WMI=0x00000015, */
175 /* IDL: SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL=0x00000016, */
176 /* IDL: SHTDN_REASON_MINOR_HOTFIX_UNINSTALL=0x00000017, */
177 /* IDL: SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL=0x00000018, */
178 /* IDL: SHTDN_REASON_MINOR_MMC=0x00000019, */
179 /* IDL: SHTDN_REASON_MINOR_TERMSRV=0x00000020, */
180 /* IDL: } */
183 initshutdown_dissect_enum_ReasonMinor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t *param _U_)
185 uint32_t parameter=0;
186 if (param) {
187 parameter = *param;
189 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
190 if (param) {
191 *param = parameter;
193 return offset;
197 /* IDL: bitmap { */
198 /* IDL: SHTDN_REASON_FLAG_USER_DEFINED = 0x40000000 , */
199 /* IDL: SHTDN_REASON_FLAG_PLANNED = 0x80000000 , */
200 /* IDL: } */
203 initshutdown_dissect_bitmap_ReasonFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)
205 proto_item *item;
206 static int * const initshutdown_initshutdown_ReasonFlags_fields[] = {
207 &hf_initshutdown_initshutdown_ReasonFlags_SHTDN_REASON_FLAG_USER_DEFINED,
208 &hf_initshutdown_initshutdown_ReasonFlags_SHTDN_REASON_FLAG_PLANNED,
209 NULL
211 uint32_t flags;
212 ALIGN_TO_4_BYTES;
214 item = proto_tree_add_bitmask_with_flags(parent_tree, tvb, offset, hf_index,
215 ett_initshutdown_initshutdown_ReasonFlags, initshutdown_initshutdown_ReasonFlags_fields, DREP_ENC_INTEGER(drep), BMT_NO_FALSE);
217 offset = dissect_ndr_uint32(tvb, offset, pinfo, parent_tree, di, drep, -1, &flags);
219 if (!flags)
220 proto_item_append_text(item, ": (No values set)");
222 if (flags & (~0xc0000000)) {
223 flags &= (~0xc0000000);
224 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
227 return offset;
230 static int
231 initshutdown_dissect_element_Init_hostname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
233 offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, initshutdown_dissect_element_Init_hostname_, NDR_POINTER_UNIQUE, "Pointer to Hostname (uint16)",hf_initshutdown_initshutdown_Init_hostname);
235 return offset;
238 static int
239 initshutdown_dissect_element_Init_hostname_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
241 offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Init_hostname, 0);
243 return offset;
246 static int
247 initshutdown_dissect_element_Init_message(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
249 offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, initshutdown_dissect_element_Init_message_, NDR_POINTER_UNIQUE, "Pointer to Message (lsa_StringLarge)",hf_initshutdown_initshutdown_Init_message);
251 return offset;
254 static int
255 initshutdown_dissect_element_Init_message_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
257 offset=lsarpc_dissect_struct_lsa_StringLarge(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Init_message, 0);
259 return offset;
262 static int
263 initshutdown_dissect_element_Init_timeout(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
265 offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Init_timeout, 0);
267 return offset;
270 static int
271 initshutdown_dissect_element_Init_force_apps(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
273 offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Init_force_apps, 0);
275 return offset;
278 static int
279 initshutdown_dissect_element_Init_do_reboot(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
281 offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Init_do_reboot, 0);
283 return offset;
286 /* IDL: WERROR initshutdown_Init( */
287 /* IDL: [in] [unique(1)] uint16 *hostname, */
288 /* IDL: [in] [unique(1)] lsa_StringLarge *message, */
289 /* IDL: [in] uint32 timeout, */
290 /* IDL: [in] uint8 force_apps, */
291 /* IDL: [in] uint8 do_reboot */
292 /* IDL: ); */
294 static int
295 initshutdown_dissect_Init_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
297 uint32_t status;
299 di->dcerpc_procedure_name="Init";
300 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_werror, &status);
302 if (status != 0)
303 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));
305 return offset;
308 static int
309 initshutdown_dissect_Init_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
311 di->dcerpc_procedure_name="Init";
312 offset = initshutdown_dissect_element_Init_hostname(tvb, offset, pinfo, tree, di, drep);
313 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
314 offset = initshutdown_dissect_element_Init_message(tvb, offset, pinfo, tree, di, drep);
315 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
316 offset = initshutdown_dissect_element_Init_timeout(tvb, offset, pinfo, tree, di, drep);
317 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
318 offset = initshutdown_dissect_element_Init_force_apps(tvb, offset, pinfo, tree, di, drep);
319 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
320 offset = initshutdown_dissect_element_Init_do_reboot(tvb, offset, pinfo, tree, di, drep);
321 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
322 return offset;
325 static int
326 initshutdown_dissect_element_Abort_server(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
328 offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, initshutdown_dissect_element_Abort_server_, NDR_POINTER_UNIQUE, "Pointer to Server (uint16)",hf_initshutdown_initshutdown_Abort_server);
330 return offset;
333 static int
334 initshutdown_dissect_element_Abort_server_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
336 offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Abort_server, 0);
338 return offset;
341 /* IDL: WERROR initshutdown_Abort( */
342 /* IDL: [in] [unique(1)] uint16 *server */
343 /* IDL: ); */
345 static int
346 initshutdown_dissect_Abort_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
348 uint32_t status;
350 di->dcerpc_procedure_name="Abort";
351 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_werror, &status);
353 if (status != 0)
354 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));
356 return offset;
359 static int
360 initshutdown_dissect_Abort_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
362 di->dcerpc_procedure_name="Abort";
363 offset = initshutdown_dissect_element_Abort_server(tvb, offset, pinfo, tree, di, drep);
364 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
365 return offset;
368 static int
369 initshutdown_dissect_element_InitEx_hostname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
371 offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, initshutdown_dissect_element_InitEx_hostname_, NDR_POINTER_UNIQUE, "Pointer to Hostname (uint16)",hf_initshutdown_initshutdown_InitEx_hostname);
373 return offset;
376 static int
377 initshutdown_dissect_element_InitEx_hostname_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
379 offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_hostname, 0);
381 return offset;
384 static int
385 initshutdown_dissect_element_InitEx_message(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
387 offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, initshutdown_dissect_element_InitEx_message_, NDR_POINTER_UNIQUE, "Pointer to Message (lsa_StringLarge)",hf_initshutdown_initshutdown_InitEx_message);
389 return offset;
392 static int
393 initshutdown_dissect_element_InitEx_message_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
395 offset=lsarpc_dissect_struct_lsa_StringLarge(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_message, 0);
397 return offset;
400 static int
401 initshutdown_dissect_element_InitEx_timeout(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
403 offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_timeout, 0);
405 return offset;
408 static int
409 initshutdown_dissect_element_InitEx_force_apps(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
411 offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_force_apps, 0);
413 return offset;
416 static int
417 initshutdown_dissect_element_InitEx_do_reboot(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
419 offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_do_reboot, 0);
421 return offset;
424 static int
425 initshutdown_dissect_element_InitEx_reason(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
427 offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_reason, 0);
429 return offset;
432 /* IDL: WERROR initshutdown_InitEx( */
433 /* IDL: [in] [unique(1)] uint16 *hostname, */
434 /* IDL: [in] [unique(1)] lsa_StringLarge *message, */
435 /* IDL: [in] uint32 timeout, */
436 /* IDL: [in] uint8 force_apps, */
437 /* IDL: [in] uint8 do_reboot, */
438 /* IDL: [in] uint32 reason */
439 /* IDL: ); */
441 static int
442 initshutdown_dissect_InitEx_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
444 uint32_t status;
446 di->dcerpc_procedure_name="InitEx";
447 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_werror, &status);
449 if (status != 0)
450 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown DOS error 0x%08x"));
452 return offset;
455 static int
456 initshutdown_dissect_InitEx_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
458 di->dcerpc_procedure_name="InitEx";
459 offset = initshutdown_dissect_element_InitEx_hostname(tvb, offset, pinfo, tree, di, drep);
460 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
461 offset = initshutdown_dissect_element_InitEx_message(tvb, offset, pinfo, tree, di, drep);
462 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
463 offset = initshutdown_dissect_element_InitEx_timeout(tvb, offset, pinfo, tree, di, drep);
464 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
465 offset = initshutdown_dissect_element_InitEx_force_apps(tvb, offset, pinfo, tree, di, drep);
466 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
467 offset = initshutdown_dissect_element_InitEx_do_reboot(tvb, offset, pinfo, tree, di, drep);
468 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
469 offset = initshutdown_dissect_element_InitEx_reason(tvb, offset, pinfo, tree, di, drep);
470 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
471 return offset;
475 static const dcerpc_sub_dissector initshutdown_dissectors[] = {
476 { 0, "Init",
477 initshutdown_dissect_Init_request, initshutdown_dissect_Init_response},
478 { 1, "Abort",
479 initshutdown_dissect_Abort_request, initshutdown_dissect_Abort_response},
480 { 2, "InitEx",
481 initshutdown_dissect_InitEx_request, initshutdown_dissect_InitEx_response},
482 { 0, NULL, NULL, NULL }
485 void proto_register_dcerpc_initshutdown(void)
487 static hf_register_info hf[] = {
488 { &hf_initshutdown_initshutdown_Abort_server,
489 { "Server", "initshutdown.initshutdown_Abort.server", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
490 { &hf_initshutdown_initshutdown_InitEx_do_reboot,
491 { "Do Reboot", "initshutdown.initshutdown_InitEx.do_reboot", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
492 { &hf_initshutdown_initshutdown_InitEx_force_apps,
493 { "Force Apps", "initshutdown.initshutdown_InitEx.force_apps", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
494 { &hf_initshutdown_initshutdown_InitEx_hostname,
495 { "Hostname", "initshutdown.initshutdown_InitEx.hostname", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
496 { &hf_initshutdown_initshutdown_InitEx_message,
497 { "Message", "initshutdown.initshutdown_InitEx.message", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
498 { &hf_initshutdown_initshutdown_InitEx_reason,
499 { "Reason", "initshutdown.initshutdown_InitEx.reason", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
500 { &hf_initshutdown_initshutdown_InitEx_timeout,
501 { "Timeout", "initshutdown.initshutdown_InitEx.timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
502 { &hf_initshutdown_initshutdown_Init_do_reboot,
503 { "Do Reboot", "initshutdown.initshutdown_Init.do_reboot", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
504 { &hf_initshutdown_initshutdown_Init_force_apps,
505 { "Force Apps", "initshutdown.initshutdown_Init.force_apps", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
506 { &hf_initshutdown_initshutdown_Init_hostname,
507 { "Hostname", "initshutdown.initshutdown_Init.hostname", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
508 { &hf_initshutdown_initshutdown_Init_message,
509 { "Message", "initshutdown.initshutdown_Init.message", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
510 { &hf_initshutdown_initshutdown_Init_timeout,
511 { "Timeout", "initshutdown.initshutdown_Init.timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
512 { &hf_initshutdown_initshutdown_ReasonFlags_SHTDN_REASON_FLAG_PLANNED,
513 { "SHTDN REASON FLAG PLANNED", "initshutdown.initshutdown_ReasonFlags.SHTDN_REASON_FLAG_PLANNED", FT_BOOLEAN, 32, TFS(&initshutdown_ReasonFlags_SHTDN_REASON_FLAG_PLANNED_tfs), ( 0x80000000 ), NULL, HFILL }},
514 { &hf_initshutdown_initshutdown_ReasonFlags_SHTDN_REASON_FLAG_USER_DEFINED,
515 { "SHTDN REASON FLAG USER DEFINED", "initshutdown.initshutdown_ReasonFlags.SHTDN_REASON_FLAG_USER_DEFINED", FT_BOOLEAN, 32, TFS(&initshutdown_ReasonFlags_SHTDN_REASON_FLAG_USER_DEFINED_tfs), ( 0x40000000 ), NULL, HFILL }},
516 { &hf_initshutdown_opnum,
517 { "Operation", "initshutdown.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
518 { &hf_initshutdown_werror,
519 { "Windows Error", "initshutdown.werror", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &WERR_errors_ext, 0, NULL, HFILL }},
523 static int *ett[] = {
524 &ett_dcerpc_initshutdown,
525 &ett_initshutdown_initshutdown_ReasonFlags,
528 proto_dcerpc_initshutdown = proto_register_protocol("Init shutdown service", "INITSHUTDOWN", "initshutdown");
529 proto_register_field_array(proto_dcerpc_initshutdown, hf, array_length (hf));
530 proto_register_subtree_array(ett, array_length(ett));
533 void proto_reg_handoff_dcerpc_initshutdown(void)
535 dcerpc_init_uuid(proto_dcerpc_initshutdown, ett_dcerpc_initshutdown,
536 &uuid_dcerpc_initshutdown, ver_dcerpc_initshutdown,
537 initshutdown_dissectors, hf_initshutdown_opnum);