From 0f45f4bcf76134ff583ef899b132fae5fb315dae Mon Sep 17 00:00:00 2001 From: Matej Tkac Date: Mon, 12 Mar 2018 14:44:15 +0100 Subject: [PATCH] [PFCP] Fixed FAR ID, QER ID and URR ID Allocation Type String appended to the Tree in UI Change-Id: Ib73c6d3d514b3fc464127246ad229df97cdccf35 Reviewed-on: https://code.wireshark.org/review/26443 Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/dissectors/packet-pfcp.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/epan/dissectors/packet-pfcp.c b/epan/dissectors/packet-pfcp.c index 56ef5ea682..04c5ef45de 100644 --- a/epan/dissectors/packet-pfcp.c +++ b/epan/dissectors/packet-pfcp.c @@ -2392,17 +2392,20 @@ static int decode_pfcp_urr_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint offset) { guint32 urr_id; + guint8 urr_id_flag; /* Octet 5 to 8 URR ID value * The bit 8 of octet 5 is used to indicate if the Rule ID is dynamically allocated by the CP function * or predefined in the UP function. If set to 0, it indicates that the Rule is dynamically provisioned * by the CP Function. If set to 1, it indicates that the Rule is predefined in the UP Function */ + urr_id_flag = tvb_get_guint8(tvb, offset) & 0x80; + proto_tree_add_item(tree, hf_pfcp_urr_id_flg, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item_ret_uint(tree, hf_pfcp_urr_id, tvb, offset, 4, ENC_BIG_ENDIAN, &urr_id); offset += 4; proto_item_append_text(item, "%s %u", - ((urr_id & 80000000) ? pfcp_id_predef_dynamic_tfs.true_string : pfcp_id_predef_dynamic_tfs.false_string), + ((urr_id_flag)? pfcp_id_predef_dynamic_tfs.true_string : pfcp_id_predef_dynamic_tfs.false_string), (urr_id & 0x7fffffff)); return offset; @@ -3016,18 +3019,21 @@ static int decode_pfcp_far_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, gint offset) { guint32 far_id; + guint8 far_id_flag; /* Octet 5 to 8 FAR ID value * The bit 8 of octet 5 is used to indicate if the Rule ID is dynamically allocated * by the CP function or predefined in the UP function. If set to 0, it indicates that * the Rule is dynamically provisioned by the CP Function. If set to 1, it indicates that * the Rule is predefined in the UP Function. */ + far_id_flag = tvb_get_guint8(tvb,offset) & 0x80; + proto_tree_add_item(tree, hf_pfcp_far_id_flg, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item_ret_uint(tree, hf_pfcp_far_id, tvb, offset, 4, ENC_BIG_ENDIAN, &far_id); offset += 4; proto_item_append_text(item, "%s %u", - ((far_id&80000000)? pfcp_id_predef_dynamic_tfs.true_string : pfcp_id_predef_dynamic_tfs.false_string), + ((far_id_flag)? pfcp_id_predef_dynamic_tfs.true_string : pfcp_id_predef_dynamic_tfs.false_string), (far_id & 0x7fffffff)); return offset; @@ -3051,17 +3057,20 @@ static int decode_pfcp_qer_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint offset) { guint32 qer_id; + guint8 qer_id_flag; /* Octet 5 to 8 QER ID value * The bit 8 of octet 5 is used to indicate if the Rule ID is dynamically allocated by the CP function * or predefined in the UP function. If set to 0, it indicates that the Rule is dynamically provisioned * by the CP Function. If set to 1, it indicates that the Rule is predefined in the UP Function */ + qer_id_flag = tvb_get_guint8(tvb, offset) & 0x80; + proto_tree_add_item(tree, hf_pfcp_qer_id_flg, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item_ret_uint(tree, hf_pfcp_qer_id, tvb, offset, 4, ENC_BIG_ENDIAN, &qer_id); offset += 4; proto_item_append_text(item, "%s %u", - ((qer_id & 80000000) ? pfcp_id_predef_dynamic_tfs.true_string : pfcp_id_predef_dynamic_tfs.false_string), + ((qer_id_flag)? pfcp_id_predef_dynamic_tfs.true_string : pfcp_id_predef_dynamic_tfs.false_string), (qer_id & 0x7fffffff)); return offset;