sgsn: Introduce test TC_rim_eutran_to_geran

GTP_Templates.ttcn new templates use BssgpCellId, hence it depends on Osmocom_Gb_Types.ttcn.

Related: SYS#5314
Change-Id: I9dcf6ee2dc55bc6aba178eca30080233254f025e
diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn
index 43c034b..b67e828 100644
--- a/library/GTP_Emulation.ttcn
+++ b/library/GTP_Emulation.ttcn
@@ -43,6 +43,7 @@
 	/* Communication with Clients */
 	port GTPEM_PT CLIENT;
 	port GTPEM_PROC_PT CLIENT_PROC;
+	port GTPEM_PT CLIENT_DEFAULT;
 
 	/* Configuration by the user */
 	var GtpEmulationCfg g_gtp_cfg;
@@ -199,11 +200,16 @@
 			vc_conn := f_comp_by_teid(g1c_ud.gtpc.teid);
 			CLIENT.send(g1c_ud) to vc_conn;
 		} else {
-			/* Send to all clients */
-			var integer i;
-			for (i := 0; i < sizeof(TidTable); i := i+1) {
-				if (isbound(TidTable[i].teid) and TidTable[i].teid == teid) {
-					CLIENT.send(g1c_ud) to TidTable[i].vc_conn;
+			/* Check if a default port is set: */
+			if (CLIENT_DEFAULT.checkstate("Connected")) {
+				CLIENT_DEFAULT.send(g1c_ud);
+			} else {
+				/* Send to all clients */
+				var integer i;
+				for (i := 0; i < sizeof(TidTable); i := i+1) {
+					if (isbound(TidTable[i].teid) and TidTable[i].teid == teid) {
+						CLIENT.send(g1c_ud) to TidTable[i].vc_conn;
+					}
 				}
 			}
 		}
@@ -220,7 +226,9 @@
 	[] CLIENT.receive(Gtp1uUnitdata:?) -> value g1u_ud sender vc_conn {
 		GTPU.send(g1u_ud);
 		}
-
+	[] CLIENT_DEFAULT.receive(Gtp1cUnitdata:?) -> value g1c_ud sender vc_conn {
+		GTPC.send(g1c_ud);
+		}
 
 	[] CLIENT_PROC.getcall(GTPEM_register_imsi:{?}) -> param(imsi) sender vc_conn {
 		f_imsi_tbl_add(imsi, vc_conn);