summaryrefslogtreecommitdiff
path: root/asn1
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-07-16 19:22:52 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2015-07-16 17:26:47 +0000
commitc911b089661e07d553b60613eac65715a8c79583 (patch)
treeb13ec9364c8363f84620fd8acc26d285b53c6615 /asn1
parent5411d70e2ea8b90932161605b7576590d5c2eb5b (diff)
downloadwireshark-c911b089661e07d553b60613eac65715a8c79583.tar.gz
LTE RRC: fix dissection of ETWS/CMAS warning messages
Change-Id: I20bb219a32b6c7e39ac415c5c13ad5379f78cba2 Reviewed-on: https://code.wireshark.org/review/9660 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'asn1')
-rw-r--r--asn1/lte-rrc/lte-rrc.cnf44
-rw-r--r--asn1/lte-rrc/packet-lte-rrc-template.c192
2 files changed, 233 insertions, 3 deletions
diff --git a/asn1/lte-rrc/lte-rrc.cnf b/asn1/lte-rrc/lte-rrc.cnf
index 0defb3ce66..510d572427 100644
--- a/asn1/lte-rrc/lte-rrc.cnf
+++ b/asn1/lte-rrc/lte-rrc.cnf
@@ -572,6 +572,16 @@ SystemInformationBlockType11/messageIdentifier TYPE=FT_UINT16 DISPLAY=BASE_DEC|B
proto_tree_add_item(subtree, hf_lte_rrc_serialNumber_upd_nb, serial_nb_tvb, 0, 2, ENC_BIG_ENDIAN);
}
+#.FN_BODY SystemInformationBlockType11/warningMessageSegmentType VAL_PTR=&segment_type
+ guint32 segment_type;
+%(DEFAULT_BODY)s
+ private_data_set_warning_message_segment_type(actx, (guint8)segment_type);
+
+#.FN_BODY SystemInformationBlockType11/warningMessageSegmentNumber VAL_PTR=&segment_number
+ guint32 segment_number;
+%(DEFAULT_BODY)s
+ private_data_set_warning_message_segment_number(actx, (guint8)segment_number);
+
#.FN_BODY SystemInformationBlockType11/dataCodingScheme VAL_PTR=&data_coding_scheme_tvb
tvbuff_t *data_coding_scheme_tvb = NULL;
%(DEFAULT_BODY)s
@@ -595,8 +605,18 @@ SystemInformationBlockType11/messageIdentifier TYPE=FT_UINT16 DISPLAY=BASE_DEC|B
p_dcs = g_hash_table_lookup(lte_rrc_etws_cmas_dcs_hash, GUINT_TO_POINTER((guint)private_data_get_message_identifier(actx)));
if (warning_msg_seg_tvb && p_dcs) {
proto_tree *subtree;
+ tvbuff_t *frag_tvb;
+ fragment_head *frag_data = fragment_add_seq_check(&lte_rrc_sib11_reassembly_table, warning_msg_seg_tvb, 0, actx->pinfo,
+ private_data_get_message_identifier(actx), NULL,
+ private_data_get_warning_message_segment_number(actx),
+ tvb_reported_length(warning_msg_seg_tvb),
+ private_data_get_warning_message_segment_type(actx) ? FALSE : TRUE);
subtree = proto_item_add_subtree(actx->created_item, ett_lte_rrc_warningMessageSegment);
- dissect_lte_rrc_warningMessageSegment(warning_msg_seg_tvb, subtree, actx->pinfo, GPOINTER_TO_UINT(p_dcs));
+ frag_tvb = process_reassembled_data(warning_msg_seg_tvb, 0, actx->pinfo, "Reassembled SIB11 warning message",
+ frag_data, &lte_rrc_sib11_frag_items, NULL, subtree);
+ if (frag_tvb) {
+ dissect_lte_rrc_warningMessageSegment(frag_tvb, subtree, actx->pinfo, GPOINTER_TO_UINT(p_dcs));
+ }
}
#.TYPE_ATTR
@@ -627,6 +647,16 @@ SystemInformationBlockType12-r9/messageIdentifier-r9 TYPE=FT_UINT16 DISPLAY=BASE
proto_tree_add_item(subtree, hf_lte_rrc_serialNumber_upd_nb, serial_nb_tvb, 0, 2, ENC_BIG_ENDIAN);
}
+#.FN_BODY SystemInformationBlockType12-r9/warningMessageSegmentType-r9 VAL_PTR=&segment_type
+ guint32 segment_type;
+%(DEFAULT_BODY)s
+ private_data_set_warning_message_segment_type(actx, (guint8)segment_type);
+
+#.FN_BODY SystemInformationBlockType12-r9/warningMessageSegmentNumber-r9 VAL_PTR=&segment_number
+ guint32 segment_number;
+%(DEFAULT_BODY)s
+ private_data_set_warning_message_segment_number(actx, (guint8)segment_number);
+
#.FN_BODY SystemInformationBlockType12-r9/dataCodingScheme-r9 VAL_PTR=&data_coding_scheme_tvb
tvbuff_t *data_coding_scheme_tvb = NULL;
%(DEFAULT_BODY)s
@@ -650,8 +680,18 @@ SystemInformationBlockType12-r9/messageIdentifier-r9 TYPE=FT_UINT16 DISPLAY=BASE
p_dcs = g_hash_table_lookup(lte_rrc_etws_cmas_dcs_hash, GUINT_TO_POINTER((guint)private_data_get_message_identifier(actx)));
if (warning_msg_seg_tvb && p_dcs) {
proto_tree *subtree;
+ tvbuff_t *frag_tvb;
+ fragment_head *frag_data = fragment_add_seq_check(&lte_rrc_sib12_reassembly_table, warning_msg_seg_tvb, 0, actx->pinfo,
+ private_data_get_message_identifier(actx), NULL,
+ private_data_get_warning_message_segment_number(actx),
+ tvb_reported_length(warning_msg_seg_tvb),
+ private_data_get_warning_message_segment_type(actx) ? FALSE : TRUE);
subtree = proto_item_add_subtree(actx->created_item, ett_lte_rrc_warningMessageSegment);
- dissect_lte_rrc_warningMessageSegment(warning_msg_seg_tvb, subtree, actx->pinfo, GPOINTER_TO_UINT(p_dcs));
+ frag_tvb = process_reassembled_data(warning_msg_seg_tvb, 0, actx->pinfo, "Reassembled SIB12 warning message",
+ frag_data, &lte_rrc_sib12_frag_items, NULL, subtree);
+ if (frag_tvb) {
+ dissect_lte_rrc_warningMessageSegment(frag_tvb, subtree, actx->pinfo, GPOINTER_TO_UINT(p_dcs));
+ }
}
#.TYPE_ATTR
diff --git a/asn1/lte-rrc/packet-lte-rrc-template.c b/asn1/lte-rrc/packet-lte-rrc-template.c
index f3cd825b70..2b8683e55b 100644
--- a/asn1/lte-rrc/packet-lte-rrc-template.c
+++ b/asn1/lte-rrc/packet-lte-rrc-template.c
@@ -36,6 +36,7 @@
#include <epan/asn1.h>
#include <epan/expert.h>
#include <epan/wmem/wmem.h>
+#include <epan/reassemble.h>
#include "packet-per.h"
#include "packet-rrc.h"
@@ -189,6 +190,28 @@ static int hf_lte_rrc_interBandTDD_CA_WithDifferentConfig_bit1 = -1;
static int hf_lte_rrc_interBandTDD_CA_WithDifferentConfig_bit2 = -1;
static int hf_lte_rrc_sr_config_periodicity = -1;
static int hf_lte_rrc_sr_config_subframe_offset = -1;
+static int hf_lte_rrc_sib11_fragments = -1;
+static int hf_lte_rrc_sib11_fragment = -1;
+static int hf_lte_rrc_sib11_fragment_overlap = -1;
+static int hf_lte_rrc_sib11_fragment_overlap_conflict = -1;
+static int hf_lte_rrc_sib11_fragment_multiple_tails = -1;
+static int hf_lte_rrc_sib11_fragment_too_long_fragment = -1;
+static int hf_lte_rrc_sib11_fragment_error = -1;
+static int hf_lte_rrc_sib11_fragment_count = -1;
+static int hf_lte_rrc_sib11_reassembled_in = -1;
+static int hf_lte_rrc_sib11_reassembled_length = -1;
+static int hf_lte_rrc_sib11_reassembled_data = -1;
+static int hf_lte_rrc_sib12_fragments = -1;
+static int hf_lte_rrc_sib12_fragment = -1;
+static int hf_lte_rrc_sib12_fragment_overlap = -1;
+static int hf_lte_rrc_sib12_fragment_overlap_conflict = -1;
+static int hf_lte_rrc_sib12_fragment_multiple_tails = -1;
+static int hf_lte_rrc_sib12_fragment_too_long_fragment = -1;
+static int hf_lte_rrc_sib12_fragment_error = -1;
+static int hf_lte_rrc_sib12_fragment_count = -1;
+static int hf_lte_rrc_sib12_reassembled_in = -1;
+static int hf_lte_rrc_sib12_reassembled_length = -1;
+static int hf_lte_rrc_sib12_reassembled_data = -1;
/* Initialize the subtree pointers */
static int ett_lte_rrc = -1;
@@ -210,6 +233,10 @@ static gint ett_lte_rrc_dataCodingScheme = -1;
static gint ett_lte_rrc_warningMessageSegment = -1;
static gint ett_lte_rrc_interBandTDD_CA_WithDifferentConfig = -1;
static gint ett_lte_rrc_sr_ConfigIndex = -1;
+static gint ett_lte_rrc_sib11_fragment = -1;
+static gint ett_lte_rrc_sib11_fragments = -1;
+static gint ett_lte_rrc_sib12_fragment = -1;
+static gint ett_lte_rrc_sib12_fragments = -1;
static expert_field ei_lte_rrc_number_pages_le15 = EI_INIT;
static expert_field ei_lte_rrc_si_info_value_changed = EI_INIT;
@@ -221,6 +248,43 @@ static expert_field ei_lte_rrc_unexpected_length_value = EI_INIT;
static expert_field ei_lte_rrc_too_many_group_a_rapids = EI_INIT;
static expert_field ei_lte_rrc_invalid_drx_config = EI_INIT;
+static reassembly_table lte_rrc_sib11_reassembly_table;
+static reassembly_table lte_rrc_sib12_reassembly_table;
+
+static const fragment_items lte_rrc_sib11_frag_items = {
+ &ett_lte_rrc_sib11_fragment,
+ &ett_lte_rrc_sib11_fragments,
+ &hf_lte_rrc_sib11_fragments,
+ &hf_lte_rrc_sib11_fragment,
+ &hf_lte_rrc_sib11_fragment_overlap,
+ &hf_lte_rrc_sib11_fragment_overlap_conflict,
+ &hf_lte_rrc_sib11_fragment_multiple_tails,
+ &hf_lte_rrc_sib11_fragment_too_long_fragment,
+ &hf_lte_rrc_sib11_fragment_error,
+ &hf_lte_rrc_sib11_fragment_count,
+ &hf_lte_rrc_sib11_reassembled_in,
+ &hf_lte_rrc_sib11_reassembled_length,
+ &hf_lte_rrc_sib11_reassembled_data,
+ "SIB11 warning message segments"
+};
+
+static const fragment_items lte_rrc_sib12_frag_items = {
+ &ett_lte_rrc_sib12_fragment,
+ &ett_lte_rrc_sib12_fragments,
+ &hf_lte_rrc_sib12_fragments,
+ &hf_lte_rrc_sib12_fragment,
+ &hf_lte_rrc_sib12_fragment_overlap,
+ &hf_lte_rrc_sib12_fragment_overlap_conflict,
+ &hf_lte_rrc_sib12_fragment_multiple_tails,
+ &hf_lte_rrc_sib12_fragment_too_long_fragment,
+ &hf_lte_rrc_sib12_fragment_error,
+ &hf_lte_rrc_sib12_fragment_count,
+ &hf_lte_rrc_sib12_reassembled_in,
+ &hf_lte_rrc_sib12_reassembled_length,
+ &hf_lte_rrc_sib12_reassembled_data,
+ "SIB12 warning message segments"
+};
+
/* Forward declarations */
static int dissect_DL_DCCH_Message_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
static int dissect_UECapabilityInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
@@ -1839,6 +1903,8 @@ typedef struct lte_rrc_private_data_t
guint8 si_or_psi_geran;
guint8 ra_preambles;
guint16 message_identifier;
+ guint8 warning_message_segment_type;
+ guint8 warning_message_segment_number;
drb_mapping_t drb_mapping;
drx_config_t drx_config;
pdcp_security_info_t pdcp_security;
@@ -1930,6 +1996,34 @@ static void private_data_set_message_identifier(asn1_ctx_t *actx, guint16 messag
}
+/* Warning message segment type */
+static guint16 private_data_get_warning_message_segment_type(asn1_ctx_t *actx)
+{
+ lte_rrc_private_data_t *private_data = (lte_rrc_private_data_t*)lte_rrc_get_private_data(actx);
+ return private_data->warning_message_segment_type;
+}
+
+static void private_data_set_warning_message_segment_type(asn1_ctx_t *actx, guint8 segment_type)
+{
+ lte_rrc_private_data_t *private_data = (lte_rrc_private_data_t*)lte_rrc_get_private_data(actx);
+ private_data->warning_message_segment_type = segment_type;
+}
+
+
+/* Warning message segment number */
+static guint16 private_data_get_warning_message_segment_number(asn1_ctx_t *actx)
+{
+ lte_rrc_private_data_t *private_data = (lte_rrc_private_data_t*)lte_rrc_get_private_data(actx);
+ return private_data->warning_message_segment_number;
+}
+
+static void private_data_set_warning_message_segment_number(asn1_ctx_t *actx, guint8 segment_number)
+{
+ lte_rrc_private_data_t *private_data = (lte_rrc_private_data_t*)lte_rrc_get_private_data(actx);
+ private_data->warning_message_segment_number = segment_number;
+}
+
+
/* Number of RA-preambles */
static guint8 private_data_get_ra_preambles(asn1_ctx_t *actx)
{
@@ -2390,6 +2484,10 @@ lte_rrc_init_protocol(void)
lte_rrc_etws_cmas_dcs_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
lte_rrc_system_info_value_changed_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
+ reassembly_table_init(&lte_rrc_sib11_reassembly_table,
+ &addresses_reassembly_table_functions);
+ reassembly_table_init(&lte_rrc_sib12_reassembly_table,
+ &addresses_reassembly_table_functions);
}
/*--- proto_register_rrc -------------------------------------------*/
@@ -2832,6 +2930,94 @@ void proto_register_lte_rrc(void) {
{ "Subframe Offset", "lte-rrc.sr_SubframeOffset",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }},
+ { &hf_lte_rrc_sib11_fragments,
+ { "Fragments", "lte-rrc.warningMessageSegment.fragments",
+ FT_NONE, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib11_fragment,
+ { "Fragment", "lte-rrc.warningMessageSegment.fragment",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib11_fragment_overlap,
+ { "Fragment Overlap", "lte-rrc.warningMessageSegment.fragment_overlap",
+ FT_BOOLEAN, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib11_fragment_overlap_conflict,
+ { "Fragment Overlap Conflict", "lte-rrc.warningMessageSegment.fragment_overlap_conflict",
+ FT_BOOLEAN, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib11_fragment_multiple_tails,
+ { "Fragment Multiple Tails", "lte-rrc.warningMessageSegment.fragment_multiple_tails",
+ FT_BOOLEAN, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib11_fragment_too_long_fragment,
+ { "Too Long Fragment", "lte-rrc.warningMessageSegment.fragment_too_long_fragment",
+ FT_BOOLEAN, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib11_fragment_error,
+ { "Fragment Error", "lte-rrc.warningMessageSegment.fragment_error",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib11_fragment_count,
+ { "Fragment Count", "lte-rrc.warningMessageSegment.fragment_count",
+ FT_UINT32, BASE_DEC, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib11_reassembled_in,
+ { "Reassembled In", "lte-rrc.warningMessageSegment.reassembled_in",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib11_reassembled_length,
+ { "Reassembled Length", "lte-rrc.warningMessageSegment.reassembled_length",
+ FT_UINT32, BASE_DEC, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib11_reassembled_data,
+ { "Reassembled Data", "lte-rrc.warningMessageSegment.reassembled_data",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_fragments,
+ { "Fragments", "lte-rrc.warningMessageSegment_r9.fragments",
+ FT_NONE, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_fragment,
+ { "Fragment", "lte-rrc.warningMessageSegment_r9.fragment",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_fragment_overlap,
+ { "Fragment Overlap", "lte-rrc.warningMessageSegment_r9.fragment_overlap",
+ FT_BOOLEAN, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_fragment_overlap_conflict,
+ { "Fragment Overlap Conflict", "lte-rrc.warningMessageSegment_r9.fragment_overlap_conflict",
+ FT_BOOLEAN, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_fragment_multiple_tails,
+ { "Fragment Multiple Tails", "lte-rrc.warningMessageSegment_r9.fragment_multiple_tails",
+ FT_BOOLEAN, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_fragment_too_long_fragment,
+ { "Too Long Fragment", "lte-rrc.warningMessageSegment_r9.fragment_too_long_fragment",
+ FT_BOOLEAN, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_fragment_error,
+ { "Fragment Error", "lte-rrc.warningMessageSegment_r9.fragment_error",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_fragment_count,
+ { "Fragment Count", "lte-rrc.warningMessageSegment_r9.fragment_count",
+ FT_UINT32, BASE_DEC, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_reassembled_in,
+ { "Reassembled In", "lte-rrc.warningMessageSegment_r9.reassembled_in",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_reassembled_length,
+ { "Reassembled Length", "lte-rrc.warningMessageSegment_r9.reassembled_length",
+ FT_UINT32, BASE_DEC, NULL, 0,
+ NULL, HFILL }},
+ { &hf_lte_rrc_sib12_reassembled_data,
+ { "Reassembled Data", "lte-rrc.warningMessageSegment_r9.reassembled_data",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }}
};
/* List of subtrees */
@@ -2853,7 +3039,11 @@ void proto_register_lte_rrc(void) {
&ett_lte_rrc_dataCodingScheme,
&ett_lte_rrc_warningMessageSegment,
&ett_lte_rrc_interBandTDD_CA_WithDifferentConfig,
- &ett_lte_rrc_sr_ConfigIndex
+ &ett_lte_rrc_sr_ConfigIndex,
+ &ett_lte_rrc_sib11_fragment,
+ &ett_lte_rrc_sib11_fragments,
+ &ett_lte_rrc_sib12_fragment,
+ &ett_lte_rrc_sib12_fragments
};
static ei_register_info ei[] = {