aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-11-29 11:47:13 +0100
committerHarald Welte <laforge@gnumonks.org>2017-11-29 12:03:32 +0100
commit1218883e157c2d3f9dfb4f4849ae9034a05c7681 (patch)
tree2a992cf4d851e24065f6e33ea1eb75b49cf0f54c /library
parent26595451b33ff8a07d7dc2f267952ef6211ed7fe (diff)
IPA_Emulation: Properly dissect multiple IPA messages in one TCP segment
Diffstat (limited to 'library')
-rw-r--r--library/IPA_CodecPort.ttcn12
-rw-r--r--library/IPA_Emulation.ttcn5
2 files changed, 5 insertions, 12 deletions
diff --git a/library/IPA_CodecPort.ttcn b/library/IPA_CodecPort.ttcn
index 3c68e227..9ba9d185 100644
--- a/library/IPA_CodecPort.ttcn
+++ b/library/IPA_CodecPort.ttcn
@@ -26,18 +26,6 @@ module IPA_CodecPort {
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 e9894d1e..98fbb921 100644
--- a/library/IPA_Emulation.ttcn
+++ b/library/IPA_Emulation.ttcn
@@ -4,6 +4,7 @@ import from IPA_Types all;
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 @@ function f_connect(charstring remote_host, PortNumber remote_port,
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;
}