diff options
-rw-r--r-- | epan/dissectors/Makefile.common | 1 | ||||
-rw-r--r-- | epan/dissectors/dcerpc/dssetup/Makefile | 16 | ||||
-rw-r--r-- | epan/dissectors/dcerpc/dssetup/dssetup.cnf | 1 | ||||
-rw-r--r-- | epan/dissectors/dcerpc/dssetup/dssetup.idl | 103 | ||||
-rw-r--r-- | epan/dissectors/dcerpc/dssetup/packet-dcerpc-dssetup.c | 892 | ||||
-rw-r--r-- | epan/dissectors/dcerpc/dssetup/packet-dcerpc-dssetup.h | 81 | ||||
-rwxr-xr-x | epan/dissectors/dcerpc/dssetup/template.c | 79 | ||||
-rwxr-xr-x | epan/dissectors/dcerpc/dssetup/template.h | 35 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-dssetup.c | 1057 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-dssetup.h | 81 |
10 files changed, 2072 insertions, 274 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common index 9f34c98ad5..1a3c213d47 100644 --- a/epan/dissectors/Makefile.common +++ b/epan/dissectors/Makefile.common @@ -637,6 +637,7 @@ DISSECTOR_INCLUDES = \ packet-dcerpc-dfs.h \ packet-dcerpc-dnsserver.h \ packet-dcerpc-drsuapi.h \ + packet-dcerpc-dssetup.h \ packet-dcerpc-efs.h \ packet-dcerpc-eventlog.h \ packet-dcerpc-frsapi.h \ diff --git a/epan/dissectors/dcerpc/dssetup/Makefile b/epan/dissectors/dcerpc/dssetup/Makefile new file mode 100644 index 0000000000..67904dba06 --- /dev/null +++ b/epan/dissectors/dcerpc/dssetup/Makefile @@ -0,0 +1,16 @@ +# $Id: Makefile 13071 2005-01-16 10:19:21Z guy $ + +DISSECTOR_FILES=packet-dcerpc-dssetup.c packet-dcerpc-dssetup.h + +all: generate_dissector + +generate_dissector: $(DISSECTOR_FILES) + +$(DISSECTOR_FILES): ../idl2eth dssetup.idl dssetup.cnf template.c template.h + ../idl2eth dssetup + +clean: + rm -f ETH_* $(DISSECTOR_FILES) + +copy_files: generate_dissector + cp $(DISSECTOR_FILES) ../.. diff --git a/epan/dissectors/dcerpc/dssetup/dssetup.cnf b/epan/dissectors/dcerpc/dssetup/dssetup.cnf new file mode 100644 index 0000000000..792d600548 --- /dev/null +++ b/epan/dissectors/dcerpc/dssetup/dssetup.cnf @@ -0,0 +1 @@ +# diff --git a/epan/dissectors/dcerpc/dssetup/dssetup.idl b/epan/dissectors/dcerpc/dssetup/dssetup.idl new file mode 100644 index 0000000000..cff982673b --- /dev/null +++ b/epan/dissectors/dcerpc/dssetup/dssetup.idl @@ -0,0 +1,103 @@ +/* IDL file taken from samba4 svn revision 5672 */ + +#include "idl_types.h" + +/* + dssetup interface definition +*/ + +[ + uuid("3919286a-b10c-11d0-9ba8-00c04fd92ef5"), + version(0.0), + endpoint("ncacn_np:[\\pipe\\lsarpc]", "ncacn_np:[\\pipe\\lsass]", "ncacn_ip_tcp:", "ncalrpc:"), + pointer_default(unique), + helpstring("Active Directory Setup") +] interface dssetup +{ + /**********************************************/ + /* Function 0x00 */ + + typedef enum { + DS_ROLE_STANDALONE_WORKSTATION = 0, + DS_ROLE_MEMBER_WORKSTATION = 1, + DS_ROLE_STANDALONE_SERVER = 2, + DS_ROLE_MEMBER_SERVER = 3, + DS_ROLE_BACKUP_DC = 4, + DS_ROLE_PRIMARY_DC = 5 + } dssetup_DsRole; + + typedef [bitmap32bit] bitmap { + DS_ROLE_PRIMARY_DS_RUNNING = 0x00000001, + DS_ROLE_PRIMARY_DS_MIXED_MODE = 0x00000002, + DS_ROLE_UPGRADE_IN_PROGRESS = 0x00000004, + DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT = 0x01000000 + } dssetup_DsRoleFlags; + + typedef struct { + dssetup_DsRole role; + dssetup_DsRoleFlags flags; + unistr *domain; + unistr *dns_domain; + unistr *forest; + GUID domain_guid; + } dssetup_DsRolePrimaryDomInfoBasic; + + typedef [v1_enum] enum { + DS_ROLE_NOT_UPGRADING = 0, + DS_ROLE_UPGRADING = 1 + } dssetup_DsUpgrade; + + typedef enum { + DS_ROLE_PREVIOUS_UNKNOWN = 0, + DS_ROLE_PREVIOUS_PRIMARY = 1, + DS_ROLE_PREVIOUS_BACKUP = 2 + } dssetup_DsPrevious; + + typedef struct { + dssetup_DsUpgrade upgrading; + dssetup_DsPrevious previous_role; + } dssetup_DsRoleUpgradeStatus; + + typedef enum { + DS_ROLE_OP_IDLE = 0, + DS_ROLE_OP_ACTIVE = 1, + DS_ROLE_OP_NEEDS_REBOOT = 2 + } dssetup_DsRoleOp; + + typedef struct { + dssetup_DsRoleOp status; + } dssetup_DsRoleOpStatus; + + typedef enum { + DS_ROLE_BASIC_INFORMATION = 1, + DS_ROLE_UPGRADE_STATUS = 2, + DS_ROLE_OP_STATUS = 3 + } dssetup_DsRoleInfoLevel; + + typedef [switch_type(dssetup_DsRoleInfoLevel)] union { + [case(DS_ROLE_BASIC_INFORMATION)] dssetup_DsRolePrimaryDomInfoBasic basic; + [case(DS_ROLE_UPGRADE_STATUS)] dssetup_DsRoleUpgradeStatus upgrade; + [case(DS_ROLE_OP_STATUS)] dssetup_DsRoleOpStatus opstatus; + } dssetup_DsRoleInfo; + + WERROR dssetup_DsRoleGetPrimaryDomainInformation( + [in] dssetup_DsRoleInfoLevel level, + [out,switch_is(level)] dssetup_DsRoleInfo *info + ); + + /* + w2k3 has removed all the calls below from their implementation. + These stubs are left here only as a way of documenting the names + of the calls in case they ever turn up on the wire. + */ + WERROR dssetup_DsRoleDnsNameToFlatName(); + WERROR dssetup_DsRoleDcAsDc(); + WERROR dssetup_DsRoleDcAsReplica(); + WERROR dssetup_DsRoleDemoteDc(); + WERROR dssetup_DsRoleGetDcOperationProgress(); + WERROR dssetup_DsRoleGetDcOperationResults(); + WERROR dssetup_DsRoleCancel(); + WERROR dssetup_DsRoleServerSaveStateForUpgrade(); + WERROR dssetup_DsRoleUpgradeDownlevelServer(); + WERROR dssetup_DsRoleAbortDownlevelServerUpgrade(); +} diff --git a/epan/dissectors/dcerpc/dssetup/packet-dcerpc-dssetup.c b/epan/dissectors/dcerpc/dssetup/packet-dcerpc-dssetup.c new file mode 100644 index 0000000000..4d6f7d155a --- /dev/null +++ b/epan/dissectors/dcerpc/dssetup/packet-dcerpc-dssetup.c @@ -0,0 +1,892 @@ +/* DO NOT EDIT + * This dissector is autogenerated + */ + +/* packet-dcerpc-dssetup.c + * Routines for DS SETUP packet disassembly + * ronnie sahlberg 2005 + * Autogenerated based on the IDL definitions from samba 4 + * + * $Id: packet-dcerpc-dssetup.c 11592 2004-08-03 02:28:49Z guy $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <glib.h> +#include <string.h> + +#include <epan/packet.h> +#include "packet-dcerpc.h" +#include "packet-dcerpc-nt.h" +#include "packet-windows-common.h" +#include "packet-dcerpc-dssetup.h" + +static int proto_dssetup = -1; + + +/* INCLUDED FILE : ETH_HF */ +static int hf_dssetup_opnum = -1; +static int hf_dssetup_rc = -1; +static int hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING = -1; +static int hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE = -1; +static int hf_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS = -1; +static int hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_role = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_flags = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_domain = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_dns_domain = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_forest = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_domain_guid = -1; +static int hf_dssetup_DsRoleUpgradeStatus_upgrading = -1; +static int hf_dssetup_DsRoleUpgradeStatus_previous_role = -1; +static int hf_dssetup_DsRoleOpStatus_status = -1; +static int hf_dssetup_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic = -1; +static int hf_dssetup_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade = -1; +static int hf_dssetup_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus = -1; +static int hf_dssetup_DsRoleGetPrimaryDomainInformation_level = -1; +static int hf_dssetup_DsRoleGetPrimaryDomainInformation_info = -1; +/* END OF INCLUDED FILE : ETH_HF */ + + + + + +/* INCLUDED FILE : ETH_ETT */ +static gint ett_dssetup = -1; +static gint ett_dssetup_DsRoleFlags = -1; +static gint ett_dssetup_DsRolePrimaryDomInfoBasic = -1; +static gint ett_dssetup_DsRoleUpgradeStatus = -1; +static gint ett_dssetup_DsRoleOpStatus = -1; +static gint ett_dssetup_DsRoleInfo = -1; +/* END OF INCLUDED FILE : ETH_ETT */ + + + + + +/* INCLUDED FILE : ETH_CODE */ +static e_uuid_t uuid_dcerpc_dssetup = { + 0x3919286a, 0xb10c, 0x11d0, + { 0x9b, 0xa8, 0x00, 0xc0, 0x4f, 0xd9, 0x2e, 0xf5} +}; + +static guint16 ver_dssetup = 0; + + +const value_string dssetup_DsRole_vals[] = { + { 0 , "DS_ROLE_STANDALONE_WORKSTATION" }, + { 1 , "DS_ROLE_MEMBER_WORKSTATION" }, + { 2 , "DS_ROLE_STANDALONE_SERVER" }, + { 3 , "DS_ROLE_MEMBER_SERVER" }, + { 4 , "DS_ROLE_BACKUP_DC" }, + { 5 , "DS_ROLE_PRIMARY_DC" }, + { 0 , NULL } +}; + +int +dssetup_dissect_DsRole(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; +} + +static const true_false_string DS_ROLE_PRIMARY_DS_RUNNING_tfs = { + "DS_ROLE_PRIMARY_DS_RUNNING is SET", + "DS_ROLE_PRIMARY_DS_RUNNING is NOT set" +}; + +static const true_false_string DS_ROLE_PRIMARY_DS_MIXED_MODE_tfs = { + "DS_ROLE_PRIMARY_DS_MIXED_MODE is SET", + "DS_ROLE_PRIMARY_DS_MIXED_MODE is NOT set" +}; + +static const true_false_string DS_ROLE_UPGRADE_IN_PROGRESS_tfs = { + "DS_ROLE_UPGRADE_IN_PROGRESS is SET", + "DS_ROLE_UPGRADE_IN_PROGRESS is NOT set" +}; + +static const true_false_string DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT_tfs = { + "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT is SET", + "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT is NOT set" +}; + + +int +dssetup_dissect_DsRoleFlags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + proto_item *item=NULL; + proto_tree *tree=NULL; + guint32 flags; + + ALIGN_TO_4_BYTES; + + if(parent_tree){ + item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, 4, TRUE); + tree=proto_item_add_subtree(item, ett_dssetup_DsRoleFlags); + } + + offset=dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &flags); + + + proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING, tvb, offset-4, 4, flags); + if(flags&0x00000001){ + proto_item_append_text(item, " DS_ROLE_PRIMARY_DS_RUNNING"); + } + flags&=(~0x00000001); + + proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE, tvb, offset-4, 4, flags); + if(flags&0x00000002){ + proto_item_append_text(item, " DS_ROLE_PRIMARY_DS_MIXED_MODE"); + } + flags&=(~0x00000002); + + proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS, tvb, offset-4, 4, flags); + if(flags&0x00000004){ + proto_item_append_text(item, " DS_ROLE_UPGRADE_IN_PROGRESS"); + } + flags&=(~0x00000004); + + proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT, tvb, offset-4, 4, flags); + if(flags&0x01000000){ + proto_item_append_text(item, " DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT"); + } + flags&=(~0x01000000); + + if(flags){ + proto_item_append_text(item, "UNKNOWN-FLAGS"); + } + + return offset; +} +static int +dssetup_dissect_DsRolePrimaryDomInfoBasic_role(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRole(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_role, param); + return offset; +} + +static int +dssetup_dissect_DsRolePrimaryDomInfoBasic_flags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRoleFlags(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_flags, param); + return offset; +} + + +static int +dssetup_dissect_unistr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_cvstring(tvb, offset, pinfo, tree, drep, 2, hf_index, FALSE, NULL); + return offset; +} + +static int +dssetup_dissect_DsRolePrimaryDomInfoBasic_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_domain, param); + return offset; +} + +static int +unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRolePrimaryDomInfoBasic_domain, NDR_POINTER_UNIQUE, "domain", -1); + return offset; +} + +static int +dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_dns_domain, param); + return offset; +} + +static int +unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain, NDR_POINTER_UNIQUE, "dns_domain", -1); + return offset; +} + +static int +dssetup_dissect_DsRolePrimaryDomInfoBasic_forest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_forest, param); + return offset; +} + +static int +unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_forest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRolePrimaryDomInfoBasic_forest, NDR_POINTER_UNIQUE, "forest", -1); + return offset; +} + + +static int +dssetup_dissect_GUID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uuid_t(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; +} + +static int +dssetup_dissect_DsRolePrimaryDomInfoBasic_domain_guid(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_GUID(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_domain_guid, param); + return offset; +} + + +int +dssetup_dissect_DsRolePrimaryDomInfoBasic(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + proto_item *item=NULL; + proto_tree *tree=NULL; + int old_offset; + + ALIGN_TO_4_BYTES; + + old_offset=offset; + if(parent_tree){ + item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE); + tree=proto_item_add_subtree(item, ett_dssetup_DsRolePrimaryDomInfoBasic); + } + + offset=dssetup_dissect_DsRolePrimaryDomInfoBasic_role(tvb, offset, pinfo, tree, drep); + + offset=dssetup_dissect_DsRolePrimaryDomInfoBasic_flags(tvb, offset, pinfo, tree, drep); + + offset=unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_domain(tvb, offset, pinfo, tree, drep); + + offset=unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain(tvb, offset, pinfo, tree, drep); + + offset=unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_forest(tvb, offset, pinfo, tree, drep); + + offset=dssetup_dissect_DsRolePrimaryDomInfoBasic_domain_guid(tvb, offset, pinfo, tree, drep); + + proto_item_set_len(item, offset-old_offset); + + return offset; +} + +const value_string dssetup_DsUpgrade_vals[] = { + { 0 , "DS_ROLE_NOT_UPGRADING" }, + { 1 , "DS_ROLE_UPGRADING" }, + { 0 , NULL } +}; + +int +dssetup_dissect_DsUpgrade(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; +} + + +const value_string dssetup_DsPrevious_vals[] = { + { 0 , "DS_ROLE_PREVIOUS_UNKNOWN" }, + { 1 , "DS_ROLE_PREVIOUS_PRIMARY" }, + { 2 , "DS_ROLE_PREVIOUS_BACKUP" }, + { 0 , NULL } +}; + +int +dssetup_dissect_DsPrevious(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; +} + +static int +dssetup_dissect_DsRoleUpgradeStatus_upgrading(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsUpgrade(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleUpgradeStatus_upgrading, param); + return offset; +} + +static int +dssetup_dissect_DsRoleUpgradeStatus_previous_role(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsPrevious(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleUpgradeStatus_previous_role, param); + return offset; +} + + +int +dssetup_dissect_DsRoleUpgradeStatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + proto_item *item=NULL; + proto_tree *tree=NULL; + int old_offset; + + ALIGN_TO_4_BYTES; + + old_offset=offset; + if(parent_tree){ + item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE); + tree=proto_item_add_subtree(item, ett_dssetup_DsRoleUpgradeStatus); + } + + offset=dssetup_dissect_DsRoleUpgradeStatus_upgrading(tvb, offset, pinfo, tree, drep); + + offset=dssetup_dissect_DsRoleUpgradeStatus_previous_role(tvb, offset, pinfo, tree, drep); + + proto_item_set_len(item, offset-old_offset); + + return offset; +} + +const value_string dssetup_DsRoleOp_vals[] = { + { 0 , "DS_ROLE_OP_IDLE" }, + { 1 , "DS_ROLE_OP_ACTIVE" }, + { 2 , "DS_ROLE_OP_NEEDS_REBOOT" }, + { 0 , NULL } +}; + +int +dssetup_dissect_DsRoleOp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; +} + +static int +dssetup_dissect_DsRoleOpStatus_status(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRoleOp(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleOpStatus_status, param); + return offset; +} + + +int +dssetup_dissect_DsRoleOpStatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + proto_item *item=NULL; + proto_tree *tree=NULL; + int old_offset; + + ALIGN_TO_2_BYTES; + + old_offset=offset; + if(parent_tree){ + item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE); + tree=proto_item_add_subtree(item, ett_dssetup_DsRoleOpStatus); + } + + offset=dssetup_dissect_DsRoleOpStatus_status(tvb, offset, pinfo, tree, drep); + + proto_item_set_len(item, offset-old_offset); + + return offset; +} + +const value_string dssetup_DsRoleInfoLevel_vals[] = { + { 1 , "DS_ROLE_BASIC_INFORMATION" }, + { 2 , "DS_ROLE_UPGRADE_STATUS" }, + { 3 , "DS_ROLE_OP_STATUS" }, + { 0 , NULL } +}; + +int +dssetup_dissect_DsRoleInfoLevel(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; +} + +static int +dssetup_dissect_union_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRolePrimaryDomInfoBasic(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic, param); + return offset; +} + +static int +dssetup_dissect_union_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRoleUpgradeStatus(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade, param); + return offset; +} + +static int +dssetup_dissect_union_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRoleOpStatus(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus, param); + return offset; +} + + +static int +dssetup_dissect_union_DsRoleInfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + proto_item *item=NULL; + proto_tree *tree=NULL; + int old_offset; + guint16 level; + + ALIGN_TO_2_BYTES; + + old_offset=offset; + if(parent_tree){ + item=proto_tree_add_text(parent_tree, tvb, offset, -1, "DsRoleInfo"); + tree=proto_item_add_subtree(item, ett_dssetup_DsRoleInfo); + } + + offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, + drep, hf_index, &level); + + switch(level){ + case DS_ROLE_BASIC_INFORMATION: + ALIGN_TO_4_BYTES; + offset=dssetup_dissect_union_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic(tvb, offset, pinfo, tree, drep); + break; + + case DS_ROLE_UPGRADE_STATUS: + ALIGN_TO_4_BYTES; + offset=dssetup_dissect_union_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade(tvb, offset, pinfo, tree, drep); + break; + + case DS_ROLE_OP_STATUS: + ALIGN_TO_2_BYTES; + offset=dssetup_dissect_union_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus(tvb, offset, pinfo, tree, drep); + break; + + } + + proto_item_set_len(item, offset-old_offset); + + return offset; +} +static int +dssetup_dissect_DsRoleGetPrimaryDomainInformation_level(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRoleInfoLevel(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleGetPrimaryDomainInformation_level, param); + return offset; +} + +static int +dssetup_dissect_DsRoleGetPrimaryDomainInformation_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_union_DsRoleInfo(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleGetPrimaryDomainInformation_info, param); + return offset; +} + +static int +unique_dssetup_dissect_DsRoleGetPrimaryDomainInformation_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRoleGetPrimaryDomainInformation_info, NDR_POINTER_UNIQUE, "info", -1); + return offset; +} + + +static int +dssetup_dissect_DsRoleGetPrimaryDomainInformation_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dssetup_dissect_DsRoleGetPrimaryDomainInformation_level(tvb, offset, pinfo, tree, drep); + offset=dissect_deferred_pointers(pinfo, tvb, offset, drep); + + + return offset; +} + +static int +dssetup_dissect_DsRoleGetPrimaryDomainInformation_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=unique_dssetup_dissect_DsRoleGetPrimaryDomainInformation_info(tvb, offset, pinfo, tree, drep); + offset=dissect_deferred_pointers(pinfo, tvb, offset, drep); + + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleDnsNameToFlatName_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleDnsNameToFlatName_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleDcAsDc_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleDcAsDc_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleDcAsReplica_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleDcAsReplica_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleDemoteDc_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleDemoteDc_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleGetDcOperationProgress_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleGetDcOperationProgress_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleGetDcOperationResults_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleGetDcOperationResults_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleCancel_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleCancel_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleServerSaveStateForUpgrade_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleServerSaveStateForUpgrade_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleUpgradeDownlevelServer_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleUpgradeDownlevelServer_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} +/* END OF INCLUDED FILE : ETH_CODE */ + + + +void +proto_register_dssetup(void) +{ + static hf_register_info hf[] = { + + +/* INCLUDED FILE : ETH_HFARR */ + { &hf_dssetup_opnum, + { "Operation", "dssetup.opnum", FT_UINT16, BASE_DEC, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_rc, + { "Return code", "dssetup.rc", FT_UINT32, BASE_HEX, + VALS(NT_errors), 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING, + { "DS_ROLE_PRIMARY_DS_RUNNING", "dssetup.DsRoleFlags.DS_ROLE_PRIMARY_DS_RUNNING", FT_BOOLEAN, 32, + TFS(&DS_ROLE_PRIMARY_DS_RUNNING_tfs), 0x00000001, + "", HFILL }}, + + { &hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE, + { "DS_ROLE_PRIMARY_DS_MIXED_MODE", "dssetup.DsRoleFlags.DS_ROLE_PRIMARY_DS_MIXED_MODE", FT_BOOLEAN, 32, + TFS(&DS_ROLE_PRIMARY_DS_MIXED_MODE_tfs), 0x00000002, + "", HFILL }}, + + { &hf_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS, + { "DS_ROLE_UPGRADE_IN_PROGRESS", "dssetup.DsRoleFlags.DS_ROLE_UPGRADE_IN_PROGRESS", FT_BOOLEAN, 32, + TFS(&DS_ROLE_UPGRADE_IN_PROGRESS_tfs), 0x00000004, + "", HFILL }}, + + { &hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT, + { "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", "dssetup.DsRoleFlags.DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", FT_BOOLEAN, 32, + TFS(&DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT_tfs), 0x01000000, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_role, + { "role", "dssetup.DsRolePrimaryDomInfoBasic.role", FT_INT16, BASE_DEC, + VALS(dssetup_DsRole_vals), 0, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_flags, + { "flags", "dssetup.DsRolePrimaryDomInfoBasic.flags", FT_UINT32, BASE_HEX, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_domain, + { "domain", "dssetup.DsRolePrimaryDomInfoBasic.domain", FT_STRING, BASE_DEC, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_dns_domain, + { "dns_domain", "dssetup.DsRolePrimaryDomInfoBasic.dns_domain", FT_STRING, BASE_DEC, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_forest, + { "forest", "dssetup.DsRolePrimaryDomInfoBasic.forest", FT_STRING, BASE_DEC, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_domain_guid, + { "domain_guid", "dssetup.DsRolePrimaryDomInfoBasic.domain_guid", FT_STRING, BASE_NONE, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleUpgradeStatus_upgrading, + { "upgrading", "dssetup.DsRoleUpgradeStatus.upgrading", FT_INT32, BASE_DEC, + VALS(dssetup_DsUpgrade_vals), 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleUpgradeStatus_previous_role, + { "previous_role", "dssetup.DsRoleUpgradeStatus.previous_role", FT_INT16, BASE_DEC, + VALS(dssetup_DsPrevious_vals), 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleOpStatus_status, + { "status", "dssetup.DsRoleOpStatus.status", FT_INT16, BASE_DEC, + VALS(dssetup_DsRoleOp_vals), 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic, + { "basic", "dssetup.DsRoleInfo.basic", FT_NONE, BASE_NONE, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade, + { "upgrade", "dssetup.DsRoleInfo.upgrade", FT_NONE, BASE_NONE, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus, + { "opstatus", "dssetup.DsRoleInfo.opstatus", FT_NONE, BASE_NONE, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleGetPrimaryDomainInformation_level, + { "level", "dssetup.DsRoleGetPrimaryDomainInformation.level", FT_INT16, BASE_DEC, + VALS(dssetup_DsRoleInfoLevel_vals), 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleGetPrimaryDomainInformation_info, + { "info", "dssetup.DsRoleGetPrimaryDomainInformation.info", FT_UINT16, BASE_DEC, + NULL, 0, + "", HFILL }}, + +/* END OF INCLUDED FILE : ETH_HFARR */ + + + }; + + static gint *ett[] = { + + +/* INCLUDED FILE : ETH_ETTARR */ + &ett_dssetup, + &ett_dssetup_DsRoleFlags, + &ett_dssetup_DsRolePrimaryDomInfoBasic, + &ett_dssetup_DsRoleUpgradeStatus, + &ett_dssetup_DsRoleOpStatus, + &ett_dssetup_DsRoleInfo, +/* END OF INCLUDED FILE : ETH_ETTARR */ + + + }; + + proto_dssetup = proto_register_protocol( + "Active Directory Setup", + "DSSETUP", "dssetup"); + proto_register_field_array(proto_dssetup, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} + +static dcerpc_sub_dissector function_dissectors[] = { + + +/* INCLUDED FILE : ETH_FT */ + { 0, "DsRoleGetPrimaryDomainInformation", + dssetup_dissect_DsRoleGetPrimaryDomainInformation_request, + dssetup_dissect_DsRoleGetPrimaryDomainInformation_response }, + { 1, "DsRoleDnsNameToFlatName", + dssetup_dissect_DsRoleDnsNameToFlatName_request, + dssetup_dissect_DsRoleDnsNameToFlatName_response }, + { 2, "DsRoleDcAsDc", + dssetup_dissect_DsRoleDcAsDc_request, + dssetup_dissect_DsRoleDcAsDc_response }, + { 3, "DsRoleDcAsReplica", + dssetup_dissect_DsRoleDcAsReplica_request, + dssetup_dissect_DsRoleDcAsReplica_response }, + { 4, "DsRoleDemoteDc", + dssetup_dissect_DsRoleDemoteDc_request, + dssetup_dissect_DsRoleDemoteDc_response }, + { 5, "DsRoleGetDcOperationProgress", + dssetup_dissect_DsRoleGetDcOperationProgress_request, + dssetup_dissect_DsRoleGetDcOperationProgress_response }, + { 6, "DsRoleGetDcOperationResults", + dssetup_dissect_DsRoleGetDcOperationResults_request, + dssetup_dissect_DsRoleGetDcOperationResults_response }, + { 7, "DsRoleCancel", + dssetup_dissect_DsRoleCancel_request, + dssetup_dissect_DsRoleCancel_response }, + { 8, "DsRoleServerSaveStateForUpgrade", + dssetup_dissect_DsRoleServerSaveStateForUpgrade_request, + dssetup_dissect_DsRoleServerSaveStateForUpgrade_response }, + { 9, "DsRoleUpgradeDownlevelServer", + dssetup_dissect_DsRoleUpgradeDownlevelServer_request, + dssetup_dissect_DsRoleUpgradeDownlevelServer_response }, + { 10, "DsRoleAbortDownlevelServerUpgrade", + dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_request, + dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_response }, +/* END OF INCLUDED FILE : ETH_FT */ + + + { 0, NULL, NULL, NULL }, +}; + +void +proto_reg_handoff_dssetup(void) +{ + + +/* INCLUDED FILE : ETH_HANDOFF */ + dcerpc_init_uuid(proto_dssetup, ett_dssetup, + &uuid_dcerpc_dssetup, ver_dssetup, + function_dissectors, hf_dssetup_opnum); +/* END OF INCLUDED FILE : ETH_HANDOFF */ + + +} + diff --git a/epan/dissectors/dcerpc/dssetup/packet-dcerpc-dssetup.h b/epan/dissectors/dcerpc/dssetup/packet-dcerpc-dssetup.h new file mode 100644 index 0000000000..1040ba28a4 --- /dev/null +++ b/epan/dissectors/dcerpc/dssetup/packet-dcerpc-dssetup.h @@ -0,0 +1,81 @@ +/* DO NOT EDIT + * This dissector is autogenerated + * ronnie sahlberg 2005 + * Autogenerated based on the IDL definitions from samba4 + */ +/* packet-dcerpc-dssetup.h + * Routines for DSSETUP packet disassembly + * + * $Id: packet-dcerpc-dssetup.h 11410 2004-07-18 18:06:47Z gram $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PACKET_DCERPC_DSSETUP_H +#define __PACKET_DCERPC_DSSETUP_H + + + +/* INCLUDED FILE : ETH_HDR */ + +#define DS_ROLE_STANDALONE_WORKSTATION 0 +#define DS_ROLE_MEMBER_WORKSTATION 1 +#define DS_ROLE_STANDALONE_SERVER 2 +#define DS_ROLE_MEMBER_SERVER 3 +#define DS_ROLE_BACKUP_DC 4 +#define DS_ROLE_PRIMARY_DC 5 + +extern const value_string dssetup_DsRole_vals[]; +int dssetup_dissect_DsRole(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); +int dssetup_dissect_DsRoleFlags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); +int dssetup_dissect_DsRolePrimaryDomInfoBasic(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); + +#define DS_ROLE_NOT_UPGRADING 0 +#define DS_ROLE_UPGRADING 1 + +extern const value_string dssetup_DsUpgrade_vals[]; +int dssetup_dissect_DsUpgrade(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); + +#define DS_ROLE_PREVIOUS_UNKNOWN 0 +#define DS_ROLE_PREVIOUS_PRIMARY 1 +#define DS_ROLE_PREVIOUS_BACKUP 2 + +extern const value_string dssetup_DsPrevious_vals[]; +int dssetup_dissect_DsPrevious(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); +int dssetup_dissect_DsRoleUpgradeStatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); + +#define DS_ROLE_OP_IDLE 0 +#define DS_ROLE_OP_ACTIVE 1 +#define DS_ROLE_OP_NEEDS_REBOOT 2 + +extern const value_string dssetup_DsRoleOp_vals[]; +int dssetup_dissect_DsRoleOp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); +int dssetup_dissect_DsRoleOpStatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); + +#define DS_ROLE_BASIC_INFORMATION 1 +#define DS_ROLE_UPGRADE_STATUS 2 +#define DS_ROLE_OP_STATUS 3 + +extern const value_string dssetup_DsRoleInfoLevel_vals[]; +int dssetup_dissect_DsRoleInfoLevel(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); +/* END OF INCLUDED FILE : ETH_HDR */ + + + +#endif /* packet-dcerpc-dssetup.h */ diff --git a/epan/dissectors/dcerpc/dssetup/template.c b/epan/dissectors/dcerpc/dssetup/template.c new file mode 100755 index 0000000000..0cb823684d --- /dev/null +++ b/epan/dissectors/dcerpc/dssetup/template.c @@ -0,0 +1,79 @@ +/* DO NOT EDIT + * This dissector is autogenerated + */ + +/* packet-dcerpc-dssetup.c + * Routines for DS SETUP packet disassembly + * ronnie sahlberg 2005 + * Autogenerated based on the IDL definitions from samba 4 + * + * $Id: packet-dcerpc-dssetup.c 11592 2004-08-03 02:28:49Z guy $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <glib.h> +#include <string.h> + +#include <epan/packet.h> +#include "packet-dcerpc.h" +#include "packet-dcerpc-nt.h" +#include "packet-windows-common.h" +#include "packet-dcerpc-dssetup.h" + +static int proto_dssetup = -1; +ETH_HF + +ETH_ETT + +ETH_CODE + +void +proto_register_dssetup(void) +{ + static hf_register_info hf[] = { +ETH_HFARR + }; + + static gint *ett[] = { +ETH_ETTARR + }; + + proto_dssetup = proto_register_protocol( + "Active Directory Setup", + "DSSETUP", "dssetup"); + proto_register_field_array(proto_dssetup, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} + +static dcerpc_sub_dissector function_dissectors[] = { +ETH_FT + { 0, NULL, NULL, NULL }, +}; + +void +proto_reg_handoff_dssetup(void) +{ +ETH_HANDOFF +} + diff --git a/epan/dissectors/dcerpc/dssetup/template.h b/epan/dissectors/dcerpc/dssetup/template.h new file mode 100755 index 0000000000..8ef6c55af6 --- /dev/null +++ b/epan/dissectors/dcerpc/dssetup/template.h @@ -0,0 +1,35 @@ +/* DO NOT EDIT + * This dissector is autogenerated + * ronnie sahlberg 2005 + * Autogenerated based on the IDL definitions from samba4 + */ +/* packet-dcerpc-dssetup.h + * Routines for DSSETUP packet disassembly + * + * $Id: packet-dcerpc-dssetup.h 11410 2004-07-18 18:06:47Z gram $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PACKET_DCERPC_DSSETUP_H +#define __PACKET_DCERPC_DSSETUP_H + +ETH_HDR + +#endif /* packet-dcerpc-dssetup.h */ diff --git a/epan/dissectors/packet-dcerpc-dssetup.c b/epan/dissectors/packet-dcerpc-dssetup.c index 381ea3a9ed..2ac1876b85 100644 --- a/epan/dissectors/packet-dcerpc-dssetup.c +++ b/epan/dissectors/packet-dcerpc-dssetup.c @@ -1,7 +1,11 @@ +/* DO NOT EDIT + * This dissector is autogenerated + */ + /* packet-dcerpc-dssetup.c - * Routines for SMB \PIPE\lsarpc packet disassembly - * Copyright 2002-2003, Tim Potter <tpot@samba.org> - * Copyright 2002, Jim McDonough <jmcd@samba.org> + * Routines for DS SETUP packet disassembly + * ronnie sahlberg 2005 + * Autogenerated based on the IDL definitions from samba 4 * * $Id$ * @@ -35,349 +39,854 @@ #include "packet-dcerpc.h" #include "packet-dcerpc-nt.h" #include "packet-windows-common.h" +#include "packet-dcerpc-dssetup.h" -#define DSSETUP_DSROLERGETDOMINFO 0x0000 -#define DSSETUP_DSROLER_DNS_NAME_TO_FLAT_NAME 0x0001 -#define DSSETUP_DSROLER_DC_AS_DC 0x0002 -#define DSSETUP_DSROLER_DC_AS_REPLICA 0x0003 -#define DSSETUP_DSROLER_DEMOTE_DC 0x0004 -#define DSSETUP_DSROLER_GET_DC_OPERATION_PROGRESS 0x0005 -#define DSSETUP_DSROLER_GET_DC_OPERATION_RESULTS 0x0006 -#define DSSETUP_DSROLER_CANCEL 0x0007 -#define DSSETUP_DSROLER_SERVER_SAVE_STATE_FOR_UPGRADE 0x0008 -#define DSSETUP_DSROLER_UPGRADE_DOWNLEVEL_SERVER 0x0009 -#define DSSETUP_DSROLER_ABORT_DOWNLEVEL_SERVER_UPGRADE 0x000a - -#define DSSETUP_DSROLE_BASIC_INFO 0x0001 -#define DSSETUP_DSROLE_UPGRADE_STATUS 0x0002 -#define DSSETUP_DSROLE_OP_STATUS 0x0003 +static int proto_dssetup = -1; -static int proto_dcerpc_dssetup = -1; +/* INCLUDED FILE : ETH_HF */ static int hf_dssetup_opnum = -1; -static int hf_dssetup_guid = -1; -static int hf_dssetup_dominfo_level = -1; -static int hf_dssetup_machine_role = -1; -static int hf_dssetup_dominfo_flags = -1; -static int hf_dssetup_dominfo_netb_name = -1; -static int hf_dssetup_dominfo_dns_name = -1; -static int hf_dssetup_dominfo_forest_name = -1; -static int hf_dssetup_upgrade_state = -1; -static int hf_dssetup_previous_role = -1; -static int hf_dssetup_op_status = -1; static int hf_dssetup_rc = -1; +static int hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING = -1; +static int hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE = -1; +static int hf_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS = -1; +static int hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_role = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_flags = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_domain = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_dns_domain = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_forest = -1; +static int hf_dssetup_DsRolePrimaryDomInfoBasic_domain_guid = -1; +static int hf_dssetup_DsRoleUpgradeStatus_upgrading = -1; +static int hf_dssetup_DsRoleUpgradeStatus_previous_role = -1; +static int hf_dssetup_DsRoleOpStatus_status = -1; +static int hf_dssetup_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic = -1; +static int hf_dssetup_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade = -1; +static int hf_dssetup_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus = -1; +static int hf_dssetup_DsRoleGetPrimaryDomainInformation_level = -1; +static int hf_dssetup_DsRoleGetPrimaryDomainInformation_info = -1; +/* END OF INCLUDED FILE : ETH_HF */ + + + + + +/* INCLUDED FILE : ETH_ETT */ +static gint ett_dssetup = -1; +static gint ett_dssetup_DsRoleFlags = -1; +static gint ett_dssetup_DsRolePrimaryDomInfoBasic = -1; +static gint ett_dssetup_DsRoleUpgradeStatus = -1; +static gint ett_dssetup_DsRoleOpStatus = -1; +static gint ett_dssetup_DsRoleInfo = -1; +/* END OF INCLUDED FILE : ETH_ETT */ -static gint ett_dcerpc_dssetup = -1; -static gint ett_dssetup_domain_info = -1; -static gint ett_dssetup_basic_domain_info = -1; -static gint ett_dssetup_upgrade_status = -1; -static gint ett_dssetup_op_status = -1; -static int -dssetup_dissect_DSROLE_BASIC_INFO(tvbuff_t *tvb, int offset, - packet_info *pinfo, proto_tree *parent_tree, guint8 *drep) -{ - proto_item *item=NULL; - proto_tree *tree=NULL; - int old_offset=offset; - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, offset, -1, - "DSROLE_BASIC_DOMAIN_INFO:"); - tree = proto_item_add_subtree(item, - ett_dssetup_basic_domain_info); - } - - ALIGN_TO_4_BYTES; - /* role */ - offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, - hf_dssetup_machine_role, 0); - - /* flags */ - offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, - hf_dssetup_dominfo_flags, 0); - - offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep, - NDR_POINTER_UNIQUE, "NetBIOS domain name pointer", - hf_dssetup_dominfo_netb_name, 0); - offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep, - NDR_POINTER_UNIQUE, "DNS domain pointer", - hf_dssetup_dominfo_dns_name, 0); - offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep, - NDR_POINTER_UNIQUE, "DNS forest name pointer", - hf_dssetup_dominfo_forest_name, 0); - /* GUID */ - offset = dissect_ndr_uuid_t(tvb, offset, pinfo, tree, drep, hf_dssetup_guid, NULL); - proto_item_set_len(item, offset-old_offset); - return offset; +/* INCLUDED FILE : ETH_CODE */ +static e_uuid_t uuid_dcerpc_dssetup = { + 0x3919286a, 0xb10c, 0x11d0, + { 0x9b, 0xa8, 0x00, 0xc0, 0x4f, 0xd9, 0x2e, 0xf5} +}; + +static guint16 ver_dssetup = 0; + + +const value_string dssetup_DsRole_vals[] = { + { 0 , "DS_ROLE_STANDALONE_WORKSTATION" }, + { 1 , "DS_ROLE_MEMBER_WORKSTATION" }, + { 2 , "DS_ROLE_STANDALONE_SERVER" }, + { 3 , "DS_ROLE_MEMBER_SERVER" }, + { 4 , "DS_ROLE_BACKUP_DC" }, + { 5 , "DS_ROLE_PRIMARY_DC" }, + { 0 , NULL } +}; + +int +dssetup_dissect_DsRole(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; } -static int -dssetup_dissect_DSROLE_UPGRADE_STATUS(tvbuff_t *tvb, int offset, - packet_info *pinfo, - proto_tree *parent_tree, guint8 *drep) +static const true_false_string DS_ROLE_PRIMARY_DS_RUNNING_tfs = { + "DS_ROLE_PRIMARY_DS_RUNNING is SET", + "DS_ROLE_PRIMARY_DS_RUNNING is NOT set" +}; + +static const true_false_string DS_ROLE_PRIMARY_DS_MIXED_MODE_tfs = { + "DS_ROLE_PRIMARY_DS_MIXED_MODE is SET", + "DS_ROLE_PRIMARY_DS_MIXED_MODE is NOT set" +}; + +static const true_false_string DS_ROLE_UPGRADE_IN_PROGRESS_tfs = { + "DS_ROLE_UPGRADE_IN_PROGRESS is SET", + "DS_ROLE_UPGRADE_IN_PROGRESS is NOT set" +}; + +static const true_false_string DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT_tfs = { + "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT is SET", + "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT is NOT set" +}; + + +int +dssetup_dissect_DsRoleFlags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_) { - proto_item *item=NULL; - proto_tree *tree=NULL; - int old_offset=offset; + proto_item *item=NULL; + proto_tree *tree=NULL; + guint32 flags; + + ALIGN_TO_4_BYTES; - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, offset, -1, - "DSROLE_UPGRADE_STATUS:"); - tree = proto_item_add_subtree(item, - ett_dssetup_upgrade_status); - } + if(parent_tree){ + item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, 4, TRUE); + tree=proto_item_add_subtree(item, ett_dssetup_DsRoleFlags); + } - offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, - hf_dssetup_upgrade_state, NULL); - offset = dissect_ndr_uint16 (tvb, offset, pinfo, tree, drep, - hf_dssetup_previous_role, NULL); - proto_item_set_len(item, offset-old_offset); + offset=dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &flags); - return offset; + + proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING, tvb, offset-4, 4, flags); + if(flags&0x00000001){ + proto_item_append_text(item, " DS_ROLE_PRIMARY_DS_RUNNING"); + } + flags&=(~0x00000001); + + proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE, tvb, offset-4, 4, flags); + if(flags&0x00000002){ + proto_item_append_text(item, " DS_ROLE_PRIMARY_DS_MIXED_MODE"); + } + flags&=(~0x00000002); + + proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS, tvb, offset-4, 4, flags); + if(flags&0x00000004){ + proto_item_append_text(item, " DS_ROLE_UPGRADE_IN_PROGRESS"); + } + flags&=(~0x00000004); + + proto_tree_add_boolean(tree, hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT, tvb, offset-4, 4, flags); + if(flags&0x01000000){ + proto_item_append_text(item, " DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT"); + } + flags&=(~0x01000000); + + if(flags){ + proto_item_append_text(item, "UNKNOWN-FLAGS"); + } + + return offset; +} +static int +dssetup_dissect_DsRolePrimaryDomInfoBasic_role(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRole(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_role, param); + return offset; } static int -dssetup_dissect_DSROLE_OP_STATUS(tvbuff_t *tvb, int offset, - packet_info *pinfo, - proto_tree *parent_tree, guint8 *drep) +dssetup_dissect_DsRolePrimaryDomInfoBasic_flags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) { - proto_item *item=NULL; - proto_tree *tree=NULL; - int old_offset=offset; + guint32 param=0; + offset=dssetup_dissect_DsRoleFlags(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_flags, param); + return offset; +} - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, offset, -1, - "DSROLE_OP_STATUS:"); - tree = proto_item_add_subtree(item, - ett_dssetup_op_status); - } - offset = dissect_ndr_uint16 (tvb, offset, pinfo, tree, drep, - hf_dssetup_op_status, NULL); - proto_item_set_len(item, offset-old_offset); - return offset; -} - static int -dssetup_dissect_DS_DOMINFO_CTR(tvbuff_t *tvb, int offset, - packet_info *pinfo, proto_tree *parent_tree, guint8 *drep) +dssetup_dissect_unistr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) { - proto_item *item=NULL; - proto_tree *tree=NULL; - int old_offset=offset; - guint16 level; + offset=dissect_ndr_cvstring(tvb, offset, pinfo, tree, drep, 2, hf_index, FALSE, NULL); + return offset; +} - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, offset, -1, - "DOMAIN_INFO:"); - tree = proto_item_add_subtree(item, ett_dssetup_domain_info); - } +static int +dssetup_dissect_DsRolePrimaryDomInfoBasic_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_domain, param); + return offset; +} - offset = dissect_ndr_uint16 (tvb, offset, pinfo, tree, drep, - hf_dssetup_dominfo_level, &level); +static int +unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRolePrimaryDomInfoBasic_domain, NDR_POINTER_UNIQUE, "domain", -1); + return offset; +} - switch(level){ - case DSSETUP_DSROLE_BASIC_INFO: - offset = dssetup_dissect_DSROLE_BASIC_INFO( - tvb, offset, pinfo, tree, drep); - break; - case DSSETUP_DSROLE_UPGRADE_STATUS: - offset = dssetup_dissect_DSROLE_UPGRADE_STATUS( - tvb, offset, pinfo, tree, drep); - break; - case DSSETUP_DSROLE_OP_STATUS: - offset = dssetup_dissect_DSROLE_OP_STATUS( - tvb, offset, pinfo, tree, drep); - break; - } - proto_item_set_len(item, offset-old_offset); +static int +dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_dns_domain, param); + return offset; +} - return offset; +static int +unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain, NDR_POINTER_UNIQUE, "dns_domain", -1); + return offset; } static int -dssetup_dissect_role_get_dom_info_rqst(tvbuff_t *tvb, int offset, - packet_info *pinfo, proto_tree *tree, guint8 *drep) +dssetup_dissect_DsRolePrimaryDomInfoBasic_forest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) { - guint16 level; + guint32 param=0; + offset=dssetup_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_forest, param); + return offset; +} - offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, - hf_dssetup_dominfo_level, &level); +static int +unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_forest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRolePrimaryDomInfoBasic_forest, NDR_POINTER_UNIQUE, "forest", -1); + return offset; +} - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); - return offset; +static int +dssetup_dissect_GUID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uuid_t(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; } static int -dssetup_dissect_role_get_dom_info_reply(tvbuff_t *tvb, int offset, - packet_info *pinfo, proto_tree *tree, guint8 *drep) +dssetup_dissect_DsRolePrimaryDomInfoBasic_domain_guid(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) { - offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, - dssetup_dissect_DS_DOMINFO_CTR, NDR_POINTER_UNIQUE, - "DOMAIN_INFORMATION pointer", -1); + guint32 param=0; + offset=dssetup_dissect_GUID(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRolePrimaryDomInfoBasic_domain_guid, param); + return offset; +} + + +int +dssetup_dissect_DsRolePrimaryDomInfoBasic(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + proto_item *item=NULL; + proto_tree *tree=NULL; + int old_offset; + + ALIGN_TO_4_BYTES; + + old_offset=offset; + if(parent_tree){ + item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE); + tree=proto_item_add_subtree(item, ett_dssetup_DsRolePrimaryDomInfoBasic); + } + + offset=dssetup_dissect_DsRolePrimaryDomInfoBasic_role(tvb, offset, pinfo, tree, drep); - offset = dissect_ntstatus( - tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + offset=dssetup_dissect_DsRolePrimaryDomInfoBasic_flags(tvb, offset, pinfo, tree, drep); - return offset; + offset=unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_domain(tvb, offset, pinfo, tree, drep); + + offset=unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_dns_domain(tvb, offset, pinfo, tree, drep); + + offset=unique_dssetup_dissect_DsRolePrimaryDomInfoBasic_forest(tvb, offset, pinfo, tree, drep); + + offset=dssetup_dissect_DsRolePrimaryDomInfoBasic_domain_guid(tvb, offset, pinfo, tree, drep); + + proto_item_set_len(item, offset-old_offset); + + return offset; } -static const value_string dssetup_dominfo_levels[] = { - { DSSETUP_DSROLE_BASIC_INFO, "DsRoleBasicInfo"}, - { DSSETUP_DSROLE_UPGRADE_STATUS, "DsRoleUpgradeStatus"}, - { DSSETUP_DSROLE_OP_STATUS, "DsRoleOpStatus"}, - { 0, NULL } +const value_string dssetup_DsUpgrade_vals[] = { + { 0 , "DS_ROLE_NOT_UPGRADING" }, + { 1 , "DS_ROLE_UPGRADING" }, + { 0 , NULL } }; -static const value_string dssetup_role_vals[] = { - { 0, "Standalone Workstation" }, - { 1, "Domain Member Workstation" }, - { 2, "Standalone Server" }, - { 3, "Domain Member Server" }, - { 4, "Backup Domain Controller" }, - { 5, "Primary Domain Controller" }, - { 0, NULL } -}; +int +dssetup_dissect_DsUpgrade(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; +} + -static const value_string dssetup_upgrade_vals[] = { - { 0, "Not currently upgrading"}, - { 1, "Upgrade in progress"}, - { 0, NULL } +const value_string dssetup_DsPrevious_vals[] = { + { 0 , "DS_ROLE_PREVIOUS_UNKNOWN" }, + { 1 , "DS_ROLE_PREVIOUS_PRIMARY" }, + { 2 , "DS_ROLE_PREVIOUS_BACKUP" }, + { 0 , NULL } }; -static const value_string dssetup_previous_roles[] = { - { 0, "Unknown state" }, - { 1, "Primary" }, - { 2, "Backup" }, - { 0, NULL } +int +dssetup_dissect_DsPrevious(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; +} + +static int +dssetup_dissect_DsRoleUpgradeStatus_upgrading(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsUpgrade(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleUpgradeStatus_upgrading, param); + return offset; +} + +static int +dssetup_dissect_DsRoleUpgradeStatus_previous_role(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsPrevious(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleUpgradeStatus_previous_role, param); + return offset; +} + + +int +dssetup_dissect_DsRoleUpgradeStatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + proto_item *item=NULL; + proto_tree *tree=NULL; + int old_offset; + + ALIGN_TO_4_BYTES; + + old_offset=offset; + if(parent_tree){ + item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE); + tree=proto_item_add_subtree(item, ett_dssetup_DsRoleUpgradeStatus); + } + + offset=dssetup_dissect_DsRoleUpgradeStatus_upgrading(tvb, offset, pinfo, tree, drep); + + offset=dssetup_dissect_DsRoleUpgradeStatus_previous_role(tvb, offset, pinfo, tree, drep); + + proto_item_set_len(item, offset-old_offset); + + return offset; +} + +const value_string dssetup_DsRoleOp_vals[] = { + { 0 , "DS_ROLE_OP_IDLE" }, + { 1 , "DS_ROLE_OP_ACTIVE" }, + { 2 , "DS_ROLE_OP_NEEDS_REBOOT" }, + { 0 , NULL } }; -static const value_string dssetup_op_states[] = { - { 0, "Idle" }, - { 1, "Active" }, - { 2, "Needs reboot" }, - { 0, NULL } +int +dssetup_dissect_DsRoleOp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; +} + +static int +dssetup_dissect_DsRoleOpStatus_status(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRoleOp(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleOpStatus_status, param); + return offset; +} + + +int +dssetup_dissect_DsRoleOpStatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + proto_item *item=NULL; + proto_tree *tree=NULL; + int old_offset; + + ALIGN_TO_2_BYTES; + + old_offset=offset; + if(parent_tree){ + item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE); + tree=proto_item_add_subtree(item, ett_dssetup_DsRoleOpStatus); + } + + offset=dssetup_dissect_DsRoleOpStatus_status(tvb, offset, pinfo, tree, drep); + + proto_item_set_len(item, offset-old_offset); + + return offset; +} + +const value_string dssetup_DsRoleInfoLevel_vals[] = { + { 1 , "DS_ROLE_BASIC_INFORMATION" }, + { 2 , "DS_ROLE_UPGRADE_STATUS" }, + { 3 , "DS_ROLE_OP_STATUS" }, + { 0 , NULL } }; +int +dssetup_dissect_DsRoleInfoLevel(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, NULL); + return offset; +} + +static int +dssetup_dissect_union_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRolePrimaryDomInfoBasic(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic, param); + return offset; +} + +static int +dssetup_dissect_union_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRoleUpgradeStatus(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade, param); + return offset; +} + +static int +dssetup_dissect_union_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRoleOpStatus(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus, param); + return offset; +} + + +static int +dssetup_dissect_union_DsRoleInfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_) +{ + proto_item *item=NULL; + proto_tree *tree=NULL; + int old_offset; + guint16 level; + + ALIGN_TO_2_BYTES; + + old_offset=offset; + if(parent_tree){ + item=proto_tree_add_text(parent_tree, tvb, offset, -1, "DsRoleInfo"); + tree=proto_item_add_subtree(item, ett_dssetup_DsRoleInfo); + } + + offset=dissect_ndr_uint16(tvb, offset, pinfo, tree, + drep, hf_index, &level); + + switch(level){ + case DS_ROLE_BASIC_INFORMATION: + ALIGN_TO_4_BYTES; + offset=dssetup_dissect_union_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic(tvb, offset, pinfo, tree, drep); + break; + + case DS_ROLE_UPGRADE_STATUS: + ALIGN_TO_4_BYTES; + offset=dssetup_dissect_union_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade(tvb, offset, pinfo, tree, drep); + break; + + case DS_ROLE_OP_STATUS: + ALIGN_TO_2_BYTES; + offset=dssetup_dissect_union_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus(tvb, offset, pinfo, tree, drep); + break; + + } + + proto_item_set_len(item, offset-old_offset); + + return offset; +} +static int +dssetup_dissect_DsRoleGetPrimaryDomainInformation_level(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_DsRoleInfoLevel(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleGetPrimaryDomainInformation_level, param); + return offset; +} + +static int +dssetup_dissect_DsRoleGetPrimaryDomainInformation_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + guint32 param=0; + offset=dssetup_dissect_union_DsRoleInfo(tvb, offset, pinfo, tree, drep, hf_dssetup_DsRoleGetPrimaryDomainInformation_info, param); + return offset; +} + +static int +unique_dssetup_dissect_DsRoleGetPrimaryDomainInformation_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep) +{ + offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, dssetup_dissect_DsRoleGetPrimaryDomainInformation_info, NDR_POINTER_UNIQUE, "info", -1); + return offset; +} + + +static int +dssetup_dissect_DsRoleGetPrimaryDomainInformation_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dssetup_dissect_DsRoleGetPrimaryDomainInformation_level(tvb, offset, pinfo, tree, drep); + offset=dissect_deferred_pointers(pinfo, tvb, offset, drep); + + + return offset; +} + +static int +dssetup_dissect_DsRoleGetPrimaryDomainInformation_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=unique_dssetup_dissect_DsRoleGetPrimaryDomainInformation_info(tvb, offset, pinfo, tree, drep); + offset=dissect_deferred_pointers(pinfo, tvb, offset, drep); + + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleDnsNameToFlatName_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleDnsNameToFlatName_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleDcAsDc_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleDcAsDc_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleDcAsReplica_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleDcAsReplica_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleDemoteDc_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleDemoteDc_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleGetDcOperationProgress_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleGetDcOperationProgress_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleGetDcOperationResults_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleGetDcOperationResults_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleCancel_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleCancel_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleServerSaveStateForUpgrade_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleServerSaveStateForUpgrade_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleUpgradeDownlevelServer_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleUpgradeDownlevelServer_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} + +static int +dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + + return offset; +} + +static int +dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_) +{ + offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_dssetup_rc, NULL); + + + return offset; +} +/* END OF INCLUDED FILE : ETH_CODE */ + + + void -proto_register_dcerpc_dssetup(void) +proto_register_dssetup(void) { static hf_register_info hf[] = { - { &hf_dssetup_opnum, - { "Operation", "dssetup.opnum", FT_UINT16, BASE_DEC, - NULL, 0x0, "Operation", HFILL }}, - - { &hf_dssetup_dominfo_level, - { "Level", "dssetup.dominfo.level", FT_UINT16, BASE_DEC, - VALS(dssetup_dominfo_levels), 0x0, - "Information level of requested data", HFILL }}, - - { &hf_dssetup_machine_role, - { "Machine role", "dssetup.role", FT_UINT16, BASE_HEX, - VALS(dssetup_role_vals), 0x0, "Role of machine in domain", HFILL}}, - - { &hf_dssetup_dominfo_flags, - { "Flags", "dssetup.dominfo.flags", FT_UINT32, BASE_HEX, - NULL, 0x0, "Machine flags", HFILL }}, - - { &hf_dssetup_dominfo_netb_name, - { "Netbios name", "dssetup.dominfo.nbname", FT_STRING, BASE_NONE, - NULL, 0x0, "Netbios Domain Name", HFILL}}, - - { &hf_dssetup_dominfo_dns_name, - { "DNS name", "dssetup.dominfo.dnsname", FT_STRING, BASE_NONE, - NULL, 0x0, "DNS Domain Name", HFILL}}, - - { &hf_dssetup_guid, - { "GUID", "dssetup.guid", FT_STRING, BASE_NONE, - NULL, 0x0, "", HFILL}}, - - { &hf_dssetup_dominfo_forest_name, - { "Forest name", "dssetup.dominfo.forest", FT_STRING, BASE_NONE, - NULL, 0x0, "DNS Forest Name", HFILL}}, - - { &hf_dssetup_upgrade_state, - { "Upgrading", "dssetup.upgrading", FT_UINT32, BASE_DEC, - VALS(dssetup_upgrade_vals), 0x0, "Upgrade State", HFILL }}, - - { &hf_dssetup_previous_role, - { "Previous role", "dssetup.upgrading", FT_UINT16, BASE_DEC, - VALS(dssetup_previous_roles), 0x0, - "Previous server role before upgrade", HFILL }}, - - { &hf_dssetup_op_status, - { "Operational status", "dssetup.op_status", FT_UINT16, BASE_DEC, - VALS(dssetup_op_states), 0x0, - "Current operational status", HFILL }}, - - { &hf_dssetup_rc, - { "Return code", "dssetup.rc", FT_UINT32, BASE_HEX, - VALS (NT_errors), 0x0, "DSSETUP return status code", HFILL }}, + +/* INCLUDED FILE : ETH_HFARR */ + { &hf_dssetup_opnum, + { "Operation", "dssetup.opnum", FT_UINT16, BASE_DEC, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_rc, + { "Return code", "dssetup.rc", FT_UINT32, BASE_HEX, + VALS(NT_errors), 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_RUNNING, + { "DS_ROLE_PRIMARY_DS_RUNNING", "dssetup.DsRoleFlags.DS_ROLE_PRIMARY_DS_RUNNING", FT_BOOLEAN, 32, + TFS(&DS_ROLE_PRIMARY_DS_RUNNING_tfs), 0x00000001, + "", HFILL }}, + + { &hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DS_MIXED_MODE, + { "DS_ROLE_PRIMARY_DS_MIXED_MODE", "dssetup.DsRoleFlags.DS_ROLE_PRIMARY_DS_MIXED_MODE", FT_BOOLEAN, 32, + TFS(&DS_ROLE_PRIMARY_DS_MIXED_MODE_tfs), 0x00000002, + "", HFILL }}, + + { &hf_dssetup_DsRoleFlags_DS_ROLE_UPGRADE_IN_PROGRESS, + { "DS_ROLE_UPGRADE_IN_PROGRESS", "dssetup.DsRoleFlags.DS_ROLE_UPGRADE_IN_PROGRESS", FT_BOOLEAN, 32, + TFS(&DS_ROLE_UPGRADE_IN_PROGRESS_tfs), 0x00000004, + "", HFILL }}, + + { &hf_dssetup_DsRoleFlags_DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT, + { "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", "dssetup.DsRoleFlags.DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", FT_BOOLEAN, 32, + TFS(&DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT_tfs), 0x01000000, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_role, + { "role", "dssetup.DsRolePrimaryDomInfoBasic.role", FT_INT16, BASE_DEC, + VALS(dssetup_DsRole_vals), 0, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_flags, + { "flags", "dssetup.DsRolePrimaryDomInfoBasic.flags", FT_UINT32, BASE_HEX, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_domain, + { "domain", "dssetup.DsRolePrimaryDomInfoBasic.domain", FT_STRING, BASE_DEC, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_dns_domain, + { "dns_domain", "dssetup.DsRolePrimaryDomInfoBasic.dns_domain", FT_STRING, BASE_DEC, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_forest, + { "forest", "dssetup.DsRolePrimaryDomInfoBasic.forest", FT_STRING, BASE_DEC, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRolePrimaryDomInfoBasic_domain_guid, + { "domain_guid", "dssetup.DsRolePrimaryDomInfoBasic.domain_guid", FT_STRING, BASE_NONE, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleUpgradeStatus_upgrading, + { "upgrading", "dssetup.DsRoleUpgradeStatus.upgrading", FT_INT32, BASE_DEC, + VALS(dssetup_DsUpgrade_vals), 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleUpgradeStatus_previous_role, + { "previous_role", "dssetup.DsRoleUpgradeStatus.previous_role", FT_INT16, BASE_DEC, + VALS(dssetup_DsPrevious_vals), 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleOpStatus_status, + { "status", "dssetup.DsRoleOpStatus.status", FT_INT16, BASE_DEC, + VALS(dssetup_DsRoleOp_vals), 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleInfo_DS_ROLE_BASIC_INFORMATION_basic, + { "basic", "dssetup.DsRoleInfo.basic", FT_NONE, BASE_NONE, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleInfo_DS_ROLE_UPGRADE_STATUS_upgrade, + { "upgrade", "dssetup.DsRoleInfo.upgrade", FT_NONE, BASE_NONE, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleInfo_DS_ROLE_OP_STATUS_opstatus, + { "opstatus", "dssetup.DsRoleInfo.opstatus", FT_NONE, BASE_NONE, + NULL, 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleGetPrimaryDomainInformation_level, + { "level", "dssetup.DsRoleGetPrimaryDomainInformation.level", FT_INT16, BASE_DEC, + VALS(dssetup_DsRoleInfoLevel_vals), 0, + "", HFILL }}, + + { &hf_dssetup_DsRoleGetPrimaryDomainInformation_info, + { "info", "dssetup.DsRoleGetPrimaryDomainInformation.info", FT_UINT16, BASE_DEC, + NULL, 0, + "", HFILL }}, + +/* END OF INCLUDED FILE : ETH_HFARR */ + + }; static gint *ett[] = { - &ett_dcerpc_dssetup, - &ett_dssetup_domain_info, - &ett_dssetup_basic_domain_info, - &ett_dssetup_upgrade_status, - &ett_dssetup_op_status + + +/* INCLUDED FILE : ETH_ETTARR */ + &ett_dssetup, + &ett_dssetup_DsRoleFlags, + &ett_dssetup_DsRolePrimaryDomInfoBasic, + &ett_dssetup_DsRoleUpgradeStatus, + &ett_dssetup_DsRoleOpStatus, + &ett_dssetup_DsRoleInfo, +/* END OF INCLUDED FILE : ETH_ETTARR */ + + }; - proto_dcerpc_dssetup = proto_register_protocol( + proto_dssetup = proto_register_protocol( "Active Directory Setup", "DSSETUP", "dssetup"); - proto_register_field_array(proto_dcerpc_dssetup, hf, array_length(hf)); + proto_register_field_array(proto_dssetup, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } -/* Protocol handoff */ +static dcerpc_sub_dissector function_dissectors[] = { + + +/* INCLUDED FILE : ETH_FT */ + { 0, "DsRoleGetPrimaryDomainInformation", + dssetup_dissect_DsRoleGetPrimaryDomainInformation_request, + dssetup_dissect_DsRoleGetPrimaryDomainInformation_response }, + { 1, "DsRoleDnsNameToFlatName", + dssetup_dissect_DsRoleDnsNameToFlatName_request, + dssetup_dissect_DsRoleDnsNameToFlatName_response }, + { 2, "DsRoleDcAsDc", + dssetup_dissect_DsRoleDcAsDc_request, + dssetup_dissect_DsRoleDcAsDc_response }, + { 3, "DsRoleDcAsReplica", + dssetup_dissect_DsRoleDcAsReplica_request, + dssetup_dissect_DsRoleDcAsReplica_response }, + { 4, "DsRoleDemoteDc", + dssetup_dissect_DsRoleDemoteDc_request, + dssetup_dissect_DsRoleDemoteDc_response }, + { 5, "DsRoleGetDcOperationProgress", + dssetup_dissect_DsRoleGetDcOperationProgress_request, + dssetup_dissect_DsRoleGetDcOperationProgress_response }, + { 6, "DsRoleGetDcOperationResults", + dssetup_dissect_DsRoleGetDcOperationResults_request, + dssetup_dissect_DsRoleGetDcOperationResults_response }, + { 7, "DsRoleCancel", + dssetup_dissect_DsRoleCancel_request, + dssetup_dissect_DsRoleCancel_response }, + { 8, "DsRoleServerSaveStateForUpgrade", + dssetup_dissect_DsRoleServerSaveStateForUpgrade_request, + dssetup_dissect_DsRoleServerSaveStateForUpgrade_response }, + { 9, "DsRoleUpgradeDownlevelServer", + dssetup_dissect_DsRoleUpgradeDownlevelServer_request, + dssetup_dissect_DsRoleUpgradeDownlevelServer_response }, + { 10, "DsRoleAbortDownlevelServerUpgrade", + dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_request, + dssetup_dissect_DsRoleAbortDownlevelServerUpgrade_response }, +/* END OF INCLUDED FILE : ETH_FT */ -static e_uuid_t uuid_dcerpc_dssetup = { - 0x3919286a, 0xb10c, 0x11d0, - { 0x9b, 0xa8, 0x00, 0xc0, 0x4f, 0xd9, 0x2e, 0xf5} -}; -static guint16 ver_dcerpc_dssetup = 0; - -static dcerpc_sub_dissector dssetup_dissectors[] = { - { DSSETUP_DSROLERGETDOMINFO, "DsRolerGetDomInfo", - dssetup_dissect_role_get_dom_info_rqst, - dssetup_dissect_role_get_dom_info_reply }, - { DSSETUP_DSROLER_DNS_NAME_TO_FLAT_NAME, - "DsRolerDnsNameToFlatName", NULL, NULL }, - { DSSETUP_DSROLER_DC_AS_DC, - "DsRolerDcAsDc", NULL, NULL }, - { DSSETUP_DSROLER_DC_AS_REPLICA, - "DsRolerDcAsReplica", NULL, NULL }, - { DSSETUP_DSROLER_DEMOTE_DC, - "DsRolerDemoteDc", NULL, NULL }, - { DSSETUP_DSROLER_GET_DC_OPERATION_PROGRESS, - "DsRolerGetDcOperationProgress", NULL, NULL }, - { DSSETUP_DSROLER_GET_DC_OPERATION_RESULTS, - "DsRolerGetDcOperationResults", NULL, NULL }, - { DSSETUP_DSROLER_CANCEL, - "DsRolerCancel", NULL, NULL }, - { DSSETUP_DSROLER_SERVER_SAVE_STATE_FOR_UPGRADE, - "DsRolerServerSaveStateForUpgrade", NULL, NULL }, - { DSSETUP_DSROLER_UPGRADE_DOWNLEVEL_SERVER, - "DsRolerUpgradeDownlevelServer", NULL, NULL }, - { DSSETUP_DSROLER_ABORT_DOWNLEVEL_SERVER_UPGRADE, - "DsRolerAbortDownlevelServerUpgrade", NULL, NULL }, { 0, NULL, NULL, NULL }, }; void -proto_reg_handoff_dcerpc_dssetup(void) +proto_reg_handoff_dssetup(void) { - /* Register protocol as dcerpc */ - dcerpc_init_uuid(proto_dcerpc_dssetup, ett_dcerpc_dssetup, - &uuid_dcerpc_dssetup, ver_dcerpc_dssetup, - dssetup_dissectors, hf_dssetup_opnum); + +/* INCLUDED FILE : ETH_HANDOFF */ + dcerpc_init_uuid(proto_dssetup, ett_dssetup, + &uuid_dcerpc_dssetup, ver_dssetup, + function_dissectors, hf_dssetup_opnum); +/* END OF INCLUDED FILE : ETH_HANDOFF */ + + } + diff --git a/epan/dissectors/packet-dcerpc-dssetup.h b/epan/dissectors/packet-dcerpc-dssetup.h new file mode 100644 index 0000000000..1040ba28a4 --- /dev/null +++ b/epan/dissectors/packet-dcerpc-dssetup.h @@ -0,0 +1,81 @@ +/* DO NOT EDIT + * This dissector is autogenerated + * ronnie sahlberg 2005 + * Autogenerated based on the IDL definitions from samba4 + */ +/* packet-dcerpc-dssetup.h + * Routines for DSSETUP packet disassembly + * + * $Id: packet-dcerpc-dssetup.h 11410 2004-07-18 18:06:47Z gram $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PACKET_DCERPC_DSSETUP_H +#define __PACKET_DCERPC_DSSETUP_H + + + +/* INCLUDED FILE : ETH_HDR */ + +#define DS_ROLE_STANDALONE_WORKSTATION 0 +#define DS_ROLE_MEMBER_WORKSTATION 1 +#define DS_ROLE_STANDALONE_SERVER 2 +#define DS_ROLE_MEMBER_SERVER 3 +#define DS_ROLE_BACKUP_DC 4 +#define DS_ROLE_PRIMARY_DC 5 + +extern const value_string dssetup_DsRole_vals[]; +int dssetup_dissect_DsRole(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); +int dssetup_dissect_DsRoleFlags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); +int dssetup_dissect_DsRolePrimaryDomInfoBasic(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); + +#define DS_ROLE_NOT_UPGRADING 0 +#define DS_ROLE_UPGRADING 1 + +extern const value_string dssetup_DsUpgrade_vals[]; +int dssetup_dissect_DsUpgrade(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); + +#define DS_ROLE_PREVIOUS_UNKNOWN 0 +#define DS_ROLE_PREVIOUS_PRIMARY 1 +#define DS_ROLE_PREVIOUS_BACKUP 2 + +extern const value_string dssetup_DsPrevious_vals[]; +int dssetup_dissect_DsPrevious(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); +int dssetup_dissect_DsRoleUpgradeStatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); + +#define DS_ROLE_OP_IDLE 0 +#define DS_ROLE_OP_ACTIVE 1 +#define DS_ROLE_OP_NEEDS_REBOOT 2 + +extern const value_string dssetup_DsRoleOp_vals[]; +int dssetup_dissect_DsRoleOp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); +int dssetup_dissect_DsRoleOpStatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); + +#define DS_ROLE_BASIC_INFORMATION 1 +#define DS_ROLE_UPGRADE_STATUS 2 +#define DS_ROLE_OP_STATUS 3 + +extern const value_string dssetup_DsRoleInfoLevel_vals[]; +int dssetup_dissect_DsRoleInfoLevel(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param); +/* END OF INCLUDED FILE : ETH_HDR */ + + + +#endif /* packet-dcerpc-dssetup.h */ |