Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-rtp-ed137.c
blobe873cee07c735837675779c5b7d06af05101ef1c
1 /* packet-rtp-ed137.c
3 * Routines for RTP ED-137 extensions dissection
4 * RTP = Real time Transport Protocol
6 * Copyright 2000, Philips Electronics N.V.
7 * Written by Andreas Sikkema <h323@ramdyne.nl>
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
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)
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).
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.
29 #include "config.h"
31 #include <epan/packet.h>
32 #include <epan/to_str.h>
33 #include <epan/expert.h>
34 #include <epan/conversation.h>
36 #include "packet-rtp.h"
38 /* ED137 conversation proto data structure */
39 typedef struct _ed137_conv_info_t {
40 wmem_tree_t *unmatched_pdus;
41 wmem_tree_t *matched_pdus;
42 } ed137_conv_info_t;
44 /* ED137 RMM transaction data structure */
45 typedef struct _ed137rmm_transaction_t {
46 uint32_t rqst_frame;
47 uint32_t resp_frame;
48 nstime_t rqst_time;
49 nstime_t resp_time;
50 uint8_t time_quality;
51 } ed137rmm_transaction_t;
53 static int proto_rtp_ed137;
55 static dissector_handle_t rtp_hdr_ext_ed137_handle;
56 static dissector_handle_t rtp_hdr_ext_ed137a_handle;
57 static dissector_handle_t rtp_hdr_ext_ed137a_feature_sqi_handle;
58 static dissector_handle_t rtp_hdr_ext_ed137a_feature_climax_tdly_handle;
59 static dissector_handle_t rtp_hdr_ext_ed137b_feature_rrc_single_handle;
60 static dissector_handle_t rtp_hdr_ext_ed137b_feature_climax_ddc_rmm_handle;
61 static dissector_handle_t rtp_hdr_ext_ed137b_feature_climax_ddc_mam_handle;
62 static dissector_handle_t rtp_hdr_ext_ed137c_feature_climax_ddc_mam_handle;
64 static dissector_table_t rtp_hdr_ext_ed137a_add_features_table;
66 /* RTP header ED-137 extension fields */
67 static int hf_rtp_hdr_ed137s;
68 static int hf_rtp_hdr_ed137;
69 static int hf_rtp_hdr_ed137_add;
70 static int hf_rtp_hdr_ed137_ptt_type;
71 static int hf_rtp_hdr_ed137_squ;
72 static int hf_rtp_hdr_ed137_ptt_id;
73 static int hf_rtp_hdr_ed137_sct;
74 static int hf_rtp_hdr_ed137_x;
75 static int hf_rtp_hdr_ed137_x_nu;
76 static int hf_rtp_hdr_ed137_ft_type;
77 static int hf_rtp_hdr_ed137_ft_len;
78 static int hf_rtp_hdr_ed137_ft_value;
79 static int hf_rtp_hdr_ed137_ft_bss_qidx;
80 static int hf_rtp_hdr_ed137_ft_bss_rssi_qidx;
81 static int hf_rtp_hdr_ed137_ft_bss_qidx_ml;
82 static int hf_rtp_hdr_ed137_vf;
83 static int hf_rtp_hdr_ed137_ft_climax_delay_value;
85 /* RTP header ED-137A extension fields */
86 static int hf_rtp_hdr_ed137a;
87 static int hf_rtp_hdr_ed137a_add;
88 static int hf_rtp_hdr_ed137a_ptt_type;
89 static int hf_rtp_hdr_ed137a_squ;
90 static int hf_rtp_hdr_ed137a_ptt_id;
91 static int hf_rtp_hdr_ed137a_pm;
92 static int hf_rtp_hdr_ed137a_ptts;
93 static int hf_rtp_hdr_ed137a_sct;
94 static int hf_rtp_hdr_ed137a_reserved;
95 static int hf_rtp_hdr_ed137a_x;
96 static int hf_rtp_hdr_ed137a_x_nu;
97 static int hf_rtp_hdr_ed137a_ft_type;
98 static int hf_rtp_hdr_ed137a_ft_len;
99 static int hf_rtp_hdr_ed137a_ft_value;
100 static int hf_rtp_hdr_ed137a_ft_padding;
101 static int hf_rtp_hdr_ed137a_ft_sqi_qidx;
102 static int hf_rtp_hdr_ed137a_ft_sqi_rssi_qidx;
103 static int hf_rtp_hdr_ed137a_ft_sqi_qidx_ml;
104 static int hf_rtp_hdr_ed137a_ft_climax_delay_mode;
105 static int hf_rtp_hdr_ed137a_ft_climax_delay_relative_value;
106 static int hf_rtp_hdr_ed137a_ft_climax_delay_absolute_value;
108 /* RTP header ED-137B extension fields */
109 static int hf_rtp_hdr_ed137b_ft_rrc_single;
110 static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f1;
111 static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f1;
112 static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f2;
113 static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f2;
114 static int hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f1;
115 static int hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f2;
116 static int hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f1;
117 static int hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f2;
118 static int hf_rtp_hdr_ed137b_ft_climax_ddc_rmm;
119 static int hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_tqv;
120 static int hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_t1;
121 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam;
122 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tqg;
123 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t1;
124 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_nmr;
125 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t2;
126 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tsd;
127 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tj1;
128 static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tid;
130 /* RTP header ED-137C extension fields */
131 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam;
132 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tqg;
133 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t1;
134 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_nmr;
135 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t2;
136 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tsd;
137 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tj1;
138 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tid;
139 static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_ts2;
141 static int hf_rtp_hdr_ed137_ft_climax_ddc_rmm_response_in;
142 static int hf_rtp_hdr_ed137_ft_climax_ddc_rmm_no_resp;
143 static int hf_rtp_hdr_ed137_ft_climax_ddc_mam_request_in;
144 static int hf_rtp_hdr_ed137_ft_climax_ddc_mam_time;
146 static expert_field ei_rtp_hdr_ed137_ft_climax_ddc_rmm_resp_not_found;
147 static expert_field ei_rtp_hdr_ed137_ft_sqi_rssi_out_of_range;
149 static int ett_hdr_ext_ed137s;
150 static int ett_hdr_ext_ed137;
151 static int ett_hdr_ext_ed137_add;
152 static int ett_hdr_ext_ed137a;
153 static int ett_hdr_ext_ed137a_add;
155 /* Forward declaration we need below */
156 void proto_register_rtp_ed137(void);
157 void proto_reg_handoff_rtp_ed137(void);
159 /* Combine 4 bits of type with 4 bits of length to 8 bit key */
160 #define MAKE_KEY(type, len) \
161 ( ( type & 0x0F ) << 4 | ( len & 0x0f ) )
163 /* ED-137 signature */
164 #define RTP_ED137_SIG 0x0067
166 /* ED-137A signature */
167 #define RTP_ED137A_SIG 0x0167
169 /* ED-137 PTT */
170 #define RTP_ED137_ptt_mask(octet) ((octet) & 0xE0000000)
171 #define RTP_ED137A_ptt_mask(octet) ((octet) & 0xE000)
172 #define RTP_ED137_squ_mask(octet) ((octet) & 0x10000000)
173 #define RTP_ED137A_squ_mask(octet) ((octet) & 0x1000)
175 /* ED-137 extended information */
176 #define RTP_ED137_extended_information(octet) ((octet) & 0x00400000)
177 #define RTP_ED137A_extended_information(octet) ((octet) & 0x0001)
179 /* ED-137 feature type */
180 #define RTP_ED137_feature_type(octet) (((octet) & 0x003C0000) >> 18)
181 #define RTP_ED137A_feature_type(octet) (((octet) & 0x0000F000) >> 12)
183 /* ED-137 feature length */
184 #define RTP_ED137_feature_length(octet) (((octet) & 0x0003C000) >> 14)
185 #define RTP_ED137A_feature_length(octet) (((octet) & 0x00000F00) >> 8)
187 /* ED-137 feature value */
188 #define RTP_ED137_feature_value(octet) (((octet) & 0x00003FFE) >> 1)
189 #define RTP_ED137A_feature_value(octet) (((octet) & 0x000000FF) >> 0)
191 /* ED_137 None constants */
192 #define RTP_ED137_feature_none_type 0x0
194 /* ED-137 BSS constants */
195 #define RTP_ED137_feature_bss_type 0x1
196 #define RTP_ED137_feature_bss_qidx(octet) (((octet) & 0x00003FC0) >> 6)
197 #define RTP_ED137_feature_bss_qidx_ml(octet) (((octet) & 0x00000038) >> 2)
198 #define RTP_ED137_feature_bss_qidx_ml_rssi 0
199 #define RTP_ED137_feature_bss_qidx_rssi_max 15
201 /* ED-137 CLIMAX-Time Delay */
202 #define RTP_ED137_feature_climax_ot_type 0x2
203 #define RTP_ED137_feature_climax_ot_value(octet) (((octet) & 0x00003F00) >> 8)
205 /* ED-137A SQI constants */
206 #define RTP_ED137A_feature_sqi_type 0x1
207 #define RTP_ED137A_feature_sqi_len 1
208 #define RTP_ED137A_feature_sqi_key MAKE_KEY( RTP_ED137A_feature_sqi_type, RTP_ED137A_feature_sqi_len )
209 #define RTP_ED137A_feature_sqi_qidx(octet) (((octet) & 0x000000F8) >> 3)
210 #define RTP_ED137A_feature_sqi_qidx_ml(octet) (((octet) & 0x00000007) >> 0)
211 #define RTP_ED137A_feature_sqi_qidx_ml_rssi 0
212 #define RTP_ED137A_feature_sqi_qidx_rssi_max 15
214 /* ED-137A CLIMAX-Time Delay */
215 #define RTP_ED137A_feature_climax_tdly_type 0x2
216 #define RTP_ED137A_feature_climax_tdly_len 1
217 #define RTP_ED137A_feature_climax_tdly_key MAKE_KEY( RTP_ED137A_feature_climax_tdly_type, RTP_ED137A_feature_climax_tdly_len )
218 #define RTP_ED137A_feature_climax_tdly_mode(octet) (((octet) & 0x00000080) >> 7)
219 #define RTP_ED137A_feature_climax_tdly_value(octet) (((octet) & 0x0000007F) >> 0)
220 #define RTP_ED137A_feature_climax_tdly_mode_relative 0
221 #define RTP_ED137A_feature_climax_tdly_mode_absolute 1
223 /* ED-137B RRC single */
224 #define RTP_ED137B_feature_rrc_single_type 0x3
225 #define RTP_ED137B_feature_rrc_single_len 1
226 #define RTP_ED137B_feature_rrc_single_key MAKE_KEY( RTP_ED137B_feature_rrc_single_type, RTP_ED137B_feature_rrc_single_len )
228 /* ED-137B CLIMAX dynamic delay compensation */
229 #define RTP_ED137B_feature_climax_ddc_type 0x4
230 #define RTP_ED137B_feature_climax_ddc_rmm_len 3
231 #define RTP_ED137B_feature_climax_ddc_mam_len 12
232 #define RTP_ED137B_feature_climax_ddc_rmm_key MAKE_KEY( RTP_ED137B_feature_climax_ddc_type, RTP_ED137B_feature_climax_ddc_rmm_len )
233 #define RTP_ED137B_feature_climax_ddc_mam_key MAKE_KEY( RTP_ED137B_feature_climax_ddc_type, RTP_ED137B_feature_climax_ddc_mam_len )
234 #define RTP_ED137B_feature_climax_ddc_rmm_tqv(octet) (((octet) & 0x00800000) >> 23)
235 #define RTP_ED137B_feature_climax_ddc_rmm_t1(octet) (((octet) & 0x007FFFFF) >> 0)
236 #define RTP_ED137B_feature_climax_ddc_mam_tqg(octet) (((octet) & 0x00800000) >> 23)
237 #define RTP_ED137B_feature_climax_ddc_mam_t1(octet) (((octet) & 0x007FFFFF) >> 0)
238 #define RTP_ED137B_feature_climax_ddc_mam_nmr(octet) (((octet) & 0x00800000) >> 23)
239 #define RTP_ED137B_feature_climax_ddc_mam_t2(octet) (((octet) & 0x007FFFFF) >> 0)
240 #define RTP_ED137B_feature_climax_ddc_mam_tsd(octet) (((octet) & 0xFFFF) >> 0)
241 #define RTP_ED137B_feature_climax_ddc_mam_tj1(octet) (((octet) & 0xFFFF) >> 0)
242 #define RTP_ED137B_feature_climax_ddc_mam_tid(octet) (((octet) & 0xFFFF) >> 0)
243 #define RTP_ED137B_feature_climax_ddc_rmm_tqv_relative 0
244 #define RTP_ED137B_feature_climax_ddc_rmm_tqv_absolute 1
245 #define RTP_ED137B_feature_climax_ddc_mam_tqg_relative 0
246 #define RTP_ED137B_feature_climax_ddc_mam_tqg_absolute 1
248 /* ED-137C CLIMAX dynamic delay compensation*/
249 #define RTP_ED137C_feature_climax_ddc_type 0x4
250 #define RTP_ED137C_feature_climax_ddc_mam_len 14
251 #define RTP_ED137C_feature_climax_ddc_mam_key MAKE_KEY( RTP_ED137C_feature_climax_ddc_type, RTP_ED137C_feature_climax_ddc_mam_len )
252 #define RTP_ED137C_feature_climax_ddc_rmm_tqv(octet) (((octet) & 0x00800000) >> 23)
253 #define RTP_ED137C_feature_climax_ddc_rmm_t1(octet) (((octet) & 0x007FFFFF) >> 0)
254 #define RTP_ED137C_feature_climax_ddc_mam_tqg(octet) (((octet) & 0x00800000) >> 23)
255 #define RTP_ED137C_feature_climax_ddc_mam_t1(octet) (((octet) & 0x007FFFFF) >> 0)
256 #define RTP_ED137C_feature_climax_ddc_mam_nmr(octet) (((octet) & 0x00800000) >> 23)
257 #define RTP_ED137C_feature_climax_ddc_mam_t2(octet) (((octet) & 0x007FFFFF) >> 0)
258 #define RTP_ED137C_feature_climax_ddc_mam_tsd(octet) (((octet) & 0xFFFF) >> 0)
259 #define RTP_ED137C_feature_climax_ddc_mam_tj1(octet) (((octet) & 0xFFFF) >> 0)
260 #define RTP_ED137C_feature_climax_ddc_mam_tid(octet) (((octet) & 0xFFFF) >> 0)
261 #define RTP_ED137C_feature_climax_ddc_mam_ts2(octet) (((octet) & 0xFFFF) >> 0)
262 #define RTP_ED137C_feature_climax_ddc_rmm_tqv_relative 0
263 #define RTP_ED137C_feature_climax_ddc_rmm_tqv_absolute 1
264 #define RTP_ED137C_feature_climax_ddc_mam_tqg_relative 0
265 #define RTP_ED137C_feature_climax_ddc_mam_tqg_absolute 1
268 static const value_string rtp_ext_ed137_ptt_type[] =
270 { 0x00, "PTT OFF" },
271 { 0x01, "Normal PTT ON" },
272 { 0x02, "Coupling PTT ON" },
273 { 0x03, "Priority PTT ON" },
274 { 0x04, "Emergency PTT ON" },
275 { 0x05, "Reserved" },
276 { 0x06, "Reserved" },
277 { 0x07, "Reserved" },
278 { 0, NULL },
281 static const value_string rtp_ext_ed137_squ[] =
283 { 0x00, "SQ OFF" },
284 { 0x01, "SQ ON" },
285 { 0, NULL },
288 static const value_string rtp_ext_ed137_ft_type[] =
290 { 0x0, "No features" },
291 { 0x1, "Best signal selection" },
292 { 0x2, "CLIMAX time delay" },
293 { 0x3, "Reserved" },
294 { 0x4, "Reserved" },
295 { 0x5, "Reserved" },
296 { 0x6, "Reserved" },
297 { 0x7, "Reserved" },
298 { 0x8, "Reserved" },
299 { 0x9, "Reserved" },
300 { 0xA, "Reserved" },
301 { 0xB, "Vendor reserved" },
302 { 0xC, "Vendor reserved" },
303 { 0xD, "Vendor reserved" },
304 { 0xE, "Vendor reserved" },
305 { 0xF, "Vendor reserved" },
306 { 0, NULL },
309 static const value_string rtp_ext_ed137_x[] =
311 { 0x00, "No extended information with additional features is used" },
312 { 0x01, "Extended information with additional features is used" },
313 { 0, NULL },
316 static const value_string rtp_ext_ed137_vf[] =
318 { 0x00, "VF OFF" },
319 { 0x01, "VF ON" },
320 { 0, NULL },
323 static const value_string rtp_ext_ed137_ft_bss_rssi_qidx[] =
325 { 0x00, "lower than -100.00 dBm" },
326 { 0x01, "lower than or equal to -97.86 dBm" },
327 { 0x02, "lower than or equal to -95.71 dBm" },
328 { 0x03, "lower than or equal to -93.57 dBm" },
329 { 0x04, "lower than or equal to -91.43 dBm" },
330 { 0x05, "lower than or equal to -89.29 dBm" },
331 { 0x06, "lower than or equal to -87.14 dBm" },
332 { 0x07, "lower than or equal to -85.00 dBm" },
333 { 0x08, "lower than or equal to -82.86 dBm" },
334 { 0x09, "lower than or equal to -80.71 dBm" },
335 { 0x0a, "lower than or equal to -78.57 dBm" },
336 { 0x0b, "lower than or equal to -76.43 dBm" },
337 { 0x0c, "lower than or equal to -74.29 dBm" },
338 { 0x0d, "lower than or equal to -72.14 dBm" },
339 { 0x0e, "lower than or equal to -70.00 dBm" },
340 { 0x0f, "higher than -70.00 dBm" },
341 { 0, NULL },
344 static const value_string rtp_ext_ed137_ft_bss_qidx_ml[] =
346 { 0x00, "RSSI" },
347 { 0x01, "AGC Level" },
348 { 0x02, "C/N" },
349 { 0x03, "Standardized PSD" },
350 { 0x04, "Vendor specific method" },
351 { 0x05, "Vendor specific method" },
352 { 0x06, "Vendor specific method" },
353 { 0x07, "Vendor specific method" },
354 { 0, NULL },
357 static const value_string rtp_ext_ed137a_ptt_type[] =
359 { 0x00, "PTT OFF" },
360 { 0x01, "Normal PTT ON" },
361 { 0x02, "Coupling PTT ON" },
362 { 0x03, "Priority PTT ON" },
363 { 0x04, "Emergency PTT ON" },
364 { 0x05, "Test PTT ON" },
365 { 0x06, "Reserved" },
366 { 0x07, "Reserved" },
367 { 0, NULL },
370 static const value_string rtp_ext_ed137a_squ[] =
372 { 0x00, "SQ OFF" },
373 { 0x01, "SQ ON" },
374 { 0, NULL },
377 static const value_string rtp_ext_ed137a_ft_type[] =
379 { 0x0, "No features" },
380 { 0x1, "Signal Quality Information" },
381 { 0x2, "CLIMAX time delay" },
382 { 0x3, "Radio remote control" },
383 { 0x4, "CLIMAX dynamic delay compensation" },
384 { 0x5, "Reserved" },
385 { 0x6, "Reserved" },
386 { 0x7, "Reserved" },
387 { 0x8, "Reserved" },
388 { 0x9, "Reserved" },
389 { 0xA, "Reserved" },
390 { 0xB, "Vendor reserved" },
391 { 0xC, "Vendor reserved" },
392 { 0xD, "Vendor reserved" },
393 { 0xE, "Vendor reserved" },
394 { 0xF, "Vendor reserved" },
395 { 0, NULL },
398 static const value_string rtp_ext_ed137a_ft_sqi_rssi_qidx[] =
400 { 0x00, "lower than -100.00 dBm" },
401 { 0x01, "lower than or equal to -97.86 dBm" },
402 { 0x02, "lower than or equal to -95.71 dBm" },
403 { 0x03, "lower than or equal to -93.57 dBm" },
404 { 0x04, "lower than or equal to -91.43 dBm" },
405 { 0x05, "lower than or equal to -89.29 dBm" },
406 { 0x06, "lower than or equal to -87.14 dBm" },
407 { 0x07, "lower than or equal to -85.00 dBm" },
408 { 0x08, "lower than or equal to -82.86 dBm" },
409 { 0x09, "lower than or equal to -80.71 dBm" },
410 { 0x0a, "lower than or equal to -78.57 dBm" },
411 { 0x0b, "lower than or equal to -76.43 dBm" },
412 { 0x0c, "lower than or equal to -74.29 dBm" },
413 { 0x0d, "lower than or equal to -72.14 dBm" },
414 { 0x0e, "lower than or equal to -70.00 dBm" },
415 { 0x0f, "higher than -70.00 dBm" },
416 { 0, NULL },
419 static const value_string rtp_ext_ed137a_ft_sqi_qidx_ml[] =
421 { 0x00, "RSSI" },
422 { 0x01, "AGC Level" },
423 { 0x02, "C/N" },
424 { 0x03, "Standardized PSD" },
425 { 0x04, "Vendor specific method" },
426 { 0x05, "Vendor specific method" },
427 { 0x06, "Vendor specific method" },
428 { 0x07, "Vendor specific method" },
429 { 0, NULL },
432 static const value_string rtp_ext_ed137a_ft_climax_delay_mode[] =
434 { 0x00, "relative" },
435 { 0x01, "absolute" },
436 { 0, NULL },
439 static const value_string rtp_ext_ed137b_ft_single_ms_tx_f1[] =
441 { 0x00, "Main transmitter for F1 is used" },
442 { 0x01, "Standby transmitter for F1 is used" },
443 { 0, NULL },
446 static const value_string rtp_ext_ed137b_ft_single_ms_rx_f1[] =
448 { 0x00, "Main receiver for F1 is used" },
449 { 0x01, "Standby receiver for F1 is used" },
450 { 0, NULL },
453 static const value_string rtp_ext_ed137b_ft_single_ms_tx_f2[] =
455 { 0x00, "Main transmitter for F2 is used" },
456 { 0x01, "Standby transmitter for F2 is used" },
457 { 0, NULL },
460 static const value_string rtp_ext_ed137b_ft_single_ms_rx_f2[] =
462 { 0x00, "Main receiver for F2 is used" },
463 { 0x01, "Standby receiver for F2 is used" },
464 { 0, NULL },
467 static const value_string rtp_ext_ed137b_ft_single_sel_tx_f1[] =
469 { 0x00, "Active transmitter for F1 shall not be used" },
470 { 0x01, "Active transmitter for F1 shall be used" },
471 { 0, NULL },
474 static const value_string rtp_ext_ed137b_ft_single_sel_tx_f2[] =
476 { 0x00, "Active transmitter for F2 shall not be used" },
477 { 0x01, "Active transmitter for F2 shall be used" },
478 { 0, NULL },
481 static const value_string rtp_ext_ed137b_ft_single_mu_rx_f1[] =
483 { 0x00, "Active receiver for F1 shall be unmuted" },
484 { 0x01, "Active receiver for F1 shall be muted" },
485 { 0, NULL },
488 static const value_string rtp_ext_ed137b_ft_single_mu_rx_f2[] =
490 { 0x00, "Active receiver for F2 shall be unmuted" },
491 { 0x01, "Active receiver for F2 shall be muted" },
492 { 0, NULL },
495 static const value_string rtp_ext_ed137b_ft_climax_ddc_time_quality[] =
497 { 0x00, "Not synchronized" },
498 { 0x01, "Synchronized" },
499 { 0, NULL },
502 static const value_string rtp_ext_ed137b_ft_climax_ddc_mam_nmr[] =
504 { 0x00, "No request" },
505 { 0x01, "GRS requests a new RTT measurement" },
506 { 0, NULL },
509 static const value_string rtp_ext_ed137c_ft_climax_ddc_time_quality[] =
511 { 0x00, "Not synchronized" },
512 { 0x01, "Synchronized" },
513 { 0, NULL },
516 static const value_string rtp_ext_ed137c_ft_climax_ddc_mam_nmr[] =
518 { 0x00, "No request" },
519 { 0x01, "GRS requests a new RTT measurement" },
520 { 0, NULL },
523 /* We do not need to allocate/free strings */
524 static char *ed137_ptt_only = "PTT";
525 static char *ed137_squ_only = "SQU";
526 static char *ed137_ptt_and_squ = "PTT+SQU";
528 /* Note:
529 * Only seen/tested headers are decoded
531 static int
532 dissect_rtp_hdr_ext_ed137(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
534 unsigned int hdr_extension_len;
535 struct _rtp_info *rtp_info=(struct _rtp_info *)data;
536 proto_tree *rtp_hext_tree = NULL;
537 unsigned int hdrext_offset = 0;
538 bool ed137_ptt = false;
539 bool ed137_squ = false;
541 hdr_extension_len = tvb_reported_length(tvb);
543 if ( hdr_extension_len > 0 ) {
545 if (rtp_info != NULL) {
546 rtp_info->info_is_ed137 = true;
548 if ( tree ) {
549 proto_item *ti;
550 ti = proto_tree_add_item(tree, hf_rtp_hdr_ed137s, tvb, 0, hdr_extension_len, ENC_NA);
551 rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext_ed137s );
554 while ( hdr_extension_len > 0 ) {
555 proto_item *ti2;
556 proto_tree *rtp_hext_tree2;
557 proto_item *ti3;
558 proto_tree *rtp_hext_tree3;
559 unsigned int ft_type;
560 uint32_t ext_value = tvb_get_ntohl( tvb, hdrext_offset );
562 if (RTP_ED137_ptt_mask(ext_value)) {
563 col_append_str(pinfo->cinfo, COL_INFO, ", PTT");
564 ed137_ptt = true;
566 if (RTP_ED137_squ_mask(ext_value)) {
567 col_append_str(pinfo->cinfo, COL_INFO, ", SQU");
568 ed137_squ = true;
571 /* Map PTT/SQU bits to string */
572 if (rtp_info != NULL) {
573 if (ed137_ptt) {
574 if (ed137_squ) {
575 rtp_info->info_ed137_info = ed137_ptt_and_squ;
576 } else {
577 rtp_info->info_ed137_info = ed137_ptt_only;
579 } else {
580 if (ed137_squ) {
581 rtp_info->info_ed137_info = ed137_squ_only;
582 } else {
583 rtp_info->info_ed137_info = NULL;
588 if ( rtp_hext_tree ) {
589 ti2 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137, tvb, hdrext_offset, 4, ENC_NA);
590 rtp_hext_tree2 = proto_item_add_subtree( ti2, ett_hdr_ext_ed137 );
592 /* 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 */
593 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ptt_type, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
594 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_squ, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
595 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ptt_id, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
596 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_sct, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
597 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_x, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
598 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_vf, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
601 ft_type = RTP_ED137_feature_type(ext_value);
603 ti3 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137_add, tvb, hdrext_offset, 4, ENC_NA);
604 rtp_hext_tree3 = proto_item_add_subtree( ti3, ett_hdr_ext_ed137_add );
606 if (RTP_ED137_extended_information(ext_value)) {
607 /* Extended information is used */
609 if ( rtp_hext_tree ) {
610 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_type, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
611 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_len, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
614 if ( rtp_hext_tree ) {
615 switch (ft_type) {
616 case RTP_ED137_feature_bss_type:
618 unsigned int bss_qidx;
619 unsigned int bss_qidx_ml;
621 bss_qidx = RTP_ED137_feature_bss_qidx(ext_value);
622 bss_qidx_ml = RTP_ED137_feature_bss_qidx_ml(ext_value);
623 if (RTP_ED137_feature_bss_qidx_ml_rssi == bss_qidx_ml) {
624 /* Special handling for RSSI method */
625 if (bss_qidx <= RTP_ED137_feature_bss_qidx_rssi_max) {
626 /* Correct range */
627 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_rssi_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
629 else {
630 /* Handle as other method */
631 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
634 else {
635 /* Other BSS method handling */
636 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
638 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_qidx_ml, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
639 break;
641 case RTP_ED137_feature_climax_ot_type:
643 unsigned int climax_ot_value;
644 unsigned int climax_ot_value_calc;
646 climax_ot_value = RTP_ED137_feature_climax_ot_value(ext_value);
648 /* Relative delay, in 2ms steps */
649 climax_ot_value_calc=2*climax_ot_value;
650 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);
652 break;
654 default:
655 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_value, tvb, hdrext_offset, 4, ENC_NA);
656 break;
660 /* Shift behind header */
661 hdrext_offset += 4;
662 hdr_extension_len -= 4;
664 else {
665 /* Extended information is not used */
666 if ( rtp_hext_tree ) {
667 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_x_nu, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
670 /* Shift behind empty additional feature header */
671 hdrext_offset += 4;
672 hdr_extension_len -= 4;
676 return tvb_captured_length(tvb);
680 #define NSTIME_INIT_USEC(nstime, usecs) \
681 nstime.secs = usecs / 1000000; \
682 nstime.nsecs = (usecs % 1000000) * 1000;
684 /* Decodes and calculates relative/absolute time item */
685 static void process_time_value(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int time_item, unsigned int hdrext_offset, bool time_relative _U_, unsigned int time_value)
687 /* Note: even there is relative/absolute flag, value is shown same way because it is relative value derived from relative/absolute start point */
688 unsigned int time_calc;
689 nstime_t tmp_time;
690 char *tmp;
692 /* Value is stored as count of 125 us ticks */
693 time_calc = time_value * 125;
694 NSTIME_INIT_USEC(tmp_time, time_calc);
695 tmp = rel_time_to_secs_str(pinfo->pool, &tmp_time);
697 proto_tree_add_uint_format_value( tree, time_item, tvb, hdrext_offset, 3, time_value, "%s s", tmp);
700 /* Decodes and calculates value based on 125us tick*/
701 static void process_125us_based_value(tvbuff_t *tvb, proto_tree *tree, int value_item, unsigned int hdrext_offset)
703 uint32_t value;
704 uint32_t value_calc;
706 /* Values is stored as count of 125 us ticks */
707 value = tvb_get_ntohs( tvb, hdrext_offset );
708 value_calc = value * 125;
710 proto_tree_add_uint_format_value( tree, value_item, tvb, hdrext_offset, 2, value, "%d us", value_calc);
713 static int
714 dissect_rtp_hdr_ext_ed137a_feature_sqi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
716 uint32_t ext_value;
717 uint32_t sqi_qidx;
718 uint32_t sqi_qidx_ml;
719 proto_item *it;
721 ext_value = tvb_get_uint8( tvb, 0 );
722 sqi_qidx = RTP_ED137A_feature_sqi_qidx(ext_value);
723 sqi_qidx_ml = RTP_ED137A_feature_sqi_qidx_ml(ext_value);
724 if (RTP_ED137A_feature_sqi_qidx_ml_rssi == sqi_qidx_ml) {
725 /* Special handling for RSSI method */
726 if (sqi_qidx <= RTP_ED137A_feature_sqi_qidx_rssi_max) {
727 /* Correct range */
728 proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_rssi_qidx, tvb, 0, 1, ENC_BIG_ENDIAN);
730 else {
731 /* Handle as other method */
732 it = proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_qidx, tvb, 0, 1, ENC_BIG_ENDIAN);
733 expert_add_info_format(pinfo, it, &ei_rtp_hdr_ed137_ft_sqi_rssi_out_of_range, "RSSI index out of range");
736 else {
737 /* Other SQI method handling */
738 proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_qidx, tvb, 0, 1, ENC_BIG_ENDIAN);
740 proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_qidx_ml, tvb, 0, 1, ENC_BIG_ENDIAN);
742 if (sqi_qidx>0) {
743 col_append_fstr(pinfo->cinfo, COL_INFO, ", SQI=%u", sqi_qidx);
745 else {
746 col_append_str(pinfo->cinfo, COL_INFO, ", SQI N/A");
749 return tvb_captured_length(tvb);
752 static int
753 dissect_rtp_hdr_ext_ed137a_feature_climax_tdly(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
755 uint32_t ext_value;
756 uint32_t climax_tdly_mode;
757 uint32_t climax_tdly_value;
758 uint32_t climax_tdly_value_calc;
760 ext_value = tvb_get_uint8( tvb, 0 );
762 climax_tdly_mode = RTP_ED137A_feature_climax_tdly_mode(ext_value);
763 climax_tdly_value = RTP_ED137A_feature_climax_tdly_value(ext_value);
765 proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_climax_delay_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
766 if (RTP_ED137A_feature_climax_tdly_mode_relative == climax_tdly_mode) {
767 /* Relative delay, in 2ms steps */
768 climax_tdly_value_calc=2*climax_tdly_value;
770 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);
771 col_append_fstr(pinfo->cinfo, COL_INFO, ", CMX=%ums rel", climax_tdly_value_calc);
774 else {
775 /* Absolute delay, in 2ms steps */
776 climax_tdly_value_calc=2*climax_tdly_value;
778 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);
779 col_append_fstr(pinfo->cinfo, COL_INFO, ", CMX=%ums abs", climax_tdly_value_calc);
783 return tvb_captured_length(tvb);
786 static int
787 dissect_rtp_hdr_ext_ed137b_feature_rrc_single(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
789 proto_tree *item;
791 /* Generated item points really to previous byte */
792 item = proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single, tvb, -1, 1, ENC_NA);
793 proto_item_set_generated(item);
795 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f1, tvb, 0, 1, ENC_BIG_ENDIAN);
796 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f1, tvb, 0, 1, ENC_BIG_ENDIAN);
797 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f2, tvb, 0, 1, ENC_BIG_ENDIAN);
798 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f2, tvb, 0, 1, ENC_BIG_ENDIAN);
799 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f1, tvb, 0, 1, ENC_BIG_ENDIAN);
800 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f2, tvb, 0, 1, ENC_BIG_ENDIAN);
801 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f1, tvb, 0, 1, ENC_BIG_ENDIAN);
802 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f2, tvb, 0, 1, ENC_BIG_ENDIAN);
804 col_append_str(pinfo->cinfo, COL_INFO, ", RRC");
806 return tvb_captured_length(tvb);
809 /* ======================================================================= */
811 Note: We are tracking conversations via the T1 key as response shall contain a copy of this field
813 static ed137rmm_transaction_t *transaction_start(packet_info * pinfo,
814 proto_tree * tree,
815 uint32_t * key,
816 uint8_t time_quality_vcs)
818 conversation_t *conversation;
819 ed137_conv_info_t *ed137_info;
820 ed137rmm_transaction_t *ed137rmm_trans;
821 wmem_tree_key_t ed137rmm_key[3];
822 proto_item *it;
824 /* Handle the conversation tracking */
825 conversation = find_or_create_conversation(pinfo);
826 ed137_info = (ed137_conv_info_t *)conversation_get_proto_data(conversation, proto_rtp_ed137);
827 if (ed137_info == NULL) {
828 ed137_info = wmem_new(wmem_file_scope(), ed137_conv_info_t);
829 ed137_info->unmatched_pdus = wmem_tree_new(wmem_file_scope());
830 ed137_info->matched_pdus = wmem_tree_new(wmem_file_scope());
831 conversation_add_proto_data(conversation, proto_rtp_ed137,
832 ed137_info);
835 if (!PINFO_FD_VISITED(pinfo)) {
836 /* this is a new request, create a new transaction structure and map it to the
837 unmatched table
839 ed137rmm_key[0].length = 1;
840 ed137rmm_key[0].key = key;
841 ed137rmm_key[1].length = 0;
842 ed137rmm_key[1].key = NULL;
844 ed137rmm_trans = wmem_new(wmem_file_scope(), ed137rmm_transaction_t);
845 ed137rmm_trans->rqst_frame = pinfo->num;
846 ed137rmm_trans->resp_frame = 0;
847 ed137rmm_trans->rqst_time = pinfo->abs_ts;
848 ed137rmm_trans->time_quality = time_quality_vcs;
849 nstime_set_zero(&ed137rmm_trans->resp_time);
850 wmem_tree_insert32_array(ed137_info->unmatched_pdus, ed137rmm_key,
851 (void *) ed137rmm_trans);
852 } else {
853 /* Already visited this frame */
854 uint32_t frame_num = pinfo->num;
856 ed137rmm_key[0].length = 1;
857 ed137rmm_key[0].key = key;
858 ed137rmm_key[1].length = 1;
859 ed137rmm_key[1].key = &frame_num;
860 ed137rmm_key[2].length = 0;
861 ed137rmm_key[2].key = NULL;
863 ed137rmm_trans =
864 (ed137rmm_transaction_t *)wmem_tree_lookup32_array(ed137_info->matched_pdus,
865 ed137rmm_key);
867 if (ed137rmm_trans == NULL) {
868 if (PINFO_FD_VISITED(pinfo)) {
869 /* No response found - add field and expert info */
870 it = proto_tree_add_item(tree, hf_rtp_hdr_ed137_ft_climax_ddc_rmm_no_resp, NULL, 0, 0,
871 ENC_NA);
872 proto_item_set_generated(it);
874 col_append_str(pinfo->cinfo, COL_INFO, ", RMM (no response found!)");
876 /* Expert info. */
877 expert_add_info_format(pinfo, it, &ei_rtp_hdr_ed137_ft_climax_ddc_rmm_resp_not_found,
878 "No response seen to RMM request");
881 return NULL;
884 /* Print state tracking in the tree */
885 if (ed137rmm_trans->resp_frame) {
886 it = proto_tree_add_uint(tree, hf_rtp_hdr_ed137_ft_climax_ddc_rmm_response_in, NULL, 0, 0,
887 ed137rmm_trans->resp_frame);
888 proto_item_set_generated(it);
890 col_append_frame_number(pinfo, COL_INFO, ", RMM (reply in %u)",
891 ed137rmm_trans->resp_frame);
894 return ed137rmm_trans;
896 } /* transaction_start() */
898 /* ======================================================================= */
899 static ed137rmm_transaction_t *transaction_end(packet_info * pinfo,
900 proto_tree * tree,
901 uint32_t * key,
902 uint8_t time_quality_grs,
903 uint32_t delta_t,
904 uint32_t tsd,
905 uint32_t internal_t)
907 conversation_t *conversation;
908 ed137_conv_info_t *ed137_info;
909 ed137rmm_transaction_t *ed137rmm_trans;
910 wmem_tree_key_t ed137rmm_key[3];
911 proto_item *it;
912 nstime_t ns;
913 double resp_time;
915 conversation =
916 find_conversation_pinfo(pinfo,0);
917 if (conversation == NULL) {
918 return NULL;
921 ed137_info = (ed137_conv_info_t *)conversation_get_proto_data(conversation, proto_rtp_ed137);
922 if (ed137_info == NULL) {
923 return NULL;
926 if (!PINFO_FD_VISITED(pinfo)) {
927 uint32_t frame_num;
929 ed137rmm_key[0].length = 1;
930 ed137rmm_key[0].key = key;
931 ed137rmm_key[1].length = 0;
932 ed137rmm_key[1].key = NULL;
933 ed137rmm_trans =
934 (ed137rmm_transaction_t *)wmem_tree_lookup32_array(ed137_info->unmatched_pdus,
935 ed137rmm_key);
936 if (ed137rmm_trans == NULL) {
937 return NULL;
940 /* we have already seen this response, or an identical one */
941 if (ed137rmm_trans->resp_frame != 0) {
942 return NULL;
945 ed137rmm_trans->resp_frame = pinfo->num;
946 ed137rmm_trans->time_quality |= time_quality_grs<<1;
948 /* we found a match. Add entries to the matched table for both request and reply frames
950 ed137rmm_key[0].length = 1;
951 ed137rmm_key[0].key = key;
952 ed137rmm_key[1].length = 1;
953 ed137rmm_key[1].key = &frame_num;
954 ed137rmm_key[2].length = 0;
955 ed137rmm_key[2].key = NULL;
957 frame_num = ed137rmm_trans->rqst_frame;
958 wmem_tree_insert32_array(ed137_info->matched_pdus, ed137rmm_key,
959 (void *) ed137rmm_trans);
961 frame_num = ed137rmm_trans->resp_frame;
962 wmem_tree_insert32_array(ed137_info->matched_pdus, ed137rmm_key,
963 (void *) ed137rmm_trans);
964 } else {
965 /* Already visited this frame */
966 uint32_t frame_num = pinfo->num;
968 ed137rmm_key[0].length = 1;
969 ed137rmm_key[0].key = key;
970 ed137rmm_key[1].length = 1;
971 ed137rmm_key[1].key = &frame_num;
972 ed137rmm_key[2].length = 0;
973 ed137rmm_key[2].key = NULL;
975 ed137rmm_trans =
976 (ed137rmm_transaction_t *)wmem_tree_lookup32_array(ed137_info->matched_pdus,
977 ed137rmm_key);
979 if (ed137rmm_trans == NULL) {
980 return NULL;
985 it = proto_tree_add_uint(tree, hf_rtp_hdr_ed137_ft_climax_ddc_mam_request_in, NULL, 0, 0,
986 ed137rmm_trans->rqst_frame);
987 proto_item_set_generated(it);
989 nstime_delta(&ns, &pinfo->abs_ts, &ed137rmm_trans->rqst_time);
990 ed137rmm_trans->resp_time = ns;
991 resp_time = nstime_to_msec(&ns);
992 it = proto_tree_add_double_format_value(tree, hf_rtp_hdr_ed137_ft_climax_ddc_mam_time,
993 NULL, 0, 0, resp_time,
994 "%.3f ms", resp_time);
995 proto_item_set_generated(it);
997 if (ed137rmm_trans->time_quality == 3) {
998 // All sync, delta t is accurate, add internal delta t, multiply by 0.125
999 col_append_fstr(pinfo->cinfo, COL_INFO, ", MAM=%.3f ms",(double)(delta_t+internal_t)*0.125); // 125 us ticks
1001 else {
1002 // No sync, estimated delay only. Formula is delta t = (T4-T1-tsd)/2 where T4 is the local time at which the VCS endpoint receives the MAM message.
1003 // We have T1 but NOT T4, so we use the frame capture time and delta t = resp_time in this case.
1004 // TODO Test whether resp_time + 2 * (t(RMM)-T1) is accurate.
1005 // resp_time is in msec, while tsd and internal_t are 125 usec ticks!
1006 col_append_fstr(pinfo->cinfo, COL_INFO, ", MAM>%.3f ms",(resp_time - (tsd*0.125)) / 2 + internal_t*0.125);
1009 col_append_frame_number(pinfo, COL_INFO, " (request in %u)",
1010 ed137rmm_trans->rqst_frame);
1012 return ed137rmm_trans;
1014 } /* transaction_end() */
1016 static int
1017 dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_rmm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1019 uint32_t ext_value;
1020 proto_tree *item;
1021 uint32_t climax_ddc_rmm_tqv;
1022 uint32_t climax_ddc_rmm_t1;
1024 /* Generated item points really to previous byte */
1025 item = proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm, tvb, -1, 1, ENC_NA);
1026 proto_item_set_generated(item);
1028 ext_value = tvb_get_ntoh24( tvb, 0 );
1029 climax_ddc_rmm_tqv = RTP_ED137B_feature_climax_ddc_rmm_tqv(ext_value);
1030 climax_ddc_rmm_t1 = RTP_ED137B_feature_climax_ddc_rmm_t1(ext_value);
1032 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_tqv, tvb, 0, 3, ENC_BIG_ENDIAN);
1033 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);
1035 transaction_start(pinfo,tree,&climax_ddc_rmm_t1,climax_ddc_rmm_tqv);
1037 return tvb_captured_length(tvb);
1040 static int
1041 dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1043 uint32_t ext_value;
1044 proto_tree *item;
1045 uint32_t climax_ddc_mam_tqg;
1046 uint32_t climax_ddc_mam_t1;
1047 uint32_t climax_ddc_mam_t2;
1049 /* Generated item points really to previous byte */
1050 item = proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam, tvb, -1, 1, ENC_NA);
1051 proto_item_set_generated(item);
1053 ext_value = tvb_get_ntoh24( tvb, 0 + 0 );
1054 climax_ddc_mam_tqg = RTP_ED137B_feature_climax_ddc_mam_tqg(ext_value);
1055 climax_ddc_mam_t1 = RTP_ED137B_feature_climax_ddc_mam_t1(ext_value);
1057 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tqg, tvb, 0, 3, ENC_BIG_ENDIAN);
1058 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);
1060 ext_value = tvb_get_ntoh24( tvb, 0 + 3 );
1061 climax_ddc_mam_t2 = RTP_ED137B_feature_climax_ddc_mam_t2(ext_value);
1063 if (RTP_ED137B_feature_climax_ddc_mam_nmr(ext_value)) {
1064 col_append_str(pinfo->cinfo, COL_INFO, ", NMR");
1067 proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_nmr, tvb, 0 + 3, 3, ENC_BIG_ENDIAN);
1068 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);
1070 process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tsd, 0 + 6);
1071 process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tj1, 0 + 8);
1072 process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tid, 0 + 10);
1074 if (climax_ddc_mam_t2 < climax_ddc_mam_t1) {
1075 climax_ddc_mam_t2 += 0x800000; // t1 and t2 are 23 bits long
1077 transaction_end(pinfo,tree,&climax_ddc_mam_t1,climax_ddc_mam_tqg,climax_ddc_mam_t2-climax_ddc_mam_t1,tvb_get_ntohs( tvb, 0+6 ),tvb_get_ntohs( tvb, 0+8 ) + tvb_get_ntohs( tvb, 0+10 ));
1079 return tvb_captured_length(tvb);
1082 static int
1083 dissect_rtp_hdr_ext_ed137c_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1085 uint32_t ext_value;
1086 proto_tree *item;
1087 uint32_t climax_ddc_mam_tqg;
1088 uint32_t climax_ddc_mam_t1;
1089 uint32_t climax_ddc_mam_t2;
1091 /* Generated item points really to previous byte */
1092 item = proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam, tvb, -1, 1, ENC_NA);
1093 proto_item_set_generated(item);
1095 ext_value = tvb_get_ntoh24( tvb, 0 + 0 );
1096 climax_ddc_mam_tqg = RTP_ED137C_feature_climax_ddc_mam_tqg(ext_value);
1097 climax_ddc_mam_t1 = RTP_ED137C_feature_climax_ddc_mam_t1(ext_value);
1099 proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tqg, tvb, 0, 3, ENC_BIG_ENDIAN);
1100 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);
1102 ext_value = tvb_get_ntoh24( tvb, 0 + 3 );
1103 climax_ddc_mam_t2 = RTP_ED137C_feature_climax_ddc_mam_t2(ext_value);
1105 if (RTP_ED137B_feature_climax_ddc_mam_nmr(ext_value)) {
1106 // New measurement request is sent in case of some unexpected event requiring a new measurement
1107 col_append_str(pinfo->cinfo, COL_INFO, ", NMR");
1110 proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_nmr, tvb, 0 + 3, 3, ENC_BIG_ENDIAN);
1111 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);
1113 process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tsd, 0 + 6);
1114 process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tj1, 0 + 8);
1115 process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tid, 0 + 10);
1116 process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_ts2, 0 + 12);
1118 if (climax_ddc_mam_t2 < climax_ddc_mam_t1) {
1119 climax_ddc_mam_t2 += 0x800000; // t1 and t2 are 23 bits long
1121 transaction_end(pinfo,tree,&climax_ddc_mam_t1,climax_ddc_mam_tqg,climax_ddc_mam_t2-climax_ddc_mam_t1,tvb_get_ntohs( tvb, 0+6 ),tvb_get_ntohs( tvb, 0+8 ) + tvb_get_ntohs( tvb, 0+10 ));
1123 return tvb_captured_length(tvb);
1126 /* Decode ED-137A fixed part and call dissectors for variable part */
1127 static int
1128 dissect_rtp_hdr_ext_ed137a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1130 uint32_t hdr_extension_len;
1131 struct _rtp_info *rtp_info=(struct _rtp_info *)data;
1132 proto_tree *rtp_hext_tree = NULL;
1133 uint32_t hdrext_offset = 0;
1134 bool ed137_ptt = false;
1135 bool ed137_squ = false;
1137 hdr_extension_len = tvb_reported_length(tvb);
1139 if ( hdr_extension_len > 0 ) {
1140 proto_item *ti2;
1141 proto_tree *rtp_hext_tree2;
1142 uint32_t ext_value = tvb_get_ntohs( tvb, hdrext_offset );
1144 if (rtp_info != NULL) {
1145 rtp_info->info_is_ed137 = true;
1147 if ( tree ) {
1148 proto_item *ti;
1149 ti = proto_tree_add_item(tree, hf_rtp_hdr_ed137s, tvb, 0, hdr_extension_len, ENC_NA);
1150 rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext_ed137s );
1153 if (RTP_ED137A_ptt_mask(ext_value)) {
1154 col_append_str(pinfo->cinfo, COL_INFO, ", PTT");
1155 ed137_ptt = true;
1157 if (RTP_ED137A_squ_mask(ext_value)) {
1158 col_append_str(pinfo->cinfo, COL_INFO, ", SQU");
1159 ed137_squ = true;
1162 /* Map PTT/SQU bits to string */
1163 if (rtp_info != NULL) {
1164 if (ed137_ptt) {
1165 if (ed137_squ) {
1166 rtp_info->info_ed137_info = ed137_ptt_and_squ;
1167 } else {
1168 rtp_info->info_ed137_info = ed137_ptt_only;
1170 } else {
1171 if (ed137_squ) {
1172 rtp_info->info_ed137_info = ed137_squ_only;
1173 } else {
1174 rtp_info->info_ed137_info = NULL;
1179 if ( rtp_hext_tree ) {
1180 ti2 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137a, tvb, hdrext_offset, 2, ENC_NA);
1181 rtp_hext_tree2 = proto_item_add_subtree( ti2, ett_hdr_ext_ed137a );
1183 /* 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 */
1184 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptt_type, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
1185 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_squ, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
1186 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptt_id, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
1187 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_pm, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
1188 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptts, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
1189 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_sct, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
1190 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_reserved, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
1191 proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_x, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
1194 /* Shift behind standard ED-137A header */
1195 hdrext_offset += 2;
1196 hdr_extension_len -= 2;
1198 /* Do we have additional feature blocks? */
1199 if (RTP_ED137A_extended_information(ext_value)) {
1201 /* Loop over all additional feature blocks */
1202 /* The shortest header length is 2, anything shorter is padding */
1203 while ( hdr_extension_len >= 2 ) {
1204 proto_item *ti3;
1205 proto_tree *rtp_hext_tree3;
1206 uint32_t ft_type;
1207 uint32_t ft_len;
1209 ext_value = tvb_get_ntohs( tvb, hdrext_offset );
1210 ft_type = RTP_ED137A_feature_type(ext_value);
1211 ft_len = RTP_ED137A_feature_length(ext_value);
1213 /* Is it header or padding? */
1214 if ( RTP_ED137_feature_none_type != ft_type ) {
1215 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);
1216 rtp_hext_tree3 = proto_item_add_subtree( ti3, ett_hdr_ext_ed137a_add );
1218 if ( rtp_hext_tree ) {
1219 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_ft_type, tvb, hdrext_offset, 1, ENC_BIG_ENDIAN);
1220 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_ft_len, tvb, hdrext_offset, 1, ENC_BIG_ENDIAN);
1223 /* Shift behind feature header */
1224 hdrext_offset += 1;
1225 hdr_extension_len -= 1;
1227 tvbuff_t *newtvb;
1228 uint32_t ft_table_key;
1230 /* join 4 bit type and 4 bit length to 8 bit key */
1231 ft_table_key = MAKE_KEY( ft_type, ft_len );
1233 /* pass interpretation of header extension to a registered subdissector */
1234 /* new subset points to value (starts behind type/length pair) */
1235 newtvb = tvb_new_subset_length(tvb, hdrext_offset, hdr_extension_len);
1237 /* try to find a dissector by type/len key and dissect additional feature header */
1238 if ( !(dissector_try_uint(rtp_hdr_ext_ed137a_add_features_table, ft_table_key, newtvb, pinfo, rtp_hext_tree3)) ) {
1239 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_ft_value, tvb, hdrext_offset, ft_len, ENC_NA);
1242 /* Shift behind feature data */
1243 hdrext_offset += ft_len;
1244 hdr_extension_len -= ft_len;
1246 else {
1247 /* Padding, exit while loop */
1248 break;
1253 /* Process padding if any */
1254 uint32_t hdr_extension_padding;
1256 hdr_extension_padding = hdr_extension_len & 0x03;
1258 /* Calculate padding size */
1259 if ( hdr_extension_padding > 0 ) {
1260 if ( rtp_hext_tree ) {
1261 proto_tree_add_item( rtp_hext_tree, hf_rtp_hdr_ed137a_ft_padding, tvb, hdrext_offset, hdr_extension_padding, ENC_NA);
1266 else {
1267 /* Extended information is not used */
1268 if ( rtp_hext_tree ) {
1269 proto_item *ti3;
1270 proto_tree *rtp_hext_tree3;
1272 ti3 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137a_add, tvb, hdrext_offset, 2, ENC_NA);
1273 rtp_hext_tree3 = proto_item_add_subtree( ti3, ett_hdr_ext_ed137a_add );
1274 proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_x_nu, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN);
1278 return tvb_captured_length(tvb);
1281 /* Register RTP ED-137 */
1282 void
1283 proto_register_rtp_ed137(void)
1285 static hf_register_info hf[] =
1287 /* ED-137 and ED-137A common structures */
1289 &hf_rtp_hdr_ed137s,
1291 "ED137 extensions",
1292 "rtp.ext.ed137s",
1293 FT_NONE,
1294 BASE_NONE,
1295 NULL,
1296 0x0,
1297 NULL, HFILL
1300 /* ED-137 only structures */
1302 &hf_rtp_hdr_ed137,
1304 "ED137 extension",
1305 "rtp.ext.ed137",
1306 FT_NONE,
1307 BASE_NONE,
1308 NULL,
1309 0x0,
1310 NULL, HFILL
1314 &hf_rtp_hdr_ed137_add,
1316 "ED137 extension additional feature",
1317 "rtp.ext.ed137.ft",
1318 FT_NONE,
1319 BASE_NONE,
1320 NULL,
1321 0x0,
1322 NULL, HFILL
1326 &hf_rtp_hdr_ed137_ptt_type,
1328 "PTT Type",
1329 "rtp.ext.ed137.ptt_type",
1330 FT_UINT32,
1331 BASE_DEC,
1332 VALS(rtp_ext_ed137_ptt_type),
1333 0xE0000000,
1334 NULL, HFILL
1338 &hf_rtp_hdr_ed137_squ,
1340 "SQU",
1341 "rtp.ext.ed137.squ",
1342 FT_UINT32,
1343 BASE_DEC,
1344 VALS(rtp_ext_ed137_squ),
1345 0x10000000,
1346 NULL, HFILL
1350 &hf_rtp_hdr_ed137_ptt_id,
1352 "PTT-id",
1353 "rtp.ext.ed137.ptt_id",
1354 FT_UINT32,
1355 BASE_DEC,
1356 NULL,
1357 0x0F000000,
1358 NULL, HFILL
1362 &hf_rtp_hdr_ed137_sct,
1364 "Simultaneous Call Transmissions",
1365 "rtp.ext.ed137.sct",
1366 FT_UINT32,
1367 BASE_DEC,
1368 NULL,
1369 0x00800000,
1370 NULL, HFILL
1374 &hf_rtp_hdr_ed137_x,
1376 "X",
1377 "rtp.ext.ed137.x",
1378 FT_UINT32,
1379 BASE_DEC,
1380 VALS(rtp_ext_ed137_x),
1381 0x00400000,
1382 NULL, HFILL
1386 &hf_rtp_hdr_ed137_x_nu,
1388 "Not used",
1389 "rtp.ext.ed137.x-nu",
1390 FT_UINT32,
1391 BASE_DEC,
1392 NULL,
1393 0x003FFFFE,
1394 NULL, HFILL
1398 &hf_rtp_hdr_ed137_ft_type,
1400 "Feature type",
1401 "rtp.ext.ed137.ft.type",
1402 FT_UINT32,
1403 BASE_HEX_DEC,
1404 VALS(rtp_ext_ed137_ft_type),
1405 0x003C0000,
1406 NULL, HFILL
1410 &hf_rtp_hdr_ed137_ft_len,
1412 "Feature length",
1413 "rtp.ext.ed137.ft.len",
1414 FT_UINT32,
1415 BASE_DEC,
1416 NULL,
1417 0x0003C000,
1418 NULL, HFILL
1422 &hf_rtp_hdr_ed137_ft_value,
1424 "Feature value",
1425 "rtp.ext.ed137.ft.value",
1426 FT_UINT32,
1427 BASE_HEX_DEC,
1428 NULL,
1429 0x00003FFE,
1430 NULL, HFILL
1434 &hf_rtp_hdr_ed137_vf,
1436 "VF",
1437 "rtp.ext.ed137.vf",
1438 FT_UINT32,
1439 BASE_DEC,
1440 VALS(rtp_ext_ed137_vf),
1441 0x00000001,
1442 NULL, HFILL
1446 &hf_rtp_hdr_ed137_ft_bss_qidx,
1448 "BSS Quality Index",
1449 "rtp.ext.ed137.ft.bss.qidx",
1450 FT_UINT32,
1451 BASE_DEC,
1452 NULL,
1453 0x00003FC0,
1454 NULL, HFILL
1458 &hf_rtp_hdr_ed137_ft_bss_rssi_qidx,
1460 "BSS Quality Index",
1461 "rtp.ext.ed137.ft.bss.qidx",
1462 FT_UINT32,
1463 BASE_DEC,
1464 VALS(rtp_ext_ed137_ft_bss_rssi_qidx),
1465 0x00003FC0,
1466 NULL, HFILL
1470 &hf_rtp_hdr_ed137_ft_bss_qidx_ml,
1472 "BSS Quality Index Method",
1473 "rtp.ext.ed137.ft.bss.qidx-ml",
1474 FT_UINT32,
1475 BASE_DEC,
1476 VALS(rtp_ext_ed137_ft_bss_qidx_ml),
1477 0x00000038,
1478 NULL, HFILL
1482 &hf_rtp_hdr_ed137_ft_climax_delay_value,
1484 "CLIMAX-Time Delay",
1485 "rtp.ext.ed137.ft.climax_delay.value",
1486 FT_UINT32,
1487 BASE_DEC,
1488 NULL,
1489 0x00003F00,
1490 NULL, HFILL
1493 /* ED-137A/B only structures */
1495 &hf_rtp_hdr_ed137a,
1497 "ED137A extension",
1498 "rtp.ext.ed137a",
1499 FT_NONE,
1500 BASE_NONE,
1501 NULL,
1502 0x0,
1503 NULL, HFILL
1507 &hf_rtp_hdr_ed137a_add,
1509 "ED137A extension additional feature",
1510 "rtp.ext.ed137a.ft",
1511 FT_NONE,
1512 BASE_NONE,
1513 NULL,
1514 0x0,
1515 NULL, HFILL
1519 &hf_rtp_hdr_ed137a_ptt_type,
1521 "PTT Type",
1522 "rtp.ext.ed137a.ptt_type",
1523 FT_UINT16,
1524 BASE_DEC,
1525 VALS(rtp_ext_ed137a_ptt_type),
1526 0xE000,
1527 NULL, HFILL
1531 &hf_rtp_hdr_ed137a_squ,
1533 "SQU",
1534 "rtp.ext.ed137a.squ",
1535 FT_UINT16,
1536 BASE_DEC,
1537 VALS(rtp_ext_ed137a_squ),
1538 0x1000,
1539 NULL, HFILL
1543 &hf_rtp_hdr_ed137a_ptt_id,
1545 "PTT-id",
1546 "rtp.ext.ed137a.ptt_id",
1547 FT_UINT16,
1548 BASE_DEC,
1549 NULL,
1550 0x0FC0,
1551 NULL, HFILL
1555 &hf_rtp_hdr_ed137a_pm,
1557 "PTT Mute",
1558 "rtp.ext.ed137a.pm",
1559 FT_UINT16,
1560 BASE_DEC,
1561 NULL,
1562 0x0020,
1563 NULL, HFILL
1567 &hf_rtp_hdr_ed137a_ptts,
1569 "PTT Summation",
1570 "rtp.ext.ed137a.ptts",
1571 FT_UINT16,
1572 BASE_DEC,
1573 NULL,
1574 0x0010,
1575 NULL, HFILL
1579 &hf_rtp_hdr_ed137a_sct,
1581 "Simultaneous Call Transmissions",
1582 "rtp.ext.ed137a.sct",
1583 FT_UINT16,
1584 BASE_DEC,
1585 NULL,
1586 0x0008,
1587 NULL, HFILL
1591 &hf_rtp_hdr_ed137a_reserved,
1593 "Reserved",
1594 "rtp.ext.ed137a.reserved",
1595 FT_UINT16,
1596 BASE_HEX_DEC,
1597 NULL,
1598 0x0006,
1599 NULL, HFILL
1603 &hf_rtp_hdr_ed137a_x,
1605 "X",
1606 "rtp.ext.ed137a.x",
1607 FT_UINT16,
1608 BASE_DEC,
1609 VALS(rtp_ext_ed137_x),
1610 0x0001,
1611 NULL, HFILL
1615 &hf_rtp_hdr_ed137a_x_nu,
1617 "Not used",
1618 "rtp.ext.ed137a.x-nu",
1619 FT_UINT16,
1620 BASE_DEC,
1621 NULL,
1622 0xFFFF,
1623 NULL, HFILL
1627 &hf_rtp_hdr_ed137a_ft_type,
1629 "Feature type",
1630 "rtp.ext.ed137a.ft.type",
1631 FT_UINT8,
1632 BASE_HEX_DEC,
1633 VALS(rtp_ext_ed137a_ft_type),
1634 0xF0,
1635 NULL, HFILL
1639 &hf_rtp_hdr_ed137a_ft_len,
1641 "Feature length",
1642 "rtp.ext.ed137a.ft.len",
1643 FT_UINT8,
1644 BASE_DEC,
1645 NULL,
1646 0x0F,
1647 NULL, HFILL
1651 &hf_rtp_hdr_ed137a_ft_value,
1653 "Feature value",
1654 "rtp.ext.ed137a.ft.value",
1655 FT_BYTES,
1656 BASE_NONE,
1657 NULL,
1658 0x0,
1659 NULL, HFILL
1663 &hf_rtp_hdr_ed137a_ft_padding,
1665 "Padding",
1666 "rtp.ext.ed137a.ft.padding",
1667 FT_BYTES,
1668 BASE_NONE,
1669 NULL,
1670 0x0,
1671 NULL, HFILL
1675 &hf_rtp_hdr_ed137a_ft_sqi_qidx,
1677 "SQI Quality Index",
1678 "rtp.ext.ed137a.ft.sqi.qidx",
1679 FT_UINT8,
1680 BASE_DEC,
1681 NULL,
1682 0xF8,
1683 NULL, HFILL
1687 &hf_rtp_hdr_ed137a_ft_sqi_rssi_qidx,
1689 "SQI Quality Index",
1690 "rtp.ext.ed137a.ft.sqi.qidx",
1691 FT_UINT8,
1692 BASE_DEC,
1693 VALS(rtp_ext_ed137a_ft_sqi_rssi_qidx),
1694 0xF8,
1695 NULL, HFILL
1699 &hf_rtp_hdr_ed137a_ft_sqi_qidx_ml,
1701 "SQI Quality Index Method",
1702 "rtp.ext.ed137a.ft.sqi.qidx-ml",
1703 FT_UINT8,
1704 BASE_DEC,
1705 VALS(rtp_ext_ed137a_ft_sqi_qidx_ml),
1706 0x07,
1707 NULL, HFILL
1711 &hf_rtp_hdr_ed137a_ft_climax_delay_mode,
1713 "CLIMAX-Time Delay Mode",
1714 "rtp.ext.ed137a.ft.climax_delay.mode",
1715 FT_UINT8,
1716 BASE_DEC,
1717 VALS(rtp_ext_ed137a_ft_climax_delay_mode),
1718 0x80,
1719 NULL, HFILL
1723 &hf_rtp_hdr_ed137a_ft_climax_delay_relative_value,
1725 "CLIMAX-Time Delay Relative",
1726 "rtp.ext.ed137a.ft.climax_delay.relative_value",
1727 FT_UINT8,
1728 BASE_DEC,
1729 NULL,
1730 0x7F,
1731 NULL, HFILL
1735 &hf_rtp_hdr_ed137a_ft_climax_delay_absolute_value,
1737 "CLIMAX-Time Delay Absolute",
1738 "rtp.ext.ed137a.ft.climax_delay.absolute_value",
1739 FT_UINT8,
1740 BASE_DEC,
1741 NULL,
1742 0x7F,
1743 NULL, HFILL
1747 &hf_rtp_hdr_ed137b_ft_rrc_single,
1749 "RRC for single frequency",
1750 "rtp.ext.ed137b.ft.rrc.single",
1751 FT_NONE,
1752 BASE_NONE,
1753 NULL,
1754 0x0,
1755 NULL, HFILL
1759 &hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f1,
1761 "MSTxF1",
1762 "rtp.ext.ed137b.ft.rrc.mstxf1",
1763 FT_UINT8,
1764 BASE_DEC,
1765 VALS(rtp_ext_ed137b_ft_single_ms_tx_f1),
1766 0x80,
1767 NULL, HFILL
1771 &hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f1,
1773 "MSRxF1",
1774 "rtp.ext.ed137b.ft.rrc.msrxf1",
1775 FT_UINT8,
1776 BASE_DEC,
1777 VALS(rtp_ext_ed137b_ft_single_ms_rx_f1),
1778 0x40,
1779 NULL, HFILL
1783 &hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f2,
1785 "MSTxF2",
1786 "rtp.ext.ed137b.ft.rrc.mstxf2",
1787 FT_UINT8,
1788 BASE_DEC,
1789 VALS(rtp_ext_ed137b_ft_single_ms_tx_f2),
1790 0x20,
1791 NULL, HFILL
1795 &hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f2,
1797 "MSRxF2",
1798 "rtp.ext.ed137b.ft.rrc.msrxf2",
1799 FT_UINT8,
1800 BASE_DEC,
1801 VALS(rtp_ext_ed137b_ft_single_ms_rx_f2),
1802 0x10,
1803 NULL, HFILL
1807 &hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f1,
1809 "SelTxF1",
1810 "rtp.ext.ed137b.ft.rrc.seltxf1",
1811 FT_UINT8,
1812 BASE_DEC,
1813 VALS(rtp_ext_ed137b_ft_single_sel_tx_f1),
1814 0x08,
1815 NULL, HFILL
1819 &hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f2,
1821 "SelTxF2",
1822 "rtp.ext.ed137b.ft.rrc.seltxf2",
1823 FT_UINT8,
1824 BASE_DEC,
1825 VALS(rtp_ext_ed137b_ft_single_sel_tx_f2),
1826 0x04,
1827 NULL, HFILL
1831 &hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f1,
1833 "MuRxF1",
1834 "rtp.ext.ed137b.ft.rrc.murxf1",
1835 FT_UINT8,
1836 BASE_DEC,
1837 VALS(rtp_ext_ed137b_ft_single_mu_rx_f1),
1838 0x02,
1839 NULL, HFILL
1843 &hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f2,
1845 "MuRxF2",
1846 "rtp.ext.ed137b.ft.rrc.murxf2",
1847 FT_UINT8,
1848 BASE_DEC,
1849 VALS(rtp_ext_ed137b_ft_single_mu_rx_f2),
1850 0x01,
1851 NULL, HFILL
1855 &hf_rtp_hdr_ed137b_ft_climax_ddc_rmm,
1857 "CLIMAX Dynamic Delay Compensation RMM Request",
1858 "rtp.ext.ed137b.ft.climax_ddc.rmm",
1859 FT_NONE,
1860 BASE_NONE,
1861 NULL,
1862 0x0,
1863 NULL, HFILL
1867 &hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_tqv,
1869 "Time Quality VCS",
1870 "rtp.ext.ed137b.ft.climax_ddc.rmm_tqv",
1871 FT_UINT24,
1872 BASE_DEC,
1873 VALS(rtp_ext_ed137b_ft_climax_ddc_time_quality),
1874 0x800000,
1875 NULL, HFILL
1879 &hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_t1,
1881 "T1",
1882 "rtp.ext.ed137b.ft.climax_ddc.rmm_t1",
1883 FT_UINT24,
1884 BASE_DEC,
1885 NULL,
1886 0x7FFFFF,
1887 NULL, HFILL
1891 &hf_rtp_hdr_ed137b_ft_climax_ddc_mam,
1893 "CLIMAX Dynamic Delay Compensation MAM Response (ED-137B)",
1894 "rtp.ext.ed137b.ft.climax_ddc.mam",
1895 FT_NONE,
1896 BASE_NONE,
1897 NULL,
1898 0x0,
1899 NULL, HFILL
1903 &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tqg,
1905 "Time Quality GRS",
1906 "rtp.ext.ed137b.ft.climax_ddc.mam_tqg",
1907 FT_UINT24,
1908 BASE_DEC,
1909 VALS(rtp_ext_ed137b_ft_climax_ddc_time_quality),
1910 0x800000,
1911 NULL, HFILL
1915 &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t1,
1917 "T1",
1918 "rtp.ext.ed137b.ft.climax_ddc.mam_t1",
1919 FT_UINT24,
1920 BASE_DEC,
1921 NULL,
1922 0x7FFFFF,
1923 NULL, HFILL
1927 &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_nmr,
1929 "New measurement requested",
1930 "rtp.ext.ed137b.ft.climax_ddc.mam_nmr",
1931 FT_UINT24,
1932 BASE_DEC,
1933 VALS(rtp_ext_ed137b_ft_climax_ddc_mam_nmr),
1934 0x800000,
1935 NULL, HFILL
1939 &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t2,
1941 "T2",
1942 "rtp.ext.ed137b.ft.climax_ddc.mam_t2",
1943 FT_UINT24,
1944 BASE_DEC,
1945 NULL,
1946 0x7FFFFF,
1947 NULL, HFILL
1951 &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tsd,
1953 "Tsd",
1954 "rtp.ext.ed137b.ft.climax_ddc.mam_tsd",
1955 FT_UINT16,
1956 BASE_DEC,
1957 NULL,
1959 NULL, HFILL
1963 &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tj1,
1965 "Tj1",
1966 "rtp.ext.ed137b.ft.climax_ddc.mam_tj1",
1967 FT_UINT16,
1968 BASE_DEC,
1969 NULL,
1971 NULL, HFILL
1975 &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tid,
1977 "Tid",
1978 "rtp.ext.ed137b.ft.climax_ddc.mam_tid",
1979 FT_UINT16,
1980 BASE_DEC,
1981 NULL,
1983 NULL, HFILL
1987 &hf_rtp_hdr_ed137c_ft_climax_ddc_mam,
1989 "CLIMAX Dynamic Delay Compensation MAM Response (ED-137C)",
1990 "rtp.ext.ed137c.ft.climax_ddc.mam",
1991 FT_NONE,
1992 BASE_NONE,
1993 NULL,
1994 0x0,
1995 NULL, HFILL
1999 &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tqg,
2001 "Time Quality GRS",
2002 "rtp.ext.ed137c.ft.climax_ddc.mam_tqg",
2003 FT_UINT24,
2004 BASE_DEC,
2005 VALS(rtp_ext_ed137c_ft_climax_ddc_time_quality),
2006 0x800000,
2007 NULL, HFILL
2011 &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t1,
2013 "T1",
2014 "rtp.ext.ed137c.ft.climax_ddc.mam_t1",
2015 FT_UINT24,
2016 BASE_DEC,
2017 NULL,
2018 0x7FFFFF,
2019 NULL, HFILL
2023 &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_nmr,
2025 "New measurement requested",
2026 "rtp.ext.ed137c.ft.climax_ddc.mam_nmr",
2027 FT_UINT24,
2028 BASE_DEC,
2029 VALS(rtp_ext_ed137c_ft_climax_ddc_mam_nmr),
2030 0x800000,
2031 NULL, HFILL
2035 &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t2,
2037 "T2",
2038 "rtp.ext.ed137c.ft.climax_ddc.mam_t2",
2039 FT_UINT24,
2040 BASE_DEC,
2041 NULL,
2042 0x7FFFFF,
2043 NULL, HFILL
2047 &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tsd,
2049 "Tsd",
2050 "rtp.ext.ed137c.ft.climax_ddc.mam_tsd",
2051 FT_UINT16,
2052 BASE_DEC,
2053 NULL,
2055 NULL, HFILL
2059 &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tj1,
2061 "Tj1",
2062 "rtp.ext.ed137c.ft.climax_ddc.mam_tj1",
2063 FT_UINT16,
2064 BASE_DEC,
2065 NULL,
2067 NULL, HFILL
2071 &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tid,
2073 "Tid",
2074 "rtp.ext.ed137c.ft.climax_ddc.mam_tid",
2075 FT_UINT16,
2076 BASE_DEC,
2077 NULL,
2079 NULL, HFILL
2083 &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_ts2,
2085 "Ts2",
2086 "rtp.ext.ed137c.ft.climax_ddc.mam_ts2",
2087 FT_UINT16,
2088 BASE_DEC,
2089 NULL,
2091 NULL, HFILL
2095 &hf_rtp_hdr_ed137_ft_climax_ddc_rmm_no_resp,
2097 "No response seen",
2098 "rtp.ext.ed137.ft.climax_ddc.rmm.no_resp",
2099 FT_NONE,
2100 BASE_NONE,
2101 NULL,
2102 0x0,
2103 "No corresponding response frame was seen", HFILL
2107 &hf_rtp_hdr_ed137_ft_climax_ddc_rmm_response_in,
2109 "Response in frame",
2110 "rtp.ext.ed137.ft.climax_ddc.rmm.response_in",
2111 FT_FRAMENUM,
2112 BASE_NONE,
2113 FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE),
2115 "This packet will be responded in the packet with this number", HFILL
2119 &hf_rtp_hdr_ed137_ft_climax_ddc_mam_request_in,
2121 "Request in frame",
2122 "rtp.ext.ed137.ft.climax_ddc.mam.request_in",
2123 FT_FRAMENUM,
2124 BASE_NONE,
2125 FRAMENUM_TYPE(FT_FRAMENUM_REQUEST),
2127 "This packet is a response to the packet with this number", HFILL
2131 &hf_rtp_hdr_ed137_ft_climax_ddc_mam_time,
2133 "Response time",
2134 "rtp.ext.ed137.ft.climax_ddc.rmm.resptime",
2135 FT_DOUBLE,
2136 BASE_NONE,
2137 NULL,
2138 0x0,
2139 "The time between the request and the response, in ms.", HFILL
2144 static int *ett[] =
2146 &ett_hdr_ext_ed137s,
2147 &ett_hdr_ext_ed137,
2148 &ett_hdr_ext_ed137_add,
2149 &ett_hdr_ext_ed137a,
2150 &ett_hdr_ext_ed137a_add,
2153 static ei_register_info ei[] =
2155 { &ei_rtp_hdr_ed137_ft_climax_ddc_rmm_resp_not_found, { "rtp.ext.ed137a.resp_not_found", PI_SEQUENCE, PI_WARN, "Response not found", EXPFILL }},
2156 { &ei_rtp_hdr_ed137_ft_sqi_rssi_out_of_range, { "rtp.ext.ed137a.sqi.out_of_range", PI_MALFORMED, PI_ERROR, "Index out of range", EXPFILL }},
2159 expert_module_t* expert_rtp_ed137;
2161 proto_rtp_ed137 = proto_register_protocol("Real-Time Transport Protocol ED137 Extensions", "RTP-ED137", "rtp.ext.ed137");
2162 proto_register_field_array(proto_rtp_ed137, hf, array_length(hf));
2163 expert_rtp_ed137 = expert_register_protocol(proto_rtp_ed137);
2164 expert_register_field_array(expert_rtp_ed137, ei, array_length(ei));
2165 proto_register_subtree_array(ett, array_length(ett));
2167 rtp_hdr_ext_ed137_handle = register_dissector("rtp.ext.ed137", dissect_rtp_hdr_ext_ed137, proto_rtp_ed137);
2168 rtp_hdr_ext_ed137a_handle = register_dissector("rtp.ext.ed137a", dissect_rtp_hdr_ext_ed137a, proto_rtp_ed137);
2170 /* Table for ED-137A additional feature dissectors */
2171 rtp_hdr_ext_ed137a_add_features_table = register_dissector_table("rtp.hdr_ext.ed137a",
2172 "RTP header ED137A additional features", proto_rtp_ed137, FT_UINT8, BASE_HEX);
2174 /* Register dissectors for tested additional headers */
2175 /* ED-137A signal quality information */
2176 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);
2177 dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137A_feature_sqi_key, rtp_hdr_ext_ed137a_feature_sqi_handle);
2179 /* ED-137A CLIMAX time delay */
2180 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);
2181 dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137A_feature_climax_tdly_key, rtp_hdr_ext_ed137a_feature_climax_tdly_handle);
2183 /* ED-137B RRC for single frequency */
2184 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);
2185 dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137B_feature_rrc_single_key, rtp_hdr_ext_ed137b_feature_rrc_single_handle);
2187 /* ED-137B CLIMAX request for measurement message (RMM) */
2188 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);
2189 dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137B_feature_climax_ddc_rmm_key, rtp_hdr_ext_ed137b_feature_climax_ddc_rmm_handle);
2191 /* ED-137B CLIMAX response message (MAM) */
2192 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);
2193 dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137B_feature_climax_ddc_mam_key, rtp_hdr_ext_ed137b_feature_climax_ddc_mam_handle);
2195 /* ED-137C CLIMAX response message (MAM) */
2196 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);
2197 dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137C_feature_climax_ddc_mam_key, rtp_hdr_ext_ed137c_feature_climax_ddc_mam_handle);
2200 void
2201 proto_reg_handoff_rtp_ed137(void)
2203 static bool prefs_initialized = false;
2205 if (!prefs_initialized) {
2207 dissector_add_uint("rtp.hdr_ext", RTP_ED137_SIG, rtp_hdr_ext_ed137_handle);
2208 dissector_add_uint("rtp.hdr_ext", RTP_ED137A_SIG, rtp_hdr_ext_ed137a_handle);
2210 prefs_initialized = true;
2215 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2217 * Local variables:
2218 * c-basic-offset: 4
2219 * tab-width: 8
2220 * indent-tabs-mode: nil
2221 * End:
2223 * vi: set shiftwidth=4 tabstop=8 expandtab:
2224 * :indentSize=4:tabSize=8:noTabs=true: