Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8714 :
[metze/wireshark/wip.git] / epan / dissectors / packet-rmt-norm.h
1 /* packet-rmt-norm.h
2  * Reliable Multicast Transport (RMT)
3  * NORM Protocol Instantiation function definitions
4  * Copyright 2005, Stefano Pettini <spettini@users.sourceforge.net>
5  *
6  * $Id$
7  *
8  * Wireshark - Network traffic analyzer
9  * By Gerald Combs <gerald@wireshark.org>
10  * Copyright 1998 Gerald Combs
11  *
12  * Extensive changes to decode more information Julian Onions
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27  */
28
29 #ifndef __PACKET_RMT_NORM__
30 #define __PACKET_RMT_NORM__
31
32 #include "packet-rmt-common.h"
33 #include "packet-rmt-fec.h"
34 #include "packet-rmt-lct.h"
35
36 /* Type definitions */
37 /* ================ */
38
39 /* Logical NORM packet representation */
40 struct _norm
41 {
42         guint8 version;
43         guint8 type;
44         guint8 hlen;
45         guint16 sequence;
46         guint32 source_id;
47
48         struct _fec fec;
49 };
50
51 enum {
52         NORM_INFO = 1,
53         NORM_DATA = 2,
54         NORM_CMD = 3,
55         NORM_NACK = 4,
56         NORM_ACK = 5,
57         NORM_REPORT = 6,
58
59         NORM_CMD_FLUSH = 1,
60         NORM_CMD_EOT = 2,
61         NORM_CMD_SQUELCH = 3,
62         NORM_CMD_CC = 4,
63         NORM_CMD_REPAIR_ADV = 5,
64         NORM_CMD_ACK_REQ = 6,
65         NORM_CMD_APPLICATION = 7,
66
67
68         NORM_FLAG_REPAIR = 0x01,
69         NORM_FLAG_EXPLICIT = 0x02,
70         NORM_FLAG_INFO = 0x04,
71         NORM_FLAG_UNRELIABLE = 0x08,
72         NORM_FLAG_FILE = 0x10,
73         NORM_FLAG_STREAM = 0x20,
74         NORM_FLAG_MSG_START = 0x40,
75
76         NORM_ACK_CC = 1,
77         NORM_ACK_FLUSH = 2,
78
79         NORM_NACK_ITEMS = 1,
80         NORM_NACK_RANGES = 2,
81         NORM_NACK_ERASURES = 3,
82
83         NORM_NACK_SEGMENT = 0x01,
84         NORM_NACK_BLOCK = 0x02,
85         NORM_NACK_INFO = 0x04,
86         NORM_NACK_OBJECT = 0x08,
87
88
89         NORM_FLAG_CC_CLR = 0x01,
90         NORM_FLAG_CC_PLR = 0x02,
91         NORM_FLAG_CC_RTT = 0x04,
92         NORM_FLAG_CC_START = 0x08,
93         NORM_FLAG_CC_LEAVE = 0x10
94
95 };
96
97
98 /* Wireshark stuff */
99 /* ============== */
100
101 /* NORM header field definitions*/
102 struct _norm_hf
103 {
104         int version;
105         int type;
106         int hlen;
107         int sequence;
108         int source_id;
109         int instance_id;
110         int grtt;
111         int backoff;
112         int gsize;
113         int flags;
114         int cmd_flavor;
115         int reserved;
116         int cc_sequence;
117         int cc_sts;
118         int cc_stus;
119         int cc_node_id;
120         int cc_flags;
121         int cc_flags_clr;
122         int cc_flags_plr;
123         int cc_flags_rtt;
124         int cc_flags_start;
125         int cc_flags_leave;
126         int cc_rtt;
127         int cc_rate;
128         int cc_transport_id;
129         int ack_source;
130         int ack_type;
131         int ack_id;
132         int ack_grtt_sec;
133         int ack_grtt_usec;
134         int nack_server;
135         int nack_grtt_sec;
136         int nack_grtt_usec;
137         int nack_form;
138         int nack_length;
139         int nack_flags;
140         int nack_flags_segment;
141         int nack_flags_block;
142         int nack_flags_info;
143         int nack_flags_object;
144         struct flaglist {
145                 int repair;
146                 int norm_explicit;
147                 int info;
148                 int unreliable;
149                 int file;
150                 int stream;
151                 int msgstart;
152         } flag;
153         int object_transport_id;
154         int extension;
155         int payload_len;
156         int payload_offset;
157         struct _fec_hf fec;
158
159         int payload;
160 };
161
162 /* NORM subtrees */
163 struct _norm_ett
164 {
165         gint main;
166         gint hdrext;
167         gint flags;
168         gint streampayload;
169         gint congestioncontrol;
170         gint nackdata;
171         struct _fec_ett fec;
172 };
173
174 /* NORM preferences */
175 struct _norm_prefs
176 {
177         struct _fec_prefs fec;
178 };
179
180 /* Function declarations */
181 /* ===================== */
182
183 #endif