IPA_Emulation: Properly dissect multiple IPA messages in one TCP segment
diff --git a/library/IPA_CodecPort.ttcn b/library/IPA_CodecPort.ttcn
index 3c68e22..9ba9d18 100644
--- a/library/IPA_CodecPort.ttcn
+++ b/library/IPA_CodecPort.ttcn
@@ -26,18 +26,6 @@
 		msg := msg
 	}
 
-	/* 'stream' contains the octets received so far, we must return the total length */
-	function f_IPA_getMsgLen(in octetstring stream, inout ro_integer args) return integer {
-		var integer stream_len := lengthof(stream);
-		var integer len;
-		if (stream_len < 2) {
-			/* insufficient length to determine the length */
-			return -1;
-		}
-		len := 3 + oct2int(substr(stream, 0, 2));
-		return len;
-	}
-
 	private function IPL4_to_IPA_RecvFrom(in ASP_RecvFrom pin, out IPA_RecvFrom pout) {
 		var PDU_IPA ipa := dec_PDU_IPA(pin.msg);
 		pout.connId := pin.connId;
diff --git a/library/IPA_Emulation.ttcn b/library/IPA_Emulation.ttcn
index e9894d1..98fbb92 100644
--- a/library/IPA_Emulation.ttcn
+++ b/library/IPA_Emulation.ttcn
@@ -4,6 +4,7 @@
 import from IPA_CodecPort all;
 import from IPA_CodecPort_CtrlFunct all;
 import from IPL4asp_Types all;
+import from IPL4asp_PortType all;
 import from MTP3asp_Types all;
 import from MTP3asp_PortType all;
 
@@ -64,6 +65,10 @@
 	res := IPA_CodecPort_CtrlFunct.f_IPL4_connect(IPA_PORT, remote_host, remote_port,
 						local_host, local_port, 0, { tcp:={} });
 	g_ipa_conn_id := res.connId;
+	/* Set function for dissecting the binary */
+	var f_IPL4_getMsgLen vl_f := refers(f_IPL4_fixedMsgLen);
+	IPA_CodecPort_CtrlFunct.f_IPL4_setGetMsgLen(IPA_PORT, g_ipa_conn_id, vl_f, {0, 2, 3, 1, 0});
+
 	g_is_bsc_mgw := true;
 }