aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_um.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-08-07 08:36:30 -0400
committerAnders Broman <a.broman58@gmail.com>2014-08-08 05:51:52 +0000
commita22b7075f84b8faf83a3ef05e45ea6d922c5001f (patch)
tree519e874bc10d1231b0dd9632dd91dabbb11502ef /epan/dissectors/packet-gsm_um.c
parent532a98dc8c827471e143c81517b7ebb321400f84 (diff)
Eliminate proto_tree_add_text from some dissectors.
Change-Id: I6f1710a093fc548c718defa9b40ab68877ede977 Reviewed-on: https://code.wireshark.org/review/3470 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-gsm_um.c')
-rw-r--r--epan/dissectors/packet-gsm_um.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/epan/dissectors/packet-gsm_um.c b/epan/dissectors/packet-gsm_um.c
index c6190f8f42..7f6715584c 100644
--- a/epan/dissectors/packet-gsm_um.c
+++ b/epan/dissectors/packet-gsm_um.c
@@ -39,6 +39,8 @@ static int hf_gsm_um_direction = -1;
static int hf_gsm_um_channel = -1;
static int hf_gsm_um_bsic = -1;
static int hf_gsm_um_arfcn = -1;
+static int hf_gsm_um_band = -1;
+static int hf_gsm_um_frequency = -1;
static int hf_gsm_um_frame = -1;
static int hf_gsm_um_error = -1;
static int hf_gsm_um_timeshift = -1;
@@ -173,9 +175,10 @@ dissect_gsm_um(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(gsm_um_tree, hf_gsm_um_arfcn, tvb, 0, 0,
pinfo->pseudo_header->gsm_um.arfcn);
- proto_tree_add_text(gsm_um_tree, tvb, 0, 0,
- "Band: %s, Frequency: %u.%03uMHz", band,
- downlink / 1000, downlink % 1000);
+ proto_tree_add_string(gsm_um_tree, hf_gsm_um_band, tvb, 0, 0,
+ band);
+ proto_tree_add_uint_format_value(gsm_um_tree, hf_gsm_um_frequency, tvb, 0, 0,
+ downlink, "%u.%03uMHz", downlink / 1000, downlink % 1000);
proto_tree_add_uint(gsm_um_tree, hf_gsm_um_bsic, tvb, 0, 0,
pinfo->pseudo_header->gsm_um.bsic);
proto_tree_add_uint(gsm_um_tree, hf_gsm_um_frame, tvb, 0, 0,
@@ -249,6 +252,14 @@ proto_register_gsm_um(void)
{ "ARFCN", "gsm_um.arfcn", FT_UINT16, BASE_DEC,
NULL, 0x0, "Absolute radio frequency channel number", HFILL }},
+ { &hf_gsm_um_band,
+ { "Band", "gsm_um.band", FT_STRING, BASE_NONE,
+ NULL, 0x0, NULL, HFILL }},
+
+ { &hf_gsm_um_frequency,
+ { "Frequency", "gsm_um.frequency", FT_UINT32, BASE_DEC,
+ NULL, 0x0, NULL, HFILL }},
+
{ &hf_gsm_um_frame,
{ "TDMA Frame", "gsm_um.frame", FT_UINT32, BASE_DEC,
NULL, 0x0, NULL, HFILL }},