Harald Welte | c4ac9e0 | 2021-04-22 23:07:44 +0200 | [diff] [blame] | 1 | module 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 | |
| 14 | import from General_Types all; |
| 15 | import from Osmocom_Types all; |
| 16 | import from OPCAP_Types all; |
| 17 | |
| 18 | |
| 19 | template (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 | |
| 36 | template (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 | }; |