/src/wireshark/epan/dissectors/packet-dcerpc-initshutdown.c
Line | Count | Source |
1 | | /* DO NOT EDIT |
2 | | This file was automatically generated by Pidl |
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 https://wiki.wireshark.org/Pidl |
9 | | */ |
10 | | |
11 | | |
12 | | #include "config.h" |
13 | | #include <string.h> |
14 | | #include <wsutil/array.h> |
15 | | #include <epan/packet.h> |
16 | | #include <epan/tfs.h> |
17 | | |
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); |
24 | | |
25 | | /* Ett declarations */ |
26 | | static int ett_dcerpc_initshutdown; |
27 | | static int ett_initshutdown_initshutdown_ReasonFlags; |
28 | | |
29 | | |
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; |
47 | | |
48 | | static int proto_dcerpc_initshutdown; |
49 | | /* Version information */ |
50 | | |
51 | | |
52 | | static e_guid_t uuid_dcerpc_initshutdown = { |
53 | | 0x894de0c0, 0x0d55, 0x11d3, |
54 | | { 0xa3, 0x22, 0x00, 0xc0, 0x4f, 0xa3, 0x21, 0xa1 } |
55 | | }; |
56 | | static uint16_t ver_dcerpc_initshutdown = 1; |
57 | | |
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 } |
68 | | }; |
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 } |
98 | | }; |
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", |
102 | | }; |
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", |
106 | | }; |
107 | | static unsigned initshutdown_dissect_element_Init_hostname(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
108 | | static unsigned initshutdown_dissect_element_Init_hostname_(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
109 | | static unsigned initshutdown_dissect_element_Init_message(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
110 | | static unsigned initshutdown_dissect_element_Init_message_(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
111 | | static unsigned initshutdown_dissect_element_Init_timeout(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
112 | | static unsigned initshutdown_dissect_element_Init_force_apps(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
113 | | static unsigned initshutdown_dissect_element_Init_do_reboot(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
114 | | static unsigned initshutdown_dissect_element_Abort_server(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
115 | | static unsigned initshutdown_dissect_element_Abort_server_(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
116 | | static unsigned initshutdown_dissect_element_InitEx_hostname(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
117 | | static unsigned initshutdown_dissect_element_InitEx_hostname_(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
118 | | static unsigned initshutdown_dissect_element_InitEx_message(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
119 | | static unsigned initshutdown_dissect_element_InitEx_message_(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
120 | | static unsigned initshutdown_dissect_element_InitEx_timeout(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
121 | | static unsigned initshutdown_dissect_element_InitEx_force_apps(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
122 | | static unsigned initshutdown_dissect_element_InitEx_do_reboot(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
123 | | static unsigned initshutdown_dissect_element_InitEx_reason(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_); |
124 | | |
125 | | |
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: } */ |
136 | | |
137 | | unsigned |
138 | | initshutdown_dissect_enum_ReasonMajor(tvbuff_t *tvb _U_, unsigned 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_) |
139 | 0 | { |
140 | 0 | uint32_t parameter=0; |
141 | 0 | if (param) { |
142 | 0 | parameter = *param; |
143 | 0 | } |
144 | 0 | offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_index, ¶meter); |
145 | 0 | if (param) { |
146 | 0 | *param = parameter; |
147 | 0 | } |
148 | 0 | return offset; |
149 | 0 | } |
150 | | |
151 | | |
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: } */ |
181 | | |
182 | | unsigned |
183 | | initshutdown_dissect_enum_ReasonMinor(tvbuff_t *tvb _U_, unsigned 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_) |
184 | 0 | { |
185 | 0 | uint32_t parameter=0; |
186 | 0 | if (param) { |
187 | 0 | parameter = *param; |
188 | 0 | } |
189 | 0 | offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_index, ¶meter); |
190 | 0 | if (param) { |
191 | 0 | *param = parameter; |
192 | 0 | } |
193 | 0 | return offset; |
194 | 0 | } |
195 | | |
196 | | |
197 | | /* IDL: bitmap { */ |
198 | | /* IDL: SHTDN_REASON_FLAG_USER_DEFINED = 0x40000000 , */ |
199 | | /* IDL: SHTDN_REASON_FLAG_PLANNED = 0x80000000 , */ |
200 | | /* IDL: } */ |
201 | | |
202 | | unsigned |
203 | | initshutdown_dissect_bitmap_ReasonFlags(tvbuff_t *tvb _U_, unsigned 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_) |
204 | 0 | { |
205 | 0 | proto_item *item; |
206 | 0 | static int * const initshutdown_initshutdown_ReasonFlags_fields[] = { |
207 | 0 | &hf_initshutdown_initshutdown_ReasonFlags_SHTDN_REASON_FLAG_USER_DEFINED, |
208 | 0 | &hf_initshutdown_initshutdown_ReasonFlags_SHTDN_REASON_FLAG_PLANNED, |
209 | 0 | NULL |
210 | 0 | }; |
211 | 0 | uint32_t flags; |
212 | 0 | ALIGN_TO_4_BYTES; |
213 | |
|
214 | 0 | item = proto_tree_add_bitmask_with_flags(parent_tree, tvb, offset, hf_index, |
215 | 0 | ett_initshutdown_initshutdown_ReasonFlags, initshutdown_initshutdown_ReasonFlags_fields, DREP_ENC_INTEGER(drep), BMT_NO_FALSE); |
216 | |
|
217 | 0 | offset = dissect_ndr_uint32(tvb, offset, pinfo, parent_tree, di, drep, -1, &flags); |
218 | |
|
219 | 0 | if (!flags) |
220 | 0 | proto_item_append_text(item, ": (No values set)"); |
221 | |
|
222 | 0 | if (flags & (~0xc0000000)) { |
223 | 0 | flags &= (~0xc0000000); |
224 | 0 | proto_item_append_text(item, "Unknown bitmap value 0x%x", flags); |
225 | 0 | } |
226 | |
|
227 | 0 | return offset; |
228 | 0 | } |
229 | | |
230 | | static unsigned |
231 | | initshutdown_dissect_element_Init_hostname(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
232 | 0 | { |
233 | 0 | 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); |
234 | |
|
235 | 0 | return offset; |
236 | 0 | } |
237 | | |
238 | | static unsigned |
239 | | initshutdown_dissect_element_Init_hostname_(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
240 | 0 | { |
241 | 0 | offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Init_hostname, 0); |
242 | |
|
243 | 0 | return offset; |
244 | 0 | } |
245 | | |
246 | | static unsigned |
247 | | initshutdown_dissect_element_Init_message(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
248 | 0 | { |
249 | 0 | 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); |
250 | |
|
251 | 0 | return offset; |
252 | 0 | } |
253 | | |
254 | | static unsigned |
255 | | initshutdown_dissect_element_Init_message_(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
256 | 0 | { |
257 | 0 | offset=lsarpc_dissect_struct_lsa_StringLarge(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Init_message, 0); |
258 | |
|
259 | 0 | return offset; |
260 | 0 | } |
261 | | |
262 | | static unsigned |
263 | | initshutdown_dissect_element_Init_timeout(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
264 | 0 | { |
265 | 0 | offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Init_timeout, 0); |
266 | |
|
267 | 0 | return offset; |
268 | 0 | } |
269 | | |
270 | | static unsigned |
271 | | initshutdown_dissect_element_Init_force_apps(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
272 | 0 | { |
273 | 0 | offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Init_force_apps, 0); |
274 | |
|
275 | 0 | return offset; |
276 | 0 | } |
277 | | |
278 | | static unsigned |
279 | | initshutdown_dissect_element_Init_do_reboot(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
280 | 0 | { |
281 | 0 | offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Init_do_reboot, 0); |
282 | |
|
283 | 0 | return offset; |
284 | 0 | } |
285 | | |
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: ); */ |
293 | | |
294 | | static unsigned |
295 | | initshutdown_dissect_Init_response(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
296 | 0 | { |
297 | 0 | uint32_t status; |
298 | |
|
299 | 0 | di->dcerpc_procedure_name="Init"; |
300 | 0 | offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_werror, &status); |
301 | |
|
302 | 0 | if (status != 0) |
303 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(pinfo->pool, status, &WERR_errors_ext, "Unknown DOS error 0x%08x")); |
304 | |
|
305 | 0 | return offset; |
306 | 0 | } |
307 | | |
308 | | static unsigned |
309 | | initshutdown_dissect_Init_request(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
310 | 0 | { |
311 | 0 | di->dcerpc_procedure_name="Init"; |
312 | 0 | offset = initshutdown_dissect_element_Init_hostname(tvb, offset, pinfo, tree, di, drep); |
313 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
314 | 0 | offset = initshutdown_dissect_element_Init_message(tvb, offset, pinfo, tree, di, drep); |
315 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
316 | 0 | offset = initshutdown_dissect_element_Init_timeout(tvb, offset, pinfo, tree, di, drep); |
317 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
318 | 0 | offset = initshutdown_dissect_element_Init_force_apps(tvb, offset, pinfo, tree, di, drep); |
319 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
320 | 0 | offset = initshutdown_dissect_element_Init_do_reboot(tvb, offset, pinfo, tree, di, drep); |
321 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
322 | 0 | return offset; |
323 | 0 | } |
324 | | |
325 | | static unsigned |
326 | | initshutdown_dissect_element_Abort_server(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
327 | 0 | { |
328 | 0 | 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); |
329 | |
|
330 | 0 | return offset; |
331 | 0 | } |
332 | | |
333 | | static unsigned |
334 | | initshutdown_dissect_element_Abort_server_(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
335 | 0 | { |
336 | 0 | offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_Abort_server, 0); |
337 | |
|
338 | 0 | return offset; |
339 | 0 | } |
340 | | |
341 | | /* IDL: WERROR initshutdown_Abort( */ |
342 | | /* IDL: [in] [unique(1)] uint16 *server */ |
343 | | /* IDL: ); */ |
344 | | |
345 | | static unsigned |
346 | | initshutdown_dissect_Abort_response(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
347 | 0 | { |
348 | 0 | uint32_t status; |
349 | |
|
350 | 0 | di->dcerpc_procedure_name="Abort"; |
351 | 0 | offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_werror, &status); |
352 | |
|
353 | 0 | if (status != 0) |
354 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(pinfo->pool, status, &WERR_errors_ext, "Unknown DOS error 0x%08x")); |
355 | |
|
356 | 0 | return offset; |
357 | 0 | } |
358 | | |
359 | | static unsigned |
360 | | initshutdown_dissect_Abort_request(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
361 | 0 | { |
362 | 0 | di->dcerpc_procedure_name="Abort"; |
363 | 0 | offset = initshutdown_dissect_element_Abort_server(tvb, offset, pinfo, tree, di, drep); |
364 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
365 | 0 | return offset; |
366 | 0 | } |
367 | | |
368 | | static unsigned |
369 | | initshutdown_dissect_element_InitEx_hostname(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
370 | 0 | { |
371 | 0 | 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); |
372 | |
|
373 | 0 | return offset; |
374 | 0 | } |
375 | | |
376 | | static unsigned |
377 | | initshutdown_dissect_element_InitEx_hostname_(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
378 | 0 | { |
379 | 0 | offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_hostname, 0); |
380 | |
|
381 | 0 | return offset; |
382 | 0 | } |
383 | | |
384 | | static unsigned |
385 | | initshutdown_dissect_element_InitEx_message(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
386 | 0 | { |
387 | 0 | 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); |
388 | |
|
389 | 0 | return offset; |
390 | 0 | } |
391 | | |
392 | | static unsigned |
393 | | initshutdown_dissect_element_InitEx_message_(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
394 | 0 | { |
395 | 0 | offset=lsarpc_dissect_struct_lsa_StringLarge(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_message, 0); |
396 | |
|
397 | 0 | return offset; |
398 | 0 | } |
399 | | |
400 | | static unsigned |
401 | | initshutdown_dissect_element_InitEx_timeout(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
402 | 0 | { |
403 | 0 | offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_timeout, 0); |
404 | |
|
405 | 0 | return offset; |
406 | 0 | } |
407 | | |
408 | | static unsigned |
409 | | initshutdown_dissect_element_InitEx_force_apps(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
410 | 0 | { |
411 | 0 | offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_force_apps, 0); |
412 | |
|
413 | 0 | return offset; |
414 | 0 | } |
415 | | |
416 | | static unsigned |
417 | | initshutdown_dissect_element_InitEx_do_reboot(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
418 | 0 | { |
419 | 0 | offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_do_reboot, 0); |
420 | |
|
421 | 0 | return offset; |
422 | 0 | } |
423 | | |
424 | | static unsigned |
425 | | initshutdown_dissect_element_InitEx_reason(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
426 | 0 | { |
427 | 0 | offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_initshutdown_InitEx_reason, 0); |
428 | |
|
429 | 0 | return offset; |
430 | 0 | } |
431 | | |
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: ); */ |
440 | | |
441 | | static unsigned |
442 | | initshutdown_dissect_InitEx_response(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
443 | 0 | { |
444 | 0 | uint32_t status; |
445 | |
|
446 | 0 | di->dcerpc_procedure_name="InitEx"; |
447 | 0 | offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_initshutdown_werror, &status); |
448 | |
|
449 | 0 | if (status != 0) |
450 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(pinfo->pool, status, &WERR_errors_ext, "Unknown DOS error 0x%08x")); |
451 | |
|
452 | 0 | return offset; |
453 | 0 | } |
454 | | |
455 | | static unsigned |
456 | | initshutdown_dissect_InitEx_request(tvbuff_t *tvb _U_, unsigned offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_) |
457 | 0 | { |
458 | 0 | di->dcerpc_procedure_name="InitEx"; |
459 | 0 | offset = initshutdown_dissect_element_InitEx_hostname(tvb, offset, pinfo, tree, di, drep); |
460 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
461 | 0 | offset = initshutdown_dissect_element_InitEx_message(tvb, offset, pinfo, tree, di, drep); |
462 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
463 | 0 | offset = initshutdown_dissect_element_InitEx_timeout(tvb, offset, pinfo, tree, di, drep); |
464 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
465 | 0 | offset = initshutdown_dissect_element_InitEx_force_apps(tvb, offset, pinfo, tree, di, drep); |
466 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
467 | 0 | offset = initshutdown_dissect_element_InitEx_do_reboot(tvb, offset, pinfo, tree, di, drep); |
468 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
469 | 0 | offset = initshutdown_dissect_element_InitEx_reason(tvb, offset, pinfo, tree, di, drep); |
470 | 0 | offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep); |
471 | 0 | return offset; |
472 | 0 | } |
473 | | |
474 | | |
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 } |
483 | | }; |
484 | | |
485 | | void proto_register_dcerpc_initshutdown(void) |
486 | 15 | { |
487 | 15 | static hf_register_info hf[] = { |
488 | 15 | { &hf_initshutdown_initshutdown_Abort_server, |
489 | 15 | { "Server", "initshutdown.initshutdown_Abort.server", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
490 | 15 | { &hf_initshutdown_initshutdown_InitEx_do_reboot, |
491 | 15 | { "Do Reboot", "initshutdown.initshutdown_InitEx.do_reboot", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
492 | 15 | { &hf_initshutdown_initshutdown_InitEx_force_apps, |
493 | 15 | { "Force Apps", "initshutdown.initshutdown_InitEx.force_apps", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
494 | 15 | { &hf_initshutdown_initshutdown_InitEx_hostname, |
495 | 15 | { "Hostname", "initshutdown.initshutdown_InitEx.hostname", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
496 | 15 | { &hf_initshutdown_initshutdown_InitEx_message, |
497 | 15 | { "Message", "initshutdown.initshutdown_InitEx.message", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, |
498 | 15 | { &hf_initshutdown_initshutdown_InitEx_reason, |
499 | 15 | { "Reason", "initshutdown.initshutdown_InitEx.reason", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
500 | 15 | { &hf_initshutdown_initshutdown_InitEx_timeout, |
501 | 15 | { "Timeout", "initshutdown.initshutdown_InitEx.timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
502 | 15 | { &hf_initshutdown_initshutdown_Init_do_reboot, |
503 | 15 | { "Do Reboot", "initshutdown.initshutdown_Init.do_reboot", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
504 | 15 | { &hf_initshutdown_initshutdown_Init_force_apps, |
505 | 15 | { "Force Apps", "initshutdown.initshutdown_Init.force_apps", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
506 | 15 | { &hf_initshutdown_initshutdown_Init_hostname, |
507 | 15 | { "Hostname", "initshutdown.initshutdown_Init.hostname", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
508 | 15 | { &hf_initshutdown_initshutdown_Init_message, |
509 | 15 | { "Message", "initshutdown.initshutdown_Init.message", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, |
510 | 15 | { &hf_initshutdown_initshutdown_Init_timeout, |
511 | 15 | { "Timeout", "initshutdown.initshutdown_Init.timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
512 | 15 | { &hf_initshutdown_initshutdown_ReasonFlags_SHTDN_REASON_FLAG_PLANNED, |
513 | 15 | { "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 | 15 | { &hf_initshutdown_initshutdown_ReasonFlags_SHTDN_REASON_FLAG_USER_DEFINED, |
515 | 15 | { "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 | 15 | { &hf_initshutdown_opnum, |
517 | 15 | { "Operation", "initshutdown.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
518 | 15 | { &hf_initshutdown_werror, |
519 | 15 | { "Windows Error", "initshutdown.werror", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &WERR_errors_ext, 0, NULL, HFILL }}, |
520 | 15 | }; |
521 | | |
522 | | |
523 | 15 | static int *ett[] = { |
524 | 15 | &ett_dcerpc_initshutdown, |
525 | 15 | &ett_initshutdown_initshutdown_ReasonFlags, |
526 | 15 | }; |
527 | | |
528 | 15 | proto_dcerpc_initshutdown = proto_register_protocol("Init shutdown service", "INITSHUTDOWN", "initshutdown"); |
529 | 15 | proto_register_field_array(proto_dcerpc_initshutdown, hf, array_length (hf)); |
530 | 15 | proto_register_subtree_array(ett, array_length(ett)); |
531 | 15 | } |
532 | | |
533 | | void proto_reg_handoff_dcerpc_initshutdown(void) |
534 | 15 | { |
535 | 15 | dcerpc_init_uuid(proto_dcerpc_initshutdown, ett_dcerpc_initshutdown, |
536 | 15 | &uuid_dcerpc_initshutdown, ver_dcerpc_initshutdown, |
537 | 15 | initshutdown_dissectors, hf_initshutdown_opnum); |
538 | 15 | } |