diff options
author | Oliver Smith <osmith@sysmocom.de> | 2018-12-14 16:14:34 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2018-12-21 13:13:30 +0100 |
commit | 10db2817e5ce76eebd61dd6b607a6dfad57fa417 (patch) | |
tree | 5425929afda0ed0330d9e20670a5686fbc4b0b12 /tests/gsup/gsup_test.c | |
parent | 19742408cf3d83bb67e4b8c2fc3b0cbbee7bee59 (diff) |
GSUP: add CHECK-IMEI message
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. In the Osmocom stack, we don't have an EIR and this request
will be handled by the HLR. We will be able to store the IMEI in the
HLR as side-effect (OS#2541).
This is roughly based on TS 29.002 8.7.1 MAP_CHECK_IMEI service, but
only implements the bare minimum required IEs (imei and imei_result).
Related: OS#3733
Change-Id: I085819df0ea7f3bfeb0cabebb5fd1942a23c6155
Diffstat (limited to 'tests/gsup/gsup_test.c')
-rw-r--r-- | tests/gsup/gsup_test.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index 079a7031..f1945735 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -289,6 +289,33 @@ static void test_gsup_messages_dec_enc(void) 0x02, /* Memory Available (SMMA) */ }; + static const uint8_t send_check_imei_req[] = { + 0x30, /* OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST */ + TEST_IMSI_IE, + + /* imei */ + 0x50, 0x09, + 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, + }; + + static const uint8_t send_check_imei_err[] = { + 0x31, /* OSMO_GSUP_MSGT_CHECK_IMEI_ERROR */ + TEST_IMSI_IE, + + /* cause */ + 0x02, 0x01, + 0x60, /* GMM_CAUSE_INV_MAND_INFO */ + }; + + static const uint8_t send_check_imei_res[] = { + 0x32, /* OSMO_GSUP_MSGT_CHECK_IMEI_RESULT */ + TEST_IMSI_IE, + + /* imei_result */ + 0x51, 0x01, + 0x00, /* OSMO_GSUP_IMEI_RESULT_ACK */ + }; + static const struct test { char *name; const uint8_t *data; @@ -338,6 +365,12 @@ static void test_gsup_messages_dec_enc(void) send_mo_mt_forward_sm_err, sizeof(send_mo_mt_forward_sm_err)}, {"ReadyForSM (MSC -> SMSC) Indication", send_ready_for_sm_ind, sizeof(send_ready_for_sm_ind)}, + {"Check IMEI Request", + send_check_imei_req, sizeof(send_check_imei_req)}, + {"Check IMEI Error", + send_check_imei_err, sizeof(send_check_imei_err)}, + {"Check IMEI Result", + send_check_imei_res, sizeof(send_check_imei_res)}, }; printf("Test GSUP message decoding/encoding\n"); |