gbproxy: Start to allocate NRIs to SGSNs

We change the osmo-gbproxy.cfg to use NRI 3 for SGSN-0 (NSEI 101) and
NRI 4 for SGSN-1 (NSEI 102).

We also add the capability to GBProxy_Tests to allocate P-TMSI with
a specific NRI and default to the first NRI of SGSN-0 so all tests
written still for a single-SGSN-non-pool scenario pass without any
modification.

Related: OS#4472, SYS#5002
Change-Id: I15f78dca5ac31a1c71f086d3e92a70e900eae250
diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 4857515..9168fa3 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -45,6 +45,12 @@
 const integer max_fr_info_size := 1600;
 
 modulepar {
+	/* NRI bit-length. 0 for no pooling */
+	integer mp_nri_bitlength := 5;
+	roro_integer mp_sgsn_nri := {
+		{ 3 },		/* list of NRIs of first SGSN */
+		{ 4 }		/* list of NRIs of second SGSN */
+	};
 	boolean mp_enable_bss_load_sharing := false;
 	/* SGSN NS configuration */
 	NSConfigurations mp_nsconfig_sgsn := {
@@ -594,10 +600,10 @@
 
 /* helper function to create, connect and start a BSSGP_ConnHdlr component */
 function f_start_handler(void_fn fn, charstring id, GbInstances pcu, GbInstances sgsn, integer imsi_suffix,
-			 float t_guard := 30.0)
+			 float t_guard := 30.0, integer nri := mp_sgsn_nri[0][0])
 runs on test_CT return BSSGP_ConnHdlr {
 	var BSSGP_ConnHdlr vc_conn;
-	var OCT4 p_tmsi := f_gen_tmsi(imsi_suffix);
+	var OCT4 p_tmsi := f_gen_tmsi(imsi_suffix, nri_v := nri, nri_bitlen := mp_nri_bitlength);
 
 	var BSSGP_ConnHdlrPars pars := {
 		imei := f_gen_imei(imsi_suffix),
@@ -608,8 +614,8 @@
 		tlli := f_gprs_tlli_from_tmsi(p_tmsi, TLLI_LOCAL),
 		tlli_old := omit,
 		ra := omit,
-		pcu := g_pcu,
-		sgsn := g_sgsn,
+		pcu := pcu,
+		sgsn := sgsn,
 		t_guard := t_guard
 	};