Allow Setting IuUP_Cfg from test using RTP_Emulation

Change-Id: I4e8296dae40277be51974338bc0d21c939eec149
diff --git a/library/IuUP_Emulation.ttcn b/library/IuUP_Emulation.ttcn
index 1bb2bb2..b649e44 100644
--- a/library/IuUP_Emulation.ttcn
+++ b/library/IuUP_Emulation.ttcn
@@ -26,6 +26,7 @@
 	/* IPTI value in number of ITIs for the corresponding RFCI */
 	uint8_t ipti
 };
+type record of IuUP_RabFlowCombination IuUP_RabFlowCombinationList;
 
 template (value) IuUP_RabFlowCombination t_IuUP_RFC(IuUP_RFCI rfci, RecOfU8 subflow_bits, uint8_t ipti) := {
 	rfci := rfci,
@@ -37,21 +38,50 @@
 template (value) IuUP_RabFlowCombination t_IuUP_RFC_AMR_SID(IuUP_RFCI rfci) := t_IuUP_RFC(rfci, {34, 0, 0}, 7);
 template (value) IuUP_RabFlowCombination t_IuUP_RFC_AMR_NO_DATA(IuUP_RFCI rfci) := t_IuUP_RFC(rfci, {0, 0, 0}, 1);
 
+
+const IuUP_RabFlowCombinationList c_IuUP_Config_RabFlowCombination_def := {
+	{
+		rfci := 0,
+		sub_flow_bits := {81, 103, 60},
+		ipti := 1
+	}, {
+		rfci := 1,
+		sub_flow_bits := {34, 0, 0},
+		ipti := 7
+	}, {
+		rfci := 2,
+		sub_flow_bits := {0, 0, 0},
+		ipti := 1
+	}
+};
 type record IuUP_Config {
 	/* actively send INIT (true) or only passively respond (false) */
 	boolean active_init,
 	boolean data_pdu_type_0,
 	/* RAB Flow Combinations */
-	record of IuUP_RabFlowCombination rab_flow_combs
+	IuUP_RabFlowCombinationList rab_flow_combs
 };
 
+template (value) IuUP_Config t_IuUP_Config(boolean active_init := true,
+					 boolean data_pdu_type_0 := true,
+					 template (value) IuUP_RabFlowCombinationList rab_flow_combs :=
+						c_IuUP_Config_RabFlowCombination_def) := {
+	active_init := active_init,
+	data_pdu_type_0 := true,
+	rab_flow_combs := rab_flow_combs
+}
+
+const IuUP_Config c_IuUP_Config_def := {
+	active_init := true,
+	data_pdu_type_0 := true,
+	rab_flow_combs := c_IuUP_Config_RabFlowCombination_def
+}
+
 type enumerated IuUP_Em_State {
 	ST_INIT,
 	ST_DATA_TRANSFER_READY
 };
 
-
-
 type record IuUP_Entity {
 	IuUP_Config cfg,
 	IuUP_Em_State state,
@@ -60,12 +90,8 @@
 	IuUP_PDU pending_tx_pdu optional
 };
 
-template (value) IuUP_Entity t_IuUP_Entity(boolean act_init) := {
-	cfg := {
-		active_init := act_init,
-		data_pdu_type_0 := true,
-		rab_flow_combs := { t_IuUP_RFC_AMR_12_2(0), t_IuUP_RFC_AMR_SID(1), t_IuUP_RFC_AMR_NO_DATA(2) }
-	},
+template (value) IuUP_Entity t_IuUP_Entity(template (value) IuUP_Config cfg) := {
+	cfg := cfg,
 	state := ST_INIT,
 	tx_next_frame_nr := 0,
 	rx_last_frame_nr := omit,
diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn
index f4d926e..eaff017 100644
--- a/library/RTP_Emulation.ttcn
+++ b/library/RTP_Emulation.ttcn
@@ -161,7 +161,7 @@
 	octetstring tx_fixed_payload optional,
 	octetstring rx_fixed_payload optional,
 	boolean iuup_mode,
-	boolean iuup_tx_init
+	IuUP_Config iuup_cfg
 };
 
 const RtpemConfig c_RtpemDefaultCfg := {
@@ -172,7 +172,7 @@
 	tx_fixed_payload := '01020304'O,
 	rx_fixed_payload := '01020304'O,
 	iuup_mode := false,
-	iuup_tx_init := true
+	iuup_cfg := c_IuUP_Config_def
 }
 
 signature RTPEM_bind(in HostName local_host, inout PortNumber local_port);
@@ -384,7 +384,7 @@
 							      os_error_code := 111,
 							      os_error_text := ? /* "Connection refused" */}};
 
-	g_iuup_ent := valueof(t_IuUP_Entity(g_cfg.iuup_tx_init));
+	g_iuup_ent := valueof(t_IuUP_Entity(g_cfg.iuup_cfg));
 
 	while (true) {
 	alt {
@@ -488,7 +488,7 @@
 		}
 		[] CTRL.getcall(RTPEM_configure:{?}) -> param (cfg) {
 			g_cfg := cfg;
-			g_iuup_ent.cfg.active_init := g_cfg.iuup_tx_init;
+			g_iuup_ent.cfg := g_cfg.iuup_cfg;
 			CTRL.reply(RTPEM_configure:{cfg});
 		}
 		[] CTRL.getcall(RTPEM_stats_get:{?, ?}) -> param (is_rtcp) {