blob: 0a1c884f0b6cd937019814641b7febc59ab5fbf9 [file] [log] [blame]
Harald Weltec4ac9e02021-04-22 23:07:44 +02001module OPCAP_Templates {
2
3/* OPCAP_Templates, defining TTCN-3 templates for the osmo-pcap protocol.
4 *
5 * OPCAP is a non-standard protocol used between osmo-pcap-client and osmo-pcap-server.
6 *
7 * (C) 2021 by Harald Welte <laforge@gnumonks.org>
8 * All rights reserved.
9 *
10 * Released under the terms of GNU General Public License, Version 2 or
11 * (at your option) any later version.
12 */
13
14import from General_Types all;
15import from Osmocom_Types all;
16import from OPCAP_Types all;
17
18
19template (present) OPCAP_PDU tr_OPCAP_FILE_HDR(template (present) uint32_t linktype := ?) := {
20 msg_type := PKT_LINK_HDR,
21 spare := ?,
22 len := 24,
23 u := {
24 file := {
25 magic := PCAP_MAGIC,
26 version_major := PCAP_VERSION_MAJOR,
27 version_minor := PCAP_VERSION_MINOR,
28 thiszone := 0,
29 sigfigs := 0,
30 snaplen := 9000,
31 linktype := linktype
32 }
33 }
34}
35
36template (present) OPCAP_PDU tr_OPCAP_PKT(template (present) octetstring payload,
37 template (present) uint32_t caplen := ?,
38 template (present) uint32_t len := ?) := {
39 msg_type := PKT_LINK_DATA,
40 spare := ?,
41 len := ?,
42 u := {
43 packet := {
44 ts_sec := ?,
45 ts_usec := ?,
46 caplen := caplen,
47 len := len,
48 payload := payload
49 }
50 }
51}
52
53
54};