Split GTP_CodecPort/GTP_Templates into C and U variants

The Types are already split in the dependent modules in GTPC_Types and
GTPU_Types.
There's no point in keeping them together in the same file since those 2
protocols are mostly independent.
Furthermore, testsuites using GTPv2C + GTPv1U don't need GTPv1C.

Change-Id: Ic15c9a2e92828cbafb4dda7355ee534107051e2d
diff --git a/library/GTPv1U_CodecPort.ttcn b/library/GTPv1U_CodecPort.ttcn
new file mode 100644
index 0000000..59c5ef3
--- /dev/null
+++ b/library/GTPv1U_CodecPort.ttcn
@@ -0,0 +1,58 @@
+/* dual-faced port sitting on top of IPL4_asp UDP to encode/decode GTPv1-U
+ * (C) 2017 Harald Welte <laforge@gnumonks.org>
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+
+module GTPv1U_CodecPort {
+	import from IPL4asp_PortType all;
+	import from IPL4asp_Types all;
+	import from GTPU_Types all;
+	import from Misc_Helpers all;
+
+	/* identifies a remote peer (sender or receiver) */
+	type record Gtp1uPeer {
+		ConnectionId	connId,
+		HostName	remName,
+		PortNumber	remPort
+	}
+
+	/* Decoded GTP1U (User Plane), used in send and receive direction */
+	type record Gtp1uUnitdata {
+		Gtp1uPeer	peer,
+		PDU_GTPU	gtpu
+	}
+
+	/* dual-faced port on top of IPL4asp; ASP_Event passed through transparently */
+	type port GTPU_PT message {
+		out	Gtp1uUnitdata;
+		in	Gtp1uUnitdata,
+			ASP_ConnId_ReadyToRelease,
+			ASP_Event;
+	} with { extension "user IPL4asp_PT
+		out(Gtp1uUnitdata -> ASP_SendTo: function(f_enc_Gtp1uUD))
+		in(ASP_RecvFrom -> Gtp1uUnitdata: function(f_dec_Gtp1uUD);
+		   ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
+		   ASP_Event -> ASP_Event: simple)" }
+
+	function f_enc_Gtp1uUD(in Gtp1uUnitdata in_ud, out ASP_SendTo out_ud) {
+		out_ud.connId := in_ud.peer.connId;
+		out_ud.remName := in_ud.peer.remName;
+		out_ud.remPort := in_ud.peer.remPort;
+		out_ud.proto := { udp := {} };
+		out_ud.msg := enc_PDU_GTPU(in_ud.gtpu);
+	} with { extension "prototype(fast)" };
+
+	function f_dec_Gtp1uUD(in ASP_RecvFrom in_ud, out Gtp1uUnitdata out_ud) {
+		out_ud.peer.connId := in_ud.connId;
+		out_ud.peer.remName := in_ud.remName;
+		out_ud.peer.remPort := in_ud.remPort;
+		out_ud.gtpu := dec_PDU_GTPU(in_ud.msg);
+	} with { extension "prototype(fast)" };
+
+}