1 /* packet-rtp-ed137.c
2  *
3  * Routines for RTP ED-137 extensions dissection
4  * RTP = Real time Transport Protocol
5  *
6  * Copyright 2000, Philips Electronics N.V.
7  * Written by Andreas Sikkema <h323@ramdyne.nl>
8  *
9  * Wireshark - Network traffic analyzer
10  * By Gerald Combs <gerald@wireshark.org>
11  * Copyright 1998 Gerald Combs
12  *
13  * SPDX-License-Identifier: GPL-2.0-or-later
14  */
15 
16 /*
17  * This dissector tries to dissect the RTP extension headers by ED-137, ED-137A, ED-137B and ED-137C specification
18  * of EUROCAE (The European Organisation for Civil Aviation Equipment)
19  *
20  * There are two packet header extension signatures. One for ED-137 and second ED-137A and later releases. Even some extensions are same in ED-137 and ED-137A, constants and code are duplicated because there are slight differences between standard release.
21  * ED-137A and later standards share some extensions (e. g. SQI is defined in ED-137A and repeated without change in ED-137B and C). Naming convention use first standard release where extension was introduced (ED-137A in SQI case).
22  *
23  * Each ED-137 header extension consists of fixed part and variable part (called "extension for additional features" in standard). The code decodes fixed part and some variable part headers. The code decode only additional headers we seen (we have samples) even standard defines more of it.
24  * To allow other developers and vendors to introduce custom decoders, there are dissector tables rtp.hdr_ext.ed137 and rtp.hdr_ext.ed137a which registers dissector for each "additional feature" header by type/length key. It allows anyone extending decoding capabilites just by adding plugin and register dissector in the table - without modifying this source.
25  * rtp.hdr_ext.ed137 table is used for ED-137 standard release. rtp.hdr_ext.ed137a table is used for ED-137A and later standard releases.
26  */
27 
28 
29 #include "config.h"
30 
31 #include <epan/packet.h>
32 #include <epan/to_str.h>
33 
34 #include "packet-rtp.h"
35 
36 static int proto_rtp_ed137      = -1;
37 
38 static dissector_handle_t rtp_hdr_ext_ed137_handle;
39 static dissector_handle_t rtp_hdr_ext_ed137a_handle;
40 static dissector_handle_t rtp_hdr_ext_ed137a_feature_sqi_handle;
41 static dissector_handle_t rtp_hdr_ext_ed137a_feature_climax_tdly_handle;
42 static dissector_handle_t rtp_hdr_ext_ed137b_feature_rrc_single_handle;
43 static dissector_handle_t rtp_hdr_ext_ed137b_feature_climax_ddc_rmm_handle;
44 static dissector_handle_t rtp_hdr_ext_ed137b_feature_climax_ddc_mam_handle;
45 static dissector_handle_t rtp_hdr_ext_ed137c_feature_climax_ddc_mam_handle;
46 
47 static dissector_table_t rtp_hdr_ext_ed137a_add_features_table;
48 
49 /* RTP header ED-137 extension fields   */
50 static int hf_rtp_hdr_ed137s    = -1;
51 static int hf_rtp_hdr_ed137     = -1;
52 static int hf_rtp_hdr_ed137_add = -1;
53 static int hf_rtp_hdr_ed137_ptt_type  = -1;
54 static int hf_rtp_hdr_ed137_squ       = -1;
55 static int hf_rtp_hdr_ed137_ptt_id    = -1;
56 static int hf_rtp_hdr_ed137_sct       = -1;
57 static int hf_rtp_hdr_ed137_x         = -1;
58 static int hf_rtp_hdr_ed137_x_nu      = -1;
59 static int hf_rtp_hdr_ed137_ft_type   = -1;
60 static int hf_rtp_hdr_ed137_ft_len    = -1;
61 static int hf_rtp_hdr_ed137_ft_value  = -1;
62 static int hf_rtp_hdr_ed137_ft_bss_qidx  = -1;
63 static int hf_rtp_hdr_ed137_ft_bss_rssi_qidx  = -1;
64 static int hf_rtp_hdr_ed137_ft_bss_qidx_ml  = -1;
65 static int hf_rtp_hdr_ed137_vf  = -1;
66 static int hf_rtp_hdr_ed137_ft_climax_delay_value = -1;
67 
68 /* RTP header ED-137A extension fields   */
69 static int hf_rtp_hdr_ed137a     = -1;
70 static int hf_rtp_hdr_ed137a_add = -1;
71 static int hf_rtp_hdr_ed137a_ptt_type  = -1;
72 static int hf_rtp_hdr_ed137a_squ       = -1;
73 static int hf_rtp_hdr_ed137a_ptt_id    = -1;
74 static int hf_rtp_hdr_ed137a_pm        = -1;
75 static int hf_rtp_hdr_ed137a_ptts      = -1;
76 static int hf_rtp_hdr_ed137a_sct       = -1;
77 static int hf_rtp_hdr_ed137a_reserved  = -1;
78 static int hf_rtp_hdr_ed137a_x         = -1;
79 static int hf_rtp_hdr_ed137a_x_nu      = -1;
80 static int hf_rtp_hdr_ed137a_ft_type   = -1;
81 static int hf_rtp_hdr_ed137a_ft_len    = -1;
82 static int hf_rtp_hdr_ed137a_ft_value  = -1;
83 static int hf_rtp_hdr_ed137a_ft_padding  = -1;
84 static int hf_rtp_hdr_ed137a_ft_sqi_qidx  = -1;
85 static int hf_rtp_hdr_ed137a_ft_sqi_rssi_qidx  = -1;
86 static int hf_rtp_hdr_ed137a_ft_sqi_qidx_ml  = -1;
87 static int hf_rtp_hdr_ed137a_ft_climax_delay_mode  = -1;
88 static int hf_rtp_hdr_ed137a_ft_climax_delay_relative_value = -1;
89 static int hf_rtp_hdr_ed137a_ft_climax_delay_absolute_value = -1;
90 
91 /* RTP header ED-137B extension fields   */
92 static int hf_rtp_hdr_ed137b_ft_rrc_single = -1;
93 static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f1 = -1;
94 static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f1 = -1;
95 static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f2 = -1;
96 static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f2 = -1;
97 static int hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f1 = -1;
98 static int hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f2 = -1;
99 static int hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f1 = -1;
100 static int hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f2 = -1;
101 static int hf_rtp_hdr_ed137b_ft_climax_ddc_unknown = -1;
102 static int hf_rtp_hdr_ed137b_ft_climax_ddc_rmm = -1;
103 static int hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_tqv = -1;
104 static int hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_t1 = -1;
105 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam = -1;
106 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tqg = -1;
107 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t1 = -1;
108 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_nmr = -1;
109 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t2 = -1;
110 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tsd = -1;
111 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tj1 = -1;
112 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tid = -1;
113 
114 /* RTP header ED-137C extension fields   */
115 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam = -1;
116 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tqg = -1;
117 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t1 = -1;
118 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_nmr = -1;
119 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t2 = -1;
120 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tsd = -1;
121 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tj1 = -1;
122 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tid = -1;
123 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_ts2 = -1;
124 
125 static gint ett_hdr_ext_ed137s  = -1;
126 static gint ett_hdr_ext_ed137   = -1;
127 static gint ett_hdr_ext_ed137_add = -1;
128 static gint ett_hdr_ext_ed137a  = -1;
129 static gint ett_hdr_ext_ed137a_add = -1;
130 
131 /* Forward declaration we need below */
132 void proto_register_rtp_ed137(void);
133 void proto_reg_handoff_rtp_ed137(void);
134 
135 /* Combine 4 bits of type with 4 bits of length to 8 bit key */
136 #define MAKE_KEY(type, len) \
137     ( ( type & 0x0F ) << 4 | ( len & 0x0f ) )
138 
139 /* ED-137 signature */
140 #define RTP_ED137_SIG    0x0067
141 
142 /* ED-137A signature */
143 #define RTP_ED137A_SIG   0x0167
144 
145 /* ED-137 PTT */
146 #define RTP_ED137_ptt_mask(octet)   ((octet) & 0xE0000000)
147 #define RTP_ED137A_ptt_mask(octet)   ((octet) & 0xE000)
148 #define RTP_ED137_squ_mask(octet)   ((octet) & 0x10000000)
149 #define RTP_ED137A_squ_mask(octet)   ((octet) & 0x1000)
150 
151 /* ED-137 extended information */
152 #define RTP_ED137_extended_information(octet)   ((octet) & 0x00400000)
153 #define RTP_ED137A_extended_information(octet)  ((octet) & 0x0001)
154 
155 /* ED-137 feature type */
156 #define RTP_ED137_feature_type(octet)  (((octet) & 0x003C0000) >> 18)
157 #define RTP_ED137A_feature_type(octet) (((octet) & 0x0000F000) >> 12)
158 
159 /* ED-137 feature length */
160 #define RTP_ED137_feature_length(octet)  (((octet) & 0x0003C000) >> 14)
161 #define RTP_ED137A_feature_length(octet) (((octet) & 0x00000F00) >> 8)
162 
163 /* ED-137 feature value */
164 #define RTP_ED137_feature_value(octet)  (((octet) & 0x00003FFE) >> 1)
165 #define RTP_ED137A_feature_value(octet) (((octet) & 0x000000FF) >> 0)
166 
167 /* ED_137 None constants */
168 #define RTP_ED137_feature_none_type    0x0
169 
170 /* ED-137 BSS constants */
171 #define RTP_ED137_feature_bss_type    0x1
172 #define RTP_ED137_feature_bss_qidx(octet)   (((octet) & 0x00003FC0) >> 6)
173 #define RTP_ED137_feature_bss_qidx_ml(octet)   (((octet) & 0x00000038) >> 2)
174 #define RTP_ED137_feature_bss_qidx_ml_rssi      0
175 #define RTP_ED137_feature_bss_qidx_rssi_max     15
176 
177 /* ED-137 CLIMAX-Time Delay */
178 #define RTP_ED137_feature_climax_ot_type   0x2
179 #define RTP_ED137_feature_climax_ot_value(octet)  (((octet) & 0x00003F00) >> 8)
180 
181 /* ED-137A SQI constants */
182 #define RTP_ED137A_feature_sqi_type             0x1
183 #define RTP_ED137A_feature_sqi_len              1
184 #define RTP_ED137A_feature_sqi_key              MAKE_KEY( RTP_ED137A_feature_sqi_type, RTP_ED137A_feature_sqi_len )
185 #define RTP_ED137A_feature_sqi_qidx(octet)  (((octet) & 0x000000F8) >> 3)
186 #define RTP_ED137A_feature_sqi_qidx_ml(octet)  (((octet) & 0x00000007) >> 0)
187 #define RTP_ED137A_feature_sqi_qidx_ml_rssi     0
188 #define RTP_ED137A_feature_sqi_qidx_rssi_max    15
189 
190 /* ED-137A CLIMAX-Time Delay */
191 #define RTP_ED137A_feature_climax_tdly_type     0x2
192 #define RTP_ED137A_feature_climax_tdly_len      1
193 #define RTP_ED137A_feature_climax_tdly_key      MAKE_KEY( RTP_ED137A_feature_climax_tdly_type, RTP_ED137A_feature_climax_tdly_len )
194 #define RTP_ED137A_feature_climax_tdly_mode(octet)  (((octet) & 0x00000080) >> 7)
195 #define RTP_ED137A_feature_climax_tdly_value(octet)  (((octet) & 0x0000007F) >> 0)
196 #define RTP_ED137A_feature_climax_tdly_mode_relative    0
197 #define RTP_ED137A_feature_climax_tdly_mode_absolute    1
198 
199 /* ED-137B RRC single */
200 #define RTP_ED137B_feature_rrc_single_type      0x3
201 #define RTP_ED137B_feature_rrc_single_len   1
202 #define RTP_ED137B_feature_rrc_single_key   MAKE_KEY( RTP_ED137B_feature_rrc_single_type, RTP_ED137B_feature_rrc_single_len )
203 
204 /* ED-137B CLIMAX dynamic delay compensation */
205 #define RTP_ED137B_feature_climax_ddc_type      0x4
206 #define RTP_ED137B_feature_climax_ddc_rmm_len   3
207 #define RTP_ED137B_feature_climax_ddc_mam_len   12
208 #define RTP_ED137B_feature_climax_ddc_rmm_key   MAKE_KEY( RTP_ED137B_feature_climax_ddc_type, RTP_ED137B_feature_climax_ddc_rmm_len )
209 #define RTP_ED137B_feature_climax_ddc_mam_key   MAKE_KEY( RTP_ED137B_feature_climax_ddc_type, RTP_ED137B_feature_climax_ddc_mam_len )
210 #define RTP_ED137B_feature_climax_ddc_rmm_tqv(octet)  (((octet) & 0x00800000) >> 23)
211 #define RTP_ED137B_feature_climax_ddc_rmm_t1(octet)   (((octet) & 0x007FFFFF) >> 0)
212 #define RTP_ED137B_feature_climax_ddc_mam_tqg(octet)  (((octet) & 0x00800000) >> 23)
213 #define RTP_ED137B_feature_climax_ddc_mam_t1(octet)   (((octet) & 0x007FFFFF) >> 0)
214 #define RTP_ED137B_feature_climax_ddc_mam_nmr(octet)  (((octet) & 0x00800000) >> 23)
215 #define RTP_ED137B_feature_climax_ddc_mam_t2(octet)   (((octet) & 0x007FFFFF) >> 0)
216 #define RTP_ED137B_feature_climax_ddc_mam_tsd(octet)  (((octet) & 0xFFFF) >> 0)
217 #define RTP_ED137B_feature_climax_ddc_mam_tj1(octet)  (((octet) & 0xFFFF) >> 0)
218 #define RTP_ED137B_feature_climax_ddc_mam_tid(octet)  (((octet) & 0xFFFF) >> 0)
219 #define RTP_ED137B_feature_climax_ddc_rmm_tqv_relative  0
220 #define RTP_ED137B_feature_climax_ddc_rmm_tqv_absolute  1
221 #define RTP_ED137B_feature_climax_ddc_mam_tqg_relative  0
222 #define RTP_ED137B_feature_climax_ddc_mam_tqg_absolute  1
223 
224 /* ED-137C CLIMAX dynamic delay compensation*/
225 #define RTP_ED137C_feature_climax_ddc_type      0x4
226 #define RTP_ED137C_feature_climax_ddc_mam_len   14
227 #define RTP_ED137C_feature_climax_ddc_mam_key   MAKE_KEY( RTP_ED137C_feature_climax_ddc_type, RTP_ED137C_feature_climax_ddc_mam_len )
228 #define RTP_ED137C_feature_climax_ddc_rmm_tqv(octet)  (((octet) & 0x00800000) >> 23)
229 #define RTP_ED137C_feature_climax_ddc_rmm_t1(octet)   (((octet) & 0x007FFFFF) >> 0)
230 #define RTP_ED137C_feature_climax_ddc_mam_tqg(octet)  (((octet) & 0x00800000) >> 23)
231 #define RTP_ED137C_feature_climax_ddc_mam_t1(octet)   (((octet) & 0x007FFFFF) >> 0)
232 #define RTP_ED137C_feature_climax_ddc_mam_nmr(octet)  (((octet) & 0x00800000) >> 23)
233 #define RTP_ED137C_feature_climax_ddc_mam_t2(octet)   (((octet) & 0x007FFFFF) >> 0)
234 #define RTP_ED137C_feature_climax_ddc_mam_tsd(octet)  (((octet) & 0xFFFF) >> 0)
235 #define RTP_ED137C_feature_climax_ddc_mam_tj1(octet)  (((octet) & 0xFFFF) >> 0)
236 #define RTP_ED137C_feature_climax_ddc_mam_tid(octet)  (((octet) & 0xFFFF) >> 0)
237 #define RTP_ED137C_feature_climax_ddc_mam_ts2(octet)  (((octet) & 0xFFFF) >> 0)
238 #define RTP_ED137C_feature_climax_ddc_rmm_tqv_relative  0
239 #define RTP_ED137C_feature_climax_ddc_rmm_tqv_absolute  1
240 #define RTP_ED137C_feature_climax_ddc_mam_tqg_relative  0
241 #define RTP_ED137C_feature_climax_ddc_mam_tqg_absolute  1
242 
243 
244 static const value_string rtp_ext_ed137_ptt_type[] =
245 {
246     { 0x00, "PTT OFF" },
247     { 0x01, "Normal PTT ON" },
248     { 0x02, "Coupling PTT ON" },
249     { 0x03, "Priority PTT ON" },
250     { 0x04, "Emergency PTT ON" },
251     { 0x05, "Reserved" },
252     { 0x06, "Reserved" },
253     { 0x07, "Reserved" },
254     { 0, NULL },
255 };
256 
257 static const value_string rtp_ext_ed137_squ[] =
258 {
259     { 0x00, "SQ OFF" },
260     { 0x01, "SQ ON" },
261     { 0, NULL },
262 };
263 
264 static const value_string rtp_ext_ed137_ft_type[] =
265 {
266     { 0x0, "No features" },
267     { 0x1, "Best signal selection" },
268     { 0x2, "CLIMAX time delay" },
269     { 0x3, "Reserved" },
270     { 0x4, "Reserved" },
271     { 0x5, "Reserved" },
272     { 0x6, "Reserved" },
273     { 0x7, "Reserved" },
274     { 0x8, "Reserved" },
275     { 0x9, "Reserved" },
276     { 0xA, "Reserved" },
277     { 0xB, "Vendor reserved" },
278     { 0xC, "Vendor reserved" },
279     { 0xD, "Vendor reserved" },
280     { 0xE, "Vendor reserved" },
281     { 0xF, "Vendor reserved" },
282     { 0, NULL },
283 };
284 
285 static const value_string rtp_ext_ed137_x[] =
286 {
287     { 0x00, "No extended information with additional features is used" },
288     { 0x01, "Extended information with additional features is used" },
289     { 0, NULL },
290 };
291 
292 static const value_string rtp_ext_ed137_vf[] =
293 {
294     { 0x00, "VF OFF" },
295     { 0x01, "VF ON" },
296     { 0, NULL },
297 };
298 
299 static const value_string rtp_ext_ed137_ft_bss_rssi_qidx[] =
300 {
301     { 0x00, "lower than -100.00 dBm" },
302     { 0x01, "lower than or equal to -97.86 dBm" },
303     { 0x02, "lower than or equal to -95.71 dBm" },
304     { 0x03, "lower than or equal to -93.57 dBm" },
305     { 0x04, "lower than or equal to -91.43 dBm" },
306     { 0x05, "lower than or equal to -89.29 dBm" },
307     { 0x06, "lower than or equal to -87.14 dBm" },
308     { 0x07, "lower than or equal to -85.00 dBm" },
309     { 0x08, "lower than or equal to -82.86 dBm" },
310     { 0x09, "lower than or equal to -80.71 dBm" },
311     { 0x0a, "lower than or equal to -78.57 dBm" },
312     { 0x0b, "lower than or equal to -76.43 dBm" },
313     { 0x0c, "lower than or equal to -74.29 dBm" },
314     { 0x0d, "lower than or equal to -72.14 dBm" },
315     { 0x0e, "lower than or equal to -70.00 dBm" },
316     { 0x0f, "higher than -70.00 dBm" },
317     { 0, NULL },
318 };
319 
320 static const value_string rtp_ext_ed137_ft_bss_qidx_ml[] =
321 {
322     { 0x00, "RSSI" },
323     { 0x01, "AGC Level" },
324     { 0x02, "C/N" },
325     { 0x03, "Standardized PSD" },
326     { 0x04, "Vendor specific method" },
327     { 0x05, "Vendor specific method" },
328     { 0x06, "Vendor specific method" },
329     { 0x07, "Vendor specific method" },
330     { 0, NULL },
331 };
332 
333 static const value_string rtp_ext_ed137a_ptt_type[] =
334 {
335     { 0x00, "PTT OFF" },
336     { 0x01, "Normal PTT ON" },
337     { 0x02, "Coupling PTT ON" },
338     { 0x03, "Priority PTT ON" },
339     { 0x04, "Emergency PTT ON" },
340     { 0x05, "Test PTT ON" },
341     { 0x06, "Reserved" },
342     { 0x07, "Reserved" },
343     { 0, NULL },
344 };
345 
346 static const value_string rtp_ext_ed137a_squ[] =
347 {
348     { 0x00, "SQ OFF" },
349     { 0x01, "SQ ON" },
350     { 0, NULL },
351 };
352 
353 static const value_string rtp_ext_ed137a_ft_type[] =
354 {
355     { 0x0, "No features" },
356     { 0x1, "Signal Quality Information" },
357     { 0x2, "CLIMAX time delay" },
358     { 0x3, "Radio remote control" },
359     { 0x4, "CLIMAX dynamic delay compensation" },
360     { 0x5, "Reserved" },
361     { 0x6, "Reserved" },
362     { 0x7, "Reserved" },
363     { 0x8, "Reserved" },
364     { 0x9, "Reserved" },
365     { 0xA, "Reserved" },
366     { 0xB, "Vendor reserved" },
367     { 0xC, "Vendor reserved" },
368     { 0xD, "Vendor reserved" },
369     { 0xE, "Vendor reserved" },
370     { 0xF, "Vendor reserved" },
371     { 0, NULL },
372 };
373 
374 static const value_string rtp_ext_ed137a_ft_sqi_rssi_qidx[] =
375 {
376     { 0x00, "lower than -100.00 dBm" },
377     { 0x01, "lower than or equal to -97.86 dBm" },
378     { 0x02, "lower than or equal to -95.71 dBm" },
379     { 0x03, "lower than or equal to -93.57 dBm" },
380     { 0x04, "lower than or equal to -91.43 dBm" },
381     { 0x05, "lower than or equal to -89.29 dBm" },
382     { 0x06, "lower than or equal to -87.14 dBm" },
383     { 0x07, "lower than or equal to -85.00 dBm" },
384     { 0x08, "lower than or equal to -82.86 dBm" },
385     { 0x09, "lower than or equal to -80.71 dBm" },
386     { 0x0a, "lower than or equal to -78.57 dBm" },
387     { 0x0b, "lower than or equal to -76.43 dBm" },
388     { 0x0c, "lower than or equal to -74.29 dBm" },
389     { 0x0d, "lower than or equal to -72.14 dBm" },
390     { 0x0e, "lower than or equal to -70.00 dBm" },
391     { 0x0f, "higher than -70.00 dBm" },
392     { 0, NULL },
393 };
394 
395 static const value_string rtp_ext_ed137a_ft_sqi_qidx_ml[] =
396 {
397     { 0x00, "RSSI" },
398     { 0x01, "AGC Level" },
399     { 0x02, "C/N" },
400     { 0x03, "Standardized PSD" },
401     { 0x04, "Vendor specific method" },
402     { 0x05, "Vendor specific method" },
403     { 0x06, "Vendor specific method" },
404     { 0x07, "Vendor specific method" },
405     { 0, NULL },
406 };
407 
408 static const value_string rtp_ext_ed137a_ft_climax_delay_mode[] =
409 {
410     { 0x00, "relative" },
411     { 0x01, "absolute" },
412     { 0, NULL },
413 };
414 
415 static const value_string rtp_ext_ed137b_ft_single_ms_tx_f1[] =
416 {
417     { 0x00, "Main transmitter for F1 is used" },
418     { 0x01, "Standby transmitter for F1 is used" },
419     { 0, NULL },
420 };
421 
422 static const value_string rtp_ext_ed137b_ft_single_ms_rx_f1[] =
423 {
424     { 0x00, "Main receiver for F1 is used" },
425     { 0x01, "Standby receiver for F1 is used" },
426     { 0, NULL },
427 };
428 
429 static const value_string rtp_ext_ed137b_ft_single_ms_tx_f2[] =
430 {
431     { 0x00, "Main transmitter for F2 is used" },
432     { 0x01, "Standby transmitter for F2 is used" },
433     { 0, NULL },
434 };
435 
436 static const value_string rtp_ext_ed137b_ft_single_ms_rx_f2[] =
437 {
438     { 0x00, "Main receiver for F2 is used" },
439     { 0x01, "Standby receiver for F2 is used" },
440     { 0, NULL },
441 };
442 
443 static const value_string rtp_ext_ed137b_ft_single_sel_tx_f1[] =
444 {
445     { 0x00, "Active transmitter for F1 shall not be used" },
446     { 0x01, "Active transmitter for F1 shall be used" },
447     { 0, NULL },
448 };
449 
450 static const value_string rtp_ext_ed137b_ft_single_sel_tx_f2[] =
451 {
452     { 0x00, "Active transmitter for F2 shall not be used" },
453     { 0x01, "Active transmitter for F2 shall be used" },
454     { 0, NULL },
455 };
456 
457 static const value_string rtp_ext_ed137b_ft_single_mu_rx_f1[] =
458 {
459     { 0x00, "Active receiver for F1 shall be unmuted" },
460     { 0x01, "Active receiver for F1 shall be muted" },
461     { 0, NULL },
462 };
463 
464 static const value_string rtp_ext_ed137b_ft_single_mu_rx_f2[] =
465 {
466     { 0x00, "Active receiver for F2 shall be unmuted" },
467     { 0x01, "Active receiver for F2 shall be muted" },
468     { 0, NULL },
469 };
470 
471 static const value_string rtp_ext_ed137b_ft_climax_ddc_time_quality[] =
472 {
473     { 0x00, "Not synchronized" },
474     { 0x01, "Synchronized" },
475     { 0, NULL },
476 };
477 
478 static const value_string rtp_ext_ed137b_ft_climax_ddc_mam_nmr[] =
479 {
480     { 0x00, "No request" },
481     { 0x01, "GRS requests a new RTT measurement" },
482     { 0, NULL },
483 };
484 
485 static const value_string rtp_ext_ed137c_ft_climax_ddc_time_quality[] =
486 {
487     { 0x00, "Not synchronized" },
488     { 0x01, "Synchronized" },
489     { 0, NULL },
490 };
491 
492 static const value_string rtp_ext_ed137c_ft_climax_ddc_mam_nmr[] =
493 {
494     { 0x00, "No request" },
495     { 0x01, "GRS requests a new RTT measurement" },
496     { 0, NULL },
497 };
498 
499 /* We do not need to allocate/free strings */
500 static char *ed137_ptt_only = "PTT";
501 static char *ed137_squ_only = "SQU";
502 static char *ed137_ptt_and_squ = "PTT+SQU";
503 
504 /* Note:
505  * Only seen/tested headers are decoded
506  */
507 static int
508 dissect_rtp_hdr_ext_ed137(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
509 {
510     unsigned int hdr_extension_len;
511     struct _rtp_info *rtp_info=(struct _rtp_info *)data;
512     proto_tree *rtp_hext_tree = NULL;
513     unsigned int hdrext_offset = 0;
514     gboolean ed137_ptt = FALSE;
515     gboolean ed137_squ = FALSE;
516 
517     hdr_extension_len = tvb_reported_length(tvb);
518 
519     if ( hdr_extension_len > 0 ) {
520 
521         if (rtp_info != NULL) {
522             rtp_info->info_is_ed137 = TRUE;
523         }
524         if ( tree ) {
525             proto_item *ti;
526             ti = proto_tree_add_item(tree, hf_rtp_hdr_ed137s, tvb, 0, hdr_extension_len, ENC_NA);
527             rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext_ed137s );
528         }
529 
530         while ( hdr_extension_len > 0 ) {
531             proto_item *ti2;
532             proto_tree *rtp_hext_tree2;
533             proto_item *ti3;
534             proto_tree *rtp_hext_tree3;
535             unsigned int ft_type;
536             guint32 ext_value = tvb_get_ntohl( tvb, hdrext_offset );
537 
538             if (RTP_ED137_ptt_mask(ext_value)) {
539                 col_append_str(pinfo->cinfo, COL_INFO, ", PTT");
540                 ed137_ptt = TRUE;
541             }
542             if (RTP_ED137_squ_mask(ext_value)) {
543                 col_append_str(pinfo->cinfo, COL_INFO, ", SQU");
544                 ed137_squ = TRUE;
545             }
546 
547             /* Map PTT/SQU bits to string */
548             if (rtp_info != NULL) {
549                 if (ed137_ptt) {
550                     if (ed137_squ) {
551                         rtp_info->info_ed137_info = ed137_ptt_and_squ;
552                     } else {
553                         rtp_info->info_ed137_info = ed137_ptt_only;
554                     }
555                 } else {
556                     if (ed137_squ) {
557                         rtp_info->info_ed137_info = ed137_squ_only;
558                     } else {
559                         rtp_info->info_ed137_info = NULL;
560                     }
561                 }
562             }
563 
564             if ( rtp_hext_tree ) {
565                 ti2 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137, tvb, hdrext_offset, 4, ENC_NA);
566                 rtp_hext_tree2 = proto_item_add_subtree( ti2, ett_hdr_ext_ed137 );
567 
568                 /* There are multiple formats of header - depends on direction of a flow. As it is not possible to quess flow direction, we use items from RTPRx because unused fields are empty in other formats */
569                 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ptt_type, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
570                 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_squ, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
571                 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ptt_id, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
572                 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_sct, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
573                 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_x, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
574                 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_vf, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
575             }
576 
577             ft_type = RTP_ED137_feature_type(ext_value);
578 
579             ti3 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137_add, tvb, hdrext_offset, 4, ENC_NA);
580             rtp_hext_tree3 = proto_item_add_subtree( ti3, ett_hdr_ext_ed137_add );
581 
582             if (RTP_ED137_extended_information(ext_value)) {
583                 /* Extended information is used */
584 
585                 if ( rtp_hext_tree ) {
586                     proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_type, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
587                     proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_len, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
588                 }
589 
590                 if ( rtp_hext_tree ) {
591                     switch (ft_type) {
592                         case RTP_ED137_feature_bss_type:
593                         {
594                             unsigned int bss_qidx;
595                             unsigned int bss_qidx_ml;
596 
597                             bss_qidx    = RTP_ED137_feature_bss_qidx(ext_value);
598                             bss_qidx_ml = RTP_ED137_feature_bss_qidx_ml(ext_value);
599                             if (RTP_ED137_feature_bss_qidx_ml_rssi == bss_qidx_ml) {
600                                 /* Special handling for RSSI method */
601                                 if (bss_qidx <= RTP_ED137_feature_bss_qidx_rssi_max) {
602                                     /* Correct range */
603                                     proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_rssi_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
604                                 }
605                                 else {
606                                     /* Handle as other method */
607                                     proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
608                                 }
609                             }
610                             else {
611                                 /* Other BSS method handling */
612                                 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
613                             }
614                             proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_qidx_ml, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
615                             break;
616                         }
617                         case RTP_ED137_feature_climax_ot_type:
618                         {
619                             unsigned int climax_ot_value;
620                             unsigned int climax_ot_value_calc;
621 
622                             climax_ot_value = RTP_ED137_feature_climax_ot_value(ext_value);
623 
624                             /* Relative delay, in 2ms steps */
625                             climax_ot_value_calc=2*climax_ot_value;
626                             proto_tree_add_uint_format_value( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_climax_delay_value, tvb, hdrext_offset, 4, climax_ot_value, "%d ms", climax_ot_value_calc);
627 
628                             break;
629                         }
630                         default:
631                             proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_value, tvb, hdrext_offset, 4, ENC_NA);
632                             break;
633                     }
634                 }
635 
636                 /* Shift behind header */
637                 hdrext_offset += 4;
638                 hdr_extension_len -= 4;
639             }
640             else {
641                 /* Extended information is not used */
642                 if ( rtp_hext_tree ) {
643                     proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_x_nu, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
644                 }
645 
646                 /* Shift behind empty additional feature header */
647                 hdrext_offset += 4;
648                 hdr_extension_len -= 4;
649             }
650         }
651     }
652     return tvb_captured_length(tvb);
653 }
654 
655 
656 #define NSTIME_INIT_USEC(nstime, usecs) \
657     nstime.secs = usecs / 1000000; \
658     nstime.nsecs = (usecs % 1000000) * 1000;
659 
660 /* Decodes and calculates relative/absolute time item */
661 static void process_time_value(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int time_item, unsigned int hdrext_offset, gboolean time_relative _U_, unsigned int time_value)
662 {
663     /* Note: even there is relative/absolute flag, value is shown same way because it is relative value derived from relative/absolute start point */
664     unsigned int time_calc;
665     nstime_t tmp_time;
666     gchar *tmp;
667 
668     /* Value is stored as count of 125 us ticks */
669     time_calc = time_value * 125;
670     NSTIME_INIT_USEC(tmp_time, time_calc);
671     tmp = rel_time_to_secs_str(pinfo->pool, &tmp_time);
672 
673     proto_tree_add_uint_format_value( tree, time_item, tvb, hdrext_offset, 3, time_value, "%s s", tmp);
674 }
675 
676 /* Decodes and calculates value based on 125us tick*/
677 static void process_125us_based_value(tvbuff_t *tvb, proto_tree *tree, int value_item, unsigned int hdrext_offset)
678 {
679     guint32 value;
680     guint32 value_calc;
681 
682     /* Values is stored as count of 125 us ticks */
683     value = tvb_get_ntohs( tvb, hdrext_offset );
684     value_calc = value * 125;
685 
686     proto_tree_add_uint_format_value( tree, value_item, tvb, hdrext_offset, 2, value, "%d us", value_calc);
687 }
688 
689 static int
690 dissect_rtp_hdr_ext_ed137a_feature_sqi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
691 {
692     guint32 ext_value;
693     guint32 sqi_qidx;
694     guint32 sqi_qidx_ml;
695 
696     ext_value = tvb_get_guint8( tvb, 0 );
697     sqi_qidx    = RTP_ED137A_feature_sqi_qidx(ext_value);
698     sqi_qidx_ml = RTP_ED137A_feature_sqi_qidx_ml(ext_value);
699     if (RTP_ED137A_feature_sqi_qidx_ml_rssi == sqi_qidx_ml) {
700         /* Special handling for RSSI method */
701         if (sqi_qidx <= RTP_ED137A_feature_sqi_qidx_rssi_max) {
702             /* Correct range */
703             proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_rssi_qidx, tvb, 0, 1, ENC_BIG_ENDIAN);
704         }
705         else {
706             /* Handle as other method */
707             proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_qidx, tvb, 0, 1, ENC_BIG_ENDIAN);
708         }
709     }
710     else {
711         /* Other SQI method handling */
712         proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_qidx, tvb, 0, 1, ENC_BIG_ENDIAN);
713     }
714     proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_qidx_ml, tvb, 0, 1, ENC_BIG_ENDIAN);
715 
716     return tvb_captured_length(tvb);
717 }
718 
719 static int
720 dissect_rtp_hdr_ext_ed137a_feature_climax_tdly(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
721 {
722     guint32 ext_value;
723     guint32 climax_tdly_mode;
724     guint32 climax_tdly_value;
725     guint32 climax_tdly_value_calc;
726 
727     ext_value = tvb_get_guint8( tvb, 0 );
728 
729     climax_tdly_mode = RTP_ED137A_feature_climax_tdly_mode(ext_value);
730     climax_tdly_value = RTP_ED137A_feature_climax_tdly_value(ext_value);
731 
732     proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_climax_delay_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
733     if (RTP_ED137A_feature_climax_tdly_mode_relative == climax_tdly_mode) {
734         /* Relative delay, in 2ms steps */
735         climax_tdly_value_calc=2*climax_tdly_value;
736 
737         proto_tree_add_uint_format_value( tree, hf_rtp_hdr_ed137a_ft_climax_delay_relative_value, tvb, 0, 1, climax_tdly_value, "%d ms", climax_tdly_value_calc);
738 
739     }
740     else {
741         /* Absolute delay, in 2ms steps */
742         climax_tdly_value_calc=2*climax_tdly_value;
743 
744         proto_tree_add_uint_format_value( tree, hf_rtp_hdr_ed137a_ft_climax_delay_absolute_value, tvb, 0, 1, climax_tdly_value, "%d ms", climax_tdly_value_calc);
745 
746     }
747 
748     return tvb_captured_length(tvb);
749 }
750 
751 static int
752 dissect_rtp_hdr_ext_ed137b_feature_rrc_single(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
753 {
754     proto_tree *item;
755 
756     /* Generated item points really to previous byte */
757     item = proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single, tvb, -1, 1, ENC_NA);
758     proto_item_set_generated(item);
759 
760     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f1, tvb, 0, 1, ENC_BIG_ENDIAN);
761     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f1, tvb, 0, 1, ENC_BIG_ENDIAN);
762     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f2, tvb, 0, 1, ENC_BIG_ENDIAN);
763     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f2, tvb, 0, 1, ENC_BIG_ENDIAN);
764     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f1, tvb, 0, 1, ENC_BIG_ENDIAN);
765     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f2, tvb, 0, 1, ENC_BIG_ENDIAN);
766     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f1, tvb, 0, 1, ENC_BIG_ENDIAN);
767     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f2, tvb, 0, 1, ENC_BIG_ENDIAN);
768 
769     return tvb_captured_length(tvb);
770 }
771 
772 static int
773 dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_rmm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
774 {
775     guint32 ext_value;
776     proto_tree *item;
777     guint32 climax_ddc_rmm_tqv;
778     guint32 climax_ddc_rmm_t1;
779 
780     /* Generated item points really to previous byte */
781     item = proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm, tvb, -1, 1, ENC_NA);
782     proto_item_set_generated(item);
783 
784     ext_value = tvb_get_ntoh24( tvb, 0 );
785     climax_ddc_rmm_tqv = RTP_ED137B_feature_climax_ddc_rmm_tqv(ext_value);
786     climax_ddc_rmm_t1 = RTP_ED137B_feature_climax_ddc_rmm_t1(ext_value);
787 
788     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_tqv, tvb, 0, 3, ENC_BIG_ENDIAN);
789     process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_t1, 0, (RTP_ED137B_feature_climax_ddc_rmm_tqv_relative == climax_ddc_rmm_tqv), climax_ddc_rmm_t1);
790 
791     return tvb_captured_length(tvb);
792 }
793 
794 static int
795 dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
796 {
797     guint32 ext_value;
798     proto_tree *item;
799     guint32 climax_ddc_mam_tqg;
800     guint32 climax_ddc_mam_t1;
801     guint32 climax_ddc_mam_t2;
802 
803     /* Generated item points really to previous byte */
804     item = proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam, tvb, -1, 1, ENC_NA);
805     proto_item_set_generated(item);
806 
807     ext_value = tvb_get_ntoh24( tvb, 0 + 0 );
808     climax_ddc_mam_tqg = RTP_ED137B_feature_climax_ddc_mam_tqg(ext_value);
809     climax_ddc_mam_t1 = RTP_ED137B_feature_climax_ddc_mam_t1(ext_value);
810 
811     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tqg, tvb, 0, 3, ENC_BIG_ENDIAN);
812     process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t1, 0, (RTP_ED137B_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t1);
813 
814     ext_value = tvb_get_ntoh24( tvb, 0 + 3 );
815     climax_ddc_mam_t2 = RTP_ED137B_feature_climax_ddc_mam_t2(ext_value);
816 
817     proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_nmr, tvb, 0 + 3, 3, ENC_BIG_ENDIAN);
818     process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t2, 0 + 3, (RTP_ED137B_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t2);
819 
820     process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tsd, 0 + 6);
821     process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tj1, 0 + 8);
822     process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tid, 0 + 10);
823 
824     return tvb_captured_length(tvb);
825 }
826 
827 static int
828 dissect_rtp_hdr_ext_ed137c_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
829 {
830     guint32 ext_value;
831     proto_tree *item;
832     guint32 climax_ddc_mam_tqg;
833     guint32 climax_ddc_mam_t1;
834     guint32 climax_ddc_mam_t2;
835 
836     /* Generated item points really to previous byte */
837     item = proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam, tvb, -1, 1, ENC_NA);
838     proto_item_set_generated(item);
839 
840     ext_value = tvb_get_ntoh24( tvb, 0 + 0 );
841     climax_ddc_mam_tqg = RTP_ED137C_feature_climax_ddc_mam_tqg(ext_value);
842     climax_ddc_mam_t1 = RTP_ED137C_feature_climax_ddc_mam_t1(ext_value);
843 
844     proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tqg, tvb, 0, 3, ENC_BIG_ENDIAN);
845     process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t1, 0, (RTP_ED137C_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t1);
846 
847     ext_value = tvb_get_ntoh24( tvb, 0 + 3 );
848     climax_ddc_mam_t2 = RTP_ED137C_feature_climax_ddc_mam_t2(ext_value);
849 
850     proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_nmr, tvb, 0 + 3, 3, ENC_BIG_ENDIAN);
851     process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t2, 0 + 3, (RTP_ED137C_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t2);
852 
853     process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tsd, 0 + 6);
854     process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tj1, 0 + 8);
855     process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tid, 0 + 10);
856     process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_ts2, 0 + 12);
857 
858     return tvb_captured_length(tvb);
859 }
860 
861 /* Decode ED-137A fixed part and call dissectors for variable part */
862 static int
863 dissect_rtp_hdr_ext_ed137a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
864 {
865     guint32 hdr_extension_len;
866     struct _rtp_info *rtp_info=(struct _rtp_info *)data;
867     proto_tree *rtp_hext_tree = NULL;
868     guint32 hdrext_offset = 0;
869     gboolean ed137_ptt = FALSE;
870     gboolean ed137_squ = FALSE;
871 
872     hdr_extension_len = tvb_reported_length(tvb);
873 
874     if ( hdr_extension_len > 0 ) {
875         proto_item *ti2;
876         proto_tree *rtp_hext_tree2;
877         guint32 ext_value = tvb_get_ntohs( tvb, hdrext_offset );
878 
879         if (rtp_info != NULL) {
880             rtp_info->info_is_ed137 = TRUE;
881         }
882         if ( tree ) {
883             proto_item *ti;
884             ti = proto_tree_add_item(tree, hf_rtp_hdr_ed137s, tvb, 0, hdr_extension_len, ENC_NA);
885             rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext_ed137s );
886         }
887 
888         if (RTP_ED137A_ptt_mask(ext_value)) {
889             col_append_str(pinfo->cinfo, COL_INFO, ", PTT");
890             ed137_ptt = TRUE;
891         }
892         if (RTP_ED137A_squ_mask(ext_value)) {
893             col_append_str(pinfo->cinfo, COL_INFO, ", SQU");
894             ed137_squ = TRUE;
895         }
896 
897         /* Map PTT/SQU bits to string */
898         if (rtp_info != NULL) {
899             if (ed137_ptt) {
900                 if (ed137_squ) {
901                     rtp_info->info_ed137_info = ed137_ptt_and_squ;
902                 } else {
903                     rtp_info->info_ed137_info = ed137_ptt_only;
904                 }
905             } else {
906                 if (ed137_squ) {
907                     rtp_info->info_ed137_info = ed137_squ_only;
908                 } else {
909                     rtp_info->info_ed137_info = NULL;
910                 }
911             }
912         }
913 
914         if ( rtp_hext_tree ) {
915             ti2 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137a, tvb, hdrext_offset, 2, ENC_NA);
916             rtp_hext_tree2 = proto_item_add_subtree( ti2, ett_hdr_ext_ed137a );
917 
918             /* There are multiple formats of header - depends on direction of a flow. As it is not possible to quess flow direction, we use items from RTPRx because unused fields are empty in other formats */
919             proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptt_type, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
920             proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_squ, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
921             proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptt_id, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
922             proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_pm, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
923             proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptts, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
924             proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_sct, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
925             proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_reserved, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
926             proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_x, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
927         }
928 
929         /* Shift behind standard ED-137A header */
930         hdrext_offset += 2;
931         hdr_extension_len -= 2;
932 
933         /* Do we have additional feature blocks? */
934         if (RTP_ED137A_extended_information(ext_value)) {
935 
936             /* Loop over all additional feature blocks */
937             /* The shortest header lenght is 2, anything shorter is padding */
938             while ( hdr_extension_len >= 2 ) {
939                 proto_item *ti3;
940                 proto_tree *rtp_hext_tree3;
941                 guint32 ft_type;
942                 guint32 ft_len;
943 
944                 ext_value = tvb_get_ntohs( tvb, hdrext_offset );
945                 ft_type = RTP_ED137A_feature_type(ext_value);
946                 ft_len = RTP_ED137A_feature_length(ext_value);
947 
948                 /* Is it header or padding? */
949                 if ( RTP_ED137_feature_none_type != ft_type ) {
950                     ti3 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137a_add, tvb, hdrext_offset, (ft_len > 0 ? ft_len + 1 : 2), ENC_NA);
951                     rtp_hext_tree3 = proto_item_add_subtree( ti3, ett_hdr_ext_ed137a_add );
952 
953                     if ( rtp_hext_tree ) {
954                         proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_ft_type, tvb, hdrext_offset, 1, ENC_BIG_ENDIAN);
955                         proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_ft_len, tvb, hdrext_offset, 1, ENC_BIG_ENDIAN);
956                     }
957 
958                     /* Shift behind feature header */
959                     hdrext_offset += 1;
960                     hdr_extension_len -= 1;
961 
962                     if ( rtp_hext_tree ) {
963                         tvbuff_t   *newtvb;
964                         guint32     ft_table_key;
965 
966                         /* join 4 bit type and 4 bit lenght to 8 bit key */
967                         ft_table_key = MAKE_KEY( ft_type, ft_len );
968 
969                         /* pass interpretation of header extension to a registered subdissector */
970                         /* new subset points to value (starts behind type/length pair) */
971                         newtvb = tvb_new_subset_length(tvb, hdrext_offset, hdr_extension_len);
972 
973                         /* try to find a dissector by type/len key and dissect additional feature header */
974                         if ( !(dissector_try_uint(rtp_hdr_ext_ed137a_add_features_table, ft_table_key, newtvb, pinfo, rtp_hext_tree3)) ) {
975                             proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_ft_value, tvb, hdrext_offset, ft_len, ENC_NA);
976                         }
977                     }
978 
979                     /* Shift behind feature data */
980                     hdrext_offset += ft_len;
981                     hdr_extension_len -= ft_len;
982                 }
983                 else {
984                     /* Padding, exit while loop */
985                     break;
986                 }
987 
988             }
989 
990             /* Process padding if any */
991             guint32 hdr_extension_padding;
992 
993             hdr_extension_padding = hdr_extension_len & 0x03;
994 
995             /* Calculate padding size */
996             if ( hdr_extension_padding > 0 ) {
997                 if ( rtp_hext_tree ) {
998                     proto_tree_add_item( rtp_hext_tree, hf_rtp_hdr_ed137a_ft_padding, tvb, hdrext_offset, hdr_extension_padding, ENC_NA);
999                 }
1000             }
1001 
1002         }
1003         else {
1004             /* Extended information is not used */
1005             if ( rtp_hext_tree ) {
1006                 proto_item *ti3;
1007                 proto_tree *rtp_hext_tree3;
1008 
1009                 ti3 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137a_add, tvb, hdrext_offset, 2, ENC_NA);
1010                 rtp_hext_tree3 = proto_item_add_subtree( ti3, ett_hdr_ext_ed137a_add );
1011                 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_x_nu, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
1012             }
1013         }
1014     }
1015     return tvb_captured_length(tvb);
1016 }
1017 
1018 /* Register RTP ED-137 */
1019 void
1020 proto_register_rtp_ed137(void)
1021 {
1022     static hf_register_info hf[] =
1023     {
1024 /* ED-137 and ED-137A common structures */
1025         {
1026             &hf_rtp_hdr_ed137s,
1027             {
1028                 "ED137 extensions",
1029                 "rtp.ext.ed137s",
1030                 FT_NONE,
1031                 BASE_NONE,
1032                 NULL,
1033                 0x0,
1034                 NULL, HFILL
1035             }
1036         },
1037 /* ED-137 only structures */
1038         {
1039             &hf_rtp_hdr_ed137,
1040             {
1041                 "ED137 extension",
1042                 "rtp.ext.ed137",
1043                 FT_NONE,
1044                 BASE_NONE,
1045                 NULL,
1046                 0x0,
1047                 NULL, HFILL
1048             }
1049         },
1050         {
1051             &hf_rtp_hdr_ed137_add,
1052             {
1053                 "ED137 extension additional feature",
1054                 "rtp.ext.ed137.ft",
1055                 FT_NONE,
1056                 BASE_NONE,
1057                 NULL,
1058                 0x0,
1059                 NULL, HFILL
1060             }
1061         },
1062         {
1063             &hf_rtp_hdr_ed137_ptt_type,
1064             {
1065                 "PTT Type",
1066                 "rtp.ext.ed137.ptt_type",
1067                 FT_UINT32,
1068                 BASE_DEC,
1069                 VALS(rtp_ext_ed137_ptt_type),
1070                 0xE0000000,
1071                 NULL, HFILL
1072             }
1073         },
1074         {
1075             &hf_rtp_hdr_ed137_squ,
1076             {
1077                 "SQU",
1078                 "rtp.ext.ed137.squ",
1079                 FT_UINT32,
1080                 BASE_DEC,
1081                 VALS(rtp_ext_ed137_squ),
1082                 0x10000000,
1083                 NULL, HFILL
1084             }
1085         },
1086         {
1087             &hf_rtp_hdr_ed137_ptt_id,
1088             {
1089                 "PTT-id",
1090                 "rtp.ext.ed137.ptt_id",
1091                 FT_UINT32,
1092                 BASE_DEC,
1093                 NULL,
1094                 0x0F000000,
1095                 NULL, HFILL
1096             }
1097         },
1098         {
1099             &hf_rtp_hdr_ed137_sct,
1100             {
1101                 "Simultaneous Call Transmissions",
1102                 "rtp.ext.ed137.sct",
1103                 FT_UINT32,
1104                 BASE_DEC,
1105                 NULL,
1106                 0x00800000,
1107                 NULL, HFILL
1108             }
1109         },
1110         {
1111             &hf_rtp_hdr_ed137_x,
1112             {
1113                 "X",
1114                 "rtp.ext.ed137.x",
1115                 FT_UINT32,
1116                 BASE_DEC,
1117                 VALS(rtp_ext_ed137_x),
1118                 0x00400000,
1119                 NULL, HFILL
1120             }
1121         },
1122         {
1123             &hf_rtp_hdr_ed137_x_nu,
1124             {
1125                 "Not used",
1126                 "rtp.ext.ed137.x-nu",
1127                 FT_UINT32,
1128                 BASE_DEC,
1129                 NULL,
1130                 0x003FFFFE,
1131                 NULL, HFILL
1132             }
1133         },
1134         {
1135             &hf_rtp_hdr_ed137_ft_type,
1136             {
1137                 "Feature type",
1138                 "rtp.ext.ed137.ft.type",
1139                 FT_UINT32,
1140                 BASE_HEX_DEC,
1141                 VALS(rtp_ext_ed137_ft_type),
1142                 0x003C0000,
1143                 NULL, HFILL
1144             }
1145         },
1146         {
1147             &hf_rtp_hdr_ed137_ft_len,
1148             {
1149                 "Feature length",
1150                 "rtp.ext.ed137.ft.len",
1151                 FT_UINT32,
1152                 BASE_DEC,
1153                 NULL,
1154                 0x0003C000,
1155                 NULL, HFILL
1156             }
1157         },
1158         {
1159             &hf_rtp_hdr_ed137_ft_value,
1160             {
1161                 "Feature value",
1162                 "rtp.ext.ed137.ft.value",
1163                 FT_UINT32,
1164                 BASE_HEX_DEC,
1165                 NULL,
1166                 0x00003FFE,
1167                 NULL, HFILL
1168             }
1169         },
1170         {
1171             &hf_rtp_hdr_ed137_vf,
1172             {
1173                 "VF",
1174                 "rtp.ext.ed137.vf",
1175                 FT_UINT32,
1176                 BASE_DEC,
1177                 VALS(rtp_ext_ed137_vf),
1178                 0x00000001,
1179                 NULL, HFILL
1180             }
1181         },
1182         {
1183             &hf_rtp_hdr_ed137_ft_bss_qidx,
1184             {
1185                 "BSS Quality Index",
1186                 "rtp.ext.ed137.ft.bss.qidx",
1187                 FT_UINT32,
1188                 BASE_DEC,
1189                 NULL,
1190                 0x00003FC0,
1191                 NULL, HFILL
1192             }
1193         },
1194         {
1195             &hf_rtp_hdr_ed137_ft_bss_rssi_qidx,
1196             {
1197                 "BSS Quality Index",
1198                 "rtp.ext.ed137.ft.bss.qidx",
1199                 FT_UINT32,
1200                 BASE_DEC,
1201                 VALS(rtp_ext_ed137_ft_bss_rssi_qidx),
1202                 0x00003FC0,
1203                 NULL, HFILL
1204             }
1205         },
1206         {
1207             &hf_rtp_hdr_ed137_ft_bss_qidx_ml,
1208             {
1209                 "BSS Quality Index Method",
1210                 "rtp.ext.ed137.ft.bss.qidx-ml",
1211                 FT_UINT32,
1212                 BASE_DEC,
1213                 VALS(rtp_ext_ed137_ft_bss_qidx_ml),
1214                 0x00000038,
1215                 NULL, HFILL
1216             }
1217         },
1218         {
1219             &hf_rtp_hdr_ed137_ft_climax_delay_value,
1220             {
1221                 "CLIMAX-Time Delay",
1222                 "rtp.ext.ed137.ft.climax_delay.value",
1223                 FT_UINT32,
1224                 BASE_DEC,
1225                 NULL,
1226                 0x00003F00,
1227                 NULL, HFILL
1228             }
1229         },
1230 /* ED-137A/B only structures */
1231         {
1232             &hf_rtp_hdr_ed137a,
1233             {
1234                 "ED137A extension",
1235                 "rtp.ext.ed137a",
1236                 FT_NONE,
1237                 BASE_NONE,
1238                 NULL,
1239                 0x0,
1240                 NULL, HFILL
1241             }
1242         },
1243         {
1244             &hf_rtp_hdr_ed137a_add,
1245             {
1246                 "ED137A extension additional feature",
1247                 "rtp.ext.ed137a.ft",
1248                 FT_NONE,
1249                 BASE_NONE,
1250                 NULL,
1251                 0x0,
1252                 NULL, HFILL
1253             }
1254         },
1255         {
1256             &hf_rtp_hdr_ed137a_ptt_type,
1257             {
1258                 "PTT Type",
1259                 "rtp.ext.ed137a.ptt_type",
1260                 FT_UINT16,
1261                 BASE_DEC,
1262                 VALS(rtp_ext_ed137a_ptt_type),
1263                 0xE000,
1264                 NULL, HFILL
1265             }
1266         },
1267         {
1268             &hf_rtp_hdr_ed137a_squ,
1269             {
1270                 "SQU",
1271                 "rtp.ext.ed137a.squ",
1272                 FT_UINT16,
1273                 BASE_DEC,
1274                 VALS(rtp_ext_ed137a_squ),
1275                 0x1000,
1276                 NULL, HFILL
1277             }
1278         },
1279         {
1280             &hf_rtp_hdr_ed137a_ptt_id,
1281             {
1282                 "PTT-id",
1283                 "rtp.ext.ed137a.ptt_id",
1284                 FT_UINT16,
1285                 BASE_DEC,
1286                 NULL,
1287                 0x0FC0,
1288                 NULL, HFILL
1289             }
1290         },
1291         {
1292             &hf_rtp_hdr_ed137a_pm,
1293             {
1294                 "PTT Mute",
1295                 "rtp.ext.ed137a.pm",
1296                 FT_UINT16,
1297                 BASE_DEC,
1298                 NULL,
1299                 0x0020,
1300                 NULL, HFILL
1301             }
1302         },
1303         {
1304             &hf_rtp_hdr_ed137a_ptts,
1305             {
1306                 "PTT Summation",
1307                 "rtp.ext.ed137a.ptts",
1308                 FT_UINT16,
1309                 BASE_DEC,
1310                 NULL,
1311                 0x0010,
1312                 NULL, HFILL
1313             }
1314         },
1315         {
1316             &hf_rtp_hdr_ed137a_sct,
1317             {
1318                 "Simultaneous Call Transmissions",
1319                 "rtp.ext.ed137a.sct",
1320                 FT_UINT16,
1321                 BASE_DEC,
1322                 NULL,
1323                 0x0008,
1324                 NULL, HFILL
1325             }
1326         },
1327         {
1328             &hf_rtp_hdr_ed137a_reserved,
1329             {
1330                 "Reserved",
1331                 "rtp.ext.ed137a.reserved",
1332                 FT_UINT16,
1333                 BASE_HEX_DEC,
1334                 NULL,
1335                 0x0006,
1336                 NULL, HFILL
1337             }
1338         },
1339         {
1340             &hf_rtp_hdr_ed137a_x,
1341             {
1342                 "X",
1343                 "rtp.ext.ed137a.x",
1344                 FT_UINT16,
1345                 BASE_DEC,
1346                 VALS(rtp_ext_ed137_x),
1347                 0x0001,
1348                 NULL, HFILL
1349             }
1350         },
1351         {
1352             &hf_rtp_hdr_ed137a_x_nu,
1353             {
1354                 "Not used",
1355                 "rtp.ext.ed137a.x-nu",
1356                 FT_UINT16,
1357                 BASE_DEC,
1358                 NULL,
1359                 0xFFFF,
1360                 NULL, HFILL
1361             }
1362         },
1363         {
1364             &hf_rtp_hdr_ed137a_ft_type,
1365             {
1366                 "Feature type",
1367                 "rtp.ext.ed137a.ft.type",
1368                 FT_UINT8,
1369                 BASE_HEX_DEC,
1370                 VALS(rtp_ext_ed137a_ft_type),
1371                 0xF0,
1372                 NULL, HFILL
1373             }
1374         },
1375         {
1376             &hf_rtp_hdr_ed137a_ft_len,
1377             {
1378                 "Feature length",
1379                 "rtp.ext.ed137a.ft.len",
1380                 FT_UINT8,
1381                 BASE_DEC,
1382                 NULL,
1383                 0x0F,
1384                 NULL, HFILL
1385             }
1386         },
1387         {
1388             &hf_rtp_hdr_ed137a_ft_value,
1389             {
1390                 "Feature value",
1391                 "rtp.ext.ed137a.ft.value",
1392                 FT_BYTES,
1393                 BASE_NONE,
1394                 NULL,
1395                 0x0,
1396                 NULL, HFILL
1397             }
1398         },
1399         {
1400             &hf_rtp_hdr_ed137a_ft_padding,
1401             {
1402                 "Padding",
1403                 "rtp.ext.ed137a.ft.padding",
1404                 FT_BYTES,
1405                 BASE_NONE,
1406                 NULL,
1407                 0x0,
1408                 NULL, HFILL
1409             }
1410         },
1411         {
1412             &hf_rtp_hdr_ed137a_ft_sqi_qidx,
1413             {
1414                 "SQI Quality Index",
1415                 "rtp.ext.ed137a.ft.sqi.qidx",
1416                 FT_UINT8,
1417                 BASE_DEC,
1418                 NULL,
1419                 0xF8,
1420                 NULL, HFILL
1421             }
1422         },
1423         {
1424             &hf_rtp_hdr_ed137a_ft_sqi_rssi_qidx,
1425             {
1426                 "SQI Quality Index",
1427                 "rtp.ext.ed137a.ft.sqi.qidx",
1428                 FT_UINT8,
1429                 BASE_DEC,
1430                 VALS(rtp_ext_ed137a_ft_sqi_rssi_qidx),
1431                 0xF8,
1432                 NULL, HFILL
1433             }
1434         },
1435         {
1436             &hf_rtp_hdr_ed137a_ft_sqi_qidx_ml,
1437             {
1438                 "SQI Quality Index Method",
1439                 "rtp.ext.ed137a.ft.sqi.qidx-ml",
1440                 FT_UINT8,
1441                 BASE_DEC,
1442                 VALS(rtp_ext_ed137a_ft_sqi_qidx_ml),
1443                 0x07,
1444                 NULL, HFILL
1445             }
1446         },
1447         {
1448             &hf_rtp_hdr_ed137a_ft_climax_delay_mode,
1449             {
1450                 "CLIMAX-Time Delay Mode",
1451                 "rtp.ext.ed137a.ft.climax_delay.mode",
1452                 FT_UINT8,
1453                 BASE_DEC,
1454                 VALS(rtp_ext_ed137a_ft_climax_delay_mode),
1455                 0x80,
1456                 NULL, HFILL
1457             }
1458         },
1459         {
1460             &hf_rtp_hdr_ed137a_ft_climax_delay_relative_value,
1461             {
1462                 "CLIMAX-Time Delay Relative",
1463                 "rtp.ext.ed137a.ft.climax_delay.relative_value",
1464                 FT_UINT8,
1465                 BASE_DEC,
1466                 NULL,
1467                 0x7F,
1468                 NULL, HFILL
1469             }
1470         },
1471         {
1472             &hf_rtp_hdr_ed137a_ft_climax_delay_absolute_value,
1473             {
1474                 "CLIMAX-Time Delay Absolute",
1475                 "rtp.ext.ed137a.ft.climax_delay.absolute_value",
1476                 FT_UINT8,
1477                 BASE_DEC,
1478                 NULL,
1479                 0x7F,
1480                 NULL, HFILL
1481             }
1482         },
1483         {
1484             &hf_rtp_hdr_ed137b_ft_rrc_single,
1485             {
1486                 "RRC for single frequency",
1487                 "rtp.ext.ed137b.ft.rrc.single",
1488                 FT_NONE,
1489                 BASE_NONE,
1490                 NULL,
1491                 0x0,
1492                 NULL, HFILL
1493             }
1494         },
1495         {
1496             &hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f1,
1497             {
1498                 "MSTxF1",
1499                 "rtp.ext.ed137b.ft.rrc.mstxf1",
1500                 FT_UINT8,
1501                 BASE_DEC,
1502                 VALS(rtp_ext_ed137b_ft_single_ms_tx_f1),
1503                 0x80,
1504                 NULL, HFILL
1505             }
1506         },
1507         {
1508             &hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f1,
1509             {
1510                 "MSRxF1",
1511                 "rtp.ext.ed137b.ft.rrc.msrxf1",
1512                 FT_UINT8,
1513                 BASE_DEC,
1514                 VALS(rtp_ext_ed137b_ft_single_ms_rx_f1),
1515                 0x40,
1516                 NULL, HFILL
1517             }
1518         },
1519         {
1520             &hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f2,
1521             {
1522                 "MSTxF2",
1523                 "rtp.ext.ed137b.ft.rrc.mstxf2",
1524                 FT_UINT8,
1525                 BASE_DEC,
1526                 VALS(rtp_ext_ed137b_ft_single_ms_tx_f2),
1527                 0x20,
1528                 NULL, HFILL
1529             }
1530         },
1531         {
1532             &hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f2,
1533             {
1534                 "MSRxF2",
1535                 "rtp.ext.ed137b.ft.rrc.msrxf2",
1536                 FT_UINT8,
1537                 BASE_DEC,
1538                 VALS(rtp_ext_ed137b_ft_single_ms_rx_f2),
1539                 0x10,
1540                 NULL, HFILL
1541             }
1542         },
1543         {
1544             &hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f1,
1545             {
1546                 "SelTxF1",
1547                 "rtp.ext.ed137b.ft.rrc.seltxf1",
1548                 FT_UINT8,
1549                 BASE_DEC,
1550                 VALS(rtp_ext_ed137b_ft_single_sel_tx_f1),
1551                 0x08,
1552                 NULL, HFILL
1553             }
1554         },
1555         {
1556             &hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f2,
1557             {
1558                 "SelTxF2",
1559                 "rtp.ext.ed137b.ft.rrc.seltxf2",
1560                 FT_UINT8,
1561                 BASE_DEC,
1562                 VALS(rtp_ext_ed137b_ft_single_sel_tx_f2),
1563                 0x04,
1564                 NULL, HFILL
1565             }
1566         },
1567         {
1568             &hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f1,
1569             {
1570                 "MuRxF1",
1571                 "rtp.ext.ed137b.ft.rrc.murxf1",
1572                 FT_UINT8,
1573                 BASE_DEC,
1574                 VALS(rtp_ext_ed137b_ft_single_mu_rx_f1),
1575                 0x02,
1576                 NULL, HFILL
1577             }
1578         },
1579         {
1580             &hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f2,
1581             {
1582                 "MuRxF2",
1583                 "rtp.ext.ed137b.ft.rrc.murxf2",
1584                 FT_UINT8,
1585                 BASE_DEC,
1586                 VALS(rtp_ext_ed137b_ft_single_mu_rx_f2),
1587                 0x01,
1588                 NULL, HFILL
1589             }
1590         },
1591         {
1592             &hf_rtp_hdr_ed137b_ft_climax_ddc_unknown,
1593             {
1594                 "CLIMAX Dynamic Delay Compensation Unknown Method",
1595                 "rtp.ext.ed137b.ft.climax_ddc.unknown",
1596                 FT_BYTES,
1597                 BASE_NONE,
1598                 NULL,
1599                 0x0,
1600                 NULL, HFILL
1601             }
1602         },
1603         {
1604             &hf_rtp_hdr_ed137b_ft_climax_ddc_rmm,
1605             {
1606                 "CLIMAX Dynamic Delay Compensation RMM Request",
1607                 "rtp.ext.ed137b.ft.climax_ddc.rmm",
1608                 FT_NONE,
1609                 BASE_NONE,
1610                 NULL,
1611                 0x0,
1612                 NULL, HFILL
1613             }
1614         },
1615         {
1616             &hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_tqv,
1617             {
1618                 "Time Quality VCS",
1619                 "rtp.ext.ed137b.ft.climax_ddc.rmm_tqv",
1620                 FT_UINT24,
1621                 BASE_DEC,
1622                 VALS(rtp_ext_ed137b_ft_climax_ddc_time_quality),
1623                 0x800000,
1624                 NULL, HFILL
1625             }
1626         },
1627         {
1628             &hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_t1,
1629             {
1630                 "T1",
1631                 "rtp.ext.ed137b.ft.climax_ddc.rmm_t1",
1632                 FT_UINT24,
1633                 BASE_DEC,
1634                 NULL,
1635                 0x7FFFFF,
1636                 NULL, HFILL
1637             }
1638         },
1639         {
1640             &hf_rtp_hdr_ed137b_ft_climax_ddc_mam,
1641             {
1642                 "CLIMAX Dynamic Delay Compensation MAM Response (ED-137B)",
1643                 "rtp.ext.ed137b.ft.climax_ddc.mam",
1644                 FT_NONE,
1645                 BASE_NONE,
1646                 NULL,
1647                 0x0,
1648                 NULL, HFILL
1649             }
1650         },
1651         {
1652             &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tqg,
1653             {
1654                 "Time Quality GRS",
1655                 "rtp.ext.ed137b.ft.climax_ddc.mam_tqg",
1656                 FT_UINT24,
1657                 BASE_DEC,
1658                 VALS(rtp_ext_ed137b_ft_climax_ddc_time_quality),
1659                 0x800000,
1660                 NULL, HFILL
1661             }
1662         },
1663         {
1664             &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t1,
1665             {
1666                 "T1",
1667                 "rtp.ext.ed137b.ft.climax_ddc.mam_t1",
1668                 FT_UINT24,
1669                 BASE_DEC,
1670                 NULL,
1671                 0x7FFFFF,
1672                 NULL, HFILL
1673             }
1674         },
1675         {
1676             &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_nmr,
1677             {
1678                 "New measurement requested",
1679                 "rtp.ext.ed137b.ft.climax_ddc.mam_nmr",
1680                 FT_UINT24,
1681                 BASE_DEC,
1682                 VALS(rtp_ext_ed137b_ft_climax_ddc_mam_nmr),
1683                 0x800000,
1684                 NULL, HFILL
1685             }
1686         },
1687         {
1688             &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t2,
1689             {
1690                 "T2",
1691                 "rtp.ext.ed137b.ft.climax_ddc.mam_t2",
1692                 FT_UINT24,
1693                 BASE_DEC,
1694                 NULL,
1695                 0x7FFFFF,
1696                 NULL, HFILL
1697             }
1698         },
1699         {
1700             &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tsd,
1701             {
1702                 "Tsd",
1703                 "rtp.ext.ed137b.ft.climax_ddc.mam_tsd",
1704                 FT_UINT16,
1705                 BASE_DEC,
1706                 NULL,
1707                 0,
1708                 NULL, HFILL
1709             }
1710         },
1711         {
1712             &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tj1,
1713             {
1714                 "Tj1",
1715                 "rtp.ext.ed137b.ft.climax_ddc.mam_tj1",
1716                 FT_UINT16,
1717                 BASE_DEC,
1718                 NULL,
1719                 0,
1720                 NULL, HFILL
1721             }
1722         },
1723         {
1724             &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tid,
1725             {
1726                 "Tid",
1727                 "rtp.ext.ed137b.ft.climax_ddc.mam_tid",
1728                 FT_UINT16,
1729                 BASE_DEC,
1730                 NULL,
1731                 0,
1732                 NULL, HFILL
1733             }
1734         },
1735         {
1736             &hf_rtp_hdr_ed137c_ft_climax_ddc_mam,
1737             {
1738                 "CLIMAX Dynamic Delay Compensation MAM Response (ED-137C)",
1739                 "rtp.ext.ed137c.ft.climax_ddc.mam",
1740                 FT_NONE,
1741                 BASE_NONE,
1742                 NULL,
1743                 0x0,
1744                 NULL, HFILL
1745             }
1746         },
1747         {
1748             &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tqg,
1749             {
1750                 "Time Quality GRS",
1751                 "rtp.ext.ed137c.ft.climax_ddc.mam_tqg",
1752                 FT_UINT24,
1753                 BASE_DEC,
1754                 VALS(rtp_ext_ed137c_ft_climax_ddc_time_quality),
1755                 0x800000,
1756                 NULL, HFILL
1757             }
1758         },
1759         {
1760             &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t1,
1761             {
1762                 "T1",
1763                 "rtp.ext.ed137c.ft.climax_ddc.mam_t1",
1764                 FT_UINT24,
1765                 BASE_DEC,
1766                 NULL,
1767                 0x7FFFFF,
1768                 NULL, HFILL
1769             }
1770         },
1771         {
1772             &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_nmr,
1773             {
1774                 "New measurement requested",
1775                 "rtp.ext.ed137c.ft.climax_ddc.mam_nmr",
1776                 FT_UINT24,
1777                 BASE_DEC,
1778                 VALS(rtp_ext_ed137c_ft_climax_ddc_mam_nmr),
1779                 0x800000,
1780                 NULL, HFILL
1781             }
1782         },
1783         {
1784             &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t2,
1785             {
1786                 "T2",
1787                 "rtp.ext.ed137c.ft.climax_ddc.mam_t2",
1788                 FT_UINT24,
1789                 BASE_DEC,
1790                 NULL,
1791                 0x7FFFFF,
1792                 NULL, HFILL
1793             }
1794         },
1795         {
1796             &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tsd,
1797             {
1798                 "Tsd",
1799                 "rtp.ext.ed137c.ft.climax_ddc.mam_tsd",
1800                 FT_UINT16,
1801                 BASE_DEC,
1802                 NULL,
1803                 0,
1804                 NULL, HFILL
1805             }
1806         },
1807         {
1808             &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tj1,
1809             {
1810                 "Tj1",
1811                 "rtp.ext.ed137c.ft.climax_ddc.mam_tj1",
1812                 FT_UINT16,
1813                 BASE_DEC,
1814                 NULL,
1815                 0,
1816                 NULL, HFILL
1817             }
1818         },
1819         {
1820             &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tid,
1821             {
1822                 "Tid",
1823                 "rtp.ext.ed137c.ft.climax_ddc.mam_tid",
1824                 FT_UINT16,
1825                 BASE_DEC,
1826                 NULL,
1827                 0,
1828                 NULL, HFILL
1829             }
1830         },
1831         {
1832             &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_ts2,
1833             {
1834                 "Ts2",
1835                 "rtp.ext.ed137c.ft.climax_ddc.mam_ts2",
1836                 FT_UINT16,
1837                 BASE_DEC,
1838                 NULL,
1839                 0,
1840                 NULL, HFILL
1841             }
1842         },
1843     };
1844 
1845     static gint *ett[] =
1846     {
1847         &ett_hdr_ext_ed137s,
1848         &ett_hdr_ext_ed137,
1849         &ett_hdr_ext_ed137_add,
1850         &ett_hdr_ext_ed137a,
1851         &ett_hdr_ext_ed137a_add,
1852     };
1853 
1854     proto_rtp_ed137 = proto_register_protocol("Real-Time Transport Protocol ED137 Extensions", "RTP-ED137", "rtp.ext.ed137");
1855     proto_register_field_array(proto_rtp_ed137, hf, array_length(hf));
1856     proto_register_subtree_array(ett, array_length(ett));
1857 
1858     rtp_hdr_ext_ed137_handle = register_dissector("rtp.ext.ed137", dissect_rtp_hdr_ext_ed137, proto_rtp_ed137);
1859     rtp_hdr_ext_ed137a_handle = register_dissector("rtp.ext.ed137a", dissect_rtp_hdr_ext_ed137a, proto_rtp_ed137);
1860 
1861     /* Table for ED-137A additional feature dissectors */
1862     rtp_hdr_ext_ed137a_add_features_table = register_dissector_table("rtp.hdr_ext.ed137a",
1863                                 "RTP header ED137A additional features", proto_rtp_ed137, FT_UINT8, BASE_HEX);
1864 
1865     /* Register dissectors for tested additional headers */
1866     /* ED-137A signal quality information */
1867     rtp_hdr_ext_ed137a_feature_sqi_handle = register_dissector("rtp.hdr_ext.ed137a.ed137a_feature_sqi", dissect_rtp_hdr_ext_ed137a_feature_sqi, proto_rtp_ed137);
1868     dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137A_feature_sqi_key, rtp_hdr_ext_ed137a_feature_sqi_handle);
1869 
1870     /* ED-137A CLIMAX time delay */
1871     rtp_hdr_ext_ed137a_feature_climax_tdly_handle = register_dissector("rtp.hdr_ext.ed137a.ed137a_feature_climax_tdly", dissect_rtp_hdr_ext_ed137a_feature_climax_tdly, proto_rtp_ed137);
1872     dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137A_feature_climax_tdly_key, rtp_hdr_ext_ed137a_feature_climax_tdly_handle);
1873 
1874     /* ED-137B RRC for single frequency */
1875     rtp_hdr_ext_ed137b_feature_rrc_single_handle = register_dissector("rtp.hdr_ext.ed137a.ed137b_feature_rrc_single", dissect_rtp_hdr_ext_ed137b_feature_rrc_single, proto_rtp_ed137);
1876     dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137B_feature_rrc_single_key, rtp_hdr_ext_ed137b_feature_rrc_single_handle);
1877 
1878     /* ED-137B CLIMAX request for measurement message (RMM) */
1879     rtp_hdr_ext_ed137b_feature_climax_ddc_rmm_handle = register_dissector("rtp.hdr_ext.ed137a.ed137b_feature_climax_ddc_rmm", dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_rmm, proto_rtp_ed137);
1880     dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137B_feature_climax_ddc_rmm_key, rtp_hdr_ext_ed137b_feature_climax_ddc_rmm_handle);
1881 
1882     /* ED-137B CLIMAX response message (MAM) */
1883     rtp_hdr_ext_ed137b_feature_climax_ddc_mam_handle = register_dissector("rtp.hdr_ext.ed137a.ed137b_feature_climax_ddc_mam", dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_mam, proto_rtp_ed137);
1884     dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137B_feature_climax_ddc_mam_key, rtp_hdr_ext_ed137b_feature_climax_ddc_mam_handle);
1885 
1886     /* ED-137C CLIMAX response message (MAM) */
1887     rtp_hdr_ext_ed137c_feature_climax_ddc_mam_handle = register_dissector("rtp.hdr_ext.ed137a.ed137c_feature_climax_ddc_mam", dissect_rtp_hdr_ext_ed137c_feature_climax_ddc_mam, proto_rtp_ed137);
1888     dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137C_feature_climax_ddc_mam_key, rtp_hdr_ext_ed137c_feature_climax_ddc_mam_handle);
1889 }
1890 
1891 void
1892 proto_reg_handoff_rtp_ed137(void)
1893 {
1894     static gboolean prefs_initialized = FALSE;
1895 
1896     if (!prefs_initialized) {
1897 
1898         dissector_add_uint("rtp.hdr_ext", RTP_ED137_SIG, rtp_hdr_ext_ed137_handle);
1899         dissector_add_uint("rtp.hdr_ext", RTP_ED137A_SIG, rtp_hdr_ext_ed137a_handle);
1900 
1901         prefs_initialized = TRUE;
1902     }
1903 }
1904 
1905 /*
1906  * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
1907  *
1908  * Local variables:
1909  * c-basic-offset: 4
1910  * tab-width: 8
1911  * indent-tabs-mode: nil
1912  * End:
1913  *
1914  * vi: set shiftwidth=4 tabstop=8 expandtab:
1915  * :indentSize=4:tabSize=8:noTabs=true:
1916  */
1917