blob: b415c091e6072c72187888ec24f0a01d529de1aa [file] [log] [blame]
Harald Welte384f4fe2018-04-09 22:51:59 +02001module SMPP_CodecPort {
2
3/* Simple SMPP Codec Port, translating between raw TCP octetstring payload
4 * towards the IPL4asp port provider, and SMPP primitives
5 * which carry the decoded SMPP data types as payload.
6 *
7 * (C) 2018 by Harald Welte <laforge@gnumonks.org>
8 * All rights reserved.
9 *
10 * Released under the terms of GNU General Public License, Version 2 or
11 * (at your option) any later version.
Harald Welte34b5a952019-05-27 11:54:11 +020012 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
Harald Welte384f4fe2018-04-09 22:51:59 +020014 */
15
16
17import from IPL4asp_PortType all;
18import from IPL4asp_Types all;
19import from SMPP_Types all;
20
21type record SMPP_RecvFrom {
22 ConnectionId connId,
23 SMPP_PDU msg
24}
25
26type record SMPP_Send {
27 ConnectionId connId,
28 SMPP_PDU msg
29}
30
31template (value) SMPP_Send ts_SMPP_Send(ConnectionId conn_id, template (value) SMPP_PDU msg) := {
32 connId := conn_id,
33 msg := msg
34}
35
36template SMPP_RecvFrom tr_SMPP_Recv(template ConnectionId conn_id, template SMPP_PDU msg) := {
37 connId := conn_id,
38 msg := msg
39}
40
41private function IPL4_to_SMPP_RecvFrom(in ASP_RecvFrom pin, out SMPP_RecvFrom pout) {
42 var integer rc;
43 pout.connId := pin.connId;
44 rc := f_decode_SMPP(pin.msg, pout.msg);
45} with { extension "prototype(fast)" }
46
47private function SMPP_to_IPL4_Send(in SMPP_Send pin, out ASP_Send pout) {
48 pout.connId := pin.connId;
49 pout.proto := { tcp := {} };
50 f_encode_SMPP(pin.msg, pout.msg);
51} with { extension "prototype(fast)" }
52
53type port SMPP_CODEC_PT message {
54 out SMPP_Send;
55 in SMPP_RecvFrom,
56 ASP_ConnId_ReadyToRelease,
57 ASP_Event;
58} with { extension "user IPL4asp_PT
59 out(SMPP_Send -> ASP_Send: function(SMPP_to_IPL4_Send))
60 in(ASP_RecvFrom -> SMPP_RecvFrom: function(IPL4_to_SMPP_RecvFrom);
61 ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
62 ASP_Event -> ASP_Event: simple)"
63}
64
65
66
67}