WAND Trace processing  4.0.5
format_ndag.h
1 /*
2  *
3  * Copyright (c) 2007-2017 The University of Waikato, Hamilton, New Zealand.
4  * All rights reserved.
5  *
6  * This file is part of libtrace.
7  *
8  * This code has been developed by the University of Waikato WAND
9  * research group. For further information please see http://www.wand.net.nz/
10  *
11  * libtrace is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * libtrace is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with this program. If not, see <http://www.gnu.org/licenses/>.
23  *
24  *
25  */
26 
27 
28 #ifndef FORMAT_NDAG_H_
29 #define FORMAT_NDAG_H_
30 
31 #include <libtrace.h>
32 
33 #define NDAG_MAX_DGRAM_SIZE (8900)
34 
35 #define NDAG_MAGIC_NUMBER (0x4E444147)
36 #define NDAG_EXPORT_VERSION 1
37 
38 
39 enum {
40  NDAG_PKT_BEACON = 0x01,
41  NDAG_PKT_ENCAPERF = 0x02,
42  NDAG_PKT_RESTARTED = 0x03,
43  NDAG_PKT_ENCAPRT = 0x04,
44  NDAG_PKT_KEEPALIVE = 0x05
45 };
46 
47 /* == Protocol header structures == */
48 
49 /* Common header -- is prepended to all exported records */
50 typedef struct ndag_common_header {
51  uint32_t magic;
52  uint8_t version;
53  uint8_t type;
54  uint16_t monitorid;
55 } PACKED ndag_common_t;
56 
57 /* Beacon -- structure is too simple to be worth defining as a struct */
58 /*
59  * uint16_t numberofstreams;
60  * uint16_t firststreamport;
61  * uint16_t secondstreamport;
62  * ....
63  * uint16_t laststreamport;
64  */
65 
66 /* Encapsulation header -- used by both ENCAPERF and ENCAPRT records */
67 typedef struct ndag_encap {
68  uint64_t started;
69  uint32_t seqno;
70  uint16_t streamid;
71  uint16_t recordcount; /* acts as RT type for ENCAPRT records */
72 } PACKED ndag_encap_t;
73 
74 #endif
Definition: format_ndag.h:50
Trace file processing library header.
Definition: format_ndag.h:67