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
diff --git a/library/BSSGP_Types.ttcn b/library/BSSGP_Types.ttcn
index d51bb6d..e9984d8 100644
--- a/library/BSSGP_Types.ttcn
+++ b/library/BSSGP_Types.ttcn
@@ -245,9 +245,9 @@
 		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 @@
 		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
+					}
 				}
 			}
 		}
diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn
index 9fd7733..878166b 100644
--- a/library/GSM_RR_Types.ttcn
+++ b/library/GSM_RR_Types.ttcn
@@ -16,6 +16,7 @@
 	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 @@
 		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 @@
 		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 @@
 		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;
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index cf7b9d9..af4a573 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -315,7 +315,7 @@
 }
 
 /* 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,