aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Karlsson <oakimk@gmail.com>2019-01-24 15:40:38 +0100
committerAnders Broman <a.broman58@gmail.com>2019-01-25 11:18:16 +0000
commit394e39117f075a924511a0803dea99b1b6a5cc0c (patch)
tree5467578037953ced88ee9742d1e5dc9499e33a2d
parent31aba351e206b31bd82614f6402f4a1de5f4c1b3 (diff)
pfcp: Improved printout on some IEs
Change-Id: I98599f3c990a3b446b8080a24002371b5cf1a98b Reviewed-on: https://code.wireshark.org/review/31718 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-pfcp.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/epan/dissectors/packet-pfcp.c b/epan/dissectors/packet-pfcp.c
index 66a50bab25..efc2c548f2 100644
--- a/epan/dissectors/packet-pfcp.c
+++ b/epan/dissectors/packet-pfcp.c
@@ -116,6 +116,7 @@ static int hf_pfcp_ue_ip_addr_ipv4 = -1;
static int hf_pfcp_ue_ip_add_ipv6 = -1;
static int hf_pfcp_ue_ip_add_ipv6_prefix = -1;
static int hf_pfcp_application_id = -1;
+static int hf_pfcp_application_id_str = -1;
static int hf_pfcp_sdf_filter_flags = -1;
static int hf_pfcp_sdf_filter_flags_b0_fd = -1;
@@ -306,6 +307,7 @@ static int hf_pfcp_usage_information_b1_aft = -1;
static int hf_pfcp_usage_information_b0_bef = -1;
static int hf_pfcp_application_instance_id = -1;
+static int hf_pfcp_application_instance_id_str = -1;
static int hf_pfcp_flow_dir = -1;
static int hf_pfcp_packet_rate = -1;
static int hf_pfcp_packet_rate_b0_ulpr = -1;
@@ -1469,10 +1471,13 @@ decode_pfcp_network_instance(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII);
}
proto_tree_add_string(tree, hf_pfcp_network_instance, tvb, offset, length, apn);
+ proto_item_append_text(item, "%s", apn);
} else {
/* Domain name*/
- proto_tree_add_item(tree, hf_pfcp_network_instance, tvb, offset, length, ENC_ASCII | ENC_NA);
+ const guint8* string_value;
+ proto_tree_add_item_ret_string(tree, hf_pfcp_network_instance, tvb, offset, length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &string_value);
+ proto_item_append_text(item, "%s", string_value);
}
}
@@ -1587,10 +1592,20 @@ static void
dissect_pfcp_application_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_)
{
int offset = 0;
+
/* Octet 5 to (n+4) Application Identifier
* The Application Identifier shall be encoded as an OctetString (see 3GPP TS 29.212)
*/
- proto_tree_add_item(tree, hf_pfcp_application_id, tvb, offset, length, ENC_NA);
+ if (tvb_ascii_isprint(tvb, offset, length))
+ {
+ const guint8* string_value;
+ proto_tree_add_item_ret_string(tree, hf_pfcp_application_id_str, tvb, offset, length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &string_value);
+ proto_item_append_text(item, "%s", string_value);
+ }
+ else
+ {
+ proto_tree_add_item(tree, hf_pfcp_application_id, tvb, offset, length, ENC_NA);
+ }
}
/*
* 8.2.7 Gate Status
@@ -3387,10 +3402,21 @@ dissect_pfcp_usage_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
static void
dissect_pfcp_application_instance_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_)
{
+ int offset = 0;
+
/* Octet 5 5 to (n+4) Application Instance Identifier
* The Application Instance Identifier shall be encoded as an OctetString (see 3GPP TS 29.212)
*/
- proto_tree_add_item(tree, hf_pfcp_application_instance_id, tvb, 0, length, ENC_NA);
+ if (tvb_ascii_isprint(tvb, offset, length))
+ {
+ const guint8* string_value;
+ proto_tree_add_item_ret_string(tree, hf_pfcp_application_instance_id_str, tvb, offset, length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &string_value);
+ proto_item_append_text(item, "%s", string_value);
+ }
+ else
+ {
+ proto_tree_add_item(tree, hf_pfcp_application_instance_id, tvb, offset, length, ENC_NA);
+ }
}
/*
@@ -6315,6 +6341,11 @@ proto_register_pfcp(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
+ { &hf_pfcp_application_id_str,
+ { "Application Identifier", "pfcp.application_id_str",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }
+ },
{ &hf_pfcp_sdf_filter_flags,
{ "Flags", "pfcp.sdf_filter_flags",
FT_UINT8, BASE_HEX, NULL, 0x0,
@@ -7164,6 +7195,11 @@ proto_register_pfcp(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
+ { &hf_pfcp_application_instance_id_str,
+ { "Application Instance Identifier", "pfcp.application_instance_id_str",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }
+ },
{ &hf_pfcp_flow_dir,
{ "Flow Direction", "pfcp.flow_dir",
FT_UINT8, BASE_DEC, VALS(pfcp_flow_dir_vals), 0x07,