FIXUP: WIP: verification_trailer
[wireshark-wip.git] / epan / dissectors / packet-dcerpc-dssetup.c
blob78237fadfe197dd590895eb2c5dcf5b119d8e231
1 /* DO NOT EDIT
2 This filter was automatically generated
3 from dssetup.idl and dssetup.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 http://wiki.wireshark.org/Pidl
10 $Id$
14 #include "config.h"
15 #ifdef _MSC_VER
16 #pragma warning(disable:4005)
17 #pragma warning(disable:4013)
18 #pragma warning(disable:4018)
19 #pragma warning(disable:4101)
20 #endif
22 #include <glib.h>
23 #include <string.h>
24 #include <epan/packet.h>
26 #include "packet-dcerpc.h"
27 #include "packet-dcerpc-nt.h"
28 #include "packet-windows-common.h"
29 #include "packet-dcerpc-dssetup.h"
31 /* Ett declarations */
32 static gint ett_dcerpc_dssetup = -1;
33 static gint ett_dssetup_dssetup_DsRoleFlags = -1;
34 static gint ett_dssetup_dssetup_DsRolePrimaryDomInfoBasic = -1;
35 static gint ett_dssetup_dssetup_DsRoleUpgradeStatus = -1;
36 static gint ett_dssetup_dssetup_DsRoleOpStatus = -1;
37 static gint ett_dssetup_dssetup_DsRoleInfo = -1;
40 /* Header field declarations */
41 static gint hf_dssetup_dssetup_DsRoleGetPrimaryDomainInformation_level = -1;
42 static gint hf_dssetup_opnum = -1;
43 static gint hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_flags = -1;
44 static gint hf_dssetup_dssetup_DsRoleUpgradeStatus_previous_role = -1;
45 static gint hf_dssetup_dssetup_DsRoleInfo_opstatus = -1;
46 static gint hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_domain_guid = -1;
47 static gint hf_dssetup_dssetup_DsRoleOpStatus_status = -1;
48 static gint hf_dssetup_dssetup_DsRoleInfo_upgrade = -1;
49 static gint hf_dssetup_dssetup_DsRoleGetPrimaryDomainInformation_info = -1;
50 static gint hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS = -1;
51 static gint hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT = -1;
52 static gint hf_dssetup_dssetup_DsRoleInfo_basic = -1;
53 static gint hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_role = -1;
54 static gint hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING = -1;
55 static gint hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_dns_domain = -1;
56 static gint hf_dssetup_dssetup_DsRoleUpgradeStatus_upgrading = -1;
57 static gint hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_domain = -1;
58 static gint hf_dssetup_werror = -1;
59 static gint hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE = -1;
60 static gint hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_forest = -1;
62 static gint proto_dcerpc_dssetup = -1;
63 /* Version information */
66 static e_uuid_t uuid_dcerpc_dssetup = {
67 0x3919286a, 0xb10c, 0x11d0,
68 { 0x9b, 0xa8, 0x00, 0xc0, 0x4f, 0xd9, 0x2e, 0xf5 }
70 static guint16 ver_dcerpc_dssetup = 0;
72 const value_string dssetup_dssetup_DsRole_vals[] = {
73 { DS_ROLE_STANDALONE_WORKSTATION, "DS_ROLE_STANDALONE_WORKSTATION" },
74 { DS_ROLE_MEMBER_WORKSTATION, "DS_ROLE_MEMBER_WORKSTATION" },
75 { DS_ROLE_STANDALONE_SERVER, "DS_ROLE_STANDALONE_SERVER" },
76 { DS_ROLE_MEMBER_SERVER, "DS_ROLE_MEMBER_SERVER" },
77 { DS_ROLE_BACKUP_DC, "DS_ROLE_BACKUP_DC" },
78 { DS_ROLE_PRIMARY_DC, "DS_ROLE_PRIMARY_DC" },
79 { 0, NULL }
81 static const true_false_string dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING_tfs = {
82 "DS_ROLE_PRIMARY_DS_RUNNING is SET",
83 "DS_ROLE_PRIMARY_DS_RUNNING is NOT SET",
85 static const true_false_string dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE_tfs = {
86 "DS_ROLE_PRIMARY_DS_MIXED_MODE is SET",
87 "DS_ROLE_PRIMARY_DS_MIXED_MODE is NOT SET",
89 static const true_false_string dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS_tfs = {
90 "DS_ROLE_UPGRADE_IN_PROGRESS is SET",
91 "DS_ROLE_UPGRADE_IN_PROGRESS is NOT SET",
93 static const true_false_string dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT_tfs = {
94 "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT is SET",
95 "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT is NOT SET",
97 static int dssetup_dissect_element_DsRolePrimaryDomInfoBasic_role(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
98 static int dssetup_dissect_element_DsRolePrimaryDomInfoBasic_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
99 static int dssetup_dissect_element_DsRolePrimaryDomInfoBasic_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
100 static int dssetup_dissect_element_DsRolePrimaryDomInfoBasic_domain_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
101 static int dssetup_dissect_element_DsRolePrimaryDomInfoBasic_dns_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
102 static int dssetup_dissect_element_DsRolePrimaryDomInfoBasic_dns_domain_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
103 static int dssetup_dissect_element_DsRolePrimaryDomInfoBasic_forest(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
104 static int dssetup_dissect_element_DsRolePrimaryDomInfoBasic_forest_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
105 static int dssetup_dissect_element_DsRolePrimaryDomInfoBasic_domain_guid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
106 const value_string dssetup_dssetup_DsUpgrade_vals[] = {
107 { DS_ROLE_NOT_UPGRADING, "DS_ROLE_NOT_UPGRADING" },
108 { DS_ROLE_UPGRADING, "DS_ROLE_UPGRADING" },
109 { 0, NULL }
111 const value_string dssetup_dssetup_DsPrevious_vals[] = {
112 { DS_ROLE_PREVIOUS_UNKNOWN, "DS_ROLE_PREVIOUS_UNKNOWN" },
113 { DS_ROLE_PREVIOUS_PRIMARY, "DS_ROLE_PREVIOUS_PRIMARY" },
114 { DS_ROLE_PREVIOUS_BACKUP, "DS_ROLE_PREVIOUS_BACKUP" },
115 { 0, NULL }
117 static int dssetup_dissect_element_DsRoleUpgradeStatus_upgrading(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
118 static int dssetup_dissect_element_DsRoleUpgradeStatus_previous_role(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
119 const value_string dssetup_dssetup_DsRoleOp_vals[] = {
120 { DS_ROLE_OP_IDLE, "DS_ROLE_OP_IDLE" },
121 { DS_ROLE_OP_ACTIVE, "DS_ROLE_OP_ACTIVE" },
122 { DS_ROLE_OP_NEEDS_REBOOT, "DS_ROLE_OP_NEEDS_REBOOT" },
123 { 0, NULL }
125 static int dssetup_dissect_element_DsRoleOpStatus_status(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
126 const value_string dssetup_dssetup_DsRoleInfoLevel_vals[] = {
127 { DS_ROLE_BASIC_INFORMATION, "DS_ROLE_BASIC_INFORMATION" },
128 { DS_ROLE_UPGRADE_STATUS, "DS_ROLE_UPGRADE_STATUS" },
129 { DS_ROLE_OP_STATUS, "DS_ROLE_OP_STATUS" },
130 { 0, NULL }
132 static int dssetup_dissect_element_DsRoleInfo_basic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
133 static int dssetup_dissect_element_DsRoleInfo_upgrade(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
134 static int dssetup_dissect_element_DsRoleInfo_opstatus(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
135 static int dssetup_dissect_element_DsRoleGetPrimaryDomainInformation_level(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
136 static int dssetup_dissect_element_DsRoleGetPrimaryDomainInformation_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
137 static int dssetup_dissect_element_DsRoleGetPrimaryDomainInformation_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
140 /* IDL: enum { */
141 /* IDL: DS_ROLE_STANDALONE_WORKSTATION=0, */
142 /* IDL: DS_ROLE_MEMBER_WORKSTATION=1, */
143 /* IDL: DS_ROLE_STANDALONE_SERVER=2, */
144 /* IDL: DS_ROLE_MEMBER_SERVER=3, */
145 /* IDL: DS_ROLE_BACKUP_DC=4, */
146 /* IDL: DS_ROLE_PRIMARY_DC=5, */
147 /* IDL: } */
150 dssetup_dissect_enum_DsRole(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
152 guint1632 parameter=0;
153 if(param){
154 parameter=(guint1632)*param;
156 offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
157 if(param){
158 *param=(guint32)parameter;
160 return offset;
164 /* IDL: bitmap { */
165 /* IDL: DS_ROLE_PRIMARY_DS_RUNNING = 0x00000001 , */
166 /* IDL: DS_ROLE_PRIMARY_DS_MIXED_MODE = 0x00000002 , */
167 /* IDL: DS_ROLE_UPGRADE_IN_PROGRESS = 0x00000004 , */
168 /* IDL: DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT = 0x01000000 , */
169 /* IDL: } */
172 dssetup_dissect_bitmap_DsRoleFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
174 proto_item *item = NULL;
175 proto_tree *tree = NULL;
177 guint32 flags;
178 ALIGN_TO_4_BYTES;
180 if (parent_tree) {
181 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 4, DREP_ENC_INTEGER(drep));
182 tree = proto_item_add_subtree(item,ett_dssetup_dssetup_DsRoleFlags);
185 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, di, drep, -1, &flags);
186 proto_item_append_text(item, ": ");
188 if (!flags)
189 proto_item_append_text(item, "(No values set)");
191 proto_tree_add_boolean(tree, hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING, tvb, offset-4, 4, flags);
192 if (flags&( 0x00000001 )){
193 proto_item_append_text(item, "DS_ROLE_PRIMARY_DS_RUNNING");
194 if (flags & (~( 0x00000001 )))
195 proto_item_append_text(item, ", ");
197 flags&=(~( 0x00000001 ));
199 proto_tree_add_boolean(tree, hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE, tvb, offset-4, 4, flags);
200 if (flags&( 0x00000002 )){
201 proto_item_append_text(item, "DS_ROLE_PRIMARY_DS_MIXED_MODE");
202 if (flags & (~( 0x00000002 )))
203 proto_item_append_text(item, ", ");
205 flags&=(~( 0x00000002 ));
207 proto_tree_add_boolean(tree, hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS, tvb, offset-4, 4, flags);
208 if (flags&( 0x00000004 )){
209 proto_item_append_text(item, "DS_ROLE_UPGRADE_IN_PROGRESS");
210 if (flags & (~( 0x00000004 )))
211 proto_item_append_text(item, ", ");
213 flags&=(~( 0x00000004 ));
215 proto_tree_add_boolean(tree, hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT, tvb, offset-4, 4, flags);
216 if (flags&( 0x01000000 )){
217 proto_item_append_text(item, "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT");
218 if (flags & (~( 0x01000000 )))
219 proto_item_append_text(item, ", ");
221 flags&=(~( 0x01000000 ));
223 if (flags) {
224 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
227 return offset;
231 /* IDL: struct { */
232 /* IDL: dssetup_DsRole role; */
233 /* IDL: dssetup_DsRoleFlags flags; */
234 /* IDL: [unique(1)] [charset(UTF16)] uint16 *domain; */
235 /* IDL: [unique(1)] [charset(UTF16)] uint16 *dns_domain; */
236 /* IDL: [unique(1)] [charset(UTF16)] uint16 *forest; */
237 /* IDL: GUID domain_guid; */
238 /* IDL: } */
240 static int
241 dssetup_dissect_element_DsRolePrimaryDomInfoBasic_role(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
243 offset = dssetup_dissect_enum_DsRole(tvb, offset, pinfo, tree, di, drep, hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_role, 0);
245 return offset;
248 static int
249 dssetup_dissect_element_DsRolePrimaryDomInfoBasic_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
251 offset = dssetup_dissect_bitmap_DsRoleFlags(tvb, offset, pinfo, tree, di, drep, hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_flags, 0);
253 return offset;
256 static int
257 dssetup_dissect_element_DsRolePrimaryDomInfoBasic_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
259 offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, di, drep, dssetup_dissect_element_DsRolePrimaryDomInfoBasic_domain_, NDR_POINTER_UNIQUE, "Pointer to Domain (uint16)",hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_domain);
261 return offset;
264 static int
265 dssetup_dissect_element_DsRolePrimaryDomInfoBasic_domain_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
267 char *data;
269 offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(guint16), hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_domain, FALSE, &data);
270 proto_item_append_text(tree, ": %s", data);
272 return offset;
275 static int
276 dssetup_dissect_element_DsRolePrimaryDomInfoBasic_dns_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
278 offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, di, drep, dssetup_dissect_element_DsRolePrimaryDomInfoBasic_dns_domain_, NDR_POINTER_UNIQUE, "Pointer to Dns Domain (uint16)",hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_dns_domain);
280 return offset;
283 static int
284 dssetup_dissect_element_DsRolePrimaryDomInfoBasic_dns_domain_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
286 char *data;
288 offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(guint16), hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_dns_domain, FALSE, &data);
289 proto_item_append_text(tree, ": %s", data);
291 return offset;
294 static int
295 dssetup_dissect_element_DsRolePrimaryDomInfoBasic_forest(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
297 offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, di, drep, dssetup_dissect_element_DsRolePrimaryDomInfoBasic_forest_, NDR_POINTER_UNIQUE, "Pointer to Forest (uint16)",hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_forest);
299 return offset;
302 static int
303 dssetup_dissect_element_DsRolePrimaryDomInfoBasic_forest_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
305 char *data;
307 offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(guint16), hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_forest, FALSE, &data);
308 proto_item_append_text(tree, ": %s", data);
310 return offset;
313 static int
314 dssetup_dissect_element_DsRolePrimaryDomInfoBasic_domain_guid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
316 offset = dissect_ndr_uuid_t(tvb, offset, pinfo, tree, di, drep, hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_domain_guid, NULL);
318 return offset;
322 dssetup_dissect_struct_DsRolePrimaryDomInfoBasic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
324 proto_item *item = NULL;
325 proto_tree *tree = NULL;
326 int old_offset;
328 ALIGN_TO_5_BYTES;
330 old_offset = offset;
332 if (parent_tree) {
333 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
334 tree = proto_item_add_subtree(item, ett_dssetup_dssetup_DsRolePrimaryDomInfoBasic);
337 offset = dssetup_dissect_element_DsRolePrimaryDomInfoBasic_role(tvb, offset, pinfo, tree, di, drep);
339 offset = dssetup_dissect_element_DsRolePrimaryDomInfoBasic_flags(tvb, offset, pinfo, tree, di, drep);
341 offset = dssetup_dissect_element_DsRolePrimaryDomInfoBasic_domain(tvb, offset, pinfo, tree, di, drep);
343 offset = dssetup_dissect_element_DsRolePrimaryDomInfoBasic_dns_domain(tvb, offset, pinfo, tree, di, drep);
345 offset = dssetup_dissect_element_DsRolePrimaryDomInfoBasic_forest(tvb, offset, pinfo, tree, di, drep);
347 offset = dssetup_dissect_element_DsRolePrimaryDomInfoBasic_domain_guid(tvb, offset, pinfo, tree, di, drep);
350 proto_item_set_len(item, offset-old_offset);
353 if (di->call_data->flags & DCERPC_IS_NDR64) {
354 ALIGN_TO_5_BYTES;
357 return offset;
361 /* IDL: enum { */
362 /* IDL: DS_ROLE_NOT_UPGRADING=0, */
363 /* IDL: DS_ROLE_UPGRADING=1, */
364 /* IDL: } */
367 dssetup_dissect_enum_DsUpgrade(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
369 guint32 parameter=0;
370 if(param){
371 parameter=(guint32)*param;
373 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
374 if(param){
375 *param=(guint32)parameter;
377 return offset;
381 /* IDL: enum { */
382 /* IDL: DS_ROLE_PREVIOUS_UNKNOWN=0, */
383 /* IDL: DS_ROLE_PREVIOUS_PRIMARY=1, */
384 /* IDL: DS_ROLE_PREVIOUS_BACKUP=2, */
385 /* IDL: } */
388 dssetup_dissect_enum_DsPrevious(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
390 guint1632 parameter=0;
391 if(param){
392 parameter=(guint1632)*param;
394 offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
395 if(param){
396 *param=(guint32)parameter;
398 return offset;
402 /* IDL: struct { */
403 /* IDL: dssetup_DsUpgrade upgrading; */
404 /* IDL: dssetup_DsPrevious previous_role; */
405 /* IDL: } */
407 static int
408 dssetup_dissect_element_DsRoleUpgradeStatus_upgrading(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
410 offset = dssetup_dissect_enum_DsUpgrade(tvb, offset, pinfo, tree, di, drep, hf_dssetup_dssetup_DsRoleUpgradeStatus_upgrading, 0);
412 return offset;
415 static int
416 dssetup_dissect_element_DsRoleUpgradeStatus_previous_role(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
418 offset = dssetup_dissect_enum_DsPrevious(tvb, offset, pinfo, tree, di, drep, hf_dssetup_dssetup_DsRoleUpgradeStatus_previous_role, 0);
420 return offset;
424 dssetup_dissect_struct_DsRoleUpgradeStatus(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
426 proto_item *item = NULL;
427 proto_tree *tree = NULL;
428 int old_offset;
430 ALIGN_TO_4_BYTES;
432 old_offset = offset;
434 if (parent_tree) {
435 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
436 tree = proto_item_add_subtree(item, ett_dssetup_dssetup_DsRoleUpgradeStatus);
439 offset = dssetup_dissect_element_DsRoleUpgradeStatus_upgrading(tvb, offset, pinfo, tree, di, drep);
441 offset = dssetup_dissect_element_DsRoleUpgradeStatus_previous_role(tvb, offset, pinfo, tree, di, drep);
444 proto_item_set_len(item, offset-old_offset);
447 if (di->call_data->flags & DCERPC_IS_NDR64) {
448 ALIGN_TO_4_BYTES;
451 return offset;
455 /* IDL: enum { */
456 /* IDL: DS_ROLE_OP_IDLE=0, */
457 /* IDL: DS_ROLE_OP_ACTIVE=1, */
458 /* IDL: DS_ROLE_OP_NEEDS_REBOOT=2, */
459 /* IDL: } */
462 dssetup_dissect_enum_DsRoleOp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
464 guint1632 parameter=0;
465 if(param){
466 parameter=(guint1632)*param;
468 offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
469 if(param){
470 *param=(guint32)parameter;
472 return offset;
476 /* IDL: struct { */
477 /* IDL: dssetup_DsRoleOp status; */
478 /* IDL: } */
480 static int
481 dssetup_dissect_element_DsRoleOpStatus_status(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
483 offset = dssetup_dissect_enum_DsRoleOp(tvb, offset, pinfo, tree, di, drep, hf_dssetup_dssetup_DsRoleOpStatus_status, 0);
485 return offset;
489 dssetup_dissect_struct_DsRoleOpStatus(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
491 proto_item *item = NULL;
492 proto_tree *tree = NULL;
493 int old_offset;
495 ALIGN_TO_3_BYTES;
497 old_offset = offset;
499 if (parent_tree) {
500 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
501 tree = proto_item_add_subtree(item, ett_dssetup_dssetup_DsRoleOpStatus);
504 offset = dssetup_dissect_element_DsRoleOpStatus_status(tvb, offset, pinfo, tree, di, drep);
507 proto_item_set_len(item, offset-old_offset);
510 if (di->call_data->flags & DCERPC_IS_NDR64) {
511 ALIGN_TO_3_BYTES;
514 return offset;
518 /* IDL: enum { */
519 /* IDL: DS_ROLE_BASIC_INFORMATION=1, */
520 /* IDL: DS_ROLE_UPGRADE_STATUS=2, */
521 /* IDL: DS_ROLE_OP_STATUS=3, */
522 /* IDL: } */
525 dssetup_dissect_enum_DsRoleInfoLevel(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
527 guint1632 parameter=0;
528 if(param){
529 parameter=(guint1632)*param;
531 offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
532 if(param){
533 *param=(guint32)parameter;
535 return offset;
539 /* IDL: [switch_type(dssetup_DsRoleInfoLevel)] union { */
540 /* IDL: [case(DS_ROLE_BASIC_INFORMATION)] [case(DS_ROLE_BASIC_INFORMATION)] dssetup_DsRolePrimaryDomInfoBasic basic; */
541 /* IDL: [case(DS_ROLE_UPGRADE_STATUS)] [case(DS_ROLE_UPGRADE_STATUS)] dssetup_DsRoleUpgradeStatus upgrade; */
542 /* IDL: [case(DS_ROLE_OP_STATUS)] [case(DS_ROLE_OP_STATUS)] dssetup_DsRoleOpStatus opstatus; */
543 /* IDL: } */
545 static int
546 dssetup_dissect_element_DsRoleInfo_basic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
548 offset = dssetup_dissect_struct_DsRolePrimaryDomInfoBasic(tvb,offset,pinfo,tree,di,drep,hf_dssetup_dssetup_DsRoleInfo_basic,0);
550 return offset;
553 static int
554 dssetup_dissect_element_DsRoleInfo_upgrade(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
556 offset = dssetup_dissect_struct_DsRoleUpgradeStatus(tvb,offset,pinfo,tree,di,drep,hf_dssetup_dssetup_DsRoleInfo_upgrade,0);
558 return offset;
561 static int
562 dssetup_dissect_element_DsRoleInfo_opstatus(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
564 offset = dssetup_dissect_struct_DsRoleOpStatus(tvb,offset,pinfo,tree,di,drep,hf_dssetup_dssetup_DsRoleInfo_opstatus,0);
566 return offset;
569 static int
570 dssetup_dissect_DsRoleInfo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
572 proto_item *item = NULL;
573 proto_tree *tree = NULL;
574 int old_offset;
575 guint1632 level;
577 old_offset = offset;
578 if (parent_tree) {
579 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "dssetup_DsRoleInfo");
580 tree = proto_item_add_subtree(item, ett_dssetup_dssetup_DsRoleInfo);
583 offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, di, drep, hf_index, &level);
584 ALIGN_TO_5_BYTES;
586 switch(level) {
587 case DS_ROLE_BASIC_INFORMATION:
588 offset = dssetup_dissect_element_DsRoleInfo_basic(tvb, offset, pinfo, tree, di, drep);
589 break;
591 case DS_ROLE_UPGRADE_STATUS:
592 offset = dssetup_dissect_element_DsRoleInfo_upgrade(tvb, offset, pinfo, tree, di, drep);
593 break;
595 case DS_ROLE_OP_STATUS:
596 offset = dssetup_dissect_element_DsRoleInfo_opstatus(tvb, offset, pinfo, tree, di, drep);
597 break;
599 proto_item_set_len(item, offset-old_offset);
602 return offset;
604 static int
605 dssetup_dissect_element_DsRoleGetPrimaryDomainInformation_level(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
607 offset = dssetup_dissect_enum_DsRoleInfoLevel(tvb, offset, pinfo, tree, di, drep, hf_dssetup_dssetup_DsRoleGetPrimaryDomainInformation_level, 0);
609 return offset;
612 static int
613 dssetup_dissect_element_DsRoleGetPrimaryDomainInformation_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
615 offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, dssetup_dissect_element_DsRoleGetPrimaryDomainInformation_info_, NDR_POINTER_UNIQUE, "Pointer to Info (dssetup_DsRoleInfo)",hf_dssetup_dssetup_DsRoleGetPrimaryDomainInformation_info);
617 return offset;
620 static int
621 dssetup_dissect_element_DsRoleGetPrimaryDomainInformation_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
623 offset = dssetup_dissect_DsRoleInfo(tvb, offset, pinfo, tree, di, drep, hf_dssetup_dssetup_DsRoleGetPrimaryDomainInformation_info, 0);
625 return offset;
628 /* IDL: WERROR dssetup_DsRoleGetPrimaryDomainInformation( */
629 /* IDL: [in] dssetup_DsRoleInfoLevel level, */
630 /* IDL: [out] [unique(1)] [switch_is(level)] dssetup_DsRoleInfo *info */
631 /* IDL: ); */
633 static int
634 dssetup_dissect_DsRoleGetPrimaryDomainInformation_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
636 guint32 status;
638 pinfo->dcerpc_procedure_name="DsRoleGetPrimaryDomainInformation";
639 offset = dssetup_dissect_element_DsRoleGetPrimaryDomainInformation_info(tvb, offset, pinfo, tree, di, drep);
640 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
642 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
644 if (status != 0)
645 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
647 return offset;
650 static int
651 dssetup_dissect_DsRoleGetPrimaryDomainInformation_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
653 pinfo->dcerpc_procedure_name="DsRoleGetPrimaryDomainInformation";
654 offset = dssetup_dissect_element_DsRoleGetPrimaryDomainInformation_level(tvb, offset, pinfo, tree, di, drep);
655 offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
656 return offset;
659 /* IDL: WERROR dssetup_DsRoleDnsNameToFlatName( */
660 /* IDL: */
661 /* IDL: ); */
663 static int
664 dssetup_dissect_DsRoleDnsNameToFlatName_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
666 guint32 status;
668 pinfo->dcerpc_procedure_name="DsRoleDnsNameToFlatName";
669 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
671 if (status != 0)
672 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
674 return offset;
677 static int
678 dssetup_dissect_DsRoleDnsNameToFlatName_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
680 pinfo->dcerpc_procedure_name="DsRoleDnsNameToFlatName";
681 return offset;
684 /* IDL: WERROR dssetup_DsRoleDcAsDc( */
685 /* IDL: */
686 /* IDL: ); */
688 static int
689 dssetup_dissect_DsRoleDcAsDc_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
691 guint32 status;
693 pinfo->dcerpc_procedure_name="DsRoleDcAsDc";
694 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
696 if (status != 0)
697 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
699 return offset;
702 static int
703 dssetup_dissect_DsRoleDcAsDc_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
705 pinfo->dcerpc_procedure_name="DsRoleDcAsDc";
706 return offset;
709 /* IDL: WERROR dssetup_DsRoleDcAsReplica( */
710 /* IDL: */
711 /* IDL: ); */
713 static int
714 dssetup_dissect_DsRoleDcAsReplica_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
716 guint32 status;
718 pinfo->dcerpc_procedure_name="DsRoleDcAsReplica";
719 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
721 if (status != 0)
722 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
724 return offset;
727 static int
728 dssetup_dissect_DsRoleDcAsReplica_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
730 pinfo->dcerpc_procedure_name="DsRoleDcAsReplica";
731 return offset;
734 /* IDL: WERROR dssetup_DsRoleDemoteDc( */
735 /* IDL: */
736 /* IDL: ); */
738 static int
739 dssetup_dissect_DsRoleDemoteDc_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
741 guint32 status;
743 pinfo->dcerpc_procedure_name="DsRoleDemoteDc";
744 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
746 if (status != 0)
747 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
749 return offset;
752 static int
753 dssetup_dissect_DsRoleDemoteDc_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
755 pinfo->dcerpc_procedure_name="DsRoleDemoteDc";
756 return offset;
759 /* IDL: WERROR dssetup_DsRoleGetDcOperationProgress( */
760 /* IDL: */
761 /* IDL: ); */
763 static int
764 dssetup_dissect_DsRoleGetDcOperationProgress_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
766 guint32 status;
768 pinfo->dcerpc_procedure_name="DsRoleGetDcOperationProgress";
769 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
771 if (status != 0)
772 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
774 return offset;
777 static int
778 dssetup_dissect_DsRoleGetDcOperationProgress_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
780 pinfo->dcerpc_procedure_name="DsRoleGetDcOperationProgress";
781 return offset;
784 /* IDL: WERROR dssetup_DsRoleGetDcOperationResults( */
785 /* IDL: */
786 /* IDL: ); */
788 static int
789 dssetup_dissect_DsRoleGetDcOperationResults_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
791 guint32 status;
793 pinfo->dcerpc_procedure_name="DsRoleGetDcOperationResults";
794 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
796 if (status != 0)
797 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
799 return offset;
802 static int
803 dssetup_dissect_DsRoleGetDcOperationResults_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
805 pinfo->dcerpc_procedure_name="DsRoleGetDcOperationResults";
806 return offset;
809 /* IDL: WERROR dssetup_DsRoleCancel( */
810 /* IDL: */
811 /* IDL: ); */
813 static int
814 dssetup_dissect_DsRoleCancel_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
816 guint32 status;
818 pinfo->dcerpc_procedure_name="DsRoleCancel";
819 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
821 if (status != 0)
822 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
824 return offset;
827 static int
828 dssetup_dissect_DsRoleCancel_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
830 pinfo->dcerpc_procedure_name="DsRoleCancel";
831 return offset;
834 /* IDL: WERROR dssetup_DsRoleServerSaveStateForUpgrade( */
835 /* IDL: */
836 /* IDL: ); */
838 static int
839 dssetup_dissect_DsRoleServerSaveStateForUpgrade_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
841 guint32 status;
843 pinfo->dcerpc_procedure_name="DsRoleServerSaveStateForUpgrade";
844 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
846 if (status != 0)
847 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
849 return offset;
852 static int
853 dssetup_dissect_DsRoleServerSaveStateForUpgrade_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
855 pinfo->dcerpc_procedure_name="DsRoleServerSaveStateForUpgrade";
856 return offset;
859 /* IDL: WERROR dssetup_DsRoleUpgradeDownlevelServer( */
860 /* IDL: */
861 /* IDL: ); */
863 static int
864 dssetup_dissect_DsRoleUpgradeDownlevelServer_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
866 guint32 status;
868 pinfo->dcerpc_procedure_name="DsRoleUpgradeDownlevelServer";
869 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
871 if (status != 0)
872 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
874 return offset;
877 static int
878 dssetup_dissect_DsRoleUpgradeDownlevelServer_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
880 pinfo->dcerpc_procedure_name="DsRoleUpgradeDownlevelServer";
881 return offset;
884 /* IDL: WERROR dssetup_DsRoleAbortDownlevelServerUpgrade( */
885 /* IDL: */
886 /* IDL: ); */
888 static int
889 dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
891 guint32 status;
893 pinfo->dcerpc_procedure_name="DsRoleAbortDownlevelServerUpgrade";
894 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_dssetup_werror, &status);
896 if (status != 0)
897 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
899 return offset;
902 static int
903 dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
905 pinfo->dcerpc_procedure_name="DsRoleAbortDownlevelServerUpgrade";
906 return offset;
910 static dcerpc_sub_dissector dssetup_dissectors[] = {
911 { 0, "DsRoleGetPrimaryDomainInformation",
912 dssetup_dissect_DsRoleGetPrimaryDomainInformation_request, dssetup_dissect_DsRoleGetPrimaryDomainInformation_response},
913 { 1, "DsRoleDnsNameToFlatName",
914 dssetup_dissect_DsRoleDnsNameToFlatName_request, dssetup_dissect_DsRoleDnsNameToFlatName_response},
915 { 2, "DsRoleDcAsDc",
916 dssetup_dissect_DsRoleDcAsDc_request, dssetup_dissect_DsRoleDcAsDc_response},
917 { 3, "DsRoleDcAsReplica",
918 dssetup_dissect_DsRoleDcAsReplica_request, dssetup_dissect_DsRoleDcAsReplica_response},
919 { 4, "DsRoleDemoteDc",
920 dssetup_dissect_DsRoleDemoteDc_request, dssetup_dissect_DsRoleDemoteDc_response},
921 { 5, "DsRoleGetDcOperationProgress",
922 dssetup_dissect_DsRoleGetDcOperationProgress_request, dssetup_dissect_DsRoleGetDcOperationProgress_response},
923 { 6, "DsRoleGetDcOperationResults",
924 dssetup_dissect_DsRoleGetDcOperationResults_request, dssetup_dissect_DsRoleGetDcOperationResults_response},
925 { 7, "DsRoleCancel",
926 dssetup_dissect_DsRoleCancel_request, dssetup_dissect_DsRoleCancel_response},
927 { 8, "DsRoleServerSaveStateForUpgrade",
928 dssetup_dissect_DsRoleServerSaveStateForUpgrade_request, dssetup_dissect_DsRoleServerSaveStateForUpgrade_response},
929 { 9, "DsRoleUpgradeDownlevelServer",
930 dssetup_dissect_DsRoleUpgradeDownlevelServer_request, dssetup_dissect_DsRoleUpgradeDownlevelServer_response},
931 { 10, "DsRoleAbortDownlevelServerUpgrade",
932 dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_request, dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_response},
933 { 0, NULL, NULL, NULL }
936 void proto_register_dcerpc_dssetup(void)
938 static hf_register_info hf[] = {
939 { &hf_dssetup_dssetup_DsRoleGetPrimaryDomainInformation_level,
940 { "Level", "dssetup.dssetup_DsRoleGetPrimaryDomainInformation.level", FT_UINT1632, BASE_DEC, VALS(dssetup_dssetup_DsRoleInfoLevel_vals), 0, NULL, HFILL }},
941 { &hf_dssetup_opnum,
942 { "Operation", "dssetup.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
943 { &hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_flags,
944 { "Flags", "dssetup.dssetup_DsRolePrimaryDomInfoBasic.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
945 { &hf_dssetup_dssetup_DsRoleUpgradeStatus_previous_role,
946 { "Previous Role", "dssetup.dssetup_DsRoleUpgradeStatus.previous_role", FT_UINT1632, BASE_DEC, VALS(dssetup_dssetup_DsPrevious_vals), 0, NULL, HFILL }},
947 { &hf_dssetup_dssetup_DsRoleInfo_opstatus,
948 { "Opstatus", "dssetup.dssetup_DsRoleInfo.opstatus", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
949 { &hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_domain_guid,
950 { "Domain Guid", "dssetup.dssetup_DsRolePrimaryDomInfoBasic.domain_guid", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }},
951 { &hf_dssetup_dssetup_DsRoleOpStatus_status,
952 { "Status", "dssetup.dssetup_DsRoleOpStatus.status", FT_UINT1632, BASE_DEC, VALS(dssetup_dssetup_DsRoleOp_vals), 0, NULL, HFILL }},
953 { &hf_dssetup_dssetup_DsRoleInfo_upgrade,
954 { "Upgrade", "dssetup.dssetup_DsRoleInfo.upgrade", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
955 { &hf_dssetup_dssetup_DsRoleGetPrimaryDomainInformation_info,
956 { "Info", "dssetup.dssetup_DsRoleGetPrimaryDomainInformation.info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
957 { &hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS,
958 { "Ds Role Upgrade In Progress", "dssetup.dssetup_DsRoleFlags.DS_ROLE_UPGRADE_IN_PROGRESS", FT_BOOLEAN, 32, TFS(&dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS_tfs), ( 0x00000004 ), NULL, HFILL }},
959 { &hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT,
960 { "Ds Role Primary Domain Guid Present", "dssetup.dssetup_DsRoleFlags.DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", FT_BOOLEAN, 32, TFS(&dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT_tfs), ( 0x01000000 ), NULL, HFILL }},
961 { &hf_dssetup_dssetup_DsRoleInfo_basic,
962 { "Basic", "dssetup.dssetup_DsRoleInfo.basic", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
963 { &hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_role,
964 { "Role", "dssetup.dssetup_DsRolePrimaryDomInfoBasic.role", FT_UINT1632, BASE_DEC, VALS(dssetup_dssetup_DsRole_vals), 0, NULL, HFILL }},
965 { &hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING,
966 { "Ds Role Primary Ds Running", "dssetup.dssetup_DsRoleFlags.DS_ROLE_PRIMARY_DS_RUNNING", FT_BOOLEAN, 32, TFS(&dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING_tfs), ( 0x00000001 ), NULL, HFILL }},
967 { &hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_dns_domain,
968 { "Dns Domain", "dssetup.dssetup_DsRolePrimaryDomInfoBasic.dns_domain", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
969 { &hf_dssetup_dssetup_DsRoleUpgradeStatus_upgrading,
970 { "Upgrading", "dssetup.dssetup_DsRoleUpgradeStatus.upgrading", FT_UINT32, BASE_DEC, VALS(dssetup_dssetup_DsUpgrade_vals), 0, NULL, HFILL }},
971 { &hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_domain,
972 { "Domain", "dssetup.dssetup_DsRolePrimaryDomInfoBasic.domain", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
973 { &hf_dssetup_werror,
974 { "Windows Error", "dssetup.werror", FT_UINT32, BASE_HEX, VALS(WERR_errors), 0, NULL, HFILL }},
975 { &hf_dssetup_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE,
976 { "Ds Role Primary Ds Mixed Mode", "dssetup.dssetup_DsRoleFlags.DS_ROLE_PRIMARY_DS_MIXED_MODE", FT_BOOLEAN, 32, TFS(&dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE_tfs), ( 0x00000002 ), NULL, HFILL }},
977 { &hf_dssetup_dssetup_DsRolePrimaryDomInfoBasic_forest,
978 { "Forest", "dssetup.dssetup_DsRolePrimaryDomInfoBasic.forest", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
982 static gint *ett[] = {
983 &ett_dcerpc_dssetup,
984 &ett_dssetup_dssetup_DsRoleFlags,
985 &ett_dssetup_dssetup_DsRolePrimaryDomInfoBasic,
986 &ett_dssetup_dssetup_DsRoleUpgradeStatus,
987 &ett_dssetup_dssetup_DsRoleOpStatus,
988 &ett_dssetup_dssetup_DsRoleInfo,
991 proto_dcerpc_dssetup = proto_register_protocol("Active Directory Setup", "DSSETUP", "dssetup");
992 proto_register_field_array(proto_dcerpc_dssetup, hf, array_length (hf));
993 proto_register_subtree_array(ett, array_length(ett));
996 void proto_reg_handoff_dcerpc_dssetup(void)
998 dcerpc_init_uuid(proto_dcerpc_dssetup, ett_dcerpc_dssetup,
999 &uuid_dcerpc_dssetup, ver_dcerpc_dssetup,
1000 dssetup_dissectors, hf_dssetup_opnum);