diff options
author | Michael Mann <mmann78@netscape.net> | 2014-08-01 10:08:57 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-08-03 16:30:10 +0000 |
commit | 5db1352526e71727091ff0e1c0e97821eec4e4cb (patch) | |
tree | 01f836967616b7ae8b2840c488b500c7ff13d55c /epan/dissectors/packet-bat.c | |
parent | 3fa5625ea074908d5617111a7edfcf6d95e6108a (diff) |
Eliminate proto_tree_add_text from some dissectors.
Change-Id: I398e9cf4f6882e76644aa758e12c39a39159e95f
Reviewed-on: https://code.wireshark.org/review/3319
Petri-Dish: Michael Mann <mmann78@netscape.net>
Petri-Dish: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-bat.c')
-rw-r--r-- | epan/dissectors/packet-bat.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/epan/dissectors/packet-bat.c b/epan/dissectors/packet-bat.c index ffea48911c..8ae2c08095 100644 --- a/epan/dissectors/packet-bat.c +++ b/epan/dissectors/packet-bat.c @@ -114,6 +114,8 @@ static int hf_bat_batman_version = -1; static int hf_bat_batman_flags = -1; static int hf_bat_batman_ttl = -1; static int hf_bat_batman_gwflags = -1; +static int hf_bat_batman_gwflags_dl_speed = -1; +static int hf_bat_batman_gwflags_ul_speed = -1; static int hf_bat_batman_seqno = -1; static int hf_bat_batman_gwport = -1; static int hf_bat_batman_orig = -1; @@ -223,8 +225,8 @@ static void dissect_bat_gwflags(tvbuff_t *tvb, guint8 gwflags, int offset, proto up = ((upbits + 1) * down) / 8; gwflags_tree = proto_item_add_subtree(tgw, ett_bat_batman_gwflags); - proto_tree_add_text(gwflags_tree, tvb, offset, 1, "Download Speed: %dkbit", down); - proto_tree_add_text(gwflags_tree, tvb, offset, 1, "Upload Speed: %dkbit", up); + proto_tree_add_uint_format_value(gwflags_tree, hf_bat_batman_gwflags_dl_speed, tvb, offset, 1, down, "%dkbit", down); + proto_tree_add_uint_format_value(gwflags_tree, hf_bat_batman_gwflags_ul_speed, tvb, offset, 1, up, "%dkbit", up); } @@ -746,6 +748,16 @@ void proto_register_bat(void) FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_bat_batman_gwflags_dl_speed, + { "Download Speed", "bat.batman.gwflags.dl_speed", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_bat_batman_gwflags_ul_speed, + { "Upload Speed", "bat.batman.gwflags.ul_speed", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, { &hf_bat_batman_seqno, { "Sequence number", "bat.batman.seq", FT_UINT16, BASE_DEC, NULL, 0x0, |