aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_sms.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2016-01-21 22:15:57 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2016-01-21 22:15:39 +0000
commited587b23a75e06f0a655fd879b46571981a11a52 (patch)
treed8c693e64e62b17d3c777c9e0980236e473357c6 /epan/dissectors/packet-gsm_sms.c
parent77046c0c2dfb882c24194aa785480cac2d7ddadd (diff)
GSM SMS: add dissection of Special SMS Message Indication IE
Change-Id: I154c3b4c4ef7dd3a243c9df003df01807b45c095 Reviewed-on: https://code.wireshark.org/review/13475 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-gsm_sms.c')
-rw-r--r--epan/dissectors/packet-gsm_sms.c76
1 files changed, 75 insertions, 1 deletions
diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c
index f4055b0a2a..e826e89a75 100644
--- a/epan/dissectors/packet-gsm_sms.c
+++ b/epan/dissectors/packet-gsm_sms.c
@@ -166,6 +166,11 @@ static gint hf_gsm_sms_tp_command_type = -1;
static gint hf_gsm_sms_tp_message_number = -1;
static gint hf_gsm_sms_tp_command_data = -1;
static gint hf_gsm_sms_tp_command_data_length = -1;
+static gint hf_gsm_sms_msg_ind_type_and_stor = -1;
+static gint hf_gsm_sms_msg_profile_id = -1;
+static gint hf_gsm_sms_ext_msg_ind_type = -1;
+static gint hf_gsm_sms_msg_ind_type = -1;
+static gint hf_gsm_sms_msg_count = -1;
static gint hf_gsm_sms_destination_port8 = -1;
static gint hf_gsm_sms_originator_port8 = -1;
static gint hf_gsm_sms_destination_port16 = -1;
@@ -738,6 +743,7 @@ dis_field_dcs(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint8 oct,
break;
case 0x02:
default_3_bits = TRUE;
+ *ucs2 = TRUE;
break;
case 0x03:
default_data = TRUE;
@@ -1271,7 +1277,47 @@ dis_iei_csm8(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint32 offset
}
-/* TODO 9.2.3.24.2 Special SMS Message Indication */
+/* 9.2.3.24.2 Special SMS Message Indication */
+static const true_false_string gsm_sms_msg_type_and_stor_value = {
+ "Store message after updating indication",
+ "Discard message after updating indication"
+};
+
+static const value_string gsm_sms_profile_id_vals[] = {
+ { 0, "Profile ID 1" },
+ { 1, "Profile ID 2" },
+ { 2, "Profile ID 3" },
+ { 3, "Profile ID 4" },
+ { 0, NULL },
+};
+
+static const range_string gsm_sms_ext_msg_ind_type_vals[] = {
+ { 0, 0, "No extended message indication type" },
+ { 1, 1, "Video Message Waiting" },
+ { 2, 7, "Reserved" },
+ { 0, 0, NULL }
+};
+
+static const value_string gsm_sms_msg_ind_type_vals[] = {
+ { 0, "Voice Message Waiting" },
+ { 1, "Fax Message Waiting" },
+ { 2, "Electronic Mail Message Waiting" },
+ { 3, "Extended Message Type Waiting" },
+ { 0, NULL },
+};
+
+static void
+dis_iei_spe_sms_msg_ind(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint32 offset,
+ guint8 length, gsm_sms_udh_fields_t *p_udh_fields _U_)
+{
+ EXACT_DATA_CHECK(length, 2);
+
+ proto_tree_add_item(tree, hf_gsm_sms_msg_ind_type_and_stor, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_gsm_sms_msg_profile_id, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_gsm_sms_ext_msg_ind_type, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_gsm_sms_msg_ind_type, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_gsm_sms_msg_count, tvb, offset+1, 1, ENC_BIG_ENDIAN);
+}
/* 9.2.3.24.3 */
static const range_string gsm_sms_8bit_port_values[] = {
@@ -1636,6 +1682,9 @@ dis_field_ud_iei(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint32 of
case 0x00:
iei_fcn = dis_iei_csm8;
break;
+ case 0x01:
+ iei_fcn = dis_iei_spe_sms_msg_ind;
+ break;
case 0x04:
iei_fcn = dis_iei_apa_8bit;
break;
@@ -3005,6 +3054,31 @@ proto_register_gsm_sms(void)
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
+ { &hf_gsm_sms_msg_ind_type_and_stor,
+ { "Message Indication type and Storage", "gsm_sms.msg_ind_type_and_stor",
+ FT_BOOLEAN, 8, TFS(&gsm_sms_msg_type_and_stor_value), 0x80,
+ NULL, HFILL }
+ },
+ { &hf_gsm_sms_msg_profile_id,
+ { "Multiple Subscriber Profile", "gsm_sms.profile_id",
+ FT_UINT8, BASE_DEC, VALS(gsm_sms_profile_id_vals), 0x60,
+ NULL, HFILL }
+ },
+ { &hf_gsm_sms_ext_msg_ind_type,
+ { "Extended Message Indication Type", "gsm_sms.ext_msg_ind_type",
+ FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gsm_sms_ext_msg_ind_type_vals), 0x1c,
+ NULL, HFILL }
+ },
+ { &hf_gsm_sms_msg_ind_type,
+ { "Message Indication Type", "gsm_sms.msg_ind_type",
+ FT_UINT8, BASE_DEC, VALS(gsm_sms_msg_ind_type_vals), 0x03,
+ NULL, HFILL }
+ },
+ { &hf_gsm_sms_msg_count,
+ { "Message Count", "gsm_sms.msg_count",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }
+ },
{ &hf_gsm_sms_destination_port8,
{ "Destination port", "gsm_sms.destination_port",
FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gsm_sms_8bit_port_values), 0x0,