Implement L1CTL port type (dual-faced port on top of UnixDomain)
diff --git a/lapd/L1CTL_PortType.ttcn b/lapd/L1CTL_PortType.ttcn
new file mode 100644
index 0000000..d726ce4
--- /dev/null
+++ b/lapd/L1CTL_PortType.ttcn
@@ -0,0 +1,52 @@
+/* dual-faced port that wraps an Unixdomain port and encodes/decodes L1CTL */
+module L1CTL_PortType {
+ import from L1CTL_Types all;
+ import from UD_PortType all;
+ import from UD_Types all;
+
+ type record L1CTL_connect {
+ charstring path
+ }
+
+ type record L1CTL_connect_result {
+ UD_Result_code result_code optional,
+ charstring err optional
+ }
+
+ private function L1CTL_to_UD_connect(in L1CTL_connect pin, out UD_connect pout) {
+ pout.path := pin.path;
+ pout.id := 0;
+ } with { extension "prototype(fast)" }
+
+ private function UD_to_L1CTL_connect_result(in UD_connect_result pin, out L1CTL_connect_result pout) {
+ pout.result_code := pin.result.result_code;
+ pout.err := pin.result.err;
+ } with { extension "prototype(fast)" }
+
+ private function L1CTL_to_UD_ul(in L1ctlUlMessage pin, out UD_send_data pout) {
+ var L1ctlUlMessageLV msg_lv := { msg := pin };
+ pout.data := enc_L1ctlUlMessageLV(msg_lv);
+ pout.id := 0;
+ } with { extension "prototype(fast)" }
+
+ private function UD_to_L1CTL_dl(in UD_send_data pin, out L1ctlDlMessage pout) {
+ var L1ctlDlMessageLV msg_lv := dec_L1ctlDlMessageLV(pin.data);
+ pout:= msg_lv.msg;
+ } with { extension "prototype(fast)" }
+
+ type port L1CTL_PT message {
+ out L1ctlUlMessage
+ out L1CTL_connect
+ in L1ctlDlMessage
+ in L1CTL_connect_result
+ in UD_listen_result
+ in UD_connected
+ } with { extension "user UD_PT
+ out(L1ctlUlMessage -> UD_send_data: function(L1CTL_to_UD_ul);
+ L1CTL_connect -> UD_connect: function(L1CTL_to_UD_connect))
+ in(UD_send_data -> L1ctlDlMessage: function(UD_to_L1CTL_dl);
+ UD_connect_result -> L1CTL_connect_result: function(UD_to_L1CTL_connect_result);
+ UD_listen_result -> UD_listen_result: simple;
+ UD_connected -> UD_connected: simple
+ )" }
+}