make dissect_ber_choice take a guint* that will return the
[obnox/wireshark/wip.git] / epan / dissectors / packet-dcerpc-dssetup.c
1 /* DO NOT EDIT
2  * This dissector is autogenerated
3  */
4
5 /* packet-dcerpc-dssetup.c
6  * Routines for DS SETUP packet disassembly
7  *   ronnie sahlberg 2005
8  * Autogenerated based on the IDL definitions from samba 4
9  *
10  * $Id$
11  *
12  * Ethereal - Network traffic analyzer
13  * By Gerald Combs <gerald@ethereal.com>
14  * Copyright 1998 Gerald Combs
15  *
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
29  */
30
31 #ifdef HAVE_CONFIG_H
32 #include "config.h"
33 #endif
34
35 #include <glib.h>
36 #include <string.h>
37
38 #include <epan/packet.h>
39 #include "packet-dcerpc.h"
40 #include "packet-dcerpc-nt.h"
41 #include "packet-windows-common.h"
42 #include "packet-dcerpc-dssetup.h"
43
44 static int proto_dssetup = -1;
45
46
47 /* INCLUDED FILE : ETH_HF */
48 static int hf_dssetup_opnum = -1;
49 static int hf_dssetup_rc = -1;
50 static int hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING = -1;
51 static int hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE = -1;
52 static int hf_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS = -1;
53 static int hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT = -1;
54 static int hf_dssetup_DsRolePrimaryDomInfoBasic_role = -1;
55 static int hf_dssetup_DsRolePrimaryDomInfoBasic_flags = -1;
56 static int hf_dssetup_DsRolePrimaryDomInfoBasic_domain = -1;
57 static int hf_dssetup_DsRolePrimaryDomInfoBasic_dns_domain = -1;
58 static int hf_dssetup_DsRolePrimaryDomInfoBasic_forest = -1;
59 static int hf_dssetup_DsRolePrimaryDomInfoBasic_domain_guid = -1;
60 static int hf_dssetup_DsRoleUpgradeStatus_upgrading = -1;
61 static int hf_dssetup_DsRoleUpgradeStatus_previous_role = -1;
62 static int hf_dssetup_DsRoleOpStatus_status = -1;
63 static int hf_dssetup_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic = -1;
64 static int hf_dssetup_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade = -1;
65 static int hf_dssetup_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus = -1;
66 static int hf_dssetup_DsRoleGetPrimaryDomainInformation_level = -1;
67 static int hf_dssetup_DsRoleGetPrimaryDomainInformation_info = -1;
68 /* END OF INCLUDED FILE : ETH_HF */
69
70
71
72
73
74 /* INCLUDED FILE : ETH_ETT */
75 static gint ett_dssetup = -1;
76 static gint ett_dssetup_DsRoleFlags = -1;
77 static gint ett_dssetup_DsRolePrimaryDomInfoBasic = -1;
78 static gint ett_dssetup_DsRoleUpgradeStatus = -1;
79 static gint ett_dssetup_DsRoleOpStatus = -1;
80 static gint ett_dssetup_DsRoleInfo = -1;
81 /* END OF INCLUDED FILE : ETH_ETT */
82
83
84
85
86
87 /* INCLUDED FILE : ETH_CODE */
88 static e_uuid_t uuid_dcerpc_dssetup = {
89     0x3919286a, 0xb10c, 0x11d0,
90     { 0x9b, 0xa8, 0x00, 0xc0, 0x4f, 0xd9, 0x2e, 0xf5}
91 };
92
93 static guint16 ver_dssetup = 0;
94
95
96 const value_string dssetup_DsRole_vals[] = {
97     { 0 , "DS_ROLE_STANDALONE_WORKSTATION" },
98     { 1 , "DS_ROLE_MEMBER_WORKSTATION" },
99     { 2 , "DS_ROLE_STANDALONE_SERVER" },
100     { 3 , "DS_ROLE_MEMBER_SERVER" },
101     { 4 , "DS_ROLE_BACKUP_DC" },
102     { 5 , "DS_ROLE_PRIMARY_DC" },
103     { 0 , NULL }
104 };
105
106 int
107 dssetup_dissect_DsRole(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
108 {
109     offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL);
110     return offset;
111 }
112
113 static const true_false_string DS_ROLE_PRIMARY_DS_RUNNING_tfs = {
114     "DS_ROLE_PRIMARY_DS_RUNNING is SET",
115     "DS_ROLE_PRIMARY_DS_RUNNING is NOT set"
116 };
117
118 static const true_false_string DS_ROLE_PRIMARY_DS_MIXED_MODE_tfs = {
119     "DS_ROLE_PRIMARY_DS_MIXED_MODE is SET",
120     "DS_ROLE_PRIMARY_DS_MIXED_MODE is NOT set"
121 };
122
123 static const true_false_string DS_ROLE_UPGRADE_IN_PROGRESS_tfs = {
124     "DS_ROLE_UPGRADE_IN_PROGRESS is SET",
125     "DS_ROLE_UPGRADE_IN_PROGRESS is NOT set"
126 };
127
128 static const true_false_string DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT_tfs = {
129     "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT is SET",
130     "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT is NOT set"
131 };
132
133
134 int
135 dssetup_dissect_DsRoleFlags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
136 {
137     proto_item *item=NULL;
138     proto_tree *tree=NULL;
139     guint32 flags;
140
141     ALIGN_TO_4_BYTES;
142
143     if(parent_tree){
144         item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, 4, TRUE);
145         tree=proto_item_add_subtree(item, ett_dssetup_DsRoleFlags);
146     }
147
148     offset=dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &flags);
149
150
151     proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING, tvb, offset-4, 4, flags);
152     if(flags&0x00000001){
153         proto_item_append_text(item, " DS_ROLE_PRIMARY_DS_RUNNING");
154     }
155     flags&=(~0x00000001);
156
157     proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE, tvb, offset-4, 4, flags);
158     if(flags&0x00000002){
159         proto_item_append_text(item, " DS_ROLE_PRIMARY_DS_MIXED_MODE");
160     }
161     flags&=(~0x00000002);
162
163     proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS, tvb, offset-4, 4, flags);
164     if(flags&0x00000004){
165         proto_item_append_text(item, " DS_ROLE_UPGRADE_IN_PROGRESS");
166     }
167     flags&=(~0x00000004);
168
169     proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT, tvb, offset-4, 4, flags);
170     if(flags&0x01000000){
171         proto_item_append_text(item, " DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT");
172     }
173     flags&=(~0x01000000);
174
175     if(flags){
176         proto_item_append_text(item, "UNKNOWN-FLAGS");
177     }
178
179     return offset;
180 }
181 static int
182 dssetup_dissect_DsRolePrimaryDomInfoBasic_role(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
183 {
184     guint32 param=0;
185     offset=dssetup_dissect_DsRole(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_role, param);
186     return offset;
187 }
188
189 static int
190 dssetup_dissect_DsRolePrimaryDomInfoBasic_flags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
191 {
192     guint32 param=0;
193     offset=dssetup_dissect_DsRoleFlags(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_flags, param);
194     return offset;
195 }
196
197
198 static int
199 dssetup_dissect_unistr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
200 {
201     offset=dissect_ndr_cvstring(tvb, offset, pinfo, tree, drep, 2, hf_index, FALSE, NULL);
202     return offset;
203 }
204
205 static int
206 dssetup_dissect_DsRolePrimaryDomInfoBasic_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
207 {
208     guint32 param=0;
209     offset=dssetup_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_domain, param);
210     return offset;
211 }
212
213 static int
214 unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
215 {
216     offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRolePrimaryDomInfoBasic_domain, NDR_POINTER_UNIQUE, "domain", -1);
217     return offset;
218 }
219
220 static int
221 dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
222 {
223     guint32 param=0;
224     offset=dssetup_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_dns_domain, param);
225     return offset;
226 }
227
228 static int
229 unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
230 {
231     offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain, NDR_POINTER_UNIQUE, "dns_domain", -1);
232     return offset;
233 }
234
235 static int
236 dssetup_dissect_DsRolePrimaryDomInfoBasic_forest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
237 {
238     guint32 param=0;
239     offset=dssetup_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_forest, param);
240     return offset;
241 }
242
243 static int
244 unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_forest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
245 {
246     offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRolePrimaryDomInfoBasic_forest, NDR_POINTER_UNIQUE, "forest", -1);
247     return offset;
248 }
249
250
251 static int
252 dssetup_dissect_GUID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
253 {
254     offset=dissect_ndr_uuid_t(tvb, offset, pinfo, tree, drep, hf_index, NULL);
255     return offset;
256 }
257
258 static int
259 dssetup_dissect_DsRolePrimaryDomInfoBasic_domain_guid(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
260 {
261     guint32 param=0;
262     offset=dssetup_dissect_GUID(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_domain_guid, param);
263     return offset;
264 }
265
266
267 int
268 dssetup_dissect_DsRolePrimaryDomInfoBasic(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
269 {
270     proto_item *item=NULL;
271     proto_tree *tree=NULL;
272     int old_offset;
273
274     ALIGN_TO_4_BYTES;
275
276     old_offset=offset;
277     if(parent_tree){
278         item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
279         tree=proto_item_add_subtree(item, ett_dssetup_DsRolePrimaryDomInfoBasic);
280     }
281
282     offset=dssetup_dissect_DsRolePrimaryDomInfoBasic_role(tvb, offset, pinfo, tree, drep);
283
284     offset=dssetup_dissect_DsRolePrimaryDomInfoBasic_flags(tvb, offset, pinfo, tree, drep);
285
286     offset=unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_domain(tvb, offset, pinfo, tree, drep);
287
288     offset=unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain(tvb, offset, pinfo, tree, drep);
289
290     offset=unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_forest(tvb, offset, pinfo, tree, drep);
291
292     offset=dssetup_dissect_DsRolePrimaryDomInfoBasic_domain_guid(tvb, offset, pinfo, tree, drep);
293
294     proto_item_set_len(item, offset-old_offset);
295
296     return offset;
297 }
298
299 const value_string dssetup_DsUpgrade_vals[] = {
300     { 0 , "DS_ROLE_NOT_UPGRADING" },
301     { 1 , "DS_ROLE_UPGRADING" },
302     { 0 , NULL }
303 };
304
305 int
306 dssetup_dissect_DsUpgrade(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
307 {
308     offset=dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_index, NULL);
309     return offset;
310 }
311
312
313 const value_string dssetup_DsPrevious_vals[] = {
314     { 0 , "DS_ROLE_PREVIOUS_UNKNOWN" },
315     { 1 , "DS_ROLE_PREVIOUS_PRIMARY" },
316     { 2 , "DS_ROLE_PREVIOUS_BACKUP" },
317     { 0 , NULL }
318 };
319
320 int
321 dssetup_dissect_DsPrevious(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
322 {
323     offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL);
324     return offset;
325 }
326
327 static int
328 dssetup_dissect_DsRoleUpgradeStatus_upgrading(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
329 {
330     guint32 param=0;
331     offset=dssetup_dissect_DsUpgrade(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleUpgradeStatus_upgrading, param);
332     return offset;
333 }
334
335 static int
336 dssetup_dissect_DsRoleUpgradeStatus_previous_role(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
337 {
338     guint32 param=0;
339     offset=dssetup_dissect_DsPrevious(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleUpgradeStatus_previous_role, param);
340     return offset;
341 }
342
343
344 int
345 dssetup_dissect_DsRoleUpgradeStatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
346 {
347     proto_item *item=NULL;
348     proto_tree *tree=NULL;
349     int old_offset;
350
351     ALIGN_TO_4_BYTES;
352
353     old_offset=offset;
354     if(parent_tree){
355         item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
356         tree=proto_item_add_subtree(item, ett_dssetup_DsRoleUpgradeStatus);
357     }
358
359     offset=dssetup_dissect_DsRoleUpgradeStatus_upgrading(tvb, offset, pinfo, tree, drep);
360
361     offset=dssetup_dissect_DsRoleUpgradeStatus_previous_role(tvb, offset, pinfo, tree, drep);
362
363     proto_item_set_len(item, offset-old_offset);
364
365     return offset;
366 }
367
368 const value_string dssetup_DsRoleOp_vals[] = {
369     { 0 , "DS_ROLE_OP_IDLE" },
370     { 1 , "DS_ROLE_OP_ACTIVE" },
371     { 2 , "DS_ROLE_OP_NEEDS_REBOOT" },
372     { 0 , NULL }
373 };
374
375 int
376 dssetup_dissect_DsRoleOp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
377 {
378     offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL);
379     return offset;
380 }
381
382 static int
383 dssetup_dissect_DsRoleOpStatus_status(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
384 {
385     guint32 param=0;
386     offset=dssetup_dissect_DsRoleOp(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleOpStatus_status, param);
387     return offset;
388 }
389
390
391 int
392 dssetup_dissect_DsRoleOpStatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
393 {
394     proto_item *item=NULL;
395     proto_tree *tree=NULL;
396     int old_offset;
397
398     ALIGN_TO_2_BYTES;
399
400     old_offset=offset;
401     if(parent_tree){
402         item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
403         tree=proto_item_add_subtree(item, ett_dssetup_DsRoleOpStatus);
404     }
405
406     offset=dssetup_dissect_DsRoleOpStatus_status(tvb, offset, pinfo, tree, drep);
407
408     proto_item_set_len(item, offset-old_offset);
409
410     return offset;
411 }
412
413 const value_string dssetup_DsRoleInfoLevel_vals[] = {
414     { 1 , "DS_ROLE_BASIC_INFORMATION" },
415     { 2 , "DS_ROLE_UPGRADE_STATUS" },
416     { 3 , "DS_ROLE_OP_STATUS" },
417     { 0 , NULL }
418 };
419
420 int
421 dssetup_dissect_DsRoleInfoLevel(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
422 {
423     offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL);
424     return offset;
425 }
426
427 static int
428 dssetup_dissect_union_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
429 {
430     guint32 param=0;
431     offset=dssetup_dissect_DsRolePrimaryDomInfoBasic(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic, param);
432     return offset;
433 }
434
435 static int
436 dssetup_dissect_union_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
437 {
438     guint32 param=0;
439     offset=dssetup_dissect_DsRoleUpgradeStatus(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade, param);
440     return offset;
441 }
442
443 static int
444 dssetup_dissect_union_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
445 {
446     guint32 param=0;
447     offset=dssetup_dissect_DsRoleOpStatus(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus, param);
448     return offset;
449 }
450
451
452 static int
453 dssetup_dissect_union_DsRoleInfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
454 {
455     proto_item *item=NULL;
456     proto_tree *tree=NULL;
457     int old_offset;
458     guint16 level;
459
460     ALIGN_TO_2_BYTES;
461
462     old_offset=offset;
463     if(parent_tree){
464         item=proto_tree_add_text(parent_tree, tvb, offset, -1, "DsRoleInfo");
465         tree=proto_item_add_subtree(item, ett_dssetup_DsRoleInfo);
466     }
467
468     offset=dissect_ndr_uint16(tvb, offset, pinfo, tree,
469                               drep, hf_index, &level);
470
471     switch(level){
472     case DS_ROLE_BASIC_INFORMATION:
473         ALIGN_TO_4_BYTES;
474         offset=dssetup_dissect_union_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic(tvb, offset, pinfo, tree, drep);
475         break;
476
477     case DS_ROLE_UPGRADE_STATUS:
478         ALIGN_TO_4_BYTES;
479         offset=dssetup_dissect_union_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade(tvb, offset, pinfo, tree, drep);
480         break;
481
482     case DS_ROLE_OP_STATUS:
483         ALIGN_TO_2_BYTES;
484         offset=dssetup_dissect_union_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus(tvb, offset, pinfo, tree, drep);
485         break;
486
487     }
488
489     proto_item_set_len(item, offset-old_offset);
490
491    return offset;
492 }
493 static int
494 dssetup_dissect_DsRoleGetPrimaryDomainInformation_level(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
495 {
496     guint32 param=0;
497     offset=dssetup_dissect_DsRoleInfoLevel(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleGetPrimaryDomainInformation_level, param);
498     return offset;
499 }
500
501 static int
502 dssetup_dissect_DsRoleGetPrimaryDomainInformation_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
503 {
504     guint32 param=0;
505     offset=dssetup_dissect_union_DsRoleInfo(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleGetPrimaryDomainInformation_info, param);
506     return offset;
507 }
508
509 static int
510 unique_dssetup_dissect_DsRoleGetPrimaryDomainInformation_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
511 {
512     offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRoleGetPrimaryDomainInformation_info, NDR_POINTER_UNIQUE, "info", -1);
513     return offset;
514 }
515
516
517 static int
518 dssetup_dissect_DsRoleGetPrimaryDomainInformation_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
519 {
520         offset=dssetup_dissect_DsRoleGetPrimaryDomainInformation_level(tvb, offset, pinfo, tree, drep);
521         offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
522
523
524    return offset;
525 }
526
527 static int
528 dssetup_dissect_DsRoleGetPrimaryDomainInformation_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
529 {
530         offset=unique_dssetup_dissect_DsRoleGetPrimaryDomainInformation_info(tvb, offset, pinfo, tree, drep);
531         offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
532
533    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
534
535
536    return offset;
537 }
538
539 static int
540 dssetup_dissect_DsRoleDnsNameToFlatName_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
541 {
542
543    return offset;
544 }
545
546 static int
547 dssetup_dissect_DsRoleDnsNameToFlatName_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
548 {
549    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
550
551
552    return offset;
553 }
554
555 static int
556 dssetup_dissect_DsRoleDcAsDc_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
557 {
558
559    return offset;
560 }
561
562 static int
563 dssetup_dissect_DsRoleDcAsDc_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
564 {
565    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
566
567
568    return offset;
569 }
570
571 static int
572 dssetup_dissect_DsRoleDcAsReplica_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
573 {
574
575    return offset;
576 }
577
578 static int
579 dssetup_dissect_DsRoleDcAsReplica_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
580 {
581    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
582
583
584    return offset;
585 }
586
587 static int
588 dssetup_dissect_DsRoleDemoteDc_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
589 {
590
591    return offset;
592 }
593
594 static int
595 dssetup_dissect_DsRoleDemoteDc_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
596 {
597    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
598
599
600    return offset;
601 }
602
603 static int
604 dssetup_dissect_DsRoleGetDcOperationProgress_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
605 {
606
607    return offset;
608 }
609
610 static int
611 dssetup_dissect_DsRoleGetDcOperationProgress_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
612 {
613    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
614
615
616    return offset;
617 }
618
619 static int
620 dssetup_dissect_DsRoleGetDcOperationResults_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
621 {
622
623    return offset;
624 }
625
626 static int
627 dssetup_dissect_DsRoleGetDcOperationResults_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
628 {
629    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
630
631
632    return offset;
633 }
634
635 static int
636 dssetup_dissect_DsRoleCancel_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
637 {
638
639    return offset;
640 }
641
642 static int
643 dssetup_dissect_DsRoleCancel_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
644 {
645    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
646
647
648    return offset;
649 }
650
651 static int
652 dssetup_dissect_DsRoleServerSaveStateForUpgrade_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
653 {
654
655    return offset;
656 }
657
658 static int
659 dssetup_dissect_DsRoleServerSaveStateForUpgrade_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
660 {
661    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
662
663
664    return offset;
665 }
666
667 static int
668 dssetup_dissect_DsRoleUpgradeDownlevelServer_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
669 {
670
671    return offset;
672 }
673
674 static int
675 dssetup_dissect_DsRoleUpgradeDownlevelServer_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
676 {
677    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
678
679
680    return offset;
681 }
682
683 static int
684 dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
685 {
686
687    return offset;
688 }
689
690 static int
691 dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
692 {
693    offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL);
694
695
696    return offset;
697 }
698 /* END OF INCLUDED FILE : ETH_CODE */
699
700
701
702 void
703 proto_register_dssetup(void)
704 {
705         static hf_register_info hf[] = {
706
707
708 /* INCLUDED FILE : ETH_HFARR */
709         { &hf_dssetup_opnum,
710           { "Operation", "dssetup.opnum", FT_UINT16, BASE_DEC,
711           NULL, 0,
712          "", HFILL }},
713
714         { &hf_dssetup_rc,
715           { "Return code", "dssetup.rc", FT_UINT32, BASE_HEX,
716           VALS(NT_errors), 0,
717          "", HFILL }},
718
719         { &hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING,
720           { "DS_ROLE_PRIMARY_DS_RUNNING", "dssetup.DsRoleFlags.DS_ROLE_PRIMARY_DS_RUNNING", FT_BOOLEAN, 32,
721           TFS(&DS_ROLE_PRIMARY_DS_RUNNING_tfs), 0x00000001,
722          "", HFILL }},
723
724         { &hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE,
725           { "DS_ROLE_PRIMARY_DS_MIXED_MODE", "dssetup.DsRoleFlags.DS_ROLE_PRIMARY_DS_MIXED_MODE", FT_BOOLEAN, 32,
726           TFS(&DS_ROLE_PRIMARY_DS_MIXED_MODE_tfs), 0x00000002,
727          "", HFILL }},
728
729         { &hf_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS,
730           { "DS_ROLE_UPGRADE_IN_PROGRESS", "dssetup.DsRoleFlags.DS_ROLE_UPGRADE_IN_PROGRESS", FT_BOOLEAN, 32,
731           TFS(&DS_ROLE_UPGRADE_IN_PROGRESS_tfs), 0x00000004,
732          "", HFILL }},
733
734         { &hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT,
735           { "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", "dssetup.DsRoleFlags.DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", FT_BOOLEAN, 32,
736           TFS(&DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT_tfs), 0x01000000,
737          "", HFILL }},
738
739         { &hf_dssetup_DsRolePrimaryDomInfoBasic_role,
740           { "role", "dssetup.DsRolePrimaryDomInfoBasic.role", FT_INT16, BASE_DEC,
741           VALS(dssetup_DsRole_vals), 0,
742          "", HFILL }},
743
744         { &hf_dssetup_DsRolePrimaryDomInfoBasic_flags,
745           { "flags", "dssetup.DsRolePrimaryDomInfoBasic.flags", FT_UINT32, BASE_HEX,
746           NULL, 0,
747          "", HFILL }},
748
749         { &hf_dssetup_DsRolePrimaryDomInfoBasic_domain,
750           { "domain", "dssetup.DsRolePrimaryDomInfoBasic.domain", FT_STRING, BASE_DEC,
751           NULL, 0,
752          "", HFILL }},
753
754         { &hf_dssetup_DsRolePrimaryDomInfoBasic_dns_domain,
755           { "dns_domain", "dssetup.DsRolePrimaryDomInfoBasic.dns_domain", FT_STRING, BASE_DEC,
756           NULL, 0,
757          "", HFILL }},
758
759         { &hf_dssetup_DsRolePrimaryDomInfoBasic_forest,
760           { "forest", "dssetup.DsRolePrimaryDomInfoBasic.forest", FT_STRING, BASE_DEC,
761           NULL, 0,
762          "", HFILL }},
763
764         { &hf_dssetup_DsRolePrimaryDomInfoBasic_domain_guid,
765           { "domain_guid", "dssetup.DsRolePrimaryDomInfoBasic.domain_guid", FT_STRING, BASE_NONE,
766           NULL, 0,
767          "", HFILL }},
768
769         { &hf_dssetup_DsRoleUpgradeStatus_upgrading,
770           { "upgrading", "dssetup.DsRoleUpgradeStatus.upgrading", FT_INT32, BASE_DEC,
771           VALS(dssetup_DsUpgrade_vals), 0,
772          "", HFILL }},
773
774         { &hf_dssetup_DsRoleUpgradeStatus_previous_role,
775           { "previous_role", "dssetup.DsRoleUpgradeStatus.previous_role", FT_INT16, BASE_DEC,
776           VALS(dssetup_DsPrevious_vals), 0,
777          "", HFILL }},
778
779         { &hf_dssetup_DsRoleOpStatus_status,
780           { "status", "dssetup.DsRoleOpStatus.status", FT_INT16, BASE_DEC,
781           VALS(dssetup_DsRoleOp_vals), 0,
782          "", HFILL }},
783
784         { &hf_dssetup_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic,
785           { "basic", "dssetup.DsRoleInfo.basic", FT_NONE, BASE_NONE,
786           NULL, 0,
787          "", HFILL }},
788
789         { &hf_dssetup_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade,
790           { "upgrade", "dssetup.DsRoleInfo.upgrade", FT_NONE, BASE_NONE,
791           NULL, 0,
792          "", HFILL }},
793
794         { &hf_dssetup_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus,
795           { "opstatus", "dssetup.DsRoleInfo.opstatus", FT_NONE, BASE_NONE,
796           NULL, 0,
797          "", HFILL }},
798
799         { &hf_dssetup_DsRoleGetPrimaryDomainInformation_level,
800           { "level", "dssetup.DsRoleGetPrimaryDomainInformation.level", FT_INT16, BASE_DEC,
801           VALS(dssetup_DsRoleInfoLevel_vals), 0,
802          "", HFILL }},
803
804         { &hf_dssetup_DsRoleGetPrimaryDomainInformation_info,
805           { "info", "dssetup.DsRoleGetPrimaryDomainInformation.info", FT_UINT16, BASE_DEC,
806           NULL, 0,
807          "", HFILL }},
808
809 /* END OF INCLUDED FILE : ETH_HFARR */
810
811
812         };
813
814         static gint *ett[] = {
815
816
817 /* INCLUDED FILE : ETH_ETTARR */
818         &ett_dssetup,
819         &ett_dssetup_DsRoleFlags,
820         &ett_dssetup_DsRolePrimaryDomInfoBasic,
821         &ett_dssetup_DsRoleUpgradeStatus,
822         &ett_dssetup_DsRoleOpStatus,
823         &ett_dssetup_DsRoleInfo,
824 /* END OF INCLUDED FILE : ETH_ETTARR */
825
826
827         };
828
829         proto_dssetup = proto_register_protocol(
830                 "Active Directory Setup", 
831                 "DSSETUP", "dssetup");
832         proto_register_field_array(proto_dssetup, hf, array_length(hf));
833         proto_register_subtree_array(ett, array_length(ett));
834 }
835
836 static dcerpc_sub_dissector function_dissectors[] = {
837
838
839 /* INCLUDED FILE : ETH_FT */
840     { 0, "DsRoleGetPrimaryDomainInformation",
841         dssetup_dissect_DsRoleGetPrimaryDomainInformation_request,
842         dssetup_dissect_DsRoleGetPrimaryDomainInformation_response },
843     { 1, "DsRoleDnsNameToFlatName",
844         dssetup_dissect_DsRoleDnsNameToFlatName_request,
845         dssetup_dissect_DsRoleDnsNameToFlatName_response },
846     { 2, "DsRoleDcAsDc",
847         dssetup_dissect_DsRoleDcAsDc_request,
848         dssetup_dissect_DsRoleDcAsDc_response },
849     { 3, "DsRoleDcAsReplica",
850         dssetup_dissect_DsRoleDcAsReplica_request,
851         dssetup_dissect_DsRoleDcAsReplica_response },
852     { 4, "DsRoleDemoteDc",
853         dssetup_dissect_DsRoleDemoteDc_request,
854         dssetup_dissect_DsRoleDemoteDc_response },
855     { 5, "DsRoleGetDcOperationProgress",
856         dssetup_dissect_DsRoleGetDcOperationProgress_request,
857         dssetup_dissect_DsRoleGetDcOperationProgress_response },
858     { 6, "DsRoleGetDcOperationResults",
859         dssetup_dissect_DsRoleGetDcOperationResults_request,
860         dssetup_dissect_DsRoleGetDcOperationResults_response },
861     { 7, "DsRoleCancel",
862         dssetup_dissect_DsRoleCancel_request,
863         dssetup_dissect_DsRoleCancel_response },
864     { 8, "DsRoleServerSaveStateForUpgrade",
865         dssetup_dissect_DsRoleServerSaveStateForUpgrade_request,
866         dssetup_dissect_DsRoleServerSaveStateForUpgrade_response },
867     { 9, "DsRoleUpgradeDownlevelServer",
868         dssetup_dissect_DsRoleUpgradeDownlevelServer_request,
869         dssetup_dissect_DsRoleUpgradeDownlevelServer_response },
870     { 10, "DsRoleAbortDownlevelServerUpgrade",
871         dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_request,
872         dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_response },
873 /* END OF INCLUDED FILE : ETH_FT */
874
875
876         { 0, NULL, NULL, NULL },
877 };
878
879 void
880 proto_reg_handoff_dssetup(void)
881 {
882
883
884 /* INCLUDED FILE : ETH_HANDOFF */
885     dcerpc_init_uuid(proto_dssetup, ett_dssetup,
886         &uuid_dcerpc_dssetup, ver_dssetup,
887         function_dissectors, hf_dssetup_opnum);
888 /* END OF INCLUDED FILE : ETH_HANDOFF */
889
890
891 }
892