summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-dcerpc-nt.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-01-30 03:43:03 +0000
committerGuy Harris <guy@alum.mit.edu>2005-01-30 03:43:03 +0000
commitcdaf516b8b5611c206e1b630a234c3f9a5fcea40 (patch)
tree07d15ad73e247246918801791d2dac210fb6a6a0 /epan/dissectors/packet-dcerpc-nt.c
parent0431c0c49ff2373d0383b9a1adb49ed11fc326da (diff)
downloadwireshark-cdaf516b8b5611c206e1b630a234c3f9a5fcea40.tar.gz
Byte arrays are byte arrays, not strings.
svn path=/trunk/; revision=13203
Diffstat (limited to 'epan/dissectors/packet-dcerpc-nt.c')
-rw-r--r--epan/dissectors/packet-dcerpc-nt.c50
1 files changed, 49 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c
index d76ad8f84a..d5f0bfd155 100644
--- a/epan/dissectors/packet-dcerpc-nt.c
+++ b/epan/dissectors/packet-dcerpc-nt.c
@@ -208,13 +208,61 @@ dissect_ndr_counted_byte_array_cb(tvbuff_t *tvb, int offset,
return offset;
}
+void cb_byte_array_postprocess(packet_info *pinfo, proto_tree *tree _U_,
+ proto_item *item, tvbuff_t *tvb,
+ int start_offset, int end_offset,
+ void *callback_args)
+{
+ gint options = GPOINTER_TO_INT(callback_args);
+ gint levels = CB_STR_ITEM_LEVELS(options);
+ char *s;
+
+ /* Align start_offset on 4-byte boundary. */
+
+ if (start_offset % 4)
+ start_offset += 4 - (start_offset % 4);
+
+ /* Get byte array value */
+
+ if ((end_offset - start_offset) <= 12)
+ return;
+
+ s = tvb_bytes_to_str(
+ tvb, start_offset + 12, (end_offset - start_offset - 12) );
+
+ /* Append string to COL_INFO */
+
+ if (options & CB_STR_COL_INFO) {
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s);
+ }
+
+ /* Append string to upper-level proto_items */
+
+ if (levels > 0 && item && s && s[0]) {
+ proto_item_append_text(item, ": %s", s);
+ item = item->parent;
+ levels--;
+ if (levels > 0) {
+ proto_item_append_text(item, ": %s", s);
+ item = item->parent;
+ levels--;
+ while (levels > 0) {
+ proto_item_append_text(item, " %s", s);
+ item = item->parent;
+ levels--;
+ }
+ }
+ }
+}
+
int
dissect_ndr_counted_byte_array(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree,
guint8 *drep, int hf_index, int levels)
{
return dissect_ndr_counted_byte_array_cb(
- tvb, offset, pinfo, tree, drep, hf_index, cb_str_postprocess, GINT_TO_POINTER(2 + levels));
+ tvb, offset, pinfo, tree, drep, hf_index, cb_byte_array_postprocess, GINT_TO_POINTER(2 + levels));
}
/* This function is used to dissect a DCERPC encoded 64 bit time value.