aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mac-lte.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2018-04-12 15:13:50 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2018-04-13 16:25:41 +0000
commit38a806a94ee6c9abf95f8d92f218a5ad47efe113 (patch)
tree4f7145b103c071354fc1850a1e8b4082b17378c7 /epan/dissectors/packet-mac-lte.c
parent5f4ffa2c76eff731b4082e7879d7313416aca67c (diff)
MAC LTE: add an expert info for unknown UDP framing tags
Change-Id: I505e1df17d468c84f363c3be0ac5e2c29c85ca23 Reviewed-on: https://code.wireshark.org/review/26910 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-mac-lte.c')
-rw-r--r--epan/dissectors/packet-mac-lte.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index 7398af5ba6..3b952376b6 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -440,6 +440,7 @@ static expert_field ei_mac_lte_no_per_frame_data = EI_INIT;
static expert_field ei_mac_lte_sch_invalid_length = EI_INIT;
static expert_field ei_mac_lte_mch_invalid_length = EI_INIT;
static expert_field ei_mac_lte_invalid_sc_mcch_sc_mtch_subheader_multiplexing = EI_INIT;
+static expert_field ei_mac_lte_unknown_udp_framing_tag = EI_INIT;
/* Constants and value strings */
@@ -2423,7 +2424,7 @@ call_with_catch_all(dissector_handle_t handle, tvbuff_t* tvb, packet_info *pinfo
/* Dissect context fields in the format described in packet-mac-lte.h.
Return TRUE if the necessary information was successfully found */
gboolean dissect_mac_lte_context_fields(struct mac_lte_info *p_mac_lte_info, tvbuff_t *tvb,
- gint *p_offset)
+ packet_info *pinfo, proto_tree *tree, gint *p_offset)
{
gint offset = *p_offset;
guint8 tag = 0;
@@ -2624,6 +2625,17 @@ gboolean dissect_mac_lte_context_fields(struct mac_lte_info *p_mac_lte_info, tv
default:
/* It must be a recognised tag */
+ {
+ proto_item *ti;
+ proto_tree *subtree;
+
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC-LTE");
+ col_clear(pinfo->cinfo, COL_INFO);
+ ti = proto_tree_add_item(tree, proto_mac_lte, tvb, offset, tvb_reported_length(tvb), ENC_NA);
+ subtree = proto_item_add_subtree(ti, ett_mac_lte);
+ proto_tree_add_expert(subtree, pinfo, &ei_mac_lte_unknown_udp_framing_tag,
+ tvb, offset-1, 1);
+ }
return FALSE;
}
}
@@ -2672,23 +2684,20 @@ static gboolean dissect_mac_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
}
/* Dissect the fields to populate p_mac_lte */
- if (!dissect_mac_lte_context_fields(p_mac_lte_info, tvb, &offset)) {
- return FALSE;
- }
+ if (dissect_mac_lte_context_fields(p_mac_lte_info, tvb, pinfo, tree, &offset)) {
+ if (!infoAlreadySet) {
+ /* Store info in packet */
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_mac_lte, 0, p_mac_lte_info);
+ }
+ /**************************************/
+ /* OK, now dissect as MAC LTE */
- if (!infoAlreadySet) {
- /* Store info in packet */
- p_add_proto_data(wmem_file_scope(), pinfo, proto_mac_lte, 0, p_mac_lte_info);
+ /* Create tvb that starts at actual MAC PDU */
+ mac_tvb = tvb_new_subset_remaining(tvb, offset);
+ dissect_mac_lte(mac_tvb, pinfo, tree, NULL);
}
- /**************************************/
- /* OK, now dissect as MAC LTE */
-
- /* Create tvb that starts at actual MAC PDU */
- mac_tvb = tvb_new_subset_remaining(tvb, offset);
- dissect_mac_lte(mac_tvb, pinfo, tree, NULL);
-
return TRUE;
}
@@ -9514,6 +9523,7 @@ void proto_register_mac_lte(void)
{ &ei_mac_lte_sch_invalid_length, { "mac-lte.sch.invalid-length", PI_MALFORMED, PI_WARN, "Invalid PDU length (should be >= 32768)", EXPFILL }},
{ &ei_mac_lte_mch_invalid_length, { "mac-lte.mch.invalid-length", PI_MALFORMED, PI_WARN, "Invalid PDU length (should be >= 32768)", EXPFILL }},
{ &ei_mac_lte_invalid_sc_mcch_sc_mtch_subheader_multiplexing, { "mac-lte.mch.invalid-sc-mcch-sc-mtch-subheader-multiplexing", PI_MALFORMED, PI_ERROR, "SC-MCCH/SC-MTCH header multiplexed with non padding", EXPFILL }},
+ { &ei_mac_lte_unknown_udp_framing_tag, { "mac-lte.unknown-udp-framing-tag", PI_UNDECODED, PI_WARN, "Unknown UDP framing tag, aborting dissection", EXPFILL }}
};
static const enum_val_t show_info_col_vals[] = {