"This file format can't be written to a pipe" and "this file format
[obnox/wireshark/wip.git] / wiretap / network_instruments.h
1 /*
2  * $Id$
3  */
4
5 /***************************************************************************
6                           NetworkInstruments.h  -  description
7                              -------------------
8     begin                : Wed Oct 29 2003
9     copyright            : (C) 2003 by root
10     email                : scotte[AT}netinst.com
11  ***************************************************************************/
12
13 /***************************************************************************
14  *                                                                         *
15  *   This program is free software; you can redistribute it and/or modify  *
16  *   it under the terms of the GNU General Public License as published by  *
17  *   the Free Software Foundation; either version 2 of the License, or     *
18  *   (at your option) any later version.                                   *
19  *                                                                         *
20  ***************************************************************************/
21
22 #ifndef __NETWORK_INSTRUMENTS_H__
23 #define __NETWORK_INSTRUMENTS_H__
24
25 int network_instruments_open(wtap *wth, int *err, gchar **err_info);
26 int network_instruments_dump_can_write_encap(int encap);
27 gboolean network_instruments_dump_open(wtap_dumper *wdh, int *err);
28
29 typedef struct capture_file_header
30 {
31         char    observer_version[32];
32         guint16 offset_to_first_packet;
33         char    probe_instance;
34         guint8  number_of_information_elements; /* number of TLVs in the header */
35 } capture_file_header;
36
37 typedef struct tlv_header
38 {
39         guint16 type;
40         guint16 length;         /* includes the length of the TLV header */
41 } tlv_header;
42
43 /*
44  * TLV type values.
45  */
46 #define INFORMATION_TYPE_ALIAS_LIST 0x01
47 #define INFORMATION_TYPE_COMMENT    0x02        /* ASCII text */
48
49 typedef struct packet_entry_header
50 {
51         guint32 packet_magic;
52         guint32 network_speed;
53         guint16 captured_size;
54         guint16 network_size;
55         guint16 offset_to_frame;
56         guint16 offset_to_next_packet;
57         guint8 network_type;
58         guint8 flags;
59         guint8 number_of_information_elements;  /* number of TLVs in the header */
60         guint8 packet_type;
61         guint16 errors;
62         guint16 reserved;
63         guint64 packet_number;
64         guint64 original_packet_number;
65         guint64 nano_seconds_since_2000;
66 } packet_entry_header;
67
68 /*
69  * Network type values.
70  */
71 #define OBSERVER_UNDEFINED 0xFF
72 #define OBSERVER_ETHERNET  0x00
73 #define OBSERVER_TOKENRING 0x01
74 #define OBSERVER_FDDI      0x02
75
76 /*
77  * Packet type values.
78  */
79 #define PACKET_TYPE_DATA_PACKET                 0
80 #define PACKET_TYPE_EXPERT_INFORMATION_PACKET   1
81
82 /*
83  * The Observer document indicates that the types of expert information
84  * packets are:
85  *
86  *      Network Load (markers used by Expert Time Interval and What If
87  *      analysis modes)
88  *
89  *      Start/Stop Packet Capture marker frames (with time stamps when
90  *      captures start and stop)
91  *
92  *      Wireless Channel Change (markers showing what channel was being
93  *      currently listened to)
94  *
95  * That information appears to be contained in TLVs.
96  */
97
98 /*
99  * TLV type values.
100  */
101 #define INFORMATION_TYPE_NETWORK_LOAD           0x0100
102 #define INFORMATION_TYPE_CAPTURE_START_STOP     0x0104
103
104 /*
105  * Might some of these be broadcast and multicast packet counts?
106  */
107 typedef struct tlv_network_load
108 {
109         guint32 utilization;    /* network utilization, in .1% units */
110         guint32 unknown1;
111         guint32 unknown2;
112         guint32 packets_per_second;
113         guint32 unknown3;
114         guint32 bytes_per_second;
115         guint32 unknown4;
116 } tlv_network_load;
117
118 typedef struct tlv_capture_start_stop
119 {
120         guint32 start_stop;
121 } tlv_capture_start_stop;
122
123 #define START_STOP_TYPE_STOP    0
124 #define START_STOP_TYPE_START   1
125
126 #endif
127