diff options
author | Darien Spencer <cusneud@mail.com> | 2018-06-06 23:18:49 +0300 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-06-07 04:57:10 +0000 |
commit | 27ce47ce83fb496c78821a934a9e16e20156a0ca (patch) | |
tree | d776cb24af5e0e82d33aae494cabb3db6508dca3 | |
parent | 24713511ebe18a91835c8f77dac2349d0dd10445 (diff) |
FP: Decode T1,T2,T3
Converting the encoded value to milliseconds according to
TS 25.427 - 6.3.3.6
Change-Id: I0aa03351c2976782da9832d50c4f6792f864864a
Reviewed-on: https://code.wireshark.org/review/28074
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-umts_fp.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c index 8922bca189..1db23a597c 100644 --- a/epan/dissectors/packet-umts_fp.c +++ b/epan/dissectors/packet-umts_fp.c @@ -1100,11 +1100,12 @@ dissect_common_dl_node_synchronisation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { /* T1 (3 bytes) */ - guint32 t1 = tvb_get_ntoh24(tvb, offset); - proto_tree_add_item(tree, hf_fp_t1, tvb, offset, 3, ENC_BIG_ENDIAN); + guint32 encoded = tvb_get_ntoh24(tvb, offset); + float t1 = encoded * (float)0.125; + proto_tree_add_float_format_value(tree, hf_fp_t1, tvb, offset, 3, t1, "%.3f ms (%u)", t1, encoded); offset += 3; - col_append_fstr(pinfo->cinfo, COL_INFO, " T1=%u", t1); + col_append_fstr(pinfo->cinfo, COL_INFO, " T1=%.3f", t1); return offset; } @@ -1113,24 +1114,28 @@ static int dissect_common_ul_node_synchronisation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - guint32 t1, t2, t3; + guint32 encoded; + float t1, t2, t3; /* T1 (3 bytes) */ - t1 = tvb_get_ntoh24(tvb, offset); - proto_tree_add_item(tree, hf_fp_t1, tvb, offset, 3, ENC_BIG_ENDIAN); + encoded = tvb_get_ntoh24(tvb, offset); + t1 = encoded * (float)0.125; + proto_tree_add_float_format_value(tree, hf_fp_t1, tvb, offset, 3, t1, "%.3f ms (%u)", t1, encoded); offset += 3; /* T2 (3 bytes) */ - t2 = tvb_get_ntoh24(tvb, offset); - proto_tree_add_item(tree, hf_fp_t2, tvb, offset, 3, ENC_BIG_ENDIAN); + encoded = tvb_get_ntoh24(tvb, offset); + t2 = encoded * (float)0.125; + proto_tree_add_float_format_value(tree, hf_fp_t2, tvb, offset, 3, t2, "%.3f ms (%u)", t2, encoded); offset += 3; /* T3 (3 bytes) */ - t3 = tvb_get_ntoh24(tvb, offset); - proto_tree_add_item(tree, hf_fp_t3, tvb, offset, 3, ENC_BIG_ENDIAN); + encoded = tvb_get_ntoh24(tvb, offset); + t3 = encoded * (float)0.125; + proto_tree_add_float_format_value(tree, hf_fp_t3, tvb, offset, 3, t3, "%.3f ms (%u)", t3, encoded); offset += 3; - col_append_fstr(pinfo->cinfo, COL_INFO, " T1=%u T2=%u, T3=%u", + col_append_fstr(pinfo->cinfo, COL_INFO, " T1=%.3f T2=%.3f, T3=%.3f", t1, t2, t3); return offset; @@ -6483,19 +6488,19 @@ void proto_register_fp(void) }, { &hf_fp_t1, { "T1", - "fp.t1", FT_UINT24, BASE_DEC, NULL, 0x0, + "fp.t1", FT_FLOAT, BASE_NONE, NULL, 0x0, "RNC frame number indicating time it sends frame", HFILL } }, { &hf_fp_t2, { "T2", - "fp.t2", FT_UINT24, BASE_DEC, NULL, 0x0, + "fp.t2", FT_FLOAT, BASE_NONE, NULL, 0x0, "NodeB frame number indicating time it received DL Sync", HFILL } }, { &hf_fp_t3, { "T3", - "fp.t3", FT_UINT24, BASE_DEC, NULL, 0x0, + "fp.t3", FT_FLOAT, BASE_NONE, NULL, 0x0, "NodeB frame number indicating time it sends frame", HFILL } }, |