aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dcerpc-netlogon.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2002-11-04 11:52:36 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2002-11-04 11:52:36 +0000
commita2d8f07d7ea6fae4281a5877464000cd7fd6fffc (patch)
treec1853c0c13e88f142c59d56c9873e9e7aefe7cd3 /packet-dcerpc-netlogon.c
parenta7f2e8a0e17699f152182d2829d58d5fd7119b56 (diff)
Bugfix.
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; git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6559 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-dcerpc-netlogon.c')
-rw-r--r--packet-dcerpc-netlogon.c46
1 files changed, 11 insertions, 35 deletions
diff --git a/packet-dcerpc-netlogon.c b/packet-dcerpc-netlogon.c
index ea75aa0dd4..de5d4bad74 100644
--- a/packet-dcerpc-netlogon.c
+++ b/packet-dcerpc-netlogon.c
@@ -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,
@@ -4544,33 +4543,6 @@ netlogon_dissect_DSROLE_PRIMARY_DOMAIN_INFO_EX_ARRAY(tvbuff_t *tvb, int 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,
char *drep)
@@ -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);