summaryrefslogtreecommitdiffstats
path: root/library/GSMTAP_PortType.ttcn
blob: a3f655dc5aec299805bbaa6379ea4b258a464d13 (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
74
75
76
77
78
/* dual-faced port that wraps an IPL4asp port and encodes/decodes GSMTAP */
module GSMTAP_PortType {
	import from GSMTAP_Types all;
	import from IPL4asp_PortType all;
	import from IPL4asp_Types all;

	/* just like ASP_ReacFrom but with decoded GsmtapMessage */
	type record GSMTAP_RecvFrom {
		ConnectionId	connId,
		HostName	remName,
		PortNumber	remPort,
		HostName	locName,
		PortNumber	locPort,
		ProtoTuple	proto,
		UserData	userData,
		GsmtapMessage	msg
	}

	/* just like ASP_Send but with decoded GsmtapMessage */
	type record GSMTAP_Send {
		ConnectionId	connId,
		ProtoTuple	proto,
		GsmtapMessage	msg
	}

	/* just like ASP_SendTo but with decoded GsmtapMessage */
	type record GSMTAP_SendTo {
		ConnectionId	connId,
		HostName	remName,
		PortNumber	remPort,
		ProtoTuple	proto,
		GsmtapMessage	msg
	}

	/* Convert RecvFrom from ASP to GSMTAP decoded */
	private function IPL4_to_GSMTAP(in ASP_RecvFrom pin, out GSMTAP_RecvFrom pout) {
		pout.connId := pin.connId;
		pout.remName := pin.remName;
		pout.remPort := pin.remPort;
		pout.locName := pin.locName;
		pout.locPort := pin.locPort;
		pout.proto := pin.proto;
		pout.userData := pin.userData;
		pout.msg := dec_GsmtapMessage(pin.msg);
	} with { extension "prototype(fast)" }

	/* Convert SendTo from GSMTAP to ASP */
	private function GSMTAP_to_IPL4_SendTo(in GSMTAP_SendTo pin, out ASP_SendTo pout) {
		pout.connId := pin.connId;
		pout.remName := pin.remName;
		pout.remPort := pin.remPort;
		pout.proto := pin.proto;
		pout.msg := enc_GsmtapMessage(pin.msg);
	} with { extension "prototype(fast)" }

	/* Convert SendTo from GSMTAP to ASP */
	private function GSMTAP_to_IPL4_Send(in GSMTAP_Send pin, out ASP_Send pout) {
		pout.connId := pin.connId;
		pout.proto := pin.proto;
		pout.msg := enc_GsmtapMessage(pin.msg);
	} with { extension "prototype(fast)" }

	/* dual-faced port that converts from octetstring to decoded
	 * GSMTAP and vice-versa */
	type port GSMTAP_PT message {
		out GSMTAP_Send
		out GSMTAP_SendTo
		in GSMTAP_RecvFrom
		in ASP_Event
		in ASP_ConnId_ReadyToRelease
	} with { extension "user IPL4asp_PT
		out(GSMTAP_Send -> ASP_Send: function(GSMTAP_to_IPL4_Send);
		    GSMTAP_SendTo -> ASP_SendTo: function(GSMTAP_to_IPL4_SendTo))
		in(ASP_RecvFrom -> GSMTAP_RecvFrom: function(IPL4_to_GSMTAP);
		   ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
		   ASP_Event -> ASP_Event: simple)" }

}