aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_gsup.c
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-01-08 14:04:29 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2019-01-15 17:45:25 +0000
commit80ed3a5b2694fea1bc1cf7b9b7ee0363da2fad45 (patch)
tree42ab438f6b9715e5cee1bc13651e05a46fafd399 /epan/dissectors/packet-gsm_gsup.c
parent8f3f842d9a3eedc2d7b497eb5c5607c8438edc18 (diff)
GSUP: add CHECK-IMEI message decoding
Implement necessary messages for Procedure Check_IMEI_VLR (TS 23.018 Chapter 7.1.2.9). This lets the VLR ask the EIR to check if an IMEI is valid. Use the IMEI dissector from BSSAP by making it available as stand-alone dissector. For more information, please see: https://git.osmocom.org/libosmocore/commit/?id=10db2817e5ce76eebd61dd6b607a6dfad57fa417 https://git.osmocom.org/osmo-gsm-manuals/commit/?id=0f41399d36770fb6d2069d5aea7e5315beb368e6 Change-Id: Ie66c79ace7a9448b3191bec8208805aa3bb7888e Reviewed-on: https://code.wireshark.org/review/31445 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-gsm_gsup.c')
-rw-r--r--epan/dissectors/packet-gsm_gsup.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/epan/dissectors/packet-gsm_gsup.c b/epan/dissectors/packet-gsm_gsup.c
index 5b6c1621cb..e768891c04 100644
--- a/epan/dissectors/packet-gsm_gsup.c
+++ b/epan/dissectors/packet-gsm_gsup.c
@@ -96,6 +96,9 @@ enum osmo_gsup_iei {
OSMO_GSUP_SM_RP_CAUSE_IE = 0x44,
OSMO_GSUP_SM_RP_MMS_IE = 0x45,
OSMO_GSUP_SM_ALERT_RSN_IE = 0x46,
+
+ OSMO_GSUP_IMEI_IE = 0x50,
+ OSMO_GSUP_IMEI_RESULT_IE = 0x51,
};
/*! GSUP message type */
@@ -141,6 +144,10 @@ enum osmo_gsup_message_type {
OSMO_GSUP_MSGT_READY_FOR_SM_REQUEST = 0x2c,
OSMO_GSUP_MSGT_READY_FOR_SM_ERROR = 0x2d,
OSMO_GSUP_MSGT_READY_FOR_SM_RESULT = 0x2e,
+
+ OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST = 0x30,
+ OSMO_GSUP_MSGT_CHECK_IMEI_ERROR = 0x31,
+ OSMO_GSUP_MSGT_CHECK_IMEI_RESULT = 0x32,
};
#define OSMO_GSUP_IS_MSGT_REQUEST(msgt) (((msgt) & 0b00000011) == 0b00)
@@ -157,6 +164,11 @@ enum osmo_gsup_cn_domain {
OSMO_GSUP_CN_DOMAIN_CS = 2,
};
+enum osmo_gsup_imei_result {
+ OSMO_GSUP_IMEI_RESULT_ACK = 0,
+ OSMO_GSUP_IMEI_RESULT_NACK = 1,
+};
+
enum osmo_gsup_session_state {
OSMO_GSUP_SESSION_STATE_NONE = 0x00,
OSMO_GSUP_SESSION_STATE_BEGIN = 0x01,
@@ -218,6 +230,7 @@ static int hf_gsup_sm_rp_oa_id_type = -1;
static int hf_gsup_sm_rp_cause = -1;
static int hf_gsup_sm_rp_mms = -1;
static int hf_gsup_sm_alert_rsn = -1;
+static int hf_gsup_imei_result = -1;
static gint ett_gsup = -1;
static gint ett_gsup_ie = -1;
@@ -227,6 +240,7 @@ static expert_field ei_sm_rp_oa_invalid = EI_INIT;
static dissector_handle_t gsm_map_handle;
static dissector_handle_t gsm_sms_handle;
+static dissector_handle_t bssap_imei_handle;
static const value_string gsup_iei_types[] = {
{ OSMO_GSUP_IMSI_IE, "IMSI" },
@@ -262,6 +276,8 @@ static const value_string gsup_iei_types[] = {
{ OSMO_GSUP_SM_RP_CAUSE_IE, "SM-RP-Cause" },
{ OSMO_GSUP_SM_RP_MMS_IE, "SM-RP-MMS (More Messages to Send)" },
{ OSMO_GSUP_SM_ALERT_RSN_IE, "SM Alert Reason" },
+ { OSMO_GSUP_IMEI_IE, "IMEI" },
+ { OSMO_GSUP_IMEI_RESULT_IE, "IMEI Check Result" },
{ 0, NULL }
};
@@ -297,6 +313,9 @@ static const value_string gsup_msg_types[] = {
{ OSMO_GSUP_MSGT_READY_FOR_SM_REQUEST, "Ready for SM Request"},
{ OSMO_GSUP_MSGT_READY_FOR_SM_ERROR, "Ready for SM Error"},
{ OSMO_GSUP_MSGT_READY_FOR_SM_RESULT, "Ready for SM Result"},
+ { OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST, "Check IMEI Request"},
+ { OSMO_GSUP_MSGT_CHECK_IMEI_ERROR, "Check IMEI Error"},
+ { OSMO_GSUP_MSGT_CHECK_IMEI_RESULT, "Check IMEI Result"},
{ 0, NULL }
};
@@ -336,6 +355,12 @@ static const value_string osmo_gsup_sms_sm_alert_rsn_types[] = {
{ 0, NULL }
};
+static const value_string gsup_imei_result_types[] = {
+ { OSMO_GSUP_IMEI_RESULT_ACK, "ACK" },
+ { OSMO_GSUP_IMEI_RESULT_NACK, "NACK" },
+ { 0, NULL }
+};
+
static void dissect_ss_info_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint len, proto_tree *tree)
{
guint saved_offset;
@@ -481,6 +506,14 @@ static void dissect_sm_rp_ui_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset,
call_dissector(gsm_sms_handle, ss_tvb, pinfo, tree);
}
+static void dissect_imei_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset,
+ guint ie_len, proto_tree *tree)
+{
+ tvbuff_t *ss_tvb = tvb_new_subset_length(tvb, offset-1, ie_len);
+ if(bssap_imei_handle)
+ call_dissector(bssap_imei_handle, ss_tvb, pinfo, tree);
+}
+
static gint
dissect_gsup_tlvs(tvbuff_t *tvb, int base_offs, int length, packet_info *pinfo, proto_tree *tree,
proto_item *gsup_ti, guint8 msg_type)
@@ -613,6 +646,12 @@ dissect_gsup_tlvs(tvbuff_t *tvb, int base_offs, int length, packet_info *pinfo,
case OSMO_GSUP_SM_ALERT_RSN_IE:
proto_tree_add_item(att_tree, hf_gsup_sm_alert_rsn, tvb, offset, len, ENC_NA);
break;
+ case OSMO_GSUP_IMEI_IE:
+ dissect_imei_ie(tvb, pinfo, offset, len, att_tree);
+ break;
+ case OSMO_GSUP_IMEI_RESULT_IE:
+ proto_tree_add_item(att_tree, hf_gsup_imei_result, tvb, offset, len, ENC_NA);
+ break;
case OSMO_GSUP_HLR_NUMBER_IE:
case OSMO_GSUP_PDP_TYPE_IE:
case OSMO_GSUP_PDP_QOS_IE:
@@ -724,6 +763,8 @@ proto_register_gsup(void)
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
{ &hf_gsup_sm_alert_rsn, { "SM Alert Reason", "gsup.sm_alert_rsn",
FT_UINT8, BASE_DEC, VALS(osmo_gsup_sms_sm_alert_rsn_types), 0, NULL, HFILL } },
+ { &hf_gsup_imei_result, { "IMEI Check Result", "gsup.imei_check_res",
+ FT_UINT8, BASE_DEC, VALS(gsup_imei_result_types), 0, NULL, HFILL } },
};
static gint *ett[] = {
&ett_gsup,
@@ -757,6 +798,7 @@ proto_reg_handoff_gsup(void)
dissector_add_uint_with_preference("ipa.osmo.protocol", IPAC_PROTO_EXT_GSUP, gsup_handle);
gsm_map_handle = find_dissector_add_dependency("gsm_map", proto_gsup);
gsm_sms_handle = find_dissector_add_dependency("gsm_sms", proto_gsup);
+ bssap_imei_handle = find_dissector_add_dependency("bssap.imei", proto_gsup);
}
/*