blob: 8d4078dd0deaf15c10c1cc09746d04b9a1ddeec4 [file] [log] [blame]
Neels Hofmeyra2d1d7a2022-01-20 23:11:38 +01001/* dual-faced port sitting on top of IPL4_asp UDP to encode/decode PFCP
2 *
3 * (C) 2022 sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
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 */
11module PFCP_CodecPort {
12
13import from IPL4asp_PortType all;
14import from IPL4asp_Types all;
15import from PFCP_Types all;
16
17/* identifies a remote peer (sender or receiver) */
18type record PFCP_Peer {
19 ConnectionId conn_id,
20 HostName remote_name,
21 PortNumber remote_port
22}
23
24type record PFCP_Unitdata {
25 PFCP_Peer peer,
26 PDU_PFCP pdu
27}
28
29/* Translation port on top of IPL4asp; ASP_Event passed through transparently */
30type port PFCP_PT message {
31 out PFCP_Unitdata;
32 in PFCP_Unitdata,
33 ASP_ConnId_ReadyToRelease,
34 ASP_Event;
35} with { extension "user IPL4asp_PT
36 out(PFCP_Unitdata -> ASP_SendTo: function(f_enc_pfcp_unitdata))
37 in(ASP_RecvFrom -> PFCP_Unitdata: function(f_dec_pfcp_unitdata);
38 ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
39 ASP_Event -> ASP_Event: simple)" }
40
41private function f_enc_pfcp_unitdata(in PFCP_Unitdata in_ud, out ASP_SendTo out_ud) {
42 out_ud.connId := in_ud.peer.conn_id;
43 out_ud.remName := in_ud.peer.remote_name;
44 out_ud.remPort := in_ud.peer.remote_port;
45 out_ud.proto := { udp := {} };
46 out_ud.msg := enc_PDU_PFCP(in_ud.pdu);
47} with { extension "prototype(fast)" };
48
49private function f_dec_pfcp_unitdata(in ASP_RecvFrom in_ud, out PFCP_Unitdata out_ud) {
50 out_ud.peer.conn_id := in_ud.connId;
51 out_ud.peer.remote_name := in_ud.remName;
52 out_ud.peer.remote_port := in_ud.remPort;
53 out_ud.pdu := dec_PDU_PFCP(in_ud.msg);
54} with { extension "prototype(fast)" };
55
56}