3 * Routines for SPRT dissection
4 * SPRT = Simple Packet Relay Transport
6 * Written by Jamison Adcock <jamison.adcock@cobham.com>
7 * for Sparta Inc., dba Cobham Analytic Solutions
8 * This code is largely based on the RTP parsing code
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * SPDX-License-Identifier: GPL-2.0-or-later
18 * - work on conversations
24 #include <epan/packet.h>
25 #include <epan/prefs.h>
26 #include <epan/conversation.h>
27 #include <epan/expert.h>
29 #include <wsutil/array.h>
30 #include "packet-sprt.h"
32 void proto_register_sprt(void);
33 void proto_reg_handoff_sprt(void);
35 /* for some "range_string"s, there's only one value in the range */
36 #define SPRT_VALUE_RANGE(a) a,a
38 /* TODO - conversation states */
39 #define SPRT_STATE_XXX_TODO 0
41 #define SPRT_CONV_MAX_SETUP_METHOD_SIZE 12
43 /* is DLCI field present in I_OCTET message? See "DLCI enabled" in CONNECT message */
48 } i_octet_dlci_status_t
;
51 /* Keep conversation info for one side of an SPRT conversation
52 * TODO - this needs to be bidirectional
54 struct _sprt_conversation_info
56 char method
[SPRT_CONV_MAX_SETUP_METHOD_SIZE
+ 1];
58 uint32_t frame_number
; /* the frame where this conversation is started */
60 /* sequence numbers for each channel: */
63 /* are we using the DLCI field in I_OCTET messages? See CONNECT message ("DLCI enabled") */
64 i_octet_dlci_status_t i_octet_dlci_status
;
65 uint32_t connect_frame_number
; /* the CONNECT frame that tells us if the DLCI is enabled */
67 /* TODO - maintain state */
71 /* SPRT Message IDs: */
72 #define SPRT_MODEM_RELAY_MSG_ID_NULL 0
73 #define SPRT_MODEM_RELAY_MSG_ID_INIT 1
74 #define SPRT_MODEM_RELAY_MSG_ID_XID_XCHG 2
75 #define SPRT_MODEM_RELAY_MSG_ID_JM_INFO 3
76 #define SPRT_MODEM_RELAY_MSG_ID_START_JM 4
77 #define SPRT_MODEM_RELAY_MSG_ID_CONNECT 5
78 #define SPRT_MODEM_RELAY_MSG_ID_BREAK 6
79 #define SPRT_MODEM_RELAY_MSG_ID_BREAK_ACK 7
80 #define SPRT_MODEM_RELAY_MSG_ID_MR_EVENT 8
81 #define SPRT_MODEM_RELAY_MSG_ID_CLEARDOWN 9
82 #define SPRT_MODEM_RELAY_MSG_ID_PROF_XCHG 10
84 #define SPRT_MODEM_RELAY_MSG_ID_RESERVED1_START 11
85 #define SPRT_MODEM_RELAY_MSG_ID_RESERVED1_END 15
87 #define SPRT_MODEM_RELAY_MSG_ID_I_RAW_OCTET 16
88 #define SPRT_MODEM_RELAY_MSG_ID_I_RAW_BIT 17
89 #define SPRT_MODEM_RELAY_MSG_ID_I_OCTET 18
90 #define SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT 19
91 #define SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN 20
92 #define SPRT_MODEM_RELAY_MSG_ID_I_FRAME 21
93 #define SPRT_MODEM_RELAY_MSG_ID_I_OCTET_CS 22
94 #define SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT_CS 23
95 #define SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN_CS 24
96 /* 25 - 99 Reserved */
97 #define SPRT_MODEM_RELAY_MSG_ID_RESERVED2_START 25
98 #define SPRT_MODEM_RELAY_MSG_ID_RESERVED2_END 99
99 /* 100 - 127 Vendor-specific */
100 #define SPRT_MODEM_RELAY_MSG_ID_VENDOR_START 100
101 #define SPRT_MODEM_RELAY_MSG_ID_VENDOR_END 127
104 /* error correcting protocol in XID_XCHG message: */
105 #define SPRT_ECP_NO_LINK_LAYER_PROTO 0
106 #define SPRT_ECP_V42_LAPM 1
107 #define SPRT_ECP_ANNEX_AV42_1996 2
108 /* 3 - 25 Reserved for ITU-T */
109 #define SPRT_ECP_RESERVED_START 3
110 #define SPRT_ECP_RESERVED_END 25
113 /* category ID used in JM_INFO message: */
114 #define SPRT_JM_INFO_CAT_ID_CALL_FUNCT 0x8
115 #define SPRT_JM_INFO_CAT_ID_MOD_MODES 0xA
116 #define SPRT_JM_INFO_CAT_ID_PROTOCOLS 0x5
117 #define SPRT_JM_INFO_CAT_ID_PSTN_ACCESS 0xB
118 #define SPRT_JM_INFO_CAT_ID_PCM_MODEM_AVAIL 0xE
119 #define SPRT_JM_INFO_CAT_ID_CATEGORY_EXTENSION 0x0
122 #define SPRT_JMINFO_TBC_CALL_FUNCT_PSTN_MULTIMEDIA_TERM 0x4
123 #define SPRT_JMINFO_TBC_CALL_FUNCT_TEXTPHONE_ITU_T_REC_V18 0x2
124 #define SPRT_JMINFO_TBC_CALL_FUNCT_VIDEOTEXT_ITU_T_REC_T101 0x6
125 #define SPRT_JMINFO_TBC_CALL_FUNCT_TRANS_FAX_ITU_T_REC_T30 0x1
126 #define SPRT_JMINFO_TBC_CALL_FUNCT_RECV_FAX_ITU_T_REC_T30 0x5
127 #define SPRT_JMINFO_TBC_CALL_FUNCT_DATA_V_SERIES_MODEM_REC 0x3
130 #define SPRT_JMINFO_TBC_PROTOCOL_LAPM_ITU_T_REC_V42 0x4
133 /* selected modulations in CONNECT message: */
134 #define SPRT_SELMOD_NULL 0
135 #define SPRT_SELMOD_V92 1
136 #define SPRT_SELMOD_V91 2
137 #define SPRT_SELMOD_V90 3
138 #define SPRT_SELMOD_V34 4
139 #define SPRT_SELMOD_V32_BIS 5
140 #define SPRT_SELMOD_V32 6
141 #define SPRT_SELMOD_V22_BIS 7
142 #define SPRT_SELMOD_V22 8
143 #define SPRT_SELMOD_V17 9
144 #define SPRT_SELMOD_V29 10
145 #define SPRT_SELMOD_V27_TER 11
146 #define SPRT_SELMOD_V26_TER 12
147 #define SPRT_SELMOD_V26_BIS 13
148 #define SPRT_SELMOD_V23 14
149 #define SPRT_SELMOD_V21 15
150 #define SPRT_SELMOD_BELL_212 16
151 #define SPRT_SELMOD_BELL_103 17
152 /* 18 - 30 Vendor-specific modulations */
153 #define SPRT_SELMOD_VENDOR_START 18
154 #define SPRT_SELMOD_VENDOR_END 30
155 /* 31 - 63 Reserved for ITU-T */
156 #define SPRT_SELMOD_RESERVED_START 31
157 #define SPRT_SELMOD_RESERVED_END 63
160 /* Compression direction in CONNECT message: */
161 #define SPRT_COMPR_DIR_NO_COMPRESSION 0
162 #define SPRT_COMPR_DIR_TRANSMIT 1
163 #define SPRT_COMPR_DIR_RECEIVE 2
164 #define SPRT_COMPR_DIR_BIDIRECTIONAL 3
167 /* Selected compression modes in CONNECT message: */
168 #define SPRT_SELECTED_COMPR_NONE 0
169 #define SPRT_SELECTED_COMPR_V42_BIS 1
170 #define SPRT_SELECTED_COMPR_V44 2
171 #define SPRT_SELECTED_COMPR_MNP5 3
172 /* 4 - 15 Reserved by ITU-T */
173 #define SPRT_SELECTED_COMPR_RESERVED_START 4
174 #define SPRT_SELECTED_COMPR_RESERVED_END 15
177 /* Selected error correction modes in CONNECT message: */
178 #define SPRT_SELECTED_ERR_CORR_V14_OR_NONE 0
179 #define SPRT_SELECTED_ERR_CORR_V42_LAPM 1
180 #define SPRT_SELECTED_ERR_CORR_ANNEX_AV42 2
181 /* 3 - 15 Reserved for ITU-T */
182 #define SPRT_SELECTED_ERR_CORR_RESERVED_START 3
183 #define SPRT_SELECTED_ERR_CORR_RESERVED_END 15
186 /* Break source protocol in BREAK message: */
187 #define SPRT_BREAK_SRC_PROTO_V42_LAPM 0
188 #define SPRT_BREAK_SRC_PROTO_ANNEX_AV42_1996 1
189 #define SPRT_BREAK_SRC_PROTO_V14 2
190 /* 3 - 15 Reserved for ITU-T */
191 #define SPRT_BREAK_SRC_PROTO_RESERVED_START 3
192 #define SPRT_BREAK_SRC_PROTO_RESERVED_END 15
195 #define SPRT_BREAK_TYPE_NOT_APPLICABLE 0
196 #define SPRT_BREAK_TYPE_DESTRUCTIVE_AND_EXPEDITED 1
197 #define SPRT_BREAK_TYPE_NONDESTRUCTIVE_AND_EXPEDITED 2
198 #define SPRT_BREAK_TYPE_NONDESTRUCTIVE_AND_NONEXPEDITED 3
199 /* 4 - 15 Reserved for ITU-T */
200 #define SPRT_BREAK_TYPE_RESERVED_START 4
201 #define SPRT_BREAK_TYPE_RESERVED_END 15
204 /* Modem relay info in MR_EVENT messages: */
205 #define SPRT_MREVT_EVENT_ID_NULL 0
206 #define SPRT_MREVT_EVENT_ID_RATE_RENEGOTIATION 1
207 #define SPRT_MREVT_EVENT_ID_RETRAIN 2
208 #define SPRT_MREVT_EVENT_ID_PHYSUP 3
209 /* 4 - 255 Reserved for ITU-T */
210 #define SPRT_MREVT_EVENT_ID_RESERVED_START 4
211 #define SPRT_MREVT_EVENT_ID_RESERVED_END 255
214 #define SPRT_MREVT_REASON_CODE_NULL 0
215 #define SPRT_MREVT_REASON_CODE_INIT 1
216 #define SPRT_MREVT_REASON_CODE_RESPONDING 2
217 /* 3 - 255 Undefined */
218 #define SPRT_MREVT_REASON_CODE_RESERVED_START 3
219 #define SPRT_MREVT_REASON_CODE_RESERVED_END 255
222 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_NULL 0
223 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_600 1
224 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_1200 2
225 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_1600 3
226 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_2400 4
227 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_2743 5
228 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3000 6
229 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3200 7
230 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3429 8
231 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_8000 9
232 /* 10 - 254 Reserved for ITU-T */
233 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_RESERVED_START 10
234 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_RESERVED_END 254
235 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_UNSPECIFIED 255
238 /* Cleardown reason codes: */
239 #define SPRT_CLEARDOWN_RIC_UNKNOWN 0
240 #define SPRT_CLEARDOWN_RIC_PHYSICAL_LAYER_RELEASE 1
241 #define SPRT_CLEARDOWN_RIC_LINK_LAYER_DISCONNECT 2
242 #define SPRT_CLEARDOWN_RIC_DATA_COMPRESSION_DISCONNECT 3
243 #define SPRT_CLEARDOWN_RIC_ABORT 4
244 #define SPRT_CLEARDOWN_RIC_ON_HOOK 5
245 #define SPRT_CLEARDOWN_RIC_NETWORK_LAYER_TERMINATION 6
246 #define SPRT_CLEARDOWN_RIC_ADMINISTRATIVE 7
249 /* PROF_XCHG messages (XID profile exchange for MR1): */
250 #define SPRT_PROF_XCHG_SUPPORT_NO 0
251 #define SPRT_PROF_XCHG_SUPPORT_YES 1
252 #define SPRT_PROF_XCHG_SUPPORT_UNKNOWN 2
255 /* DLCI field in I_OCTET: */
256 #define SPRT_PAYLOAD_DLCI1_DTE2DTE 0
257 #define SPRT_PAYLOAD_DLCI1_RESERVED_START 1
258 #define SPRT_PAYLOAD_DLCI1_RESERVED_END 31
259 #define SPRT_PAYLOAD_DLCI1_NOT_RESERVED_START 32
260 #define SPRT_PAYLOAD_DLCI1_NOT_RESERVED_END 62
261 #define SPRT_PAYLOAD_DLCI1_CTRLFN2CTRLFN 63
263 #define SPRT_PAYLOAD_DLCI2_START 0
264 #define SPRT_PAYLOAD_DLCI2_END 127
266 /* Payload fields for I_CHAR_STAT_CS, etc.: */
268 #define SPRT_PAYLOAD_D_0 0
269 #define SPRT_PAYLOAD_D_1 1
270 #define SPRT_PAYLOAD_D_2 2
271 #define SPRT_PAYLOAD_D_3 3
275 #define SPRT_PAYLOAD_P_0 0
276 #define SPRT_PAYLOAD_P_1 1
277 #define SPRT_PAYLOAD_P_2 2
278 #define SPRT_PAYLOAD_P_3 3
279 #define SPRT_PAYLOAD_P_4 4
280 #define SPRT_PAYLOAD_P_5 5
281 #define SPRT_PAYLOAD_P_6 6
282 #define SPRT_PAYLOAD_P_7 7
286 #define SPRT_PAYLOAD_S_0 0
287 #define SPRT_PAYLOAD_S_1 1
288 #define SPRT_PAYLOAD_S_2 2
289 #define SPRT_PAYLOAD_S_3 3
292 /* data frame state */
293 #define SPRT_PAYLOAD_FR_0 0
294 #define SPRT_PAYLOAD_FR_1 1
295 #define SPRT_PAYLOAD_FR_2 2
296 #define SPRT_PAYLOAD_FR_3 3
299 /* Initialize the protocol & registered fields */
300 static int proto_sprt
;
302 static int hf_sprt_setup
;
303 static int hf_sprt_setup_frame
;
304 static int hf_sprt_setup_method
;
306 static int hf_sprt_header_extension_bit
;
307 static int hf_sprt_subsession_id
;
308 static int hf_sprt_reserved_bit
;
309 static int hf_sprt_payload_type
;
310 static int hf_sprt_transport_channel_id
;
311 static int hf_sprt_sequence_number
;
312 static int hf_sprt_number_of_ack_fields
;
313 static int hf_sprt_base_sequence_number
;
314 static int hf_sprt_ack_field_items
;
315 static int hf_sprt_transport_channel_item
;
316 static int hf_sprt_sequence_item
;
318 static int hf_sprt_payload_length
;
319 static int hf_sprt_payload_no_data
;
320 static int hf_sprt_payload_reserved_bit
;
321 static int hf_sprt_payload_message_id
;
323 static int hf_sprt_payload_data
; /* stuff after msgid */
325 static int hf_sprt_payload_msg_init_all_fields
;
326 static int hf_sprt_payload_msg_init_necrxch
;
327 static int hf_sprt_payload_msg_init_ecrxch
;
328 static int hf_sprt_payload_msg_init_xid_prof_exch
;
329 static int hf_sprt_payload_msg_init_asymm_data_types
;
330 static int hf_sprt_payload_msg_init_opt_moip_types_i_raw_bit
;
331 static int hf_sprt_payload_msg_init_opt_moip_types_i_frame
;
332 static int hf_sprt_payload_msg_init_opt_moip_types_i_char_stat
;
333 static int hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn
;
334 static int hf_sprt_payload_msg_init_opt_moip_types_i_octet_cs
;
335 static int hf_sprt_payload_msg_init_opt_moip_types_i_char_stat_cs
;
336 static int hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn_cs
;
337 static int hf_sprt_payload_msg_init_opt_moip_types_reserved
;
338 /* XID_XCHG message: */
339 static int hf_sprt_payload_msg_xidxchg_ecp
;
340 static int hf_sprt_payload_msg_xidxchg_xidlr1_v42bis
;
341 static int hf_sprt_payload_msg_xidxchg_xidlr1_v44
;
342 static int hf_sprt_payload_msg_xidxchg_xidlr1_mnp5
;
343 static int hf_sprt_payload_msg_xidxchg_xidlr1_reserved
;
344 static int hf_sprt_payload_msg_xidxchg_xidlr2_v42bis_compr_req
;
345 static int hf_sprt_payload_msg_xidxchg_xidlr3and4_v42bis_num_codewords
;
346 static int hf_sprt_payload_msg_xidxchg_xidlr5_v42bis_max_strlen
;
347 static int hf_sprt_payload_msg_xidxchg_xidlr6_v44_capability
;
348 static int hf_sprt_payload_msg_xidxchg_xidlr7_v44_compr_req
;
349 static int hf_sprt_payload_msg_xidxchg_xidlr8and9_v44_num_codewords_trans
;
350 static int hf_sprt_payload_msg_xidxchg_xidlr10and11_v44_num_codewords_recv
;
351 static int hf_sprt_payload_msg_xidxchg_xidlr12_v44_max_strlen_trans
;
352 static int hf_sprt_payload_msg_xidxchg_xidlr13_v44_max_strlen_recv
;
353 static int hf_sprt_payload_msg_xidxchg_xidlr14and15_v44_history_len_trans
;
354 static int hf_sprt_payload_msg_xidxchg_xidlr16and17_v44_history_len_recv
;
355 /* V.8 JM_INFO msg: */
356 static int hf_sprt_payload_msg_jminfo_category_data
;
357 static int hf_sprt_payload_msg_jminfo_category_id
;
358 static int hf_sprt_payload_msg_jminfo_category_ext_info
;
359 static int hf_sprt_payload_msg_jminfo_unk_category_info
;
360 static int hf_sprt_payload_msg_jminfo_category_leftover_bits
;
361 static int hf_sprt_payload_msg_jminfo_call_function
;
362 static int hf_sprt_payload_msg_jminfo_mod_v34_duplex
;
363 static int hf_sprt_payload_msg_jminfo_mod_v34_half_duplex
;
364 static int hf_sprt_payload_msg_jminfo_mod_v32bis_v32
;
365 static int hf_sprt_payload_msg_jminfo_mod_v22bis_v22
;
366 static int hf_sprt_payload_msg_jminfo_mod_v17
;
367 static int hf_sprt_payload_msg_jminfo_mod_v29_half_duplex
;
368 static int hf_sprt_payload_msg_jminfo_mod_v27ter
;
369 static int hf_sprt_payload_msg_jminfo_mod_v26ter
;
370 static int hf_sprt_payload_msg_jminfo_mod_v26bis
;
371 static int hf_sprt_payload_msg_jminfo_mod_v23_duplex
;
372 static int hf_sprt_payload_msg_jminfo_mod_v23_half_duplex
;
373 static int hf_sprt_payload_msg_jminfo_mod_v21
;
374 static int hf_sprt_payload_msg_jminfo_protocols
;
375 static int hf_sprt_payload_msg_jminfo_pstn_access_call_dce_cell
;
376 static int hf_sprt_payload_msg_jminfo_pstn_access_answ_dce_cell
;
377 static int hf_sprt_payload_msg_jminfo_pstn_access_dce_on_digital_net
;
378 static int hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_analog
;
379 static int hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_digital
;
380 static int hf_sprt_payload_msg_jminfo_pcm_modem_avail_v91
;
382 static int hf_sprt_payload_msg_connect_selmod
;
383 static int hf_sprt_payload_msg_connect_compr_dir
;
384 static int hf_sprt_payload_msg_connect_selected_compr
;
385 static int hf_sprt_payload_msg_connect_selected_err_corr
;
386 static int hf_sprt_payload_msg_connect_tdsr
;
387 static int hf_sprt_payload_msg_connect_rdsr
;
388 static int hf_sprt_payload_msg_connect_dlci_enabled
;
389 static int hf_sprt_payload_msg_connect_avail_data_types
;
390 static int hf_sprt_payload_msg_connect_adt_octet_no_format_no_dlci
;
391 static int hf_sprt_payload_msg_connect_adt_i_raw_bit
;
392 static int hf_sprt_payload_msg_connect_adt_i_frame
;
393 static int hf_sprt_payload_msg_connect_adt_i_char_stat
;
394 static int hf_sprt_payload_msg_connect_adt_i_char_dyn
;
395 static int hf_sprt_payload_msg_connect_adt_i_octet_cs
;
396 static int hf_sprt_payload_msg_connect_adt_i_char_stat_cs
;
397 static int hf_sprt_payload_msg_connect_adt_i_char_dyn_cs
;
398 static int hf_sprt_payload_msg_connect_adt_reserved
;
399 static int hf_sprt_payload_msg_connect_compr_trans_dict_sz
;
400 static int hf_sprt_payload_msg_connect_compr_recv_dict_sz
;
401 static int hf_sprt_payload_msg_connect_compr_trans_str_len
;
402 static int hf_sprt_payload_msg_connect_compr_recv_str_len
;
403 static int hf_sprt_payload_msg_connect_compr_trans_hist_sz
;
404 static int hf_sprt_payload_msg_connect_compr_recv_hist_sz
;
406 static int hf_sprt_payload_msg_break_source_proto
;
407 static int hf_sprt_payload_msg_break_type
;
408 static int hf_sprt_payload_msg_break_length
;
410 static int hf_sprt_payload_msg_mr_event_id
;
411 static int hf_sprt_payload_msg_mr_evt_reason_code
;
412 static int hf_sprt_payload_msg_mr_evt_selmod
;
413 static int hf_sprt_payload_msg_mr_evt_txsen
;
414 static int hf_sprt_payload_msg_mr_evt_rxsen
;
415 static int hf_sprt_payload_msg_mr_evt_tdsr
;
416 static int hf_sprt_payload_msg_mr_evt_rdsr
;
417 static int hf_sprt_payload_msg_mr_evt_txsr
;
418 static int hf_sprt_payload_msg_mr_evt_rxsr
;
420 static int hf_sprt_payload_msg_cleardown_reason_code
;
421 static int hf_sprt_payload_msg_cleardown_vendor_tag
;
422 static int hf_sprt_payload_msg_cleardown_vendor_info
;
424 static int hf_sprt_payload_msg_profxchg_v42_lapm
;
425 static int hf_sprt_payload_msg_profxchg_annex_av42
;
426 static int hf_sprt_payload_msg_profxchg_v44_compr
;
427 static int hf_sprt_payload_msg_profxchg_v42bis_compr
;
428 static int hf_sprt_payload_msg_profxchg_mnp5_compr
;
429 static int hf_sprt_payload_msg_profxchg_reserved
;
430 static int hf_sprt_payload_msg_profxchg_xidlr2_v42bis_compr_req
;
431 static int hf_sprt_payload_msg_profxchg_xidlr3and4_v42bis_num_codewords
;
432 static int hf_sprt_payload_msg_profxchg_xidlr5_v42bis_max_strlen
;
433 static int hf_sprt_payload_msg_profxchg_xidlr6_v44_capability
;
434 static int hf_sprt_payload_msg_profxchg_xidlr7_v44_compr_req
;
435 static int hf_sprt_payload_msg_profxchg_xidlr8and9_v44_num_codewords_trans
;
436 static int hf_sprt_payload_msg_profxchg_xidlr10and11_v44_num_codewords_recv
;
437 static int hf_sprt_payload_msg_profxchg_xidlr12_v44_max_strlen_trans
;
438 static int hf_sprt_payload_msg_profxchg_xidlr13_v44_max_strlen_recv
;
439 static int hf_sprt_payload_msg_profxchg_xidlr14and15_v44_history_len_trans
;
440 static int hf_sprt_payload_msg_profxchg_xidlr16and17_v44_history_len_recv
;
442 static int hf_sprt_payload_i_octet_no_dlci
;
443 static int hf_sprt_payload_i_octet_dlci_presence_unknown
;
444 static int hf_sprt_payload_i_octet_dlci1
;
445 static int hf_sprt_payload_i_octet_cr
;
446 static int hf_sprt_payload_i_octet_ea
;
447 static int hf_sprt_payload_i_octet_dlci2
;
448 static int hf_sprt_payload_i_octet_dlci_setup_by_connect_frame
;
450 /* I_OCTET_CS, I_CHAR_STAT_CS, I_CHAR_DYN_CS msgs: */
451 static int hf_sprt_payload_data_cs
;
452 static int hf_sprt_payload_data_reserved_bit
;
453 static int hf_sprt_payload_data_num_data_bits
;
454 static int hf_sprt_payload_data_parity_type
;
455 static int hf_sprt_payload_num_stop_bits
;
456 static int hf_sprt_payload_frame_reserved_bits
;
457 static int hf_sprt_payload_frame_state
;
458 static int hf_sprt_payload_rawoctet_n_field_present
;
459 static int hf_sprt_payload_rawoctet_l
;
460 static int hf_sprt_payload_rawoctet_n
;
461 static int hf_sprt_payload_rawbit_included_fields_l
;
462 static int hf_sprt_payload_rawbit_included_fields_lp
;
463 static int hf_sprt_payload_rawbit_included_fields_lpn
;
464 static int hf_sprt_payload_rawbit_len_a
;
465 static int hf_sprt_payload_rawbit_len_b
;
466 static int hf_sprt_payload_rawbit_len_c
;
467 static int hf_sprt_payload_rawbit_p
;
468 static int hf_sprt_payload_rawbit_n
;
471 static bool global_sprt_show_setup_info
= true; /* show how this SPRT stream got started */
472 static bool global_sprt_show_dlci_info
= true; /* show DLCI in I_OCTET messages, including setup frame (if we can) */
475 /* dissector handle */
476 static dissector_handle_t sprt_handle
;
479 /* initialize the subtree pointers */
481 static int ett_sprt_setup
;
482 static int ett_sprt_ack_fields
;
483 static int ett_payload
;
484 static int ett_init_msg_all_fields
;
485 static int ett_jminfo_msg_cat_data
;
486 static int ett_connect_msg_adt
;
488 static expert_field ei_sprt_sequence_number_0
;
490 /* value strings & range strings */
491 static const value_string sprt_transport_channel_characteristics
[] = {
492 { 0, "Unreliable, unsequenced" },
493 { 1, "Reliable, sequenced" },
494 { 2, "Expedited, reliable, sequenced" },
495 { 3, "Unreliable, sequenced" },
499 static const range_string sprt_modem_relay_msg_id_name
[] = {
500 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_NULL
), "NULL reserved for ITU-T" },
501 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_INIT
), "INIT" },
502 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_XID_XCHG
), "XID_XCHG" },
503 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_JM_INFO
), "JM_INFO" },
504 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_START_JM
), "START_JM" },
505 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_CONNECT
), "CONNECT" },
506 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_BREAK
), "BREAK" },
507 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_BREAK_ACK
), "BREAK_ACK" },
508 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_MR_EVENT
), "MR_EVENT" },
509 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_CLEARDOWN
), "CLEARDOWN" },
510 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_PROF_XCHG
), "PROF_XCHG" },
511 { SPRT_MODEM_RELAY_MSG_ID_RESERVED1_START
, SPRT_MODEM_RELAY_MSG_ID_RESERVED1_END
, "Reserved for ITU-T" },
512 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_RAW_OCTET
), "I_RAW-OCTET" },
513 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_RAW_BIT
), "I_RAW-BIT" },
514 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_OCTET
), "I_OCTET" },
515 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT
), "I_CHAR-STAT" },
516 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN
), "I_CHAR-DYN" },
517 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_FRAME
), "I_FRAME" },
518 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_OCTET_CS
), "I_OCTET-CS" },
519 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT_CS
), "I_CHAR-STAT-CS" },
520 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN_CS
), "I_CHAR-DYN-CS" },
521 { SPRT_MODEM_RELAY_MSG_ID_RESERVED2_START
, SPRT_MODEM_RELAY_MSG_ID_RESERVED2_END
, "Reserved for ITU-T" },
522 { SPRT_MODEM_RELAY_MSG_ID_VENDOR_START
, SPRT_MODEM_RELAY_MSG_ID_VENDOR_END
, "Vendor-specific message" },
526 static const range_string sprt_ecp_name
[] = {
527 { SPRT_VALUE_RANGE(SPRT_ECP_NO_LINK_LAYER_PROTO
), "No link layer protocol" },
528 { SPRT_VALUE_RANGE(SPRT_ECP_V42_LAPM
), "V.42/LAPM" },
529 { SPRT_VALUE_RANGE(SPRT_ECP_ANNEX_AV42_1996
), "Annex A/V.42(1996)" },
530 { SPRT_ECP_RESERVED_START
, SPRT_ECP_RESERVED_END
, "Reserved for ITU-T" },
534 static const value_string sprt_jm_info_cat_id_name
[] = {
535 { SPRT_JM_INFO_CAT_ID_CALL_FUNCT
, "Call function" },
536 { SPRT_JM_INFO_CAT_ID_MOD_MODES
, "Modulation modes" },
537 { SPRT_JM_INFO_CAT_ID_PROTOCOLS
, "Protocols" },
538 { SPRT_JM_INFO_CAT_ID_PSTN_ACCESS
, "PSTN access" },
539 { SPRT_JM_INFO_CAT_ID_PCM_MODEM_AVAIL
, "PCM modem availability" },
540 { SPRT_JM_INFO_CAT_ID_CATEGORY_EXTENSION
, "Extension of current category" },
544 static const value_string sprt_jminfo_tbc_call_funct_name
[] = {
545 { SPRT_JMINFO_TBC_CALL_FUNCT_PSTN_MULTIMEDIA_TERM
, "PSTN Multimedia terminal (ITU-T Rec. H.324)" },
546 { SPRT_JMINFO_TBC_CALL_FUNCT_TEXTPHONE_ITU_T_REC_V18
, "Textphone (ITU-T Rec. V.18)" },
547 { SPRT_JMINFO_TBC_CALL_FUNCT_VIDEOTEXT_ITU_T_REC_T101
, "Videotext (ITU-T Rec. T.101)" },
548 { SPRT_JMINFO_TBC_CALL_FUNCT_TRANS_FAX_ITU_T_REC_T30
, "Transmit facsimile from call terminal (ITU-T Rec. T.30)" },
549 { SPRT_JMINFO_TBC_CALL_FUNCT_RECV_FAX_ITU_T_REC_T30
, "Receive facsimile at call terminal (ITU-T Rec. T.30)" },
550 { SPRT_JMINFO_TBC_CALL_FUNCT_DATA_V_SERIES_MODEM_REC
, "Data (V-series modem Recommendations)" },
554 static const range_string sprt_jminfo_tbc_protocol_name
[] = {
555 { SPRT_VALUE_RANGE(SPRT_JMINFO_TBC_PROTOCOL_LAPM_ITU_T_REC_V42
), "LAPM protocol according to ITU-T Rec. V.42" },
559 static const range_string sprt_selmod_name
[] = {
560 { SPRT_VALUE_RANGE(SPRT_SELMOD_NULL
), "NULL" },
561 { SPRT_VALUE_RANGE(SPRT_SELMOD_V92
), "V.92" },
562 { SPRT_VALUE_RANGE(SPRT_SELMOD_V91
), "V.91" },
563 { SPRT_VALUE_RANGE(SPRT_SELMOD_V90
), "V.90" },
564 { SPRT_VALUE_RANGE(SPRT_SELMOD_V34
), "V.34" },
565 { SPRT_VALUE_RANGE(SPRT_SELMOD_V32_BIS
), "V.32bis" },
566 { SPRT_VALUE_RANGE(SPRT_SELMOD_V32
), "V.32" },
567 { SPRT_VALUE_RANGE(SPRT_SELMOD_V22_BIS
), "V.22bis" },
568 { SPRT_VALUE_RANGE(SPRT_SELMOD_V22
), "V.22" },
569 { SPRT_VALUE_RANGE(SPRT_SELMOD_V17
), "V.17" },
570 { SPRT_VALUE_RANGE(SPRT_SELMOD_V29
), "V.29" },
571 { SPRT_VALUE_RANGE(SPRT_SELMOD_V27_TER
), "V.27ter" },
572 { SPRT_VALUE_RANGE(SPRT_SELMOD_V26_TER
), "V.26ter" },
573 { SPRT_VALUE_RANGE(SPRT_SELMOD_V26_BIS
), "V.26bis" },
574 { SPRT_VALUE_RANGE(SPRT_SELMOD_V23
), "V.23" },
575 { SPRT_VALUE_RANGE(SPRT_SELMOD_V21
), "V.21" },
576 { SPRT_VALUE_RANGE(SPRT_SELMOD_BELL_212
), "Bell 212" },
577 { SPRT_VALUE_RANGE(SPRT_SELMOD_BELL_103
), "Bell 103" },
578 { SPRT_SELMOD_VENDOR_START
, SPRT_SELMOD_VENDOR_END
, "Vendor-specific modulation" },
579 { SPRT_SELMOD_RESERVED_START
, SPRT_SELMOD_RESERVED_END
, "Reserved for ITU-T" },
583 static const value_string sprt_comp_direction
[] = {
584 { SPRT_COMPR_DIR_NO_COMPRESSION
, "None" },
585 { SPRT_COMPR_DIR_TRANSMIT
, "Transmit" },
586 { SPRT_COMPR_DIR_RECEIVE
, "Receive" },
587 { SPRT_COMPR_DIR_BIDIRECTIONAL
, "Bidirectional" },
591 static const range_string sprt_selected_compr_name
[] = {
592 { SPRT_VALUE_RANGE(SPRT_SELECTED_COMPR_NONE
), "None" },
593 { SPRT_VALUE_RANGE(SPRT_SELECTED_COMPR_V42_BIS
), "V.42bis" },
594 { SPRT_VALUE_RANGE(SPRT_SELECTED_COMPR_V44
), "V.44" },
595 { SPRT_VALUE_RANGE(SPRT_SELECTED_COMPR_MNP5
), "MNP5" },
596 { SPRT_SELECTED_COMPR_RESERVED_START
, SPRT_SELECTED_COMPR_RESERVED_END
, "Reserved by ITU-T" },
600 static const range_string sprt_selected_err_corr_name
[] = {
601 { SPRT_VALUE_RANGE(SPRT_SELECTED_ERR_CORR_V14_OR_NONE
), "V.14 or no error correction protocol" },
602 { SPRT_VALUE_RANGE(SPRT_SELECTED_ERR_CORR_V42_LAPM
), "V.42/LAPM" },
603 { SPRT_VALUE_RANGE(SPRT_SELECTED_ERR_CORR_ANNEX_AV42
), "Annex A/V.42" },
604 { SPRT_SELECTED_ERR_CORR_RESERVED_START
, SPRT_SELECTED_ERR_CORR_RESERVED_END
, "Reserved for ITU-T" },
608 static const range_string sprt_break_src_proto_name
[] = {
609 { SPRT_VALUE_RANGE(SPRT_BREAK_SRC_PROTO_V42_LAPM
), "V.42/LAPM" },
610 { SPRT_VALUE_RANGE(SPRT_BREAK_SRC_PROTO_ANNEX_AV42_1996
), "Annex A/V.42(1996)" },
611 { SPRT_VALUE_RANGE(SPRT_BREAK_SRC_PROTO_V14
), "V.14" },
612 { SPRT_BREAK_SRC_PROTO_RESERVED_START
, SPRT_BREAK_SRC_PROTO_RESERVED_END
, "Reserved for ITU-T" },
616 static const range_string sprt_break_type_name
[] = {
617 { SPRT_VALUE_RANGE(SPRT_BREAK_TYPE_NOT_APPLICABLE
), "Not applicable" },
618 { SPRT_VALUE_RANGE(SPRT_BREAK_TYPE_DESTRUCTIVE_AND_EXPEDITED
), "Destructive and expedited" },
619 { SPRT_VALUE_RANGE(SPRT_BREAK_TYPE_NONDESTRUCTIVE_AND_EXPEDITED
), "Non-destructive and expedited" },
620 { SPRT_VALUE_RANGE(SPRT_BREAK_TYPE_NONDESTRUCTIVE_AND_NONEXPEDITED
), "Non-destructive and non-expedited" },
621 { SPRT_BREAK_TYPE_RESERVED_START
, SPRT_BREAK_TYPE_RESERVED_END
, "Reserved for ITU-T" },
625 static const range_string sprt_mrevent_id_name
[] = {
626 { SPRT_VALUE_RANGE(SPRT_MREVT_EVENT_ID_NULL
), "NULL" },
627 { SPRT_VALUE_RANGE(SPRT_MREVT_EVENT_ID_RATE_RENEGOTIATION
), "Rate renegotiation" },
628 { SPRT_VALUE_RANGE(SPRT_MREVT_EVENT_ID_RETRAIN
), "Retrain" },
629 { SPRT_VALUE_RANGE(SPRT_MREVT_EVENT_ID_PHYSUP
), "Physical layer ready" }, /* reason code should be 0 */
630 { SPRT_MREVT_EVENT_ID_RESERVED_START
, SPRT_MREVT_EVENT_ID_RESERVED_END
, "Reserved for ITU-T" },
634 static const range_string sprt_mrevent_reason_code_name
[] = {
635 { SPRT_VALUE_RANGE(SPRT_MREVT_REASON_CODE_NULL
), "Null/not applicable" }, /* for eventid = PHYSUP */
636 { SPRT_VALUE_RANGE(SPRT_MREVT_REASON_CODE_INIT
), "Initiation" },
637 { SPRT_VALUE_RANGE(SPRT_MREVT_REASON_CODE_RESPONDING
), "Responding" },
638 { SPRT_MREVT_REASON_CODE_RESERVED_START
, SPRT_MREVT_REASON_CODE_RESERVED_END
, "Reserved for ITU-T" },
642 static const range_string sprt_mrevent_phys_layer_symbol_rate
[] = {
643 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_NULL
), "Null/not applicable" },
644 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_600
), "600" },
645 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_1200
), "1200" },
646 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_1600
), "1600" },
647 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_2400
), "2400" },
648 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_2743
), "2743" },
649 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3000
), "3000" },
650 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3200
), "3200" },
651 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3429
), "3249" },
652 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_8000
), "8000" },
653 { SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_RESERVED_START
, SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_RESERVED_END
, "Reserved for ITU-T" },
654 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_UNSPECIFIED
), "Unspecified" },
658 static const value_string sprt_cleardown_reason
[] = {
659 { SPRT_CLEARDOWN_RIC_UNKNOWN
, "Unknown/unspecified" },
660 { SPRT_CLEARDOWN_RIC_PHYSICAL_LAYER_RELEASE
, "Physical layer release" },
661 { SPRT_CLEARDOWN_RIC_LINK_LAYER_DISCONNECT
, "Link layer disconnect" },
662 { SPRT_CLEARDOWN_RIC_DATA_COMPRESSION_DISCONNECT
, "Data compression disconnect" },
663 { SPRT_CLEARDOWN_RIC_ABORT
, "Abort" },
664 { SPRT_CLEARDOWN_RIC_ON_HOOK
, "On hook" },
665 { SPRT_CLEARDOWN_RIC_NETWORK_LAYER_TERMINATION
, "Network layer termination" },
666 { SPRT_CLEARDOWN_RIC_ADMINISTRATIVE
, "Administrative" },
670 static const value_string sprt_prof_xchg_support
[] = {
671 { SPRT_PROF_XCHG_SUPPORT_NO
, "No" },
672 { SPRT_PROF_XCHG_SUPPORT_YES
, "Yes" },
673 { SPRT_PROF_XCHG_SUPPORT_UNKNOWN
, "Unknown" },
677 static const range_string sprt_payload_dlci1
[] = {
678 { SPRT_VALUE_RANGE(SPRT_PAYLOAD_DLCI1_DTE2DTE
), "DTE-to-DTE (V.24 interfaces) data" },
679 { SPRT_PAYLOAD_DLCI1_RESERVED_START
, SPRT_PAYLOAD_DLCI1_RESERVED_END
, "Reserved for ITU-T" },
680 { SPRT_PAYLOAD_DLCI1_NOT_RESERVED_START
, SPRT_PAYLOAD_DLCI1_NOT_RESERVED_END
, "Not reserved for ITU-T" },
681 { SPRT_VALUE_RANGE(SPRT_PAYLOAD_DLCI1_CTRLFN2CTRLFN
), "Control-function to control-function information" },
685 static const true_false_string sprt_payload_ea_bit
= {
686 "Last octet of address field", "Another octet of address field follows"
689 static const range_string sprt_payload_dlci2
[] = {
690 { SPRT_PAYLOAD_DLCI2_START
, SPRT_PAYLOAD_DLCI2_END
, "Reserved by ITU-T for further study" },
694 static const value_string sprt_payload_data_bits
[] = {
695 { SPRT_PAYLOAD_D_0
, "5 bits" },
696 { SPRT_PAYLOAD_D_1
, "6 bits" },
697 { SPRT_PAYLOAD_D_2
, "7 bits" },
698 { SPRT_PAYLOAD_D_3
, "8 bits" },
702 static const value_string sprt_payload_parity
[] = {
703 { SPRT_PAYLOAD_P_0
, "Unknown" },
704 { SPRT_PAYLOAD_P_1
, "None" },
705 { SPRT_PAYLOAD_P_2
, "Even parity" },
706 { SPRT_PAYLOAD_P_3
, "Odd parity" },
707 { SPRT_PAYLOAD_P_4
, "Space parity" },
708 { SPRT_PAYLOAD_P_5
, "Mark parity" },
709 { SPRT_PAYLOAD_P_6
, "Reserved" },
710 { SPRT_PAYLOAD_P_7
, "Reserved" },
714 static const value_string sprt_payload_stop_bits
[] = {
715 { SPRT_PAYLOAD_S_0
, "1 stop bit" },
716 { SPRT_PAYLOAD_S_1
, "2 stop bits" },
717 { SPRT_PAYLOAD_S_2
, "Reserved" },
718 { SPRT_PAYLOAD_S_3
, "Reserved" },
722 static const value_string sprt_payload_frame_state
[] = {
723 { SPRT_PAYLOAD_FR_0
, "Data frame without termination" },
724 { SPRT_PAYLOAD_FR_1
, "Data frame with termination" },
725 { SPRT_PAYLOAD_FR_2
, "Data frame with abort termination" },
726 { SPRT_PAYLOAD_FR_3
, "Undefined" },
730 /* Fix for SPRT Parser Crash (Gitlab Issue #19559)
731 RTP Version is the first 2 bits of the first octet in the UDP payload */
732 #define RTP_VERSION(octet) ((octet) >> 6)
733 static dissector_handle_t rtp_handle
;
735 /* look for a conversation & return the associated data */
736 static struct _sprt_conversation_info
* find_sprt_conversation_data(packet_info
*pinfo
)
738 conversation_t
*p_conv
= NULL
;
739 struct _sprt_conversation_info
*p_conv_data
= NULL
;
740 /* Use existing packet info if available */
741 p_conv
= find_conversation_pinfo(pinfo
, NO_ADDR_B
|NO_PORT_B
);
744 p_conv_data
= (struct _sprt_conversation_info
*)conversation_get_proto_data(p_conv
, proto_sprt
);
751 /* set up SPRT conversation */
752 void sprt_add_address(packet_info
*pinfo
,
753 address
*addr
, int port
,
755 const char *setup_method
,
756 uint32_t setup_frame_number
)
759 conversation_t
* p_conv
;
760 struct _sprt_conversation_info
*p_conv_data
= NULL
;
763 * If this isn't the first time this packet has been processed,
764 * we've already done this work, so we don't need to do it
767 if (pinfo
->fd
->visited
)
772 clear_address(&null_addr
);
775 * Check if the ip address and port combination is not
776 * already registered as a conversation.
778 p_conv
= find_conversation(setup_frame_number
, addr
, &null_addr
, CONVERSATION_UDP
, port
, other_port
,
779 NO_ADDR_B
| (!other_port
? NO_PORT_B
: 0));
782 * If not, create a new conversation.
784 if (!p_conv
|| p_conv
->setup_frame
!= setup_frame_number
) {
785 p_conv
= conversation_new(setup_frame_number
, addr
, &null_addr
, CONVERSATION_UDP
,
786 (uint32_t)port
, (uint32_t)other_port
,
787 NO_ADDR2
| (!other_port
? NO_PORT2
: 0));
791 conversation_set_dissector(p_conv
, sprt_handle
);
794 * Check if the conversation has data associated with it.
796 p_conv_data
= (struct _sprt_conversation_info
*)conversation_get_proto_data(p_conv
, proto_sprt
);
799 * If not, add a new data item.
802 /* Create conversation data */
803 p_conv_data
= wmem_new(wmem_file_scope(), struct _sprt_conversation_info
);
804 p_conv_data
->stream_started
= false;
805 p_conv_data
->seqnum
[0] = 0;
806 p_conv_data
->seqnum
[1] = 0;
807 p_conv_data
->seqnum
[2] = 0;
808 p_conv_data
->seqnum
[3] = 0;
809 p_conv_data
->i_octet_dlci_status
= DLCI_UNKNOWN
;
810 p_conv_data
->connect_frame_number
= 0;
811 conversation_add_proto_data(p_conv
, proto_sprt
, p_conv_data
);
814 /* Update the conversation data. */
815 (void) g_strlcpy(p_conv_data
->method
, setup_method
, SPRT_CONV_MAX_SETUP_METHOD_SIZE
);
816 p_conv_data
->frame_number
= setup_frame_number
;
821 /* Display setup info */
822 static void show_setup_info(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
824 struct _sprt_conversation_info
*p_conv_data
;
825 proto_tree
*sprt_setup_tree
;
828 /* look up the conversation & get the data */
829 p_conv_data
= find_sprt_conversation_data(pinfo
);
833 proto_tree_add_string_format(tree
, hf_sprt_setup
, tvb
, 0, 0, "", "No setup info found");
837 /* Create setup info subtree with summary info. */
838 ti
= proto_tree_add_string_format(tree
, hf_sprt_setup
, tvb
, 0, 0,
840 "Stream setup by %s (frame %u)",
842 p_conv_data
->frame_number
);
843 proto_item_set_generated(ti
);
844 sprt_setup_tree
= proto_item_add_subtree(ti
, ett_sprt_setup
);
847 /* Add details into subtree */
848 proto_item
* item
= proto_tree_add_uint(sprt_setup_tree
, hf_sprt_setup_frame
,
849 tvb
, 0, 0, p_conv_data
->frame_number
);
850 proto_item_set_generated(item
);
851 item
= proto_tree_add_string(sprt_setup_tree
, hf_sprt_setup_method
,
852 tvb
, 0, 0, p_conv_data
->method
);
853 proto_item_set_generated(item
);
858 /* code to actually dissect the packet payload data */
860 dissect_sprt_data(tvbuff_t
*tvb
,
862 struct _sprt_conversation_info
*p_conv_data
,
863 proto_tree
*sprt_tree
,
865 unsigned payload_length
)
868 proto_tree
*sprt_payload_tree
, *field_subtree
;
869 uint8_t octet
, payload_msgid
, category_id
;
870 uint8_t selcompr
, mr_event_id
;
871 uint16_t word
, category_count
;
873 if (payload_length
> 0)
875 ti
= proto_tree_add_uint(sprt_tree
, hf_sprt_payload_length
, tvb
, offset
, 1, payload_length
);
876 proto_item_set_len(ti
, payload_length
);
878 sprt_payload_tree
= proto_item_add_subtree(ti
, ett_payload
);
880 payload_msgid
= tvb_get_uint8(tvb
, offset
) & 0x7F;
882 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
883 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_message_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
887 /* what kind of message is this? */
888 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", %s(%d)",
889 rval_to_str_const(payload_msgid
, sprt_modem_relay_msg_id_name
, "Unknown"),
892 /* now parse payload stuff after ext. bit & msgid */
893 switch(payload_msgid
)
895 case SPRT_MODEM_RELAY_MSG_ID_INIT
:
897 ti
= proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_init_all_fields
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
898 field_subtree
= proto_item_add_subtree(ti
, ett_init_msg_all_fields
);
899 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_necrxch
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
900 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_ecrxch
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
901 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_xid_prof_exch
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
902 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_asymm_data_types
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
903 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_raw_bit
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
904 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_frame
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
905 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_char_stat
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
906 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
907 /* from V.150.1 amendment 2 (5-2006): */
908 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_octet_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
909 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_char_stat_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
910 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
911 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
914 case SPRT_MODEM_RELAY_MSG_ID_XID_XCHG
:
915 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_ecp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
917 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr1_v42bis
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
918 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr1_v44
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
919 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr1_mnp5
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
920 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr1_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
922 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr2_v42bis_compr_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
924 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr3and4_v42bis_num_codewords
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
926 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr5_v42bis_max_strlen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
928 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr6_v44_capability
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
930 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr7_v44_compr_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
932 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr8and9_v44_num_codewords_trans
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
934 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr10and11_v44_num_codewords_recv
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
936 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr12_v44_max_strlen_trans
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
938 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr13_v44_max_strlen_recv
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
940 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr14and15_v44_history_len_trans
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
942 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr16and17_v44_history_len_recv
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
945 case SPRT_MODEM_RELAY_MSG_ID_JM_INFO
:
947 do /* there may be multiple categories */
949 word
= tvb_get_ntohs(tvb
, offset
);
950 category_id
= (word
>> 12);
952 ti
= proto_tree_add_uint_format_value(sprt_payload_tree
, hf_sprt_payload_msg_jminfo_category_data
, tvb
, offset
, 2, word
,
953 "Item #%d: %s (0x%04x)", category_count
, val_to_str_const(category_id
, sprt_jm_info_cat_id_name
, "Unknown"), category_id
);
955 field_subtree
= proto_item_add_subtree(ti
, ett_jminfo_msg_cat_data
);
956 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
960 case SPRT_JM_INFO_CAT_ID_CALL_FUNCT
: /* 0x8 */
961 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_call_function
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
962 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_leftover_bits
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
964 case SPRT_JM_INFO_CAT_ID_MOD_MODES
: /* 0xA */
965 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v34_duplex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
966 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v34_half_duplex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
967 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v32bis_v32
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
968 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v22bis_v22
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
969 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v17
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
970 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v29_half_duplex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
971 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v27ter
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
972 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v26ter
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
973 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v26bis
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
974 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v23_duplex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
975 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v23_half_duplex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
976 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v21
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
978 case SPRT_JM_INFO_CAT_ID_PROTOCOLS
: /* 0x5 */
979 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_protocols
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
980 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_leftover_bits
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
982 case SPRT_JM_INFO_CAT_ID_PSTN_ACCESS
: /* 0xB */
983 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pstn_access_call_dce_cell
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
984 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pstn_access_answ_dce_cell
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
985 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pstn_access_dce_on_digital_net
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
986 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_leftover_bits
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
988 case SPRT_JM_INFO_CAT_ID_PCM_MODEM_AVAIL
: /* 0xE */
989 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_analog
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
990 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_digital
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
991 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pcm_modem_avail_v91
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
992 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_leftover_bits
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
994 case SPRT_JM_INFO_CAT_ID_CATEGORY_EXTENSION
: /* 0x0 */
995 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_ext_info
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
997 default: /* unknown category ID */
998 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_unk_category_info
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1002 } while (tvb_reported_length_remaining(tvb
, offset
) >= 2);
1004 case SPRT_MODEM_RELAY_MSG_ID_START_JM
:
1005 /* No additional content */
1007 case SPRT_MODEM_RELAY_MSG_ID_CONNECT
: /***/
1008 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_selmod
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1009 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_dir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1011 selcompr
= (tvb_get_uint8(tvb
, offset
) & 0xF0) >> 4;
1012 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_selected_compr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1013 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_selected_err_corr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1015 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_tdsr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1017 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_rdsr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1019 word
= tvb_get_ntohs(tvb
, offset
);
1020 /* is DLCI enabled (used w/I_OCTET messages)? */
1021 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_dlci_enabled
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1022 /* have we previously seen a CONNECT msg in this conversation (i.e., do we know if DLCI is used w/I_OCTET?) */
1023 if (p_conv_data
->connect_frame_number
== 0)
1025 p_conv_data
->connect_frame_number
= pinfo
->num
;
1028 p_conv_data
->i_octet_dlci_status
= DLCI_PRESENT
;
1030 p_conv_data
->i_octet_dlci_status
= DLCI_ABSENT
;
1034 /* do subtree for available data types */
1035 ti
= proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_avail_data_types
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1036 field_subtree
= proto_item_add_subtree(ti
, ett_connect_msg_adt
);
1037 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_octet_no_format_no_dlci
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1038 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_raw_bit
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1039 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_frame
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1040 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_char_stat
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1041 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_char_dyn
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1042 /* from V.150.1 amendment 2 (5-2006): */
1043 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_octet_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1044 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_char_stat_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1045 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_char_dyn_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1046 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1048 if (selcompr
!= SPRT_SELECTED_COMPR_NONE
&&
1049 selcompr
!= SPRT_SELECTED_COMPR_MNP5
)
1051 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_trans_dict_sz
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1053 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_recv_dict_sz
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1055 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_trans_str_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1057 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_recv_str_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1060 if (selcompr
!= SPRT_SELECTED_COMPR_NONE
&&
1061 selcompr
!= SPRT_SELECTED_COMPR_MNP5
&&
1062 selcompr
!= SPRT_SELECTED_COMPR_V42_BIS
)
1064 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_trans_hist_sz
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1066 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_recv_hist_sz
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1070 case SPRT_MODEM_RELAY_MSG_ID_BREAK
: /* no additional info */
1071 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_break_source_proto
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1072 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_break_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1074 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_break_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1077 case SPRT_MODEM_RELAY_MSG_ID_BREAK_ACK
:
1078 /* No additional content */
1080 case SPRT_MODEM_RELAY_MSG_ID_MR_EVENT
:
1081 mr_event_id
= tvb_get_uint8(tvb
, offset
);
1082 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_event_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1084 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_reason_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1086 if (mr_event_id
== SPRT_MREVT_EVENT_ID_PHYSUP
)
1088 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_selmod
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1089 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_txsen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1090 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_rxsen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1092 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_tdsr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1094 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_rdsr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1096 /* The next two fields are "optional"
1097 * they should only appear w/PHYSUP (MR_EVENT id = 3) messages, when TxSR and RxSR are true
1099 if (tvb_reported_length_remaining(tvb
, offset
) >= 2)
1101 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_txsr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1103 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_rxsr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1108 case SPRT_MODEM_RELAY_MSG_ID_CLEARDOWN
:
1109 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_cleardown_reason_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1111 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_cleardown_vendor_tag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1113 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_cleardown_vendor_info
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1116 case SPRT_MODEM_RELAY_MSG_ID_PROF_XCHG
:
1117 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_v42_lapm
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1118 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_annex_av42
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1119 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_v44_compr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1120 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_v42bis_compr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1122 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_mnp5_compr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1123 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1125 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr2_v42bis_compr_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1127 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr3and4_v42bis_num_codewords
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1129 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr5_v42bis_max_strlen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1131 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr6_v44_capability
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1133 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr7_v44_compr_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1135 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr8and9_v44_num_codewords_trans
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1137 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr10and11_v44_num_codewords_recv
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1139 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr12_v44_max_strlen_trans
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1141 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr13_v44_max_strlen_recv
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1143 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr14and15_v44_history_len_trans
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1145 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr16and17_v44_history_len_recv
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1148 case SPRT_MODEM_RELAY_MSG_ID_I_RAW_OCTET
: /* data */
1149 octet
= tvb_get_uint8(tvb
, offset
);
1150 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawoctet_n_field_present
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1151 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawoctet_l
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1152 if (octet
& 0x80) /* is N field present? */
1154 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawoctet_n
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1158 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1160 case SPRT_MODEM_RELAY_MSG_ID_I_RAW_BIT
: /* data */
1162 * L, P, N fields need to be parsed
1164 switch((tvb_get_uint8(tvb
, offset
) & 0xC0) >> 6)
1166 case 0x0: /* 00: get L (6 bits) */
1167 /* display leading "00" bits, followed by L */
1168 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_included_fields_l
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1169 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_len_a
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1173 case 0x1: /* 01: get L (3 bits) & P (3 bits) */
1174 /* display leading "01" bits, followed by L,P */
1175 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_included_fields_lp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1176 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_len_b
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1177 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_p
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1181 default: /* 10, 11: get L (4 bits), P (3 bits), N (8 bits) */
1182 /* display leading "1" bit, followed by L,P,N */
1183 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_included_fields_lpn
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1184 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_len_c
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1185 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_p
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1188 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_n
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1193 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1195 case SPRT_MODEM_RELAY_MSG_ID_I_OCTET
: /* data */
1196 if (global_sprt_show_dlci_info
)
1198 /* DLCI field may be 0, 1, or 2 bytes, depending on CONNECT message (see "DLCI enabled")...
1199 * or UNKNOWN if we don't see the CONNECT message
1201 switch(p_conv_data
->i_octet_dlci_status
)
1204 octet
= tvb_get_uint8(tvb
, offset
);
1205 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_dlci1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1206 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_cr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1207 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_ea
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1210 /* check address extension... if ea bit == 0, then DLCI has another octet (see ITU-T V42 spec for more info) */
1211 if (!(octet
& 0x01))
1213 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_dlci2
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1214 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_ea
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1218 ti
= proto_tree_add_uint(sprt_payload_tree
, hf_sprt_payload_i_octet_dlci_setup_by_connect_frame
, tvb
, 0, 0, p_conv_data
->connect_frame_number
);
1219 proto_item_set_generated(ti
);
1222 ti
= proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_no_dlci
, tvb
, 0, 0, ENC_NA
);
1223 proto_item_set_generated(ti
);
1224 ti
= proto_tree_add_uint(sprt_payload_tree
, hf_sprt_payload_i_octet_dlci_setup_by_connect_frame
, tvb
, 0, 0, p_conv_data
->connect_frame_number
);
1225 proto_item_set_generated(ti
);
1227 case DLCI_UNKNOWN
: /* e.g., we didn't see the CONNECT msg so we don't know if there is a DLCI */
1229 ti
= proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_dlci_presence_unknown
, tvb
, 0, 0, ENC_NA
);
1230 proto_item_set_generated(ti
);
1234 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1236 case SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT
: /* data */
1237 /* r: 1-bit reserved */
1238 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1239 /* D: 2-bit field indicating # of data bits */
1240 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_num_data_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1241 /* P: 3-bit field for parity type */
1242 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_parity_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1243 /* S: 2-bit field indicating # of stop bits */
1244 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_num_stop_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1248 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1250 case SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN
: /* data */
1251 /* r: 1-bit reserved */
1252 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1253 /* D: 2-bit field indicating # of data bits */
1254 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_num_data_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1255 /* P: 3-bit field for parity type */
1256 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_parity_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1257 /* S: 2-bit field indicating # of stop bits */
1258 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_num_stop_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1262 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1264 case SPRT_MODEM_RELAY_MSG_ID_I_FRAME
: /* data */
1265 /* R: 6 reserved bits */
1266 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_frame_reserved_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1267 /* Fr: data frame state */
1268 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_frame_state
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1272 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1274 case SPRT_MODEM_RELAY_MSG_ID_I_OCTET_CS
: /* data */
1275 /* CS: 2-byte character sequence number */
1276 /* TODO - does this msg type ever have a DLCI? */
1277 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1279 payload_length
-= 2;
1281 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1283 case SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT_CS
: /* data */
1284 /* r: 1-bit reserved */
1285 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1286 /* D: 2-bit field indicating # of data bits */
1287 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_num_data_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1288 /* P: 3-bit field for parity type */
1289 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_parity_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1290 /* S: 2-bit field indicating # of stop bits */
1291 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_num_stop_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1294 /* CS: 2-byte character sequence number */
1295 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1297 payload_length
-= 2;
1299 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1301 case SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN_CS
: /* data */
1302 /* r: 1-bit reserved */
1303 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1304 /* D: 2-bit field indicating # of data bits */
1305 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_num_data_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1306 /* P: 3-bit field for parity type */
1307 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_parity_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1308 /* S: 2-bit field indicating # of stop bits */
1309 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_num_stop_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1312 /* CS: 2-byte character sequence number */
1313 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1315 payload_length
-= 2;
1317 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1320 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1324 proto_tree_add_item(sprt_tree
, hf_sprt_payload_no_data
, tvb
, offset
, 0, ENC_NA
);
1325 col_append_str(pinfo
->cinfo
, COL_INFO
, ", No Payload");
1332 dissect_sprt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
1334 /* Set up structures needed to add the protocol subtree and manage it */
1336 proto_tree
*sprt_tree
= NULL
;
1337 proto_tree
*sprt_ack_field_tree
;
1339 unsigned int offset
= 0;
1340 unsigned payload_length
;
1341 struct _sprt_conversation_info
*p_conv_data
= NULL
;
1345 uint16_t seqnum
; /* 0 if TC = 0 or if no payload */
1351 /* Fix for SPRT Parser Crash (Gitlab Issue #19559)
1352 * XXX - heuristic to check for misidentified packets.
1356 unsigned int version
;
1357 octet1
= tvb_get_uint8(tvb
, offset
);
1358 version
= RTP_VERSION( octet1
);
1361 return call_dissector(rtp_handle
,tvb
,pinfo
,tree
);
1364 /* Get conversation data, or create it if not found */
1365 p_conv_data
= find_sprt_conversation_data(pinfo
);
1368 sprt_add_address(pinfo
,
1369 &pinfo
->src
, pinfo
->srcport
,
1373 p_conv_data
= find_sprt_conversation_data(pinfo
);
1375 // This shouldn't happen; likely a new RTP conversation was set up
1376 // after this frame but with a setup frame before this one.
1381 /* Make entries in Protocol column and Info column on summary display */
1382 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "SPRT");
1383 col_clear(pinfo
->cinfo
, COL_INFO
);
1387 /* create the trees */
1388 ti
= proto_tree_add_item(tree
, proto_sprt
, tvb
, 0, -1, ENC_NA
);
1389 sprt_tree
= proto_item_add_subtree(ti
, ett_sprt
);
1391 /* show conversation setup info */
1392 if (global_sprt_show_setup_info
)
1394 show_setup_info(tvb
, pinfo
, sprt_tree
);
1398 /*SPRT header packet format
1399 +------+-------+-------+-------+-------+-------+---------+-------+
1400 |0 |1 |2 |3 |4 |5 |6 |7 |
1401 +------+-------+-------+-------+-------+-------+---------+-------+
1403 +----------------------------------------------------------------+
1405 +--------------+-------------------------------------------------+
1406 | TC | Sequence Number |
1407 +--------------+-------------------------------------------------+
1409 +----------------------------------------------------------------+
1410 | NOA | Base Sequence Number |
1411 +--------------+-------------------------------------------------+
1412 | Base Sequence Number |
1413 +----------------------------------------------------------------+
1415 +--------------+-------------------------------------------------+
1417 +----------------------------------------------------------------+
1419 +--------------+-------------------------------------------------+
1421 +----------------------------------------------------------------+
1423 +--------------+-------------------------------------------------+
1425 +----------------------------------------------------------------+
1428 /* Get fields needed for further dissection */
1429 word1
= tvb_get_ntohs(tvb
, offset
+ 2);
1430 tc
= (word1
& 0xC000) >> 14;
1431 seqnum
= word1
& 0x3FFF;
1433 noa
= (tvb_get_ntohs(tvb
, offset
+ 4) & 0xC000) >> 14;
1435 proto_tree_add_item(sprt_tree
, hf_sprt_header_extension_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1436 proto_tree_add_item(sprt_tree
, hf_sprt_subsession_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1439 proto_tree_add_item(sprt_tree
, hf_sprt_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1440 proto_tree_add_item(sprt_tree
, hf_sprt_payload_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1443 proto_tree_add_item(sprt_tree
, hf_sprt_transport_channel_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1444 ti
= proto_tree_add_item(sprt_tree
, hf_sprt_sequence_number
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1445 if (tc
== 0 && seqnum
!= 0)
1446 expert_add_info(pinfo
, ti
, &ei_sprt_sequence_number_0
);
1448 p_conv_data
->seqnum
[tc
] = seqnum
; /* keep track of seqnum values */
1451 proto_tree_add_item(sprt_tree
, hf_sprt_number_of_ack_fields
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1452 proto_tree_add_item(sprt_tree
, hf_sprt_base_sequence_number
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1455 if (noa
) /* parse ack fields? There can be 0 - 3 */
1457 ti
= proto_tree_add_item(sprt_tree
, hf_sprt_ack_field_items
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1458 sprt_ack_field_tree
= proto_item_add_subtree(ti
, ett_sprt_ack_fields
);
1460 for(i
= 0; i
< noa
; i
++)
1462 proto_tree_add_item(sprt_ack_field_tree
, hf_sprt_transport_channel_item
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1463 proto_tree_add_item(sprt_ack_field_tree
, hf_sprt_sequence_item
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1468 /* put details in the info column */
1469 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "TC=%u", tc
);
1471 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Seq=%u", seqnum
);
1473 /* dissect the payload, if any */
1474 payload_length
= tvb_captured_length(tvb
) - (6 + noa
* 2); /* total sprt length - header stuff */
1475 dissect_sprt_data(tvb
, pinfo
, p_conv_data
, sprt_tree
, offset
, payload_length
);
1478 col_append_str(pinfo
->cinfo
, COL_INFO
, " (ACK fields present)");
1480 return tvb_captured_length(tvb
);
1483 /* heuristic dissector */
1485 dissect_sprt_heur(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
1487 uint8_t octet
, extension_bit
, reserved_bit
, payload_type
;
1488 uint16_t word
, tc
, seqnum
;
1489 unsigned int offset
= 0;
1491 /* This is a heuristic dissector, which means we get all the UDP
1492 * traffic not sent to a known dissector and not claimed by
1493 * a heuristic dissector called before us!
1496 if (tvb_captured_length(tvb
) < 6)
1497 return false; /* packet is waay to short */
1499 /* Get the fields in the first two octets */
1500 extension_bit
= tvb_get_uint8(tvb
, offset
) & 0x7F;
1501 if (extension_bit
!= 0) /* must be 0 */
1504 octet
= tvb_get_uint8(tvb
, offset
+ 1);
1505 reserved_bit
= octet
& 80;
1506 payload_type
= octet
& 0x7F;
1507 if (reserved_bit
!= 0) /* must be 0 */
1509 if (payload_type
< 96 || payload_type
> 128) /* value within RTP dynamic payload type range */
1512 word
= tvb_get_ntohs(tvb
, offset
+ 2);
1514 seqnum
= word
& 0x3F;
1515 if ((tc
== 0 || tc
== 3) && (seqnum
!= 0)) /* seqnum only applies if tc is 1 or 2 */
1518 dissect_sprt(tvb
, pinfo
, tree
, data
);
1522 /* register the protocol with Wireshark */
1524 proto_register_sprt(void)
1526 module_t
*sprt_module
;
1527 expert_module_t
* expert_sprt
;
1529 static hf_register_info hf
[] =
1541 "Stream setup, method and frame number", HFILL
1545 &hf_sprt_setup_frame
,
1553 "Frame that set up this stream", HFILL
1557 &hf_sprt_setup_method
,
1560 "sprt.setup-method",
1565 "Method used to set up this stream", HFILL
1568 /* SPRT header fields: */
1570 &hf_sprt_header_extension_bit
,
1572 "Header extension bit",
1576 TFS(&tfs_set_notset
),
1582 &hf_sprt_subsession_id
,
1594 &hf_sprt_reserved_bit
,
1600 TFS(&tfs_set_notset
),
1606 &hf_sprt_payload_type
,
1618 &hf_sprt_transport_channel_id
,
1620 "Transport channel ID",
1624 VALS(sprt_transport_channel_characteristics
),
1630 &hf_sprt_sequence_number
,
1642 &hf_sprt_number_of_ack_fields
,
1644 "Number of ACK fields",
1654 &hf_sprt_base_sequence_number
,
1656 "Base sequence number",
1665 /* ACK fields, if any: */
1667 &hf_sprt_ack_field_items
, /* 0 to 3 items (TCN + SQN) */
1679 &hf_sprt_transport_channel_item
,
1681 "Transport control channel",
1691 &hf_sprt_sequence_item
,
1702 /* SPRT payload, if any: */
1704 &hf_sprt_payload_length
,
1706 "Payload (in bytes)",
1707 "sprt.payload.length",
1716 &hf_sprt_payload_no_data
,
1728 &hf_sprt_payload_reserved_bit
,
1731 "sprt.payload.reserved_bit",
1734 TFS(&tfs_set_notset
),
1740 &hf_sprt_payload_message_id
,
1742 "Payload message ID",
1743 "sprt.payload.msgid",
1745 BASE_DEC
| BASE_RANGE_STRING
,
1746 RVALS(sprt_modem_relay_msg_id_name
),
1751 /* SPRT payload fields, if any (depend on payload msgid): */
1754 &hf_sprt_payload_msg_init_all_fields
,
1756 "Init message fields",
1757 "sprt.payload.msg_init.all_fields",
1766 &hf_sprt_payload_msg_init_necrxch
,
1769 "sprt.payload.msg_init.NECRxCH",
1778 &hf_sprt_payload_msg_init_ecrxch
,
1781 "sprt.payload.msg_init.ECRxCH",
1790 &hf_sprt_payload_msg_init_xid_prof_exch
,
1792 "XID profile exchange",
1793 "sprt.payload.msg_init.XID_profile_exch",
1796 TFS(&tfs_supported_not_supported
),
1802 &hf_sprt_payload_msg_init_asymm_data_types
,
1804 "Asymmetrical data types",
1805 "sprt.payload.msg_init.asymm_data_types",
1808 TFS(&tfs_supported_not_supported
),
1814 &hf_sprt_payload_msg_init_opt_moip_types_i_raw_bit
,
1817 "sprt.payload.msg_init.opt_moip_types_i_raw_bit",
1820 TFS(&tfs_supported_not_supported
),
1826 &hf_sprt_payload_msg_init_opt_moip_types_i_frame
,
1829 "sprt.payload.msg_init.opt_moip_types_i_frame",
1832 TFS(&tfs_supported_not_supported
),
1838 &hf_sprt_payload_msg_init_opt_moip_types_i_char_stat
,
1841 "sprt.payload.msg_init.opt_moip_types_i_char_stat",
1844 TFS(&tfs_supported_not_supported
),
1850 &hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn
,
1853 "sprt.payload.msg_init.opt_moip_types_i_char_dyn",
1856 TFS(&tfs_supported_not_supported
),
1862 &hf_sprt_payload_msg_init_opt_moip_types_i_octet_cs
,
1865 "sprt.payload.msg_init.opt_moip_types_i_octet_cs",
1868 TFS(&tfs_supported_not_supported
),
1874 &hf_sprt_payload_msg_init_opt_moip_types_i_char_stat_cs
,
1877 "sprt.payload.msg_init.opt_moip_types_i_char_stat_cs",
1880 TFS(&tfs_supported_not_supported
),
1886 &hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn_cs
,
1889 "sprt.payload.msg_init.opt_moip_types_i_char_dyn_cs",
1892 TFS(&tfs_supported_not_supported
),
1898 &hf_sprt_payload_msg_init_opt_moip_types_reserved
,
1900 "Reserved for ITU-T",
1901 "sprt.payload.msg_init.opt_moip_types_reserved",
1909 /* XID_XCHG message */
1911 &hf_sprt_payload_msg_xidxchg_ecp
,
1913 "Error correcting protocol",
1914 "sprt.payload.msg_xidxchg.ecp",
1916 BASE_DEC
| BASE_RANGE_STRING
,
1917 RVALS(sprt_ecp_name
),
1923 &hf_sprt_payload_msg_xidxchg_xidlr1_v42bis
,
1926 "sprt.payload.msg_xidxchg.xidlr1_v42bis",
1929 TFS(&tfs_supported_not_supported
),
1935 &hf_sprt_payload_msg_xidxchg_xidlr1_v44
,
1938 "sprt.payload.msg_xidxchg.xidlr1_v44",
1941 TFS(&tfs_supported_not_supported
),
1947 &hf_sprt_payload_msg_xidxchg_xidlr1_mnp5
,
1950 "sprt.payload.msg_xidxchg.xidlr1_mnp5",
1953 TFS(&tfs_supported_not_supported
),
1959 &hf_sprt_payload_msg_xidxchg_xidlr1_reserved
,
1961 "Reserved for ITU-T",
1962 "sprt.payload.msg_xidxchg.xidlr1_reserved",
1971 &hf_sprt_payload_msg_xidxchg_xidlr2_v42bis_compr_req
,
1973 "V.42bis data compression request",
1974 "sprt.payload.msg_xidxchg.xidlr2_v42bis_compr_req",
1983 &hf_sprt_payload_msg_xidxchg_xidlr3and4_v42bis_num_codewords
,
1985 "V.42bis number of codewords",
1986 "sprt.payload.msg_xidxchg.xidlr3and4_v42bis_num_codewords",
1995 &hf_sprt_payload_msg_xidxchg_xidlr5_v42bis_max_strlen
,
1997 "V.42bis maximum string length",
1998 "sprt.payload.msg_xidxchg.xidlr5_v42bis_max_strlen",
2007 &hf_sprt_payload_msg_xidxchg_xidlr6_v44_capability
,
2010 "sprt.payload.msg_xidxchg.xidlr6_v44_capability",
2019 &hf_sprt_payload_msg_xidxchg_xidlr7_v44_compr_req
,
2021 "V.44 data compression request",
2022 "sprt.payload.msg_xidxchg.xidlr7_v44_compr_req",
2031 &hf_sprt_payload_msg_xidxchg_xidlr8and9_v44_num_codewords_trans
,
2033 "V.44 number of codewords in transmit direction",
2034 "sprt.payload.msg_xidxchg.xidlr8and9_v44_num_codewords_trans",
2043 &hf_sprt_payload_msg_xidxchg_xidlr10and11_v44_num_codewords_recv
,
2045 "V.44 number of codewords in receive direction",
2046 "sprt.payload.msg_xidxchg.xidlr10and11_v44_num_codewords_recv",
2055 &hf_sprt_payload_msg_xidxchg_xidlr12_v44_max_strlen_trans
,
2057 "V.44 maximum string length in transmit direction",
2058 "sprt.payload.msg_xidxchg.xidlr12_v44_max_strlen_trans",
2067 &hf_sprt_payload_msg_xidxchg_xidlr13_v44_max_strlen_recv
,
2069 "V.44 maximum string length in receive direction",
2070 "sprt.payload.msg_xidxchg.xidlr13_v44_max_strlen_recv",
2079 &hf_sprt_payload_msg_xidxchg_xidlr14and15_v44_history_len_trans
,
2081 "V.44 length of history in transmit direction",
2082 "sprt.payload.msg_xidxchg.xidlr14and15_v44_history_len_trans",
2091 &hf_sprt_payload_msg_xidxchg_xidlr16and17_v44_history_len_recv
,
2093 "V.44 length of history in receive direction",
2094 "sprt.payload.msg_xidxchg.xidlr16and17_v44_history_len_recv",
2102 /* JM_INFO message */
2104 &hf_sprt_payload_msg_jminfo_category_data
,
2107 "sprt.payload.msg_jminfo.category_data",
2116 &hf_sprt_payload_msg_jminfo_category_id
,
2119 "sprt.payload.msg_jminfo.category_id",
2122 VALS(sprt_jm_info_cat_id_name
),
2128 &hf_sprt_payload_msg_jminfo_category_ext_info
,
2130 "Unrecognized category data",
2131 "sprt.payload.msg_jminfo.category_ext_info",
2140 &hf_sprt_payload_msg_jminfo_unk_category_info
,
2142 "Category extension data",
2143 "sprt.payload.msg_jminfo.unk_category_info",
2152 &hf_sprt_payload_msg_jminfo_category_leftover_bits
,
2154 "Leftover bits", /* "Category info leftover bits", */
2155 "sprt.payload.msg_jminfo.category_leftover_bits",
2164 &hf_sprt_payload_msg_jminfo_call_function
,
2167 "sprt.payload.msg_jminfo.call_function",
2170 VALS(sprt_jminfo_tbc_call_funct_name
),
2176 &hf_sprt_payload_msg_jminfo_mod_v34_duplex
,
2179 "sprt.payload.msg_jminfo.mod_v34_duplex",
2182 TFS(&tfs_available_not_available
),
2188 &hf_sprt_payload_msg_jminfo_mod_v34_half_duplex
,
2191 "sprt.payload.msg_jminfo.mod_v34_half_duplex",
2194 TFS(&tfs_available_not_available
),
2200 &hf_sprt_payload_msg_jminfo_mod_v32bis_v32
,
2203 "sprt.payload.msg_jminfo.mod_v32bis_v32",
2206 TFS(&tfs_available_not_available
),
2212 &hf_sprt_payload_msg_jminfo_mod_v22bis_v22
,
2215 "sprt.payload.msg_jminfo.mod_v22bis_v22",
2218 TFS(&tfs_available_not_available
),
2224 &hf_sprt_payload_msg_jminfo_mod_v17
,
2227 "sprt.payload.msg_jminfo.mod_v17",
2230 TFS(&tfs_available_not_available
),
2236 &hf_sprt_payload_msg_jminfo_mod_v29_half_duplex
,
2239 "sprt.payload.msg_jminfo.mod_v29_half_duplex",
2242 TFS(&tfs_available_not_available
),
2248 &hf_sprt_payload_msg_jminfo_mod_v27ter
,
2251 "sprt.payload.msg_jminfo.mod_v27ter",
2254 TFS(&tfs_available_not_available
),
2260 &hf_sprt_payload_msg_jminfo_mod_v26ter
,
2263 "sprt.payload.msg_jminfo.mod_v26ter",
2266 TFS(&tfs_available_not_available
),
2272 &hf_sprt_payload_msg_jminfo_mod_v26bis
,
2275 "sprt.payload.msg_jminfo.mod_v26bis",
2278 TFS(&tfs_available_not_available
),
2284 &hf_sprt_payload_msg_jminfo_mod_v23_duplex
,
2287 "sprt.payload.msg_jminfo.mod_v23_duplex",
2290 TFS(&tfs_available_not_available
),
2296 &hf_sprt_payload_msg_jminfo_mod_v23_half_duplex
,
2299 "sprt.payload.msg_jminfo.mod_v23_half_duplex",
2302 TFS(&tfs_available_not_available
),
2308 &hf_sprt_payload_msg_jminfo_mod_v21
,
2311 "sprt.payload.msg_jminfo.mod_v21",
2314 TFS(&tfs_available_not_available
),
2320 &hf_sprt_payload_msg_jminfo_protocols
,
2323 "sprt.payload.msg_jminfo.protocols",
2325 BASE_DEC
| BASE_RANGE_STRING
,
2326 RVALS(sprt_jminfo_tbc_protocol_name
),
2332 &hf_sprt_payload_msg_jminfo_pstn_access_call_dce_cell
,
2334 "Call DCE is on a cellular connection",
2335 "sprt.payload.msg_jminfo.pstn_access_call_dce_cell",
2344 &hf_sprt_payload_msg_jminfo_pstn_access_answ_dce_cell
,
2346 "Answer DCE is on a cellular connection",
2347 "sprt.payload.msg_jminfo.pstn_access_answ_dce_cell",
2356 &hf_sprt_payload_msg_jminfo_pstn_access_dce_on_digital_net
,
2358 "DCE is on a digital network connection",
2359 "sprt.payload.msg_jminfo.pstn_access_dce_on_digital_net",
2368 &hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_analog
,
2370 "V.90 or V.92 analog modem availability",
2371 "sprt.payload.msg_jminfo.pcm_modem_avail_v90_v92_analog",
2374 TFS(&tfs_available_not_available
),
2380 &hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_digital
,
2382 "V.90 or V.92 digital modem availability",
2383 "sprt.payload.msg_jminfo.pcm_modem_avail_v90_v92_digital",
2386 TFS(&tfs_available_not_available
),
2392 &hf_sprt_payload_msg_jminfo_pcm_modem_avail_v91
,
2394 "V.91 modem availability",
2395 "sprt.payload.msg_jminfo.pcm_modem_avail_v91",
2398 TFS(&tfs_available_not_available
),
2403 /* START_JM message has no additional fields */
2404 /* CONNECT message */
2406 &hf_sprt_payload_msg_connect_selmod
,
2408 "Selected modulation",
2409 "sprt.payload.msg_connect.selmod",
2411 BASE_DEC
| BASE_RANGE_STRING
,
2412 RVALS(sprt_selmod_name
),
2418 &hf_sprt_payload_msg_connect_compr_dir
,
2420 "Compression direction",
2421 "sprt.payload.msg_connect.compr_dir",
2424 VALS(sprt_comp_direction
),
2430 &hf_sprt_payload_msg_connect_selected_compr
,
2432 "Selected compression",
2433 "sprt.payload.msg_connect.selected_compr",
2435 BASE_DEC
| BASE_RANGE_STRING
,
2436 RVALS(sprt_selected_compr_name
),
2442 &hf_sprt_payload_msg_connect_selected_err_corr
,
2444 "Selected error correction",
2445 "sprt.payload.msg_connect.selected_err_corr",
2447 BASE_DEC
| BASE_RANGE_STRING
,
2448 RVALS(sprt_selected_err_corr_name
),
2454 &hf_sprt_payload_msg_connect_tdsr
,
2456 "Transmit data signalling rate (bits/sec)",
2457 "sprt.payload.msg_connect.tdsr",
2466 &hf_sprt_payload_msg_connect_rdsr
,
2468 "Receive data signalling rate (bits/sec)",
2469 "sprt.payload.msg_connect.rdsr",
2478 &hf_sprt_payload_msg_connect_dlci_enabled
,
2481 "sprt.payload.msg_connect.dlci_enabled",
2484 TFS(&tfs_enabled_disabled
),
2490 &hf_sprt_payload_msg_connect_avail_data_types
,
2492 "Available data types",
2493 "sprt.payload.msg_connect.avail_data_types",
2502 &hf_sprt_payload_msg_connect_adt_octet_no_format_no_dlci
,
2504 "Octet w/o formatting with no DLCI",
2505 "sprt.payload.msg_connect.adt_octet_no_format_no_dlci",
2508 TFS(&tfs_available_not_available
),
2514 &hf_sprt_payload_msg_connect_adt_i_raw_bit
,
2517 "sprt.payload.msg_connect.adt_i_raw_bit",
2520 TFS(&tfs_available_not_available
),
2526 &hf_sprt_payload_msg_connect_adt_i_frame
,
2529 "sprt.payload.msg_connect.adt_i_frame",
2532 TFS(&tfs_available_not_available
),
2538 &hf_sprt_payload_msg_connect_adt_i_char_stat
,
2541 "sprt.payload.msg_connect.adt_i_char_stat",
2544 TFS(&tfs_available_not_available
),
2550 &hf_sprt_payload_msg_connect_adt_i_char_dyn
,
2553 "sprt.payload.msg_connect.adt_i_char_dyn",
2556 TFS(&tfs_available_not_available
),
2561 { /* from V.150.1 amendment 2 (5-2006): */
2562 &hf_sprt_payload_msg_connect_adt_i_octet_cs
,
2565 "sprt.payload.msg_connect.adt_i_octet_cs",
2568 TFS(&tfs_available_not_available
),
2573 { /* from V.150.1 amendment 2 (5-2006): */
2574 &hf_sprt_payload_msg_connect_adt_i_char_stat_cs
,
2577 "sprt.payload.msg_connect.adt_i_char_stat_cs",
2580 TFS(&tfs_available_not_available
),
2585 { /* from V.150.1 amendment 2 (5-2006): */
2586 &hf_sprt_payload_msg_connect_adt_i_char_dyn_cs
,
2589 "sprt.payload.msg_connect.adt_i_char_dyn_cs",
2592 TFS(&tfs_available_not_available
),
2598 &hf_sprt_payload_msg_connect_adt_reserved
,
2600 "Reserved for ITU-T",
2601 "sprt.payload.msg_connect.adt_reserved",
2610 &hf_sprt_payload_msg_connect_compr_trans_dict_sz
,
2612 "Compression transmit dictionary size",
2613 "sprt.payload.msg_connect.compr_trans_dict_sz",
2622 &hf_sprt_payload_msg_connect_compr_recv_dict_sz
,
2624 "Compression receive dictionary size",
2625 "sprt.payload.msg_connect.compr_recv_dict_sz",
2634 &hf_sprt_payload_msg_connect_compr_trans_str_len
,
2636 "Compression transmit string length",
2637 "sprt.payload.msg_connect.compr_trans_str_len",
2646 &hf_sprt_payload_msg_connect_compr_recv_str_len
,
2648 "Compression receive string length",
2649 "sprt.payload.msg_connect.compr_recv_str_len",
2658 &hf_sprt_payload_msg_connect_compr_trans_hist_sz
,
2660 "Compression transmit history size",
2661 "sprt.payload.msg_connect.compr_trans_hist_sz",
2670 &hf_sprt_payload_msg_connect_compr_recv_hist_sz
,
2672 "Compression receive history size",
2673 "sprt.payload.msg_connect.compr_recv_hist_sz",
2683 &hf_sprt_payload_msg_break_source_proto
,
2685 "Break source protocol",
2686 "sprt.payload.msg_break.source_proto",
2688 BASE_DEC
| BASE_RANGE_STRING
,
2689 RVALS(sprt_break_src_proto_name
),
2695 &hf_sprt_payload_msg_break_type
,
2698 "sprt.payload.msg_break.type",
2700 BASE_DEC
| BASE_RANGE_STRING
,
2701 RVALS(sprt_break_type_name
),
2707 &hf_sprt_payload_msg_break_length
,
2709 "Break length (x10 msec)",
2710 "sprt.payload.msg_break.length",
2718 /* BREAK_ACK message has no additional fields */
2719 /* MR_EVENT message */
2721 &hf_sprt_payload_msg_mr_event_id
,
2723 "Modem relay event ID",
2724 "sprt.payload.msg_mr_event.id",
2726 BASE_DEC
| BASE_RANGE_STRING
,
2727 RVALS(sprt_mrevent_id_name
),
2733 &hf_sprt_payload_msg_mr_evt_reason_code
,
2736 "sprt.payload.msg_mr_event.reason_code",
2738 BASE_DEC
| BASE_RANGE_STRING
,
2739 RVALS(sprt_mrevent_reason_code_name
),
2745 &hf_sprt_payload_msg_mr_evt_selmod
,
2747 "Selected modulation",
2748 "sprt.payload.msg_mr_event.selmod",
2750 BASE_DEC
| BASE_RANGE_STRING
,
2751 RVALS(sprt_selmod_name
),
2757 &hf_sprt_payload_msg_mr_evt_txsen
,
2760 "sprt.payload.msg_mr_event.txsen",
2763 TFS(&tfs_enabled_disabled
),
2769 &hf_sprt_payload_msg_mr_evt_rxsen
,
2772 "sprt.payload.msg_mr_event.rxsen",
2775 TFS(&tfs_enabled_disabled
),
2781 &hf_sprt_payload_msg_mr_evt_tdsr
,
2783 "Transmit data signalling rate (bits/sec)",
2784 "sprt.payload.msg_mr_event.tdsr",
2793 &hf_sprt_payload_msg_mr_evt_rdsr
,
2795 "Receive data signalling rate (bits/sec)",
2796 "sprt.payload.msg_mr_event.rdsr",
2805 &hf_sprt_payload_msg_mr_evt_txsr
,
2807 "Physical layer transmitter symbol rate (TxSR)",
2808 "sprt.payload.msg_mr_event.txsr",
2810 BASE_DEC
| BASE_RANGE_STRING
,
2811 RVALS(sprt_mrevent_phys_layer_symbol_rate
),
2817 &hf_sprt_payload_msg_mr_evt_rxsr
,
2819 "Physical layer receiver symbol rate (RxSR)",
2820 "sprt.payload.msg_mr_event.rxsr",
2822 BASE_DEC
| BASE_RANGE_STRING
,
2823 RVALS(sprt_mrevent_phys_layer_symbol_rate
),
2828 /* CLEARDOWN message */
2830 &hf_sprt_payload_msg_cleardown_reason_code
,
2833 "sprt.payload.msg_cleardown.reason_code",
2836 VALS(sprt_cleardown_reason
),
2842 &hf_sprt_payload_msg_cleardown_vendor_tag
,
2845 "sprt.payload.msg_cleardown.vendor_tag",
2854 &hf_sprt_payload_msg_cleardown_vendor_info
,
2857 "sprt.payload.msg_cleardown.vendor_info",
2865 /* PROF_XCHG message */
2867 &hf_sprt_payload_msg_profxchg_v42_lapm
,
2869 "V.42/LAPM protocol support",
2870 "sprt.payload.msg_profxchg.v42_lapm",
2873 VALS(sprt_prof_xchg_support
),
2879 &hf_sprt_payload_msg_profxchg_annex_av42
,
2881 "Annex A/V.42(1996) protocol support",
2882 "sprt.payload.msg_profxchg.annex_av42",
2885 VALS(sprt_prof_xchg_support
),
2891 &hf_sprt_payload_msg_profxchg_v44_compr
,
2893 "V.44 compression support",
2894 "sprt.payload.msg_profxchg.v44_compr",
2897 VALS(sprt_prof_xchg_support
),
2903 &hf_sprt_payload_msg_profxchg_v42bis_compr
,
2905 "V.42bis compression support",
2906 "sprt.payload.msg_profxchg.v42bis_compr",
2909 VALS(sprt_prof_xchg_support
),
2915 &hf_sprt_payload_msg_profxchg_mnp5_compr
,
2917 "MNP5 compression support",
2918 "sprt.payload.msg_profxchg.mnp5_compr",
2921 VALS(sprt_prof_xchg_support
),
2927 &hf_sprt_payload_msg_profxchg_reserved
,
2929 "Reserved for ITU-T",
2930 "sprt.payload.msg_profxchg.reserved",
2939 &hf_sprt_payload_msg_profxchg_xidlr2_v42bis_compr_req
,
2941 "V.42bis data compression request",
2942 "sprt.payload.msg_profxchg.xidlr2_v42bis_compr_req",
2951 &hf_sprt_payload_msg_profxchg_xidlr3and4_v42bis_num_codewords
,
2953 "V.42bis number of codewords",
2954 "sprt.payload.msg_profxchg.xidlr3and4_v42bis_num_codewords",
2963 &hf_sprt_payload_msg_profxchg_xidlr5_v42bis_max_strlen
,
2965 "V.42bis maximum string length",
2966 "sprt.payload.msg_profxchg.xidlr5_v42bis_max_strlen",
2975 &hf_sprt_payload_msg_profxchg_xidlr6_v44_capability
,
2978 "sprt.payload.msg_profxchg.xidlr6_v44_capability",
2987 &hf_sprt_payload_msg_profxchg_xidlr7_v44_compr_req
,
2989 "V.44 data compression request",
2990 "sprt.payload.msg_profxchg.xidlr7_v44_compr_req",
2999 &hf_sprt_payload_msg_profxchg_xidlr8and9_v44_num_codewords_trans
,
3001 "V.44 number of codewords in transmit direction",
3002 "sprt.payload.msg_profxchg.xidlr8and9_v44_num_codewords_trans",
3011 &hf_sprt_payload_msg_profxchg_xidlr10and11_v44_num_codewords_recv
,
3013 "V.44 number of codewords in receive direction",
3014 "sprt.payload.msg_profxchg.xidlr10and11_v44_num_codewords_recv",
3023 &hf_sprt_payload_msg_profxchg_xidlr12_v44_max_strlen_trans
,
3025 "V.44 maximum string length in transmit direction",
3026 "sprt.payload.msg_profxchg.xidlr12_v44_max_strlen_trans",
3035 &hf_sprt_payload_msg_profxchg_xidlr13_v44_max_strlen_recv
,
3037 "V.44 maximum string length in receive direction",
3038 "sprt.payload.msg_profxchg.xidlr13_v44_max_strlen_recv",
3047 &hf_sprt_payload_msg_profxchg_xidlr14and15_v44_history_len_trans
,
3049 "V.44 length of history in transmit direction",
3050 "sprt.payload.msg_profxchg.xidlr14and15_v44_history_len_trans",
3059 &hf_sprt_payload_msg_profxchg_xidlr16and17_v44_history_len_recv
,
3061 "V.44 length of history in receive direction",
3062 "sprt.payload.msg_profxchg.xidlr16and17_v44_history_len_recv",
3070 /* User data messages... */
3071 /* I_OCTET message: need to use DLCI field (8 or 16 bits) if indicated by CONNECT message */
3073 &hf_sprt_payload_i_octet_no_dlci
,
3076 "sprt.payload.i_octet_no_dlci",
3085 &hf_sprt_payload_i_octet_dlci_presence_unknown
,
3087 "Not known if DLCI field is present",
3088 "sprt.payload.i_octet_dlci_presence_unknown",
3097 &hf_sprt_payload_i_octet_dlci1
,
3100 "sprt.payload.i_octet_dlci1",
3102 BASE_DEC
| BASE_RANGE_STRING
,
3103 RVALS(sprt_payload_dlci1
),
3109 &hf_sprt_payload_i_octet_cr
,
3111 "Command/response bit",
3112 "sprt.payload.i_octet_cr",
3121 &hf_sprt_payload_i_octet_ea
,
3123 "Address field extension bit",
3124 "sprt.payload.i_octet_ea",
3127 TFS(&sprt_payload_ea_bit
),
3133 &hf_sprt_payload_i_octet_dlci2
,
3136 "sprt.payload.i_octet_dlci2",
3138 BASE_DEC
| BASE_RANGE_STRING
,
3139 RVALS(sprt_payload_dlci2
),
3145 &hf_sprt_payload_i_octet_dlci_setup_by_connect_frame
,
3147 "DLCI setup by CONNECT message at frame",
3148 "sprt.payload.i_octet_dlci_setup_by_connect_frame",
3156 /* fields for I_RAW_OCTET message (L; L,N) */
3158 &hf_sprt_payload_rawoctet_n_field_present
,
3161 "sprt.payload.rawoctet_n_field_present",
3164 TFS(&tfs_present_absent
),
3170 &hf_sprt_payload_rawoctet_l
,
3172 "L: # of octets in segment minus one",
3173 "sprt.payload.rawoctet_l",
3182 &hf_sprt_payload_rawoctet_n
,
3184 "N: # of times octets appear in data minus 2",
3185 "sprt.payload.rawoctet_n",
3193 /* fields for I_RAW_BIT (L; L,P; L,P,N) */
3195 &hf_sprt_payload_rawbit_included_fields_l
,
3197 "Include field L only",
3198 "sprt.payload.rawbit_included_fields_l",
3202 0xC0, /* top two bits: 00 */
3207 &hf_sprt_payload_rawbit_included_fields_lp
,
3209 "Include fields L, P",
3210 "sprt.payload.rawbit_field_format_lp",
3214 0xC0, /* top two bits: 01 */
3219 &hf_sprt_payload_rawbit_included_fields_lpn
,
3221 "Include fields L, P, N",
3222 "sprt.payload.rawbit_included_fields_lpn",
3226 0x80, /* top bit: 1 */
3231 &hf_sprt_payload_rawbit_len_a
,
3233 "L: # of octets in segment",
3234 "sprt.payload.rawbit_len_a",
3238 0x3F, /* six bits */
3243 &hf_sprt_payload_rawbit_len_b
,
3245 "L: # of octets in segment",
3246 "sprt.payload.rawbit_len_b",
3250 0x38, /* three bits */
3255 &hf_sprt_payload_rawbit_len_c
,
3257 "L: # of octets in segment",
3258 "sprt.payload.rawbit_len_c",
3262 0x78, /* four bits */
3267 &hf_sprt_payload_rawbit_p
,
3269 "P: # of low-order bits in last octet that are not in segment",
3270 "sprt.payload.rawbit_p",
3274 0x7, /* three bits */
3279 &hf_sprt_payload_rawbit_n
,
3281 "N: # of times octets appear in data minus 2",
3282 "sprt.payload.rawbit_n",
3286 0xFF, /* eight bits */
3290 /* fields in I_CHAR_STAT & I_CHAR_DYN messages */
3292 &hf_sprt_payload_data_reserved_bit
,
3295 "sprt.payload.reserved_bit",
3298 TFS(&tfs_set_notset
),
3304 &hf_sprt_payload_data_num_data_bits
,
3306 "D: Number of data bits",
3307 "sprt.payload.num_data_bits",
3310 VALS(sprt_payload_data_bits
),
3316 &hf_sprt_payload_data_parity_type
,
3319 "sprt.payload.parity_type",
3322 VALS(sprt_payload_parity
),
3328 &hf_sprt_payload_num_stop_bits
,
3330 "S: Number stop bits",
3331 "sprt.payload.num_stop_bits",
3334 VALS(sprt_payload_stop_bits
),
3339 /* sequence field in I_OCTET_CS, I_CHAR_STAT_CS, & I_CHAR_DYN_CS messages */
3341 &hf_sprt_payload_data_cs
,
3343 "Character sequence number",
3352 /* fields for I_FRAME: */
3354 &hf_sprt_payload_frame_reserved_bits
,
3357 "sprt.payload.frame_reserved_bits",
3366 &hf_sprt_payload_frame_state
,
3369 "sprt.payload.frame_state",
3372 VALS(sprt_payload_frame_state
),
3377 /* just dump remaining payload data: */
3379 &hf_sprt_payload_data
,
3382 "sprt.payload.data",
3390 }; /* hf_register_info hf[] */
3392 /* setup protocol subtree array */
3393 static int *ett
[] = {
3396 &ett_sprt_ack_fields
,
3398 &ett_init_msg_all_fields
,
3399 &ett_jminfo_msg_cat_data
,
3400 &ett_connect_msg_adt
3403 static ei_register_info ei
[] = {
3404 { &ei_sprt_sequence_number_0
, { "sprt.sequence_number_0", PI_PROTOCOL
, PI_WARN
, "Should be 0 for transport channel 0", EXPFILL
}},
3407 /* register protocol name & description */
3408 proto_sprt
= proto_register_protocol("Simple Packet Relay Transport", "SPRT", "sprt");
3410 /* required function calls to register the header fields and subtrees used */
3411 proto_register_field_array(proto_sprt
, hf
, array_length(hf
));
3412 proto_register_subtree_array(ett
, array_length(ett
));
3413 expert_sprt
= expert_register_protocol(proto_sprt
);
3414 expert_register_field_array(expert_sprt
, ei
, array_length(ei
));
3416 /* register the dissector */
3417 sprt_handle
= register_dissector("sprt", dissect_sprt
, proto_sprt
);
3419 sprt_module
= prefs_register_protocol(proto_sprt
, NULL
);
3422 prefs_register_bool_preference(sprt_module
, "show_setup_info",
3423 "Show stream setup information",
3424 "Where available, show which protocol and frame caused "
3425 "this SPRT stream to be created",
3426 &global_sprt_show_setup_info
);
3427 prefs_register_bool_preference(sprt_module
, "show_dlci_info",
3428 "Show DLCI in I_OCTET messages",
3429 "Show the DLCI field in I_OCTET messages as well as the frame that "
3430 "enabled/disabled the DLCI",
3431 &global_sprt_show_dlci_info
);
3436 proto_reg_handoff_sprt(void)
3438 rtp_handle
= find_dissector_add_dependency("rtp", proto_sprt
);
3440 dissector_add_for_decode_as_with_preference("udp.port", sprt_handle
);
3442 heur_dissector_add( "udp", dissect_sprt_heur
, "SPRT over UDP", "sprt_udp", proto_sprt
, HEURISTIC_ENABLE
);
3446 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3451 * indent-tabs-mode: nil
3454 * vi: set shiftwidth=4 tabstop=8 expandtab:
3455 * :indentSize=4:tabSize=8:noTabs=true: