Harald Welte | a7261d7 | 2017-11-18 13:28:07 +0100 | [diff] [blame] | 1 | module RTP_CodecPort { |
| 2 | |
| 3 | import from IPL4asp_PortType all; |
| 4 | import from IPL4asp_Types all; |
| 5 | import from RTP_Types all; |
| 6 | |
| 7 | type record RTP_RecvFrom { |
| 8 | ConnectionId connId, |
| 9 | HostName remName, |
| 10 | PortNumber remPort, |
| 11 | HostName locName, |
| 12 | PortNumber locPort, |
| 13 | RTP_messages_union msg |
| 14 | }; |
| 15 | |
| 16 | template RTP_RecvFrom t_RTP_RecvFrom(template RTP_messages_union msg) := { |
| 17 | connId := ?, |
| 18 | remName := ?, |
| 19 | remPort := ?, |
| 20 | locName := ?, |
| 21 | locPort := ?, |
| 22 | msg := msg |
| 23 | } |
| 24 | |
| 25 | type record RTP_Send { |
| 26 | ConnectionId connId, |
| 27 | RTP_messages_union msg |
| 28 | } |
| 29 | |
| 30 | template RTP_Send t_RTP_Send(template ConnectionId connId, template RTP_messages_union msg) := { |
| 31 | connId := connId, |
| 32 | msg := msg |
| 33 | } |
| 34 | |
| 35 | private function IPL4_to_RTP_RecvFrom(in ASP_RecvFrom pin, out RTP_RecvFrom pout) { |
| 36 | pout.connId := pin.connId; |
| 37 | pout.remName := pin.remName; |
| 38 | pout.remPort := pin.remPort; |
| 39 | pout.locName := pin.locName; |
| 40 | pout.locPort := pin.locPort; |
| 41 | pout.msg := f_RTP_dec(pin.msg) |
| 42 | } with { extension "prototype(fast)" }; |
| 43 | |
| 44 | private function RTP_to_IPL4_Send(in RTP_Send pin, out ASP_Send pout) { |
| 45 | pout.connId := pin.connId; |
| 46 | pout.proto := { udp := {} }; |
| 47 | pout.msg := f_RTP_enc(pin.msg); |
| 48 | } with { extension "prototype(fast)" }; |
| 49 | |
| 50 | type port RTP_CODEC_PT message { |
| 51 | out RTP_Send; |
| 52 | in RTP_RecvFrom, |
| 53 | ASP_ConnId_ReadyToRelease, |
| 54 | ASP_Event; |
| 55 | } with { extension "user IPL4asp_PT |
| 56 | out(RTP_Send -> ASP_Send:function(RTP_to_IPL4_Send)) |
| 57 | in(ASP_RecvFrom -> RTP_RecvFrom: function(IPL4_to_RTP_RecvFrom); |
| 58 | ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple; |
| 59 | ASP_Event -> ASP_Event: simple)" |
| 60 | } |
| 61 | } |