Initial test suite for osmo-pcap-client
Change-Id: If4a1072e75cb64f785d660e4c828c0f521d84b16
diff --git a/library/OPCAP_Templates.ttcn b/library/OPCAP_Templates.ttcn
new file mode 100644
index 0000000..0a1c884
--- /dev/null
+++ b/library/OPCAP_Templates.ttcn
@@ -0,0 +1,54 @@
+module OPCAP_Templates {
+
+/* OPCAP_Templates, defining TTCN-3 templates for the osmo-pcap protocol.
+ *
+ * OPCAP is a non-standard protocol used between osmo-pcap-client and osmo-pcap-server.
+ *
+ * (C) 2021 by 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.
+ */
+
+import from General_Types all;
+import from Osmocom_Types all;
+import from OPCAP_Types all;
+
+
+template (present) OPCAP_PDU tr_OPCAP_FILE_HDR(template (present) uint32_t linktype := ?) := {
+ msg_type := PKT_LINK_HDR,
+ spare := ?,
+ len := 24,
+ u := {
+ file := {
+ magic := PCAP_MAGIC,
+ version_major := PCAP_VERSION_MAJOR,
+ version_minor := PCAP_VERSION_MINOR,
+ thiszone := 0,
+ sigfigs := 0,
+ snaplen := 9000,
+ linktype := linktype
+ }
+ }
+}
+
+template (present) OPCAP_PDU tr_OPCAP_PKT(template (present) octetstring payload,
+ template (present) uint32_t caplen := ?,
+ template (present) uint32_t len := ?) := {
+ msg_type := PKT_LINK_DATA,
+ spare := ?,
+ len := ?,
+ u := {
+ packet := {
+ ts_sec := ?,
+ ts_usec := ?,
+ caplen := caplen,
+ len := len,
+ payload := payload
+ }
+ }
+}
+
+
+};