aboutsummaryrefslogtreecommitdiffstats
path: root/library/OPCAP_Templates.ttcn
blob: 0a1c884f0b6cd937019814641b7febc59ab5fbf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
		}
	}
}


};