BSSMAP: Add IMSI/TMSI mapping table to dispatch incoming paging

If we're emulating BSC/BTS/MS, then we must be able to dispatch
incoming paging requests based on their IMSI or TMSI to the right
ConnHdlr component.  This introduces a new table to facilitate that
dispatch.

Change-Id: I85c1ea3bcf8fb4a100f20cffdc991826b58e290b
diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn
index 075dab7..c98f5eb 100644
--- a/library/BSSMAP_Templates.ttcn
+++ b/library/BSSMAP_Templates.ttcn
@@ -660,6 +660,14 @@
 	digits := imsi_digits
 }
 
+template BSSMAP_IE_IMSI tr_BSSMAP_Imsi(template hexstring imsi_digits) := {
+	elementIdentifier := '08'O,
+	lengthIndicator := ?, /* overwritten */
+	typeOfIdentity := '001'B, /* IMSI */
+	oddEvenIndicator := ?,
+	digits := imsi_digits
+}
+
 template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := {
 	cIl_noCell := ''O
 }
@@ -699,6 +707,12 @@
 	tmsiOctets := tmsi
 };
 
+template BSSMAP_IE_TMSI tr_BSSMAP_IE_TMSI(template OCT4 tmsi) := {
+	elementIdentifier := '09'O,
+	lengthIndicator := 4,
+	tmsiOctets := tmsi
+};
+
 private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI {
 	var template BSSMAP_IE_TMSI ret;
 	if (ispresent(tmsi)) {
@@ -717,7 +731,7 @@
 	pdu := {
 		bssmap := {
 			paging := {
-				messageType := '51'O,
+				messageType := '52'O,
 				iMSI := ts_BSSMAP_Imsi(imsi_digits),
 				tMSI := f_tmsi_or_omit(tmsi),
 				cellIdentifierList := ts_BSSMAP_IE_CidList(valueof(cid_list)),
@@ -729,6 +743,26 @@
 	}
 }
 
+template PDU_BSSAP tr_BSSMAP_Paging(template hexstring imsi_digits := ?,
+					template OCT4 tmsi := *,
+					template BSSMAP_IE_ChannelNeeded chneed := *)
+modifies tr_BSSAP_BSSMAP := {
+	pdu := {
+		bssmap := {
+			paging := {
+				messageType := '52'O,
+				iMSI := tr_BSSMAP_Imsi(imsi_digits),
+				tMSI := tr_BSSMAP_IE_TMSI(tmsi) ifpresent,
+				cellIdentifierList := ?,
+				channelNeeded := chneed,
+				eMLPP_Priority := omit,
+				pagingInformation := omit /* only VGCS/VBS flag */
+			}
+		}
+	}
+}
+
+
 template PDU_BSSAP ts_BSSMAP_CipherModeCmd(OCT1 alg, OCT8 key)
 modifies ts_BSSAP_BSSMAP := {
 	pdu := {