aboutsummaryrefslogtreecommitdiffstats
path: root/sccp/SCCP_CodecPort.ttcn
blob: 838517a0d8dec37c132899ed349678d6627b3ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
module SCCP_CodecPort {

/* Simple SCCP Codec Port, translating between raw MTP3 primitives with
 * octetstring payload towards the MTP3 provider, and MTP3-SCCP primitives
 * which carry the decoded SCCP data types as payload.
 *
 * (C) 2019 by Harald Welte <laforge@gnumonks.org>
 * All rights reserved.
 *
 * Released under the terms of GNU General Public License, Version 2 or
 * (at your option) any later version.
 */

import from General_Types all;
import from Osmocom_Types all;

import from MTP3asp_Types all;
import from MTP3asp_PortType all;
import from SCCP_Types all;

/* MTP3asp_Types.Types.MessageTypes.ASP_MTP3_TRANSFERind with PDU_SCCP instead of octetstring */
type record SCCP_MTP3_TRANSFERind {
	MTP3_Field_sio	sio,
	integer		opc,
	integer		dpc,
	integer		sls,
	PDU_SCCP	data
};

/* MTP3asp_Types.Types.MessageTypes.ASP_MTP3_TRANSFERreq with PDU_SCCP instead of octetstring */
type record SCCP_MTP3_TRANSFERreq {
	MTP3_Field_sio	sio,
	integer		opc,
	integer		dpc,
	integer		sls,
	PDU_SCCP	data
};

private function f_dec_TRANSFERind(in ASP_MTP3_TRANSFERind pin, out SCCP_MTP3_TRANSFERind pout) {
	pout.sio := pin.sio;
	pout.opc := pin.opc;
	pout.dpc := pin.dpc;
	pout.sls := pin.sls;
	pout.data := dec_PDU_SCCP(pin.data);
	//port.setstate(0);
} with {extension "prototype(fast)" }


private function f_enc_TRANSFERreq(in SCCP_MTP3_TRANSFERreq pin, out ASP_MTP3_TRANSFERreq pout) {
	pout.sio := pin.sio;
	pout.opc := pin.opc;
	pout.dpc := pin.dpc;
	pout.sls := pin.sls;
	pout.data := enc_PDU_SCCP(pin.data);
	//port.setstate(0);
} with {extension "prototype(fast)" }

type port SCCP_CODEC_PT message {
	out	SCCP_MTP3_TRANSFERreq;
	in	SCCP_MTP3_TRANSFERind,
		ASP_MTP3_PAUSE,
		ASP_MTP3_RESUME,
		ASP_MTP3_STATUS;
} with { extension "internal user MTP3asp_PT
	out(SCCP_MTP3_TRANSFERreq -> ASP_MTP3_TRANSFERreq: function(f_enc_TRANSFERreq))
	in(ASP_MTP3_TRANSFERind -> SCCP_MTP3_TRANSFERind: function(f_dec_TRANSFERind);
	   ASP_MTP3_PAUSE -> ASP_MTP3_PAUSE: simple;
	   ASP_MTP3_RESUME -> ASP_MTP3_RESUME: simple;
	   ASP_MTP3_STATUS -> ASP_MTP3_STATUS: simple)"
}


}