63 lines
1.5 KiB
Plaintext
63 lines
1.5 KiB
Plaintext
module NS_CodecPort {
|
|
|
|
import from IPL4asp_PortType all;
|
|
import from IPL4asp_Types all;
|
|
import from BSSGP_Helper_Functions all;
|
|
import from NS_Types all;
|
|
|
|
type record NS_RecvFrom {
|
|
ConnectionId connId,
|
|
HostName remName,
|
|
PortNumber remPort,
|
|
HostName locName,
|
|
PortNumber locPort,
|
|
NsPdu msg
|
|
}
|
|
|
|
template NS_RecvFrom t_NS_RecvFrom(template NsPdu pdu) := {
|
|
connId := ?,
|
|
remName := ?,
|
|
remPort := ?,
|
|
locName := ?,
|
|
locPort := ?,
|
|
msg := pdu
|
|
};
|
|
|
|
type record NS_Send {
|
|
ConnectionId connId,
|
|
NsPdu msg
|
|
}
|
|
|
|
template NS_Send t_NS_Send(template ConnectionId connId, template NsPdu msg) := {
|
|
connId := connId,
|
|
msg := msg
|
|
}
|
|
|
|
private function IPL4_to_NS_RecvFrom(in ASP_RecvFrom pin, out NS_RecvFrom pout) {
|
|
pout.connId := pin.connId;
|
|
pout.remName := pin.remName;
|
|
pout.remPort := pin.remPort;
|
|
pout.locName := pin.locName;
|
|
pout.locPort := pin.locPort;
|
|
pout.msg := dec_NsPdu(f_NS_expand_len(pin.msg));
|
|
} with { extension "prototype(fast)" };
|
|
|
|
private function NS_to_IPL4_Send(in NS_Send pin, out ASP_Send pout) {
|
|
pout.connId := pin.connId;
|
|
pout.proto := { udp := {} };
|
|
pout.msg := f_NS_compact_len(enc_NsPdu(pin.msg));
|
|
} with { extension "prototype(fast)" };
|
|
|
|
type port NS_CODEC_PT message {
|
|
out NS_Send;
|
|
in NS_RecvFrom,
|
|
ASP_ConnId_ReadyToRelease,
|
|
ASP_Event;
|
|
} with { extension "user IPL4asp_PT
|
|
out(NS_Send -> ASP_Send: function(NS_to_IPL4_Send))
|
|
in(ASP_RecvFrom -> NS_RecvFrom: function(IPL4_to_NS_RecvFrom);
|
|
ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
|
|
ASP_Event -> ASP_Event: simple)"
|
|
}
|
|
}
|