aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/dcerpc/drsuapi
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-03-12 12:04:44 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-03-12 12:04:44 +0000
commit54edd224ffa43a0f355b0b0b03d8a22d5dd71b5c (patch)
tree229ae20f6aac188687fb1b8c9282e17415226823 /epan/dissectors/dcerpc/drsuapi
parent947e7f41ab86d227a12dbd54a2c1a5401c2891af (diff)
the previous drsuapi patch showed how idl2eth can handle embedded arrays just fine.
beautifully fine. this patch overrides the array, tells idl2eth to not generate code to unmarshall the conformance blob or the data for the array. a handwritted replacement function is implemented in the template instead which prettifies the output a lot. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13735 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/dcerpc/drsuapi')
-rwxr-xr-xepan/dissectors/dcerpc/drsuapi/drsuapi.cnf4
-rw-r--r--epan/dissectors/dcerpc/drsuapi/drsuapi.idl4
-rwxr-xr-xepan/dissectors/dcerpc/drsuapi/template.c47
3 files changed, 53 insertions, 2 deletions
diff --git a/epan/dissectors/dcerpc/drsuapi/drsuapi.cnf b/epan/dissectors/dcerpc/drsuapi/drsuapi.cnf
index 5501f40ffd..66f7243a70 100755
--- a/epan/dissectors/dcerpc/drsuapi/drsuapi.cnf
+++ b/epan/dissectors/dcerpc/drsuapi/drsuapi.cnf
@@ -3,3 +3,7 @@
#We dont know this type yet
TYPE a_string drsuapi_dissect_a_string FT_STRING BASE_NONE 0 NULL 4
#
+# this one is better/easier to just implement by hand
+NOEMIT drsuapi_dissect_DsReplicaSyncRequest1Info_nc_dn
+NOEMIT ucarray_drsuapi_dissect_DsReplicaSyncRequest1Info_nc_dn
+#
diff --git a/epan/dissectors/dcerpc/drsuapi/drsuapi.idl b/epan/dissectors/dcerpc/drsuapi/drsuapi.idl
index 074bbe26e6..01a9f710af 100644
--- a/epan/dissectors/dcerpc/drsuapi/drsuapi.idl
+++ b/epan/dissectors/dcerpc/drsuapi/drsuapi.idl
@@ -120,10 +120,10 @@ interface drsuapi
uint32 unknown1;
uint32 unknown2;
GUID guid1;
- /* this looks like a SID followed by a uint32 which is zero */
+ /* this looks like a domain SID followed by a uint32 which is zero */
uint8 byte_array[28];
uint32 str_len;
- [size_is(str_len)] uint16 nc_dn[];
+ [size_is(str_len+1)] uint16 nc_dn[];
} drsuapi_DsReplicaSyncRequest1Info;
typedef bitmap {
diff --git a/epan/dissectors/dcerpc/drsuapi/template.c b/epan/dissectors/dcerpc/drsuapi/template.c
index 5a715da15f..4465106c60 100755
--- a/epan/dissectors/dcerpc/drsuapi/template.c
+++ b/epan/dissectors/dcerpc/drsuapi/template.c
@@ -41,11 +41,54 @@
#include "packet-dcerpc-drsuapi.h"
static int proto_drsuapi = -1;
+static int hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn = -1;
ETH_HF
ETH_ETT
static int
+ucarray_drsuapi_dissect_DsReplicaSyncRequest1Info_nc_dn(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+ header_field_info *hfinfo;
+ static guint32 len;
+ dcerpc_info *di;
+ char *s;
+ int old_offset;
+
+ di=pinfo->private_data;
+ if(di->conformant_run){
+ /*just a run to handle conformant arrays, nothing to dissect
+ but we need to remember how long this array was.
+ see packet-dcerpc.c for examples of conformant_run
+ and what it is.
+ */
+ old_offset=offset;
+ offset=dissect_dcerpc_uint32(tvb, offset, pinfo, NULL, drep, -1, &len);
+ di->array_max_count_offset=offset-4;
+ di->conformant_run=1;
+ di->conformant_eaten=offset-old_offset;
+ return offset;
+ }
+
+ ALIGN_TO_2_BYTES;
+
+ s = tvb_fake_unicode(tvb, offset, len, TRUE);
+ if (tree && len) {
+ hfinfo = proto_registrar_get_nth(hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn);
+ if (hfinfo->type == FT_STRING) {
+ proto_tree_add_string(tree, hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn, tvb, offset,
+ len, s);
+ } else {
+ proto_tree_add_item(tree, hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn, tvb, offset,
+ len, drep[0] & 0x10);
+ }
+ }
+
+ offset+=2*len;
+ return offset;
+}
+
+static int
drsuapi_dissect_a_string(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
{
offset=dissect_ndr_vstring(tvb, offset, pinfo, tree, drep, 1, hf_index, FALSE, NULL);
@@ -58,6 +101,10 @@ void
proto_register_drsuapi(void)
{
static hf_register_info hf[] = {
+ { &hf_drsuapi_DsReplicaSyncRequest1Info_nc_dn,
+ { "nc_dn", "drsuapi.DsReplicaSyncRequest1Info.nc_dn", FT_STRING, BASE_DEC,
+ NULL, 0,
+ "", HFILL }},
ETH_HFARR
};