diff options
Diffstat (limited to 'library/OPCAP_Templates.ttcn')
-rw-r--r-- | library/OPCAP_Templates.ttcn | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/library/OPCAP_Templates.ttcn b/library/OPCAP_Templates.ttcn new file mode 100644 index 00000000..0a1c884f --- /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 + } + } +} + + +}; |