Harald Welte | 3d4df7f | 2017-07-14 22:05:56 +0200 | [diff] [blame] | 1 | /* dual-faced port that wraps an IPL4asp port and encodes/decodes GSMTAP */ |
| 2 | module GSMTAP_PortType { |
| 3 | import from GSMTAP_Types all; |
| 4 | import from IPL4asp_PortType all; |
| 5 | import from IPL4asp_Types all; |
| 6 | |
| 7 | /* just like ASP_ReacFrom but with decoded GsmtapMessage */ |
| 8 | type record GSMTAP_RecvFrom { |
| 9 | ConnectionId connId, |
| 10 | HostName remName, |
| 11 | PortNumber remPort, |
| 12 | HostName locName, |
| 13 | PortNumber locPort, |
| 14 | ProtoTuple proto, |
| 15 | UserData userData, |
| 16 | GsmtapMessage msg |
| 17 | } |
| 18 | |
| 19 | /* just like ASP_Send but with decoded GsmtapMessage */ |
| 20 | type record GSMTAP_Send { |
| 21 | ConnectionId connId, |
| 22 | ProtoTuple proto, |
| 23 | GsmtapMessage msg |
| 24 | } |
| 25 | |
| 26 | /* just like ASP_SendTo but with decoded GsmtapMessage */ |
| 27 | type record GSMTAP_SendTo { |
| 28 | ConnectionId connId, |
| 29 | HostName remName, |
| 30 | PortNumber remPort, |
| 31 | ProtoTuple proto, |
| 32 | GsmtapMessage msg |
| 33 | } |
| 34 | |
| 35 | /* Convert RecvFrom from ASP to GSMTAP decoded */ |
| 36 | private function IPL4_to_GSMTAP(in ASP_RecvFrom pin, out GSMTAP_RecvFrom pout) { |
| 37 | pout.connId := pin.connId; |
| 38 | pout.remName := pin.remName; |
| 39 | pout.remPort := pin.remPort; |
| 40 | pout.locName := pin.locName; |
| 41 | pout.locPort := pin.locPort; |
| 42 | pout.proto := pin.proto; |
| 43 | pout.userData := pin.userData; |
| 44 | pout.msg := dec_GsmtapMessage(pin.msg); |
| 45 | } with { extension "prototype(fast)" } |
| 46 | |
| 47 | /* Convert SendTo from GSMTAP to ASP */ |
| 48 | private function GSMTAP_to_IPL4_SendTo(in GSMTAP_SendTo pin, out ASP_SendTo pout) { |
| 49 | pout.connId := pin.connId; |
| 50 | pout.remName := pin.remName; |
| 51 | pout.remPort := pin.remPort; |
| 52 | pout.proto := pin.proto; |
| 53 | pout.msg := enc_GsmtapMessage(pin.msg); |
| 54 | } with { extension "prototype(fast)" } |
| 55 | |
| 56 | /* Convert SendTo from GSMTAP to ASP */ |
| 57 | private function GSMTAP_to_IPL4_Send(in GSMTAP_Send pin, out ASP_Send pout) { |
| 58 | pout.connId := pin.connId; |
| 59 | pout.proto := pin.proto; |
| 60 | pout.msg := enc_GsmtapMessage(pin.msg); |
| 61 | } with { extension "prototype(fast)" } |
| 62 | |
| 63 | /* dual-faced port that converts from octetstring to decoded |
| 64 | * GSMTAP and vice-versa */ |
| 65 | type port GSMTAP_PT message { |
| 66 | out GSMTAP_Send |
| 67 | out GSMTAP_SendTo |
| 68 | in GSMTAP_RecvFrom |
| 69 | in ASP_Event |
Harald Welte | 04d74cd | 2017-11-19 09:29:51 +0100 | [diff] [blame] | 70 | in ASP_ConnId_ReadyToRelease |
Harald Welte | 3d4df7f | 2017-07-14 22:05:56 +0200 | [diff] [blame] | 71 | } with { extension "user IPL4asp_PT |
| 72 | out(GSMTAP_Send -> ASP_Send: function(GSMTAP_to_IPL4_Send); |
| 73 | GSMTAP_SendTo -> ASP_SendTo: function(GSMTAP_to_IPL4_SendTo)) |
| 74 | in(ASP_RecvFrom -> GSMTAP_RecvFrom: function(IPL4_to_GSMTAP); |
Harald Welte | 04d74cd | 2017-11-19 09:29:51 +0100 | [diff] [blame] | 75 | ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple; |
Harald Welte | 3d4df7f | 2017-07-14 22:05:56 +0200 | [diff] [blame] | 76 | ASP_Event -> ASP_Event: simple)" } |
| 77 | |
| 78 | } |