diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2024-02-18 19:26:35 +0700 |
---|---|---|
committer | fixeria <vyanitskiy@sysmocom.de> | 2024-03-01 11:57:00 +0000 |
commit | f197ed2dfd7cd47a4d79fefcf3b51fbeb3813f76 (patch) | |
tree | 9780ae38fdcd6c8b37a2cb4e51e119588382dc4d /library | |
parent | 020a8fc281a4d08fcb46c18c408230c7b1e94b24 (diff) |
library/M3UA: support TCP transport, implement desegmentation
Change-Id: If1dcdb185d08a08dc5a06c37d9d6ffe7d6da9325
Related: libosmo-sccp.git I8c76d271472befacbeb998a93bbdc9e8660d9b5d
Related: SYS#5424
Diffstat (limited to 'library')
-rw-r--r-- | library/M3UA_CodecPort.ttcn | 30 | ||||
-rw-r--r-- | library/M3UA_CodecPort_CtrlFunct.ttcn | 7 | ||||
-rw-r--r-- | library/M3UA_CodecPort_CtrlFunctDef.cc | 9 |
3 files changed, 37 insertions, 9 deletions
diff --git a/library/M3UA_CodecPort.ttcn b/library/M3UA_CodecPort.ttcn index 94d16d64..e88b6a0d 100644 --- a/library/M3UA_CodecPort.ttcn +++ b/library/M3UA_CodecPort.ttcn @@ -15,6 +15,7 @@ module M3UA_CodecPort { import from IPL4asp_PortType all; import from IPL4asp_Types all; + import from M3UA_CodecPort_CtrlFunct all; import from M3UA_Types all; type record M3UA_RecvFrom { @@ -37,7 +38,7 @@ module M3UA_CodecPort { type record M3UA_Send { ConnectionId connId, - integer stream, + integer stream optional, PDU_M3UA msg } @@ -59,14 +60,18 @@ module M3UA_CodecPort { private function M3UA_to_IPL4_Send(in M3UA_Send pin, out ASP_Send pout) { pout.connId := pin.connId; - pout.proto := { - sctp := { - sinfo_stream := pin.stream, - sinfo_ppid := 3, - remSocks := omit, - assocId := omit - } - }; + if (ispresent(pin.stream)) { + pout.proto := { + sctp := { + sinfo_stream := pin.stream, + sinfo_ppid := 3, + remSocks := omit, + assocId := omit + } + }; + } else { + pout.proto := { tcp := { } }; + } pout.msg := enc_PDU_M3UA(pin.msg); } with { extension "prototype(fast)" }; @@ -80,5 +85,12 @@ module M3UA_CodecPort { in(ASP_RecvFrom -> M3UA_RecvFrom: function(IPL4_to_M3UA_RecvFrom); ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple; ASP_Event -> ASP_Event: simple)" + }; + + function f_set_tcp_segmentation(M3UA_CODEC_PT pt, ConnectionId connId) { + /* Set function for dissecting the binary stream into packets */ + var f_IPL4_getMsgLen vl_f := refers(f_IPL4_fixedMsgLen); + /* Offset: 4, size of length: 4, delta: 0, multiplier: 1, big-endian */ + M3UA_CodecPort_CtrlFunct.f_IPL4_setGetMsgLen(pt, connId, vl_f, {4, 4, 0, 1, 0}); } } diff --git a/library/M3UA_CodecPort_CtrlFunct.ttcn b/library/M3UA_CodecPort_CtrlFunct.ttcn index fc38e43f..6f06e2c4 100644 --- a/library/M3UA_CodecPort_CtrlFunct.ttcn +++ b/library/M3UA_CodecPort_CtrlFunct.ttcn @@ -40,5 +40,12 @@ module M3UA_CodecPort_CtrlFunct { out UserData userData ) return Result; + external function f_IPL4_setGetMsgLen( + inout M3UA_CODEC_PT portRef, + in ConnectionId id, + inout f_IPL4_getMsgLen f, + in ro_integer msgLenArgs + ) + } diff --git a/library/M3UA_CodecPort_CtrlFunctDef.cc b/library/M3UA_CodecPort_CtrlFunctDef.cc index 62533dee..7ddacdc4 100644 --- a/library/M3UA_CodecPort_CtrlFunctDef.cc +++ b/library/M3UA_CodecPort_CtrlFunctDef.cc @@ -51,6 +51,15 @@ namespace M3UA__CodecPort__CtrlFunct { { return f__IPL4__PROVIDER__getUserData(portRef, connId, userData); } + + void f__IPL4__setGetMsgLen( + M3UA__CodecPort::M3UA__CODEC__PT& portRef, + const IPL4asp__Types::ConnectionId& connId, + Socket__API__Definitions::f__getMsgLen& f, + const Socket__API__Definitions::ro__integer& msgLenArgs) + { + return f__IPL4__PROVIDER__setGetMsgLen(portRef, connId, f, msgLenArgs); + } } |