Harald Welte | f736559 | 2020-04-15 21:48:45 +0200 | [diff] [blame] | 1 | module UECUPS_CodecPort { |
| 2 | |
| 3 | /* (C) 2020 by Harald Welte <laforge@gnumonks.org> |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * Released under the terms of GNU General Public License, Version 2 or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 10 | */ |
| 11 | |
| 12 | import from IPL4asp_PortType all; |
| 13 | import from IPL4asp_Types all; |
| 14 | import from UECUPS_Types all; |
| 15 | |
| 16 | type record UECUPS_RecvFrom { |
| 17 | ConnectionId connId, |
| 18 | HostName remName, |
| 19 | PortNumber remPort, |
| 20 | HostName locName, |
| 21 | PortNumber locPort, |
| 22 | PDU_UECUPS msg |
| 23 | }; |
| 24 | |
| 25 | template UECUPS_RecvFrom t_UECUPS_RecvFrom(template PDU_UECUPS msg) := { |
| 26 | connId := ?, |
| 27 | remName := ?, |
| 28 | remPort := ?, |
| 29 | locName := ?, |
| 30 | locPort := ?, |
| 31 | msg := msg |
| 32 | } |
| 33 | |
| 34 | type record UECUPS_Send { |
| 35 | ConnectionId connId, |
| 36 | PDU_UECUPS msg |
| 37 | } |
| 38 | |
| 39 | template UECUPS_Send t_UECUPS_Send(template ConnectionId connId, template PDU_UECUPS msg) := { |
| 40 | connId := connId, |
| 41 | msg := msg |
| 42 | } |
| 43 | |
| 44 | private function IPL4_to_UECUPS_RecvFrom(in ASP_RecvFrom pin, out UECUPS_RecvFrom pout) { |
| 45 | pout.connId := pin.connId; |
| 46 | pout.remName := pin.remName; |
| 47 | pout.remPort := pin.remPort; |
| 48 | pout.locName := pin.locName; |
| 49 | pout.locPort := pin.locPort; |
| 50 | pout.msg := f_dec_PDU_UECUPS(pin.msg); |
| 51 | } with { extension "prototype(fast)" }; |
| 52 | |
| 53 | private function UECUPS_to_IPL4_Send(in UECUPS_Send pin, out ASP_Send pout) { |
| 54 | pout.connId := pin.connId; |
| 55 | pout.proto := { sctp := {} }; |
| 56 | pout.msg := f_enc_PDU_UECUPS(pin.msg); |
| 57 | } with { extension "prototype(fast)" }; |
| 58 | |
| 59 | type port UECUPS_CODEC_PT message { |
| 60 | out UECUPS_Send; |
| 61 | in UECUPS_RecvFrom, |
| 62 | ASP_ConnId_ReadyToRelease, |
| 63 | ASP_Event; |
| 64 | } with { extension "user IPL4asp_PT |
| 65 | out(UECUPS_Send -> ASP_Send:function(UECUPS_to_IPL4_Send)) |
| 66 | in(ASP_RecvFrom -> UECUPS_RecvFrom: function(IPL4_to_UECUPS_RecvFrom); |
| 67 | ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple; |
| 68 | ASP_Event -> ASP_Event: simple)" |
| 69 | } |
| 70 | } |