library/GSM_RR_Types: do not duplicate Mobile Identity records

All the records related to Mobile Identity IE (see 3GPP TS 24.008,
section 10.5.1.4) are defined in [1], so there is no real need to
dumplicate them. Moreover, most of the related templates in
library/L3_Templates.ttcn are based on these records.

[1] titan.ProtocolModules.MobileL3_v13.4.0/src/MobileL3_CommonIE_Types.ttcn

Change-Id: I27c2743c59db770d6f7e9447dc8c1f539b228ced
This commit is contained in:
Vadim Yanitskiy 2020-03-28 00:57:21 +07:00
parent 35d3a159e2
commit 98bb2d5eea
9 changed files with 33 additions and 71 deletions

View File

@ -1301,7 +1301,7 @@ private function f_pageing_helper(hexstring imsi,
template OCT4 tmsi := omit) runs on test_CT
{
var template BSSMAP_IE_ChannelNeeded bssmap_chneed;
var MobileIdentity mi;
/* FIXME (unused): var MobileIdentity mi; */
var template octetstring id_enc; /* FIXME */
var RSL_Message rx_rsl;
var integer paging_group := hex2int(imsi[lengthof(imsi)-1]);

View File

@ -2979,7 +2979,7 @@ private function f_TC_paging(PagingTestCfg cfg) runs on test_CT return PagingTes
var integer new_sent := f_min(pkt_total, float2int(T_total.read * pch_blocks_per_sec) + 1);
while (st.num_paging_sent < new_sent) {
/* build mobile Identity */
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
var MobileIdentityLV mi;
if (cfg.use_tmsi) {
mi := valueof(ts_MI_TMSI_LV(f_rnd_octstring(4)));
} else {
@ -4570,7 +4570,7 @@ testcase TC_pcu_paging_from_rsl() runs on test_CT {
f_init_pcu_test();
for (var integer i := 0; i < 100; i := i+1) {
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
var MobileIdentityLV mi;
timer T := 3.0;
if (i < 50) {
mi := valueof(ts_MI_TMSI_LV(f_rnd_octstring(4)));

View File

@ -894,12 +894,14 @@ private template GsmRrMessage tr_PagingType1_empty := {
},
page_mode := PAGE_MODE_NORMAL,
mi1 := {
len := 1,
mi := {
unused := {
pad := '1111'B,
odd := false,
mi_type := MI_TYPE_NONE
lengthIndicator := 1,
mobileIdentityV := {
typeOfIdentity := '000'B,
oddEvenInd_identity := {
no_identity := {
oddevenIndicator := '0'B,
fillerDigits := 'F'H
}
}
}
},

View File

@ -245,9 +245,9 @@ module BSSGP_Types {
BssgpCause cause, /* 11.3.8 */
BssgpCellId cell_id, /* 11.3.9 */
DrxParameter drx_parameter, /* 10.3.11 */
MobileIdentity imsi, /* 11.3.14 */
MobileIdentityV imsi, /* 11.3.14 */
LocationAreaIdentification lai, /* 11.3.17 */
MobileIdentity mobile_id, /* 11.3.20 */
MobileIdentityV mobile_id, /* 11.3.20 */
BssgpPduLifetime pdu_lifetime, /* 11.3.25 */
BssgpPriority priority, /* 11.3.27 */
BssgpQosProfile qos_profile, /* 11.3.28 */
@ -388,10 +388,14 @@ module BSSGP_Types {
len := 4,
u := {
mobile_id := {
imsi := {
mi_type := MI_TYPE_IMSI,
odd := true, /* IMSI has 15 digits */
digits := imsi
typeOfIdentity := MI_TYPE_IMSI,
oddEvenInd_identity := {
imsi := {
/* TODO: introduce generic tr_IMSI_L3 */
oddevenIndicator := true, /* IMSI has 15 digits */
digits := imsi,
fillerDigit := '1111'B
}
}
}
}

View File

@ -16,6 +16,7 @@ module GSM_RR_Types {
import from Osmocom_Types all;
import from GSM_Types all;
import from RLCMAC_CSN1_Types all;
import from MobileL3_CommonIE_Types all;
/* Table 10.4.1 of Section 10.4 / 3GPP TS 44.018 */
type enumerated RrMessageType {
@ -205,51 +206,6 @@ module GSM_RR_Types {
MI_TYPE_TMGI
} with { variant "FIELDLENGTH(3)" };
type record MobileIdentityBCD {
MobileIdentityType mi_type (MI_TYPE_IMSI, MI_TYPE_IMEI, MI_TYPE_IMEISV),
boolean odd,
hexstring digits
} with { variant "FIELDORDER(lsb)" };
type record MobileIdentityTMSI {
BIT4 pad ('1111'B),
boolean odd (false),
MobileIdentityType mi_type (MI_TYPE_TMSI),
GsmTmsi tmsi
} with { variant "FIELDORDER(lsb)" };
type record MobileIdentityNone {
BIT4 pad ('1111'B),
boolean odd (false),
MobileIdentityType mi_type (MI_TYPE_NONE)
} with { variant "FIELDORDER(lsb)" };
type union MobileIdentity {
MobileIdentityBCD imsi,
MobileIdentityBCD imei,
MobileIdentityBCD imeisv,
MobileIdentityTMSI tmsi,
MobileIdentityNone unused
} with { variant "TAG(imsi, mi_type = MI_TYPE_IMSI;
imei, mi_type = MI_TYPE_IMEI;
imeisv, mi_type = MI_TYPE_IMEISV;
tmsi, mi_type = MI_TYPE_TMSI;
unused, mi_type = MI_TYPE_NONE)"
variant "FIELDORDER(lsb)"
};
/* TS 24.008 10.5.1.4 "Mobile Identity" */
type record MobileIdentityLV {
uint8_t len,
MobileIdentity mi
} with { variant (len) "LENGTHTO(mi)" };
type record MobileIdentityTLV {
uint8_t tag,
uint8_t len,
MobileIdentity mi
} with { variant (len) "LENGTHTO(mi)" };
/* TS 24.008 10.5.1.5 */
type record MsClassmark1 {
BIT1 spare,
@ -762,7 +718,7 @@ module GSM_RR_Types {
MobileIdentityLV mi1,
MobileIdentityTLV mi2 optional,
RestOctets rest_octets
} with { variant "TAG(mi2, tag = 23)" };
} with { variant "TAG(mi2, elementIdentifier = '0010111'B)" };
/* 9.1.23 */
type record PagingRequestType2 {
@ -772,7 +728,7 @@ module GSM_RR_Types {
GsmTmsi mi2,
MobileIdentityTLV mi3 optional,
RestOctets rest_octets
} with { variant "TAG(mi3, tag = 23)" };
} with { variant "TAG(mi3, elementIdentifier = '0010111'B)" };
/* 9.1.24 */
type record length(4) of GsmTmsi GsmTmsi4;

View File

@ -315,7 +315,7 @@ template PDU_ML3_NW_MS tr_PAGING_REQ1(template MobileIdentityLV mi1 := ?,
}
/* Template for receiving a Paging Request Type1 message with a given TMSI in the first mobile identity. */
template MobileL3_CommonIE_Types.MobileIdentityLV tr_PAGING_REQ1_MI1_TMSI(octetstring tmsi) := {
template MobileIdentityLV tr_PAGING_REQ1_MI1_TMSI(octetstring tmsi) := {
lengthIndicator := 5,
mobileIdentityV := {
typeOfIdentity := '100'B,

View File

@ -442,7 +442,7 @@ function f_mm_imei() runs on BSC_ConnHdlr
{
var PDU_DTAP_MT dtap_mt;
var GSUP_PDU gsup_msg;
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
var MobileIdentityLV mi;
if (not g_pars.net.expect_imei) {
return
@ -480,7 +480,7 @@ function f_mm_imei_early() runs on BSC_ConnHdlr
{
var PDU_DTAP_MT dtap_mt;
var GSUP_PDU gsup_msg;
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
var MobileIdentityLV mi;
if (not g_pars.net.expect_imei_early) {
return

View File

@ -1386,7 +1386,7 @@ testcase TC_paging_cs_from_bts() runs on RAW_PCU_Test_CT {
var RlcmacDlBlock dl_block;
var boolean ok;
var OCT4 tlli := '00000001'O;
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
var MobileIdentityLV mi;
var octetstring mi_enc_lv;
var hexstring imsi := f_gen_imsi(42);

View File

@ -553,7 +553,7 @@ function f_send_l3(template (value) PDU_L3_MS_SGSN l3_mo, integer ran_index := 0
}
altstep as_mm_identity(integer ran_index := 0) runs on BSSGP_ConnHdlr {
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
var MobileIdentityLV mi;
[is_gb(ran_index)] BSSGP[ran_index].receive(tr_GMM_ID_REQ('001'B)) {
mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
f_send_l3(ts_GMM_ID_RESP(mi), ran_index);
@ -740,7 +740,7 @@ function f_random_RAI(HEX0_3n mcc := '262'H, HEX0_3n mnc := '42'H) return Routin
}
/* return a MobileIdentityLV: P-TMSI if we have one, IMSI otherwise */
private function f_mi_get_lv() runs on BSSGP_ConnHdlr return MobileL3_CommonIE_Types.MobileIdentityLV {
private function f_mi_get_lv() runs on BSSGP_ConnHdlr return MobileIdentityLV {
if (ispresent(g_pars.p_tmsi)) {
return valueof(ts_MI_TMSI_LV(g_pars.p_tmsi));
} else {
@ -2153,7 +2153,7 @@ testcase TC_attach_detach_check_subscriber_list() runs on test_CT {
/* Attempt an attach, but loose the Identification Request (IMEI) */
private function f_TC_attach_no_imei_response(charstring id) runs on BSSGP_ConnHdlr {
var integer count_req := 0;
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
var MobileIdentityLV mi;
f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
@ -2199,7 +2199,7 @@ testcase TC_attach_no_imei_response() runs on test_CT {
/* Attempt an attach, but loose the Identification Request (IMSI) */
private function f_TC_attach_no_imsi_response(charstring id) runs on BSSGP_ConnHdlr {
var integer count_req := 0;
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
var MobileIdentityLV mi;
/* set p_tmsi to use it in Attach Req via f_mi_get_lv() */
g_pars.p_tmsi := 'c0000035'O;
@ -2479,7 +2479,7 @@ testcase TC_attach_rau_a_b() runs on test_CT {
private function f_TC_attach_gmm_attach_req_while_gmm_attach(charstring id) runs on BSSGP_ConnHdlr {
var integer count_req := 0;
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
var MobileIdentityLV mi;
var RoutingAreaIdentificationV rand_rai := f_random_RAI();
var PDU_L3_SGSN_MS l3_mt;