diff options
author | Darien Spencer <cusneud@mail.com> | 2017-08-25 17:22:14 +0300 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-08-25 20:22:16 +0000 |
commit | 166d95e7cbe9b27b070ac03829f4d8add3a1945e (patch) | |
tree | 9bbb29981851008f96ebb2783b1a869a7d16c7b5 /epan/dissectors/packet-umts_fp.c | |
parent | b1a041898333a8d38387dca4fa6d509881845072 (diff) |
FP: Refactored duplicate code
The 'get packet info from conversation' code was shared in both the 'if' and 'else' cases
Also fixed a comment about the packet's direction
Change-Id: I83568a5be7cba094aea925bdbc70479e50377477
Reviewed-on: https://code.wireshark.org/review/23207
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-umts_fp.c')
-rw-r--r-- | epan/dissectors/packet-umts_fp.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c index af79c4fe0f..0d267233f4 100644 --- a/epan/dissectors/packet-umts_fp.c +++ b/epan/dissectors/packet-umts_fp.c @@ -5497,27 +5497,24 @@ dissect_fp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat if (p_conv_data) { /*Figure out the direction of the link*/ if (addresses_equal(&(pinfo->net_dst), (&p_conv_data->crnc_address))) { + /* Node B -> CRNC*/ + pinfo->link_dir=P2P_DIR_UL; proto_item *item= proto_tree_add_uint(fp_tree, hf_fp_ul_setup_frame, tvb, 0, 0, p_conv_data->ul_frame_number); - PROTO_ITEM_SET_GENERATED(item); - /* CRNC -> Node B */ - pinfo->link_dir=P2P_DIR_UL; - if (p_fp_info == NULL) { - p_fp_info = fp_set_per_packet_inf_from_conv(p_conv, p_conv_data, tvb, pinfo, fp_tree); - } } else { + /* CRNC -> Node B */ + pinfo->link_dir=P2P_DIR_DL; + /* Maybe the frame number should be stored in the proper location already in nbap?, in ul_frame_number*/ proto_item *item= proto_tree_add_uint(fp_tree, hf_fp_dl_setup_frame, tvb, 0, 0, p_conv_data->ul_frame_number); - PROTO_ITEM_SET_GENERATED(item); - pinfo->link_dir=P2P_DIR_DL; - if (p_fp_info == NULL) { - p_fp_info = fp_set_per_packet_inf_from_conv(p_conv, p_conv_data, tvb, pinfo, fp_tree); - } + } + if (p_fp_info == NULL) { + p_fp_info = fp_set_per_packet_inf_from_conv(p_conv, p_conv_data, tvb, pinfo, fp_tree); } } |