aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatej Tkac <matej.tkac.mt@gmail.com>2017-11-09 13:58:47 +0100
committerAnders Broman <a.broman58@gmail.com>2017-11-09 15:49:24 +0000
commit2ebc41050e43c508edbc8c0fa8cccb9797c463cf (patch)
treecf16e883f8d9df2bcacda81a47e8e3169ea82dd5
parente7e4dc5d98869f91af3e649324d726217b2a8861 (diff)
[PFCP] Dissect Node ID and minor fixes
Fixed FQDN Field in Dissect Node ID according to 3GPP 29.244 Section 8.2.38 Added "Encoding error" message if the value in field is in dotted form contrary to the doc. Minor fix: Decreased F-TEID Flags spare bits (fix of dc269fcd6f1ebc41d4e164f14dbb2a078bbb6265) Change-Id: I7e9ba53a7deed7af1305f5c445bf4b2a9212e115 Reviewed-on: https://code.wireshark.org/review/24321 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.c82
1 files changed, 42 insertions, 40 deletions
diff --git a/epan/dissectors/packet-pfcp.c b/epan/dissectors/packet-pfcp.c
index 5016b7d..649de53 100644
--- a/epan/dissectors/packet-pfcp.c
+++ b/epan/dissectors/packet-pfcp.c
@@ -1646,8 +1646,8 @@ dissect_pfcp_f_seid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_i
}
}
- /*
- * 8.2.38 Node ID
+/*
+ * 8.2.38 Node ID
*/
static const value_string pfcp_node_id_type_vals[] = {
@@ -1671,45 +1671,47 @@ dissect_pfcp_node_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_
offset++;
switch (node_id_type) {
- case 0:
- /* IPv4 address */
- proto_tree_add_item(tree, hf_pfcp_node_id_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
- proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(tvb, offset));
- offset += 4;
- break;
- case 1:
- /* IPv4 address */
- proto_tree_add_item(tree, hf_pfcp_node_id_ipv6, tvb, offset, 16, ENC_NA);
- proto_item_append_text(item, "IPv6 %s", tvb_ip6_to_str(tvb, offset));
- offset += 16;
- break;
- case 2:
- /* FQDN, the Node ID value encoding shall be identical to the encoding of a FQDN
- * within a DNS message of section 3.1 of IETF RFC 1035 [27] but excluding the trailing zero byte.
- */
- if (length > 1) {
- name_len = tvb_get_guint8(tvb, offset);
-
- if (name_len < 0x20) {
- fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 2, ENC_ASCII);
- for (;;) {
- if (name_len >= length - 2)
- break;
- tmp = name_len;
- name_len = name_len + fqdn[tmp] + 1;
- fqdn[tmp] = '.';
+ case 0:
+ /* IPv4 address */
+ proto_tree_add_item(tree, hf_pfcp_node_id_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(tvb, offset));
+ offset += 4;
+ break;
+ case 1:
+ /* IPv6 address */
+ proto_tree_add_item(tree, hf_pfcp_node_id_ipv6, tvb, offset, 16, ENC_NA);
+ proto_item_append_text(item, "IPv6 %s", tvb_ip6_to_str(tvb, offset));
+ offset += 16;
+ break;
+ case 2:
+ /* FQDN, the Node ID value encoding shall be identical to the encoding of a FQDN
+ * within a DNS message of section 3.1 of IETF RFC 1035 [27] but excluding the trailing zero byte.
+ */
+ if (length > 1) {
+ name_len = tvb_get_guint8(tvb, offset);
+ /* NOTE 1: The FQDN field in the IE is not encoded as a dotted string as commonly used in DNS master zone files. */
+ if (name_len < 0x20) {
+ fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 2, ENC_ASCII);
+ for (;;) {
+ if (name_len >= length - 2)
+ break;
+ tmp = name_len;
+ name_len = name_len + fqdn[tmp] + 1;
+ fqdn[tmp] = '.';
+ }
}
+ /* In case the FQDN field is incorrectly in dotted string form.*/
+ else {
+ fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length - 1, ENC_ASCII);
+ proto_tree_add_expert(tree, pinfo, &ei_pfcp_ie_encoding_error, tvb, offset, length - 1);
+ }
+ proto_tree_add_string(tree, hf_pfcp_node_id_fqdn, tvb, offset, length - 1, fqdn);
+ proto_item_append_text(item, "%s", fqdn);
+ offset += length - 1;
}
- else {
- fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length -1, ENC_ASCII);
- }
- proto_tree_add_string(tree, hf_pfcp_node_id_fqdn, tvb, offset, length - 1, fqdn);
- proto_item_append_text(item, "%s", fqdn);
- offset += length - 1;
- }
- break;
- default:
- break;
+ break;
+ default:
+ break;
}
if (offset < length) {
@@ -3719,7 +3721,7 @@ proto_register_pfcp(void)
},
{ &hf_pfcp_fteid_flg_spare,
{ "Spare", "pfcp.fteid_flg.spare",
- FT_UINT8, BASE_DEC, NULL, 0xf8,
+ FT_UINT8, BASE_DEC, NULL, 0xf0,
NULL, HFILL }
},
{ &hf_pfcp_fteid_flg_b3_ch_id,