Previous checkin did not make sense. We can not have a union without having the
union case value stored as a separate variable or else the receiving side will
not know how to decode the packet.
Therefore it can not be a union at all. Instead we have a REF pointer to a ulong
holding the number of elements, then a unique pointer to a conformant array
of structures.

Thus, the content of the reply packet for function_24 as well as
dsrolegetprimarydomaininfo can not be

 [ref] PRIMARY_DOMAIN_INFO_EX_UNION *pdi;

but instead MUST be
 long num_entries;
 [unique][size_is(num_entries)] PRIMARY_DOMAIN_INFO_EX *pdi;

svn path=/trunk/; revision=6559
This commit is contained in:
Ronnie Sahlberg 2002-11-04 11:52:36 +00:00
parent 299f6f8322
commit cee6c74482
1 changed files with 11 additions and 35 deletions

View File

@ -3,7 +3,7 @@
* Copyright 2001, Tim Potter <tpot@samba.org>
* 2002 structure and command dissectors by Ronnie Sahlberg
*
* $Id: packet-dcerpc-netlogon.c,v 1.60 2002/11/04 09:06:15 sahlberg Exp $
* $Id: packet-dcerpc-netlogon.c,v 1.61 2002/11/04 11:52:36 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -4531,7 +4531,6 @@ netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO_EX(tvbuff_t *tvb, int offset,
return offset;
}
static int
netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree,
@ -4543,33 +4542,6 @@ netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY(tvbuff_t *tvb, int offset,
return offset;
}
static int
netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree,
char *drep)
{
guint32 level;
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
hf_netlogon_level, &level);
ALIGN_TO_4_BYTES;
switch(level){
case 1:
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY, NDR_POINTER_UNIQUE,
"DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY:", -1, 0);
break;
case 2:
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY, NDR_POINTER_UNIQUE,
"DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY:", -1, 0);
break;
}
return offset;
}
static int
netlogon_dissect_element_865_byte(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree,
@ -5370,15 +5342,16 @@ netlogon_dissect_function_24_rqst(tvbuff_t *tvb, int offset,
return offset;
}
static int
netlogon_dissect_function_24_reply(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, char *drep)
{
/*XXX This is a guess, it might be a different struct */
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
hf_netlogon_entries, NULL);
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO, NDR_POINTER_REF,
"DSROLE_PRIMARY_DOMAIN_INFO:", -1, 0);
netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY, NDR_POINTER_UNIQUE,
"DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY:", -1, 0);
offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep,
hf_netlogon_rc, NULL);
@ -5514,9 +5487,12 @@ static int
netlogon_dissect_dsrrolegetprimarydomaininformation_reply(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, char *drep)
{
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
hf_netlogon_entries, NULL);
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO, NDR_POINTER_REF,
"DSROLE_PRIMARY_DOMAIN_INFO:", -1, 0);
netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY, NDR_POINTER_UNIQUE,
"DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY:", -1, 0);
offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep,
hf_netlogon_rc, NULL);