summaryrefslogtreecommitdiffstats
path: root/library/GSMTAP_PortType.ttcn
diff options
context:
space:
mode:
Diffstat (limited to 'library/GSMTAP_PortType.ttcn')
-rw-r--r--library/GSMTAP_PortType.ttcn76
1 files changed, 76 insertions, 0 deletions
diff --git a/library/GSMTAP_PortType.ttcn b/library/GSMTAP_PortType.ttcn
new file mode 100644
index 0000000..69074df
--- /dev/null
+++ b/library/GSMTAP_PortType.ttcn
@@ -0,0 +1,76 @@
+/* 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
+ } 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_Event -> ASP_Event: simple)" }
+
+}