aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-frame.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2009-11-25 19:18:41 +0000
committerGerald Combs <gerald@wireshark.org>2009-11-25 19:18:41 +0000
commit4c6f3e96de4b448dec6dbbe59068f99b47f2af8a (patch)
tree49cc6e820c210ef5021031148aed9cbdc95ed55e /epan/dissectors/packet-frame.c
parent9ca6c5518c385bb206e5586e28c4d7b62399cdc4 (diff)
Show the number of bits captured and on the wire. Use unsigned ints.
svn path=/trunk/; revision=31074
Diffstat (limited to 'epan/dissectors/packet-frame.c')
-rw-r--r--epan/dissectors/packet-frame.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c
index b461397f26..2698028aed 100644
--- a/epan/dissectors/packet-frame.c
+++ b/epan/dissectors/packet-frame.c
@@ -116,10 +116,11 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
proto_item *volatile ti = NULL;
nstime_t ts;
- int cap_len = 0, frame_len = 0;
+ guint cap_len = 0, frame_len = 0;
proto_tree *volatile tree;
proto_item *item;
guint32 frame_number;
+ gchar *cap_plurality, *frame_plurality;
frame_number=pinfo->fd->num; /* dummy so that the buildbot crashdumps
will show the packetnumber where the
@@ -194,8 +195,13 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
cap_len = tvb_length(tvb);
frame_len = tvb_reported_length(tvb);
+ cap_plurality = plurality(cap_len, "", "s");
+ frame_plurality = plurality(frame_len, "", "s");
+
ti = proto_tree_add_protocol_format(tree, proto_frame, tvb, 0, -1,
- "Frame %u (%u bytes on wire, %u bytes captured)", pinfo->fd->num, frame_len, cap_len);
+ "Frame %u: %u byte%s on wire (%u bits), %u byte%s captured (%u bits)",
+ pinfo->fd->num, frame_len, frame_plurality, frame_len * 8,
+ cap_len, cap_plurality, cap_len * 8);
fh_tree = proto_item_add_subtree(ti, ett_frame);
@@ -237,12 +243,12 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
0, 0, pinfo->fd->num);
proto_tree_add_uint_format(fh_tree, hf_frame_len, tvb,
- 0, 0, frame_len, "Frame Length: %d byte%s", frame_len,
- plurality(frame_len, "", "s"));
+ 0, 0, frame_len, "Frame Length: %u byte%s (%u bits)",
+ frame_len, frame_plurality, frame_len * 8);
proto_tree_add_uint_format(fh_tree, hf_frame_capture_len, tvb,
- 0, 0, cap_len, "Capture Length: %d byte%s", cap_len,
- plurality(cap_len, "", "s"));
+ 0, 0, cap_len, "Capture Length: %u byte%s (%u bits)",
+ cap_len, cap_plurality, cap_len * 8);
if (generate_md5_hash) {
const guint8 *cp;