aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-data.c
diff options
context:
space:
mode:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2009-01-16 11:51:19 +0000
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2009-01-16 11:51:19 +0000
commitcc2f8f2c828e00f8b54d034c1afd4e6ece0d8b0a (patch)
tree05f8f2c09346ba77b26a304c5d36bdd65978f0ff /epan/dissectors/packet-data.c
parentcbf5760e264ea598094bcb97b6abf2e7df789e9a (diff)
Added a length entry.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27244 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-data.c')
-rw-r--r--epan/dissectors/packet-data.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/epan/dissectors/packet-data.c b/epan/dissectors/packet-data.c
index a942cfb874..e827be0f05 100644
--- a/epan/dissectors/packet-data.c
+++ b/epan/dissectors/packet-data.c
@@ -35,13 +35,16 @@
* print routines
*/
int proto_data = -1;
-int hf_data_data = -1;
-int ett_data = -1;
+
+static int hf_data_data = -1;
+static int hf_data_len = -1;
+
+static gint ett_data = -1;
static void
dissect_data(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
{
- int bytes;
+ gint bytes;
if (tree) {
bytes = tvb_length_remaining(tvb, 0);
@@ -53,6 +56,9 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
proto_tree *data_tree = proto_item_add_subtree(ti, ett_data);
proto_tree_add_item(data_tree, hf_data_data, tvb, 0, bytes, FALSE);
+
+ ti = proto_tree_add_int(data_tree, hf_data_len, tvb, 0, 0, bytes);
+ PROTO_ITEM_SET_GENERATED (ti);
}
}
}
@@ -61,9 +67,10 @@ void
proto_register_data(void)
{
static hf_register_info hf[] = {
- {&hf_data_data,
- {"Data", "data.data", FT_BYTES, BASE_HEX, NULL, 0x0,
- NULL, HFILL}}
+ { &hf_data_data,
+ { "Data", "data.data", FT_BYTES, BASE_HEX, NULL, 0x0, NULL, HFILL } },
+ { &hf_data_len,
+ { "Length", "data.len", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }
};
static gint *ett[] = {