3 * Routines for SPRT dissection
4 * SPRT = Simple Packet Relay Transport
8 * Written by Jamison Adcock <jamison.adcock@cobham.com>
9 * for Sparta Inc., dba Cobham Analytic Solutions
10 * This code is largely based on the RTP parsing code
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 * - work on conversations
40 #include <epan/packet.h>
41 #include <epan/prefs.h>
42 #include <epan/conversation.h>
43 #include <epan/expert.h>
44 #include <epan/wmem/wmem.h>
46 #include "packet-sprt.h"
49 /* for some "range_string"s, there's only one value in the range */
50 #define SPRT_VALUE_RANGE(a) a,a
52 /* TODO - conversation states */
53 #define SPRT_STATE_XXX_TODO 0
55 #define SPRT_CONV_MAX_SETUP_METHOD_SIZE 12
57 /* is DLCI field present in I_OCTET message? See "DLCI enabled" in CONNECT message */
62 } i_octet_dlci_status_t
;
65 /* Keep conversation info for one side of an SPRT conversation
66 * TODO - this needs to be bidirectional
68 struct _sprt_conversation_info
70 gchar method
[SPRT_CONV_MAX_SETUP_METHOD_SIZE
+ 1];
71 gboolean stream_started
;
72 guint32 frame_number
; /* the frame where this conversation is started */
74 /* sequence numbers for each channel: */
77 /* are we using the DLCI field in I_OCTET messages? See CONNECT message ("DLCI enabled") */
78 i_octet_dlci_status_t i_octet_dlci_status
;
79 guint32 connect_frame_number
; /* the CONNECT frame that tells us if the DLCI is enabled */
81 /* TODO - maintain state */
85 /* SPRT Message IDs: */
86 #define SPRT_MODEM_RELAY_MSG_ID_NULL 0
87 #define SPRT_MODEM_RELAY_MSG_ID_INIT 1
88 #define SPRT_MODEM_RELAY_MSG_ID_XID_XCHG 2
89 #define SPRT_MODEM_RELAY_MSG_ID_JM_INFO 3
90 #define SPRT_MODEM_RELAY_MSG_ID_START_JM 4
91 #define SPRT_MODEM_RELAY_MSG_ID_CONNECT 5
92 #define SPRT_MODEM_RELAY_MSG_ID_BREAK 6
93 #define SPRT_MODEM_RELAY_MSG_ID_BREAK_ACK 7
94 #define SPRT_MODEM_RELAY_MSG_ID_MR_EVENT 8
95 #define SPRT_MODEM_RELAY_MSG_ID_CLEARDOWN 9
96 #define SPRT_MODEM_RELAY_MSG_ID_PROF_XCHG 10
98 #define SPRT_MODEM_RELAY_MSG_ID_RESERVED1_START 11
99 #define SPRT_MODEM_RELAY_MSG_ID_RESERVED1_END 15
101 #define SPRT_MODEM_RELAY_MSG_ID_I_RAW_OCTET 16
102 #define SPRT_MODEM_RELAY_MSG_ID_I_RAW_BIT 17
103 #define SPRT_MODEM_RELAY_MSG_ID_I_OCTET 18
104 #define SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT 19
105 #define SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN 20
106 #define SPRT_MODEM_RELAY_MSG_ID_I_FRAME 21
107 #define SPRT_MODEM_RELAY_MSG_ID_I_OCTET_CS 22
108 #define SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT_CS 23
109 #define SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN_CS 24
110 /* 25 - 99 Reserved */
111 #define SPRT_MODEM_RELAY_MSG_ID_RESERVED2_START 25
112 #define SPRT_MODEM_RELAY_MSG_ID_RESERVED2_END 99
113 /* 100 - 127 Vendor-specific */
114 #define SPRT_MODEM_RELAY_MSG_ID_VENDOR_START 100
115 #define SPRT_MODEM_RELAY_MSG_ID_VENDOR_END 127
118 /* error correcting protocol in XID_XCHG message: */
119 #define SPRT_ECP_NO_LINK_LAYER_PROTO 0
120 #define SPRT_ECP_V42_LAPM 1
121 #define SPRT_ECP_ANNEX_AV42_1996 2
122 /* 3 - 25 Reserved for ITU-T */
123 #define SPRT_ECP_RESERVED_START 3
124 #define SPRT_ECP_RESERVED_END 25
127 /* category ID used in JM_INFO message: */
128 #define SPRT_JM_INFO_CAT_ID_CALL_FUNCT 0x8
129 #define SPRT_JM_INFO_CAT_ID_MOD_MODES 0xA
130 #define SPRT_JM_INFO_CAT_ID_PROTOCOLS 0x5
131 #define SPRT_JM_INFO_CAT_ID_PSTN_ACCESS 0xB
132 #define SPRT_JM_INFO_CAT_ID_PCM_MODEM_AVAIL 0xE
133 #define SPRT_JM_INFO_CAT_ID_CATEGORY_EXTENSION 0x0
136 #define SPRT_JMINFO_TBC_CALL_FUNCT_PSTN_MULTIMEDIA_TERM 0x4
137 #define SPRT_JMINFO_TBC_CALL_FUNCT_TEXTPHONE_ITU_T_REC_V18 0x2
138 #define SPRT_JMINFO_TBC_CALL_FUNCT_VIDEOTEXT_ITU_T_REC_T101 0x6
139 #define SPRT_JMINFO_TBC_CALL_FUNCT_TRANS_FAX_ITU_T_REC_T30 0x1
140 #define SPRT_JMINFO_TBC_CALL_FUNCT_RECV_FAX_ITU_T_REC_T30 0x5
141 #define SPRT_JMINFO_TBC_CALL_FUNCT_DATA_V_SERIES_MODEM_REC 0x3
144 #define SPRT_JMINFO_TBC_PROTOCOL_LAPM_ITU_T_REC_V42 0x4
147 /* selected modulations in CONNECT message: */
148 #define SPRT_SELMOD_NULL 0
149 #define SPRT_SELMOD_V92 1
150 #define SPRT_SELMOD_V91 2
151 #define SPRT_SELMOD_V90 3
152 #define SPRT_SELMOD_V34 4
153 #define SPRT_SELMOD_V32_BIS 5
154 #define SPRT_SELMOD_V32 6
155 #define SPRT_SELMOD_V22_BIS 7
156 #define SPRT_SELMOD_V22 8
157 #define SPRT_SELMOD_V17 9
158 #define SPRT_SELMOD_V29 10
159 #define SPRT_SELMOD_V27_TER 11
160 #define SPRT_SELMOD_V26_TER 12
161 #define SPRT_SELMOD_V26_BIS 13
162 #define SPRT_SELMOD_V23 14
163 #define SPRT_SELMOD_V21 15
164 #define SPRT_SELMOD_BELL_212 16
165 #define SPRT_SELMOD_BELL_103 17
166 /* 18 - 30 Vendor-specific modulations */
167 #define SPRT_SELMOD_VENDOR_START 18
168 #define SPRT_SELMOD_VENDOR_END 30
169 /* 31 - 63 Reserved for ITU-T */
170 #define SPRT_SELMOD_RESERVED_START 31
171 #define SPRT_SELMOD_RESERVED_END 63
174 /* Compression direction in CONNECT message: */
175 #define SPRT_COMPR_DIR_NO_COMPRESSION 0
176 #define SPRT_COMPR_DIR_TRANSMIT 1
177 #define SPRT_COMPR_DIR_RECEIVE 2
178 #define SPRT_COMPR_DIR_BIDIRECTIONAL 3
181 /* Selected compression modes in CONNECT message: */
182 #define SPRT_SELECTED_COMPR_NONE 0
183 #define SPRT_SELECTED_COMPR_V42_BIS 1
184 #define SPRT_SELECTED_COMPR_V44 2
185 #define SPRT_SELECTED_COMPR_MNP5 3
186 /* 4 - 15 Reserved by ITU-T */
187 #define SPRT_SELECTED_COMPR_RESERVED_START 4
188 #define SPRT_SELECTED_COMPR_RESERVED_END 15
191 /* Selected error correction modes in CONNECT message: */
192 #define SPRT_SELECTED_ERR_CORR_V14_OR_NONE 0
193 #define SPRT_SELECTED_ERR_CORR_V42_LAPM 1
194 #define SPRT_SELECTED_ERR_CORR_ANNEX_AV42 2
195 /* 3 - 15 Reserved for ITU-T */
196 #define SPRT_SELECTED_ERR_CORR_RESERVED_START 3
197 #define SPRT_SELECTED_ERR_CORR_RESERVED_END 15
200 /* Break source protocol in BREAK message: */
201 #define SPRT_BREAK_SRC_PROTO_V42_LAPM 0
202 #define SPRT_BREAK_SRC_PROTO_ANNEX_AV42_1996 1
203 #define SPRT_BREAK_SRC_PROTO_V14 2
204 /* 3 - 15 Reserved for ITU-T */
205 #define SPRT_BREAK_SRC_PROTO_RESERVED_START 3
206 #define SPRT_BREAK_SRC_PROTO_RESERVED_END 15
209 #define SPRT_BREAK_TYPE_NOT_APPLICABLE 0
210 #define SPRT_BREAK_TYPE_DESTRUCTIVE_AND_EXPEDITED 1
211 #define SPRT_BREAK_TYPE_NONDESTRUCTIVE_AND_EXPEDITED 2
212 #define SPRT_BREAK_TYPE_NONDESTRUCTIVE_AND_NONEXPEDITED 3
213 /* 4 - 15 Reserved for ITU-T */
214 #define SPRT_BREAK_TYPE_RESERVED_START 4
215 #define SPRT_BREAK_TYPE_RESERVED_END 15
218 /* Modem relay info in MR_EVENT messages: */
219 #define SPRT_MREVT_EVENT_ID_NULL 0
220 #define SPRT_MREVT_EVENT_ID_RATE_RENEGOTIATION 1
221 #define SPRT_MREVT_EVENT_ID_RETRAIN 2
222 #define SPRT_MREVT_EVENT_ID_PHYSUP 3
223 /* 4 - 255 Reserved for ITU-T */
224 #define SPRT_MREVT_EVENT_ID_RESERVED_START 4
225 #define SPRT_MREVT_EVENT_ID_RESERVED_END 255
228 #define SPRT_MREVT_REASON_CODE_NULL 0
229 #define SPRT_MREVT_REASON_CODE_INIT 1
230 #define SPRT_MREVT_REASON_CODE_RESPONDING 2
231 /* 3 - 255 Undefined */
232 #define SPRT_MREVT_REASON_CODE_RESERVED_START 3
233 #define SPRT_MREVT_REASON_CODE_RESERVED_END 255
236 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_NULL 0
237 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_600 1
238 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_1200 2
239 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_1600 3
240 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_2400 4
241 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_2743 5
242 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3000 6
243 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3200 7
244 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3429 8
245 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_8000 9
246 /* 10 - 254 Reserved for ITU-T */
247 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_RESERVED_START 10
248 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_RESERVED_END 254
249 #define SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_UNSPECIFIED 255
252 /* Cleardown reason codes: */
253 #define SPRT_CLEARDOWN_RIC_UNKNOWN 0
254 #define SPRT_CLEARDOWN_RIC_PHYSICAL_LAYER_RELEASE 1
255 #define SPRT_CLEARDOWN_RIC_LINK_LAYER_DISCONNECT 2
256 #define SPRT_CLEARDOWN_RIC_DATA_COMPRESSION_DISCONNECT 3
257 #define SPRT_CLEARDOWN_RIC_ABORT 4
258 #define SPRT_CLEARDOWN_RIC_ON_HOOK 5
259 #define SPRT_CLEARDOWN_RIC_NETWORK_LAYER_TERMINATION 6
260 #define SPRT_CLEARDOWN_RIC_ADMINISTRATIVE 7
263 /* PROF_XCHG messages (XID profile exchange for MR1): */
264 #define SPRT_PROF_XCHG_SUPPORT_NO 0
265 #define SPRT_PROF_XCHG_SUPPORT_YES 1
266 #define SPRT_PROF_XCHG_SUPPORT_UNKNOWN 2
269 /* DLCI field in I_OCTET: */
270 #define SPRT_PAYLOAD_DLCI1_DTE2DTE 0
271 #define SPRT_PAYLOAD_DLCI1_RESERVED_START 1
272 #define SPRT_PAYLOAD_DLCI1_RESERVED_END 31
273 #define SPRT_PAYLOAD_DLCI1_NOT_RESERVED_START 32
274 #define SPRT_PAYLOAD_DLCI1_NOT_RESERVED_END 62
275 #define SPRT_PAYLOAD_DLCI1_CTRLFN2CTRLFN 63
277 #define SPRT_PAYLOAD_DLCI2_START 0
278 #define SPRT_PAYLOAD_DLCI2_END 127
280 /* Payload fields for I_CHAR_STAT_CS, etc.: */
282 #define SPRT_PAYLOAD_D_0 0
283 #define SPRT_PAYLOAD_D_1 1
284 #define SPRT_PAYLOAD_D_2 2
285 #define SPRT_PAYLOAD_D_3 3
289 #define SPRT_PAYLOAD_P_0 0
290 #define SPRT_PAYLOAD_P_1 1
291 #define SPRT_PAYLOAD_P_2 2
292 #define SPRT_PAYLOAD_P_3 3
293 #define SPRT_PAYLOAD_P_4 4
294 #define SPRT_PAYLOAD_P_5 5
295 #define SPRT_PAYLOAD_P_6 6
296 #define SPRT_PAYLOAD_P_7 7
300 #define SPRT_PAYLOAD_S_0 0
301 #define SPRT_PAYLOAD_S_1 1
302 #define SPRT_PAYLOAD_S_2 2
303 #define SPRT_PAYLOAD_S_3 3
306 /* data frame state */
307 #define SPRT_PAYLOAD_FR_0 0
308 #define SPRT_PAYLOAD_FR_1 1
309 #define SPRT_PAYLOAD_FR_2 2
310 #define SPRT_PAYLOAD_FR_3 3
313 /* Initialize the protocol & registered fields */
314 static int proto_sprt
= -1;
316 static int hf_sprt_setup
= -1;
317 static int hf_sprt_setup_frame
= -1;
318 static int hf_sprt_setup_method
= -1;
320 static int hf_sprt_header_extension_bit
= -1;
321 static int hf_sprt_subsession_id
= -1;
322 static int hf_sprt_reserved_bit
= -1;
323 static int hf_sprt_payload_type
= -1;
324 static int hf_sprt_transport_channel_id
= -1;
325 static int hf_sprt_sequence_number
= -1;
326 static int hf_sprt_number_of_ack_fields
= -1;
327 static int hf_sprt_base_sequence_number
= -1;
328 static int hf_sprt_ack_field_items
= -1;
329 static int hf_sprt_transport_channel_item
= -1;
330 static int hf_sprt_sequence_item
= -1;
332 static int hf_sprt_payload
= -1;
333 static int hf_sprt_payload_no_data
= -1;
334 static int hf_sprt_payload_reserved_bit
= -1;
335 static int hf_sprt_payload_message_id
= -1;
337 static int hf_sprt_payload_data
= -1; /* stuff after msgid */
339 static int hf_sprt_payload_msg_init_all_fields
= -1;
340 static int hf_sprt_payload_msg_init_necrxch
= -1;
341 static int hf_sprt_payload_msg_init_ecrxch
= -1;
342 static int hf_sprt_payload_msg_init_xid_prof_exch
= -1;
343 static int hf_sprt_payload_msg_init_assym_data_types
= -1;
344 static int hf_sprt_payload_msg_init_opt_moip_types_i_raw_bit
= -1;
345 static int hf_sprt_payload_msg_init_opt_moip_types_i_frame
= -1;
346 static int hf_sprt_payload_msg_init_opt_moip_types_i_char_stat
= -1;
347 static int hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn
= -1;
348 static int hf_sprt_payload_msg_init_opt_moip_types_i_octet_cs
= -1;
349 static int hf_sprt_payload_msg_init_opt_moip_types_i_char_stat_cs
= -1;
350 static int hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn_cs
= -1;
351 static int hf_sprt_payload_msg_init_opt_moip_types_reserved
= -1;
352 /* XID_XCHG message: */
353 static int hf_sprt_payload_msg_xidxchg_ecp
= -1;
354 static int hf_sprt_payload_msg_xidxchg_xidlr1_v42bis
= -1;
355 static int hf_sprt_payload_msg_xidxchg_xidlr1_v44
= -1;
356 static int hf_sprt_payload_msg_xidxchg_xidlr1_mnp5
= -1;
357 static int hf_sprt_payload_msg_xidxchg_xidlr1_reserved
= -1;
358 static int hf_sprt_payload_msg_xidxchg_xidlr2_v42bis_compr_req
= -1;
359 static int hf_sprt_payload_msg_xidxchg_xidlr3and4_v42bis_num_codewords
= -1;
360 static int hf_sprt_payload_msg_xidxchg_xidlr5_v42bis_max_strlen
= -1;
361 static int hf_sprt_payload_msg_xidxchg_xidlr6_v44_capability
= -1;
362 static int hf_sprt_payload_msg_xidxchg_xidlr7_v44_compr_req
= -1;
363 static int hf_sprt_payload_msg_xidxchg_xidlr8and9_v44_num_codewords_trans
= -1;
364 static int hf_sprt_payload_msg_xidxchg_xidlr10and11_v44_num_codewords_recv
= -1;
365 static int hf_sprt_payload_msg_xidxchg_xidlr12_v44_max_strlen_trans
= -1;
366 static int hf_sprt_payload_msg_xidxchg_xidlr13_v44_max_strlen_recv
= -1;
367 static int hf_sprt_payload_msg_xidxchg_xidlr14and15_v44_history_len_trans
= -1;
368 static int hf_sprt_payload_msg_xidxchg_xidlr16and17_v44_history_len_recv
= -1;
369 /* V.8 JM_INFO msg: */
370 static int hf_sprt_payload_msg_jminfo_category_data
= -1;
371 static int hf_sprt_payload_msg_jminfo_category_id
= -1;
372 static int hf_sprt_payload_msg_jminfo_category_ext_info
= -1;
373 static int hf_sprt_payload_msg_jminfo_unk_category_info
= -1;
374 static int hf_sprt_payload_msg_jminfo_category_leftover_bits
= -1;
375 static int hf_sprt_payload_msg_jminfo_call_function
= -1;
376 static int hf_sprt_payload_msg_jminfo_mod_v34_duplex
= -1;
377 static int hf_sprt_payload_msg_jminfo_mod_v34_half_duplex
= -1;
378 static int hf_sprt_payload_msg_jminfo_mod_v32bis_v32
= -1;
379 static int hf_sprt_payload_msg_jminfo_mod_v22bis_v22
= -1;
380 static int hf_sprt_payload_msg_jminfo_mod_v17
= -1;
381 static int hf_sprt_payload_msg_jminfo_mod_v29_half_duplex
= -1;
382 static int hf_sprt_payload_msg_jminfo_mod_v27ter
= -1;
383 static int hf_sprt_payload_msg_jminfo_mod_v26ter
= -1;
384 static int hf_sprt_payload_msg_jminfo_mod_v26bis
= -1;
385 static int hf_sprt_payload_msg_jminfo_mod_v23_duplex
= -1;
386 static int hf_sprt_payload_msg_jminfo_mod_v23_half_duplex
= -1;
387 static int hf_sprt_payload_msg_jminfo_mod_v21
= -1;
388 static int hf_sprt_payload_msg_jminfo_protocols
= -1;
389 static int hf_sprt_payload_msg_jminfo_pstn_access_call_dce_cell
= -1;
390 static int hf_sprt_payload_msg_jminfo_pstn_access_answ_dce_cell
= -1;
391 static int hf_sprt_payload_msg_jminfo_pstn_access_dce_on_digital_net
= -1;
392 static int hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_analog
= -1;
393 static int hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_digital
= -1;
394 static int hf_sprt_payload_msg_jminfo_pcm_modem_avail_v91
= -1;
396 static int hf_sprt_payload_msg_connect_selmod
= -1;
397 static int hf_sprt_payload_msg_connect_compr_dir
= -1;
398 static int hf_sprt_payload_msg_connect_selected_compr
= -1;
399 static int hf_sprt_payload_msg_connect_selected_err_corr
= -1;
400 static int hf_sprt_payload_msg_connect_tdsr
= -1;
401 static int hf_sprt_payload_msg_connect_rdsr
= -1;
402 static int hf_sprt_payload_msg_connect_dlci_enabled
= -1;
403 static int hf_sprt_payload_msg_connect_avail_data_types
= -1;
404 static int hf_sprt_payload_msg_connect_adt_octet_no_format_no_dlci
= -1;
405 static int hf_sprt_payload_msg_connect_adt_i_raw_bit
= -1;
406 static int hf_sprt_payload_msg_connect_adt_i_frame
= -1;
407 static int hf_sprt_payload_msg_connect_adt_i_char_stat
= -1;
408 static int hf_sprt_payload_msg_connect_adt_i_char_dyn
= -1;
409 static int hf_sprt_payload_msg_connect_adt_i_octet_cs
= -1;
410 static int hf_sprt_payload_msg_connect_adt_i_char_stat_cs
= -1;
411 static int hf_sprt_payload_msg_connect_adt_i_char_dyn_cs
= -1;
412 static int hf_sprt_payload_msg_connect_adt_reserved
= -1;
413 static int hf_sprt_payload_msg_connect_compr_trans_dict_sz
= -1;
414 static int hf_sprt_payload_msg_connect_compr_recv_dict_sz
= -1;
415 static int hf_sprt_payload_msg_connect_compr_trans_str_len
= -1;
416 static int hf_sprt_payload_msg_connect_compr_recv_str_len
= -1;
417 static int hf_sprt_payload_msg_connect_compr_trans_hist_sz
= -1;
418 static int hf_sprt_payload_msg_connect_compr_recv_hist_sz
= -1;
420 static int hf_sprt_payload_msg_break_source_proto
= -1;
421 static int hf_sprt_payload_msg_break_type
= -1;
422 static int hf_sprt_payload_msg_break_length
= -1;
424 static int hf_sprt_payload_msg_mr_event_id
= -1;
425 static int hf_sprt_payload_msg_mr_evt_reason_code
= -1;
426 static int hf_sprt_payload_msg_mr_evt_selmod
= -1;
427 static int hf_sprt_payload_msg_mr_evt_txsen
= -1;
428 static int hf_sprt_payload_msg_mr_evt_rxsen
= -1;
429 static int hf_sprt_payload_msg_mr_evt_tdsr
= -1;
430 static int hf_sprt_payload_msg_mr_evt_rdsr
= -1;
431 static int hf_sprt_payload_msg_mr_evt_txsr
= -1;
432 static int hf_sprt_payload_msg_mr_evt_rxsr
= -1;
434 static int hf_sprt_payload_msg_cleardown_reason_code
= -1;
435 static int hf_sprt_payload_msg_cleardown_vendor_tag
= -1;
436 static int hf_sprt_payload_msg_cleardown_vendor_info
= -1;
438 static int hf_sprt_payload_msg_profxchg_v42_lapm
= -1;
439 static int hf_sprt_payload_msg_profxchg_annex_av42
= -1;
440 static int hf_sprt_payload_msg_profxchg_v44_compr
= -1;
441 static int hf_sprt_payload_msg_profxchg_v42bis_compr
= -1;
442 static int hf_sprt_payload_msg_profxchg_mnp5_compr
= -1;
443 static int hf_sprt_payload_msg_profxchg_reserved
= -1;
444 static int hf_sprt_payload_msg_profxchg_xidlr2_v42bis_compr_req
= -1;
445 static int hf_sprt_payload_msg_profxchg_xidlr3and4_v42bis_num_codewords
= -1;
446 static int hf_sprt_payload_msg_profxchg_xidlr5_v42bis_max_strlen
= -1;
447 static int hf_sprt_payload_msg_profxchg_xidlr6_v44_capability
= -1;
448 static int hf_sprt_payload_msg_profxchg_xidlr7_v44_compr_req
= -1;
449 static int hf_sprt_payload_msg_profxchg_xidlr8and9_v44_num_codewords_trans
= -1;
450 static int hf_sprt_payload_msg_profxchg_xidlr10and11_v44_num_codewords_recv
= -1;
451 static int hf_sprt_payload_msg_profxchg_xidlr12_v44_max_strlen_trans
= -1;
452 static int hf_sprt_payload_msg_profxchg_xidlr13_v44_max_strlen_recv
= -1;
453 static int hf_sprt_payload_msg_profxchg_xidlr14and15_v44_history_len_trans
= -1;
454 static int hf_sprt_payload_msg_profxchg_xidlr16and17_v44_history_len_recv
= -1;
456 static int hf_sprt_payload_i_octet_no_dlci
= -1;
457 static int hf_sprt_payload_i_octet_dlci_presence_unknown
= -1;
458 static int hf_sprt_payload_i_octet_dlci1
= -1;
459 static int hf_sprt_payload_i_octet_cr
= -1;
460 static int hf_sprt_payload_i_octet_ea
= -1;
461 static int hf_sprt_payload_i_octet_dlci2
= -1;
462 static int hf_sprt_payload_i_octet_dlci_setup_by_connect_frame
= -1;
464 /* I_OCTET_CS, I_CHAR_STAT_CS, I_CHAR_DYN_CS msgs: */
465 static int hf_sprt_payload_data_cs
= -1;
466 static int hf_sprt_payload_data_reserved_bit
= -1;
467 static int hf_sprt_payload_data_num_data_bits
= -1;
468 static int hf_sprt_payload_data_parity_type
= -1;
469 static int hf_sprt_payload_num_stop_bits
= -1;
470 static int hf_sprt_payload_frame_reserved_bits
= -1;
471 static int hf_sprt_payload_frame_state
= -1;
472 static int hf_sprt_payload_rawoctet_n_field_present
= -1;
473 static int hf_sprt_payload_rawoctet_l
= -1;
474 static int hf_sprt_payload_rawoctet_n
= -1;
475 static int hf_sprt_payload_rawbit_included_fields_l
= -1;
476 static int hf_sprt_payload_rawbit_included_fields_lp
= -1;
477 static int hf_sprt_payload_rawbit_included_fields_lpn
= -1;
478 static int hf_sprt_payload_rawbit_len_a
= -1;
479 static int hf_sprt_payload_rawbit_len_b
= -1;
480 static int hf_sprt_payload_rawbit_len_c
= -1;
481 static int hf_sprt_payload_rawbit_p
= -1;
482 static int hf_sprt_payload_rawbit_n
= -1;
485 static gboolean global_sprt_show_setup_info
= TRUE
; /* show how this SPRT stream got started */
486 static gboolean global_sprt_show_dlci_info
= TRUE
; /* show DLCI in I_OCTET messages, including setup frame (if we can) */
489 /* dissector handle */
490 static dissector_handle_t sprt_handle
;
493 /* initialize the subtree pointers */
494 static gint ett_sprt
= -1;
495 static gint ett_sprt_setup
= -1;
496 static gint ett_sprt_ack_fields
= -1;
497 static gint ett_payload
= -1;
498 static gint ett_init_msg_all_fields
= -1;
499 static gint ett_jminfo_msg_cat_data
= -1;
500 static gint ett_connect_msg_adt
= -1;
502 static expert_field ei_sprt_sequence_number_0
= EI_INIT
;
504 /* value strings & range strings */
505 static const value_string sprt_transport_channel_characteristics
[] = {
506 { 0, "Unreliable, unsequenced" },
507 { 1, "Reliable, sequenced" },
508 { 2, "Expedited, reliable, sequenced" },
509 { 3, "Unreliable, sequenced" },
513 static const range_string sprt_modem_relay_msg_id_name
[] = {
514 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_NULL
), "NULL reserved for ITU-T" },
515 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_INIT
), "INIT" },
516 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_XID_XCHG
), "XID_XCHG" },
517 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_JM_INFO
), "JM_INFO" },
518 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_START_JM
), "START_JM" },
519 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_CONNECT
), "CONNECT" },
520 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_BREAK
), "BREAK" },
521 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_BREAK_ACK
), "BREAK_ACK" },
522 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_MR_EVENT
), "MR_EVENT" },
523 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_CLEARDOWN
), "CLEARDOWN" },
524 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_PROF_XCHG
), "PROF_XCHG" },
525 { SPRT_MODEM_RELAY_MSG_ID_RESERVED1_START
, SPRT_MODEM_RELAY_MSG_ID_RESERVED1_END
, "Reserved for ITU-T" },
526 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_RAW_OCTET
), "I_RAW-OCTET" },
527 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_RAW_BIT
), "I_RAW-BIT" },
528 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_OCTET
), "I_OCTET" },
529 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT
), "I_CHAR-STAT" },
530 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN
), "I_CHAR-DYN" },
531 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_FRAME
), "I_FRAME" },
532 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_OCTET_CS
), "I_OCTET-CS" },
533 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT_CS
), "I_CHAR-STAT-CS" },
534 { SPRT_VALUE_RANGE(SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN_CS
), "I_CHAR-DYN-CS" },
535 { SPRT_MODEM_RELAY_MSG_ID_RESERVED2_START
, SPRT_MODEM_RELAY_MSG_ID_RESERVED2_END
, "Reserved for ITU-T" },
536 { SPRT_MODEM_RELAY_MSG_ID_VENDOR_START
, SPRT_MODEM_RELAY_MSG_ID_VENDOR_END
, "Vendor-specific message" },
540 static const range_string sprt_ecp_name
[] = {
541 { SPRT_VALUE_RANGE(SPRT_ECP_NO_LINK_LAYER_PROTO
), "No link layer protocol" },
542 { SPRT_VALUE_RANGE(SPRT_ECP_V42_LAPM
), "V.42/LAPM" },
543 { SPRT_VALUE_RANGE(SPRT_ECP_ANNEX_AV42_1996
), "Annex A/V.42(1996)" },
544 { SPRT_ECP_RESERVED_START
, SPRT_ECP_RESERVED_END
, "Reserved for ITU-T" },
548 static const value_string sprt_jm_info_cat_id_name
[] = {
549 { SPRT_JM_INFO_CAT_ID_CALL_FUNCT
, "Call function" },
550 { SPRT_JM_INFO_CAT_ID_MOD_MODES
, "Modulation modes" },
551 { SPRT_JM_INFO_CAT_ID_PROTOCOLS
, "Protocols" },
552 { SPRT_JM_INFO_CAT_ID_PSTN_ACCESS
, "PSTN access" },
553 { SPRT_JM_INFO_CAT_ID_PCM_MODEM_AVAIL
, "PCM modem availability" },
554 { SPRT_JM_INFO_CAT_ID_CATEGORY_EXTENSION
, "Extension of current category" },
558 static const value_string sprt_jminfo_tbc_call_funct_name
[] = {
559 { SPRT_JMINFO_TBC_CALL_FUNCT_PSTN_MULTIMEDIA_TERM
, "PSTN Multimedia terminal (ITU-T Rec. H.324)" },
560 { SPRT_JMINFO_TBC_CALL_FUNCT_TEXTPHONE_ITU_T_REC_V18
, "Textphone (ITU-T Rec. V.18)" },
561 { SPRT_JMINFO_TBC_CALL_FUNCT_VIDEOTEXT_ITU_T_REC_T101
, "Videotext (ITU-T Rec. T.101)" },
562 { SPRT_JMINFO_TBC_CALL_FUNCT_TRANS_FAX_ITU_T_REC_T30
, "Transmit facsimilie from call terminal (ITU-T Rec. T.30)" },
563 { SPRT_JMINFO_TBC_CALL_FUNCT_RECV_FAX_ITU_T_REC_T30
, "Receive facsimilie at call terminal (ITU-T Rec. T.30)" },
564 { SPRT_JMINFO_TBC_CALL_FUNCT_DATA_V_SERIES_MODEM_REC
, "Data (V-series modem Recommendations)" },
568 static const range_string sprt_jminfo_tbc_protocol_name
[] = {
569 { SPRT_VALUE_RANGE(SPRT_JMINFO_TBC_PROTOCOL_LAPM_ITU_T_REC_V42
), "LAPM protocol according to ITU-T Rec. V.42" },
573 static const range_string sprt_selmod_name
[] = {
574 { SPRT_VALUE_RANGE(SPRT_SELMOD_NULL
), "NULL" },
575 { SPRT_VALUE_RANGE(SPRT_SELMOD_V92
), "V.92" },
576 { SPRT_VALUE_RANGE(SPRT_SELMOD_V91
), "V.91" },
577 { SPRT_VALUE_RANGE(SPRT_SELMOD_V90
), "V.90" },
578 { SPRT_VALUE_RANGE(SPRT_SELMOD_V34
), "V.34" },
579 { SPRT_VALUE_RANGE(SPRT_SELMOD_V32_BIS
), "V.32bis" },
580 { SPRT_VALUE_RANGE(SPRT_SELMOD_V32
), "V.32" },
581 { SPRT_VALUE_RANGE(SPRT_SELMOD_V22_BIS
), "V.22bis" },
582 { SPRT_VALUE_RANGE(SPRT_SELMOD_V22
), "V.22" },
583 { SPRT_VALUE_RANGE(SPRT_SELMOD_V17
), "V.17" },
584 { SPRT_VALUE_RANGE(SPRT_SELMOD_V29
), "V.29" },
585 { SPRT_VALUE_RANGE(SPRT_SELMOD_V27_TER
), "V.27ter" },
586 { SPRT_VALUE_RANGE(SPRT_SELMOD_V26_TER
), "V.26ter" },
587 { SPRT_VALUE_RANGE(SPRT_SELMOD_V26_BIS
), "V.26bis" },
588 { SPRT_VALUE_RANGE(SPRT_SELMOD_V23
), "V.23" },
589 { SPRT_VALUE_RANGE(SPRT_SELMOD_V21
), "V.21" },
590 { SPRT_VALUE_RANGE(SPRT_SELMOD_BELL_212
), "Bell 212" },
591 { SPRT_VALUE_RANGE(SPRT_SELMOD_BELL_103
), "Bell 103" },
592 { SPRT_SELMOD_VENDOR_START
, SPRT_SELMOD_VENDOR_END
, "Vendor-specific modulation" },
593 { SPRT_SELMOD_RESERVED_START
, SPRT_SELMOD_RESERVED_END
, "Reserved for ITU-T" },
597 static const value_string sprt_comp_direction
[] = {
598 { SPRT_COMPR_DIR_NO_COMPRESSION
, "None" },
599 { SPRT_COMPR_DIR_TRANSMIT
, "Transmit" },
600 { SPRT_COMPR_DIR_RECEIVE
, "Receive" },
601 { SPRT_COMPR_DIR_BIDIRECTIONAL
, "Bidirectional" },
605 static const range_string sprt_selected_compr_name
[] = {
606 { SPRT_VALUE_RANGE(SPRT_SELECTED_COMPR_NONE
), "None" },
607 { SPRT_VALUE_RANGE(SPRT_SELECTED_COMPR_V42_BIS
), "V.42bis" },
608 { SPRT_VALUE_RANGE(SPRT_SELECTED_COMPR_V44
), "V.44" },
609 { SPRT_VALUE_RANGE(SPRT_SELECTED_COMPR_MNP5
), "MNP5" },
610 { SPRT_SELECTED_COMPR_RESERVED_START
, SPRT_SELECTED_COMPR_RESERVED_END
, "Reserved by ITU-T" },
614 static const range_string sprt_selected_err_corr_name
[] = {
615 { SPRT_VALUE_RANGE(SPRT_SELECTED_ERR_CORR_V14_OR_NONE
), "V.14 or no error correction protocol" },
616 { SPRT_VALUE_RANGE(SPRT_SELECTED_ERR_CORR_V42_LAPM
), "V.42/LAPM" },
617 { SPRT_VALUE_RANGE(SPRT_SELECTED_ERR_CORR_ANNEX_AV42
), "Annex A/V.42" },
618 { SPRT_SELECTED_ERR_CORR_RESERVED_START
, SPRT_SELECTED_ERR_CORR_RESERVED_END
, "Reserved for ITU-T" },
622 static const range_string sprt_break_src_proto_name
[] = {
623 { SPRT_VALUE_RANGE(SPRT_BREAK_SRC_PROTO_V42_LAPM
), "V.42/LAPM" },
624 { SPRT_VALUE_RANGE(SPRT_BREAK_SRC_PROTO_ANNEX_AV42_1996
), "Annex A/V.42(1996)" },
625 { SPRT_VALUE_RANGE(SPRT_BREAK_SRC_PROTO_V14
), "V.14" },
626 { SPRT_BREAK_SRC_PROTO_RESERVED_START
, SPRT_BREAK_SRC_PROTO_RESERVED_END
, "Reserved for ITU-T" },
630 static const range_string sprt_break_type_name
[] = {
631 { SPRT_VALUE_RANGE(SPRT_BREAK_TYPE_NOT_APPLICABLE
), "Not applicable" },
632 { SPRT_VALUE_RANGE(SPRT_BREAK_TYPE_DESTRUCTIVE_AND_EXPEDITED
), "Destructive and expedited" },
633 { SPRT_VALUE_RANGE(SPRT_BREAK_TYPE_NONDESTRUCTIVE_AND_EXPEDITED
), "Non-destructive and expedited" },
634 { SPRT_VALUE_RANGE(SPRT_BREAK_TYPE_NONDESTRUCTIVE_AND_NONEXPEDITED
), "Non-destructive and non-expedited" },
635 { SPRT_BREAK_TYPE_RESERVED_START
, SPRT_BREAK_TYPE_RESERVED_END
, "Reserved for ITU-T" },
639 static const range_string sprt_mrevent_id_name
[] = {
640 { SPRT_VALUE_RANGE(SPRT_MREVT_EVENT_ID_NULL
), "NULL" },
641 { SPRT_VALUE_RANGE(SPRT_MREVT_EVENT_ID_RATE_RENEGOTIATION
), "Rate renegotiation" },
642 { SPRT_VALUE_RANGE(SPRT_MREVT_EVENT_ID_RETRAIN
), "Retrain" },
643 { SPRT_VALUE_RANGE(SPRT_MREVT_EVENT_ID_PHYSUP
), "Physical layer ready" }, /* reason code should be 0 */
644 { SPRT_MREVT_EVENT_ID_RESERVED_START
, SPRT_MREVT_EVENT_ID_RESERVED_END
, "Reserved for ITU-T" },
648 static const range_string sprt_mrevent_reason_code_name
[] = {
649 { SPRT_VALUE_RANGE(SPRT_MREVT_REASON_CODE_NULL
), "Null/not applicable" }, /* for eventid = PHYSUP */
650 { SPRT_VALUE_RANGE(SPRT_MREVT_REASON_CODE_INIT
), "Initiation" },
651 { SPRT_VALUE_RANGE(SPRT_MREVT_REASON_CODE_RESPONDING
), "Responding" },
652 { SPRT_MREVT_REASON_CODE_RESERVED_START
, SPRT_MREVT_REASON_CODE_RESERVED_END
, "Reserved for ITU-T" },
656 static const range_string sprt_mrevent_phys_layer_symbol_rate
[] = {
657 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_NULL
), "Null/not applicable" },
658 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_600
), "600" },
659 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_1200
), "1200" },
660 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_1600
), "1600" },
661 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_2400
), "2400" },
662 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_2743
), "2743" },
663 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3000
), "3000" },
664 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3200
), "3200" },
665 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_3429
), "3249" },
666 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_8000
), "8000" },
667 { SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_RESERVED_START
, SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_RESERVED_END
, "Reserved for ITU-T" },
668 { SPRT_VALUE_RANGE(SPRT_MREVT_PHYS_LAYER_SYMBOL_RATE_UNSPECIFIED
), "Unspecified" },
672 static const value_string sprt_cleardown_reason
[] = {
673 { SPRT_CLEARDOWN_RIC_UNKNOWN
, "Unknown/unspecified" },
674 { SPRT_CLEARDOWN_RIC_PHYSICAL_LAYER_RELEASE
, "Physical layer release" },
675 { SPRT_CLEARDOWN_RIC_LINK_LAYER_DISCONNECT
, "Link layer disconnect" },
676 { SPRT_CLEARDOWN_RIC_DATA_COMPRESSION_DISCONNECT
, "Data compression disconnect" },
677 { SPRT_CLEARDOWN_RIC_ABORT
, "Abort" },
678 { SPRT_CLEARDOWN_RIC_ON_HOOK
, "On hook" },
679 { SPRT_CLEARDOWN_RIC_NETWORK_LAYER_TERMINATION
, "Network layer termination" },
680 { SPRT_CLEARDOWN_RIC_ADMINISTRATIVE
, "Administrative" },
684 static const value_string sprt_prof_xchg_support
[] = {
685 { SPRT_PROF_XCHG_SUPPORT_NO
, "No" },
686 { SPRT_PROF_XCHG_SUPPORT_YES
, "Yes" },
687 { SPRT_PROF_XCHG_SUPPORT_UNKNOWN
, "Unknown" },
691 static const range_string sprt_payload_dlci1
[] = {
692 { SPRT_VALUE_RANGE(SPRT_PAYLOAD_DLCI1_DTE2DTE
), "DTE-to-DTE (V.24 interfaces) data" },
693 { SPRT_PAYLOAD_DLCI1_RESERVED_START
, SPRT_PAYLOAD_DLCI1_RESERVED_END
, "Reserved for for ITU-T" },
694 { SPRT_PAYLOAD_DLCI1_NOT_RESERVED_START
, SPRT_PAYLOAD_DLCI1_NOT_RESERVED_END
, "Not reserved for for ITU-T" },
695 { SPRT_VALUE_RANGE(SPRT_PAYLOAD_DLCI1_CTRLFN2CTRLFN
), "Control-function to control-function information" },
699 static const true_false_string sprt_payload_ea_bit
[] = {
700 { "Last octet of address field", "Another octet of address field follows" }
703 static const range_string sprt_payload_dlci2
[] = {
704 { SPRT_PAYLOAD_DLCI2_START
, SPRT_PAYLOAD_DLCI2_END
, "Reserved by ITU-T for further study" },
708 static const value_string sprt_payload_data_bits
[] = {
709 { SPRT_PAYLOAD_D_0
, "5 bits" },
710 { SPRT_PAYLOAD_D_1
, "6 bits" },
711 { SPRT_PAYLOAD_D_2
, "7 bits" },
712 { SPRT_PAYLOAD_D_3
, "8 bits" },
716 static const value_string sprt_payload_parity
[] = {
717 { SPRT_PAYLOAD_P_0
, "Unknown" },
718 { SPRT_PAYLOAD_P_1
, "None" },
719 { SPRT_PAYLOAD_P_2
, "Even parity" },
720 { SPRT_PAYLOAD_P_3
, "Odd parity" },
721 { SPRT_PAYLOAD_P_4
, "Space parity" },
722 { SPRT_PAYLOAD_P_5
, "Mark parity" },
723 { SPRT_PAYLOAD_P_6
, "Reserved" },
724 { SPRT_PAYLOAD_P_7
, "Reserved" },
728 static const value_string sprt_payload_stop_bits
[] = {
729 { SPRT_PAYLOAD_S_0
, "1 stop bit" },
730 { SPRT_PAYLOAD_S_1
, "2 stop bits" },
731 { SPRT_PAYLOAD_S_2
, "Reserved" },
732 { SPRT_PAYLOAD_S_3
, "Reserved" },
736 static const value_string sprt_payload_frame_state
[] = {
737 { SPRT_PAYLOAD_FR_0
, "Data frame without termination" },
738 { SPRT_PAYLOAD_FR_1
, "Data frame with termination" },
739 { SPRT_PAYLOAD_FR_2
, "Data frame with abort termination" },
740 { SPRT_PAYLOAD_FR_3
, "Undefined" },
746 /* look for a conversation & return the associated data */
747 static struct _sprt_conversation_info
* find_sprt_conversation_data(packet_info
*pinfo
)
749 conversation_t
*p_conv
= NULL
;
750 struct _sprt_conversation_info
*p_conv_data
= NULL
;
751 /* Use existing packet info if available */
752 p_conv
= find_conversation(pinfo
->fd
->num
,
758 NO_ADDR_B
|NO_PORT_B
);
761 p_conv_data
= (struct _sprt_conversation_info
*)conversation_get_proto_data(p_conv
, proto_sprt
);
768 /* set up SPRT conversation */
769 void sprt_add_address(packet_info
*pinfo
,
770 address
*addr
, int port
,
772 const gchar
*setup_method
,
773 guint32 setup_frame_number
)
776 conversation_t
* p_conv
;
777 struct _sprt_conversation_info
*p_conv_data
= NULL
;
780 * If this isn't the first time this packet has been processed,
781 * we've already done this work, so we don't need to do it
784 if (pinfo
->fd
->flags
.visited
)
789 SET_ADDRESS(&null_addr
, AT_NONE
, 0, NULL
);
792 * Check if the ip address and port combination is not
793 * already registered as a conversation.
795 p_conv
= find_conversation(setup_frame_number
, addr
, &null_addr
, PT_UDP
, port
, other_port
,
796 NO_ADDR_B
| (!other_port
? NO_PORT_B
: 0));
799 * If not, create a new conversation.
801 if (!p_conv
|| p_conv
->setup_frame
!= setup_frame_number
) {
802 p_conv
= conversation_new(setup_frame_number
, addr
, &null_addr
, PT_UDP
,
803 (guint32
)port
, (guint32
)other_port
,
804 NO_ADDR2
| (!other_port
? NO_PORT2
: 0));
808 conversation_set_dissector(p_conv
, sprt_handle
);
811 * Check if the conversation has data associated with it.
813 p_conv_data
= (struct _sprt_conversation_info
*)conversation_get_proto_data(p_conv
, proto_sprt
);
816 * If not, add a new data item.
819 /* Create conversation data */
820 p_conv_data
= wmem_new(wmem_file_scope(), struct _sprt_conversation_info
);
821 p_conv_data
->stream_started
= FALSE
;
822 p_conv_data
->seqnum
[0] = 0;
823 p_conv_data
->seqnum
[1] = 0;
824 p_conv_data
->seqnum
[2] = 0;
825 p_conv_data
->seqnum
[3] = 0;
826 p_conv_data
->i_octet_dlci_status
= DLCI_UNKNOWN
;
827 p_conv_data
->connect_frame_number
= 0;
828 conversation_add_proto_data(p_conv
, proto_sprt
, p_conv_data
);
831 /* Update the conversation data. */
832 g_strlcpy(p_conv_data
->method
, setup_method
, SPRT_CONV_MAX_SETUP_METHOD_SIZE
);
833 p_conv_data
->frame_number
= setup_frame_number
;
838 /* Display setup info */
839 static void show_setup_info(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
841 struct _sprt_conversation_info
*p_conv_data
;
842 proto_tree
*sprt_setup_tree
;
845 /* look up the conversation & get the data */
846 p_conv_data
= find_sprt_conversation_data(pinfo
);
850 proto_tree_add_string_format(tree
, hf_sprt_setup
, tvb
, 0, 0, "", "No setup info found");
854 /* Create setup info subtree with summary info. */
855 ti
= proto_tree_add_string_format(tree
, hf_sprt_setup
, tvb
, 0, 0,
857 "Stream setup by %s (frame %u)",
859 p_conv_data
->frame_number
);
860 PROTO_ITEM_SET_GENERATED(ti
);
861 sprt_setup_tree
= proto_item_add_subtree(ti
, ett_sprt_setup
);
864 /* Add details into subtree */
865 proto_item
* item
= proto_tree_add_uint(sprt_setup_tree
, hf_sprt_setup_frame
,
866 tvb
, 0, 0, p_conv_data
->frame_number
);
867 PROTO_ITEM_SET_GENERATED(item
);
868 item
= proto_tree_add_string(sprt_setup_tree
, hf_sprt_setup_method
,
869 tvb
, 0, 0, p_conv_data
->method
);
870 PROTO_ITEM_SET_GENERATED(item
);
875 /* code to actually dissect the packet payload data */
877 dissect_sprt_data(tvbuff_t
*tvb
,
879 struct _sprt_conversation_info
*p_conv_data
,
880 proto_tree
*sprt_tree
,
882 guint payload_length
)
885 proto_tree
*sprt_payload_tree
, *field_subtree
;
886 guint8 octet
, payload_msgid
, category_id
;
887 guint8 selcompr
, mr_event_id
;
888 guint16 word
, category_count
;
890 if (payload_length
> 0)
892 ti
= proto_tree_add_uint(sprt_tree
, hf_sprt_payload
, tvb
, offset
, 1, payload_length
);
893 proto_item_set_len(ti
, payload_length
);
895 sprt_payload_tree
= proto_item_add_subtree(ti
, ett_payload
);
897 payload_msgid
= tvb_get_guint8(tvb
, offset
) & 0x7F;
899 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
900 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_message_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
904 /* what kind of message is this? */
905 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", %s(%d)", rval_to_str(payload_msgid
, sprt_modem_relay_msg_id_name
, "Unknown"), payload_msgid
);
907 /* now parse payload stuff after ext. bit & msgid */
908 switch(payload_msgid
)
910 case SPRT_MODEM_RELAY_MSG_ID_INIT
:
912 ti
= proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_init_all_fields
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
913 field_subtree
= proto_item_add_subtree(ti
, ett_init_msg_all_fields
);
914 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_necrxch
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
915 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_ecrxch
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
916 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_xid_prof_exch
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
917 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_assym_data_types
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
918 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_raw_bit
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
919 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_frame
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
920 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_char_stat
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
921 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
922 /* from V.150.1 amendment 2 (5-2006): */
923 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_octet_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
924 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_char_stat_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
925 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
926 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_init_opt_moip_types_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
929 case SPRT_MODEM_RELAY_MSG_ID_XID_XCHG
:
930 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_ecp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
932 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr1_v42bis
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
933 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr1_v44
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
934 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr1_mnp5
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
935 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr1_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
937 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr2_v42bis_compr_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
939 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr3and4_v42bis_num_codewords
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
941 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr5_v42bis_max_strlen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
943 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr6_v44_capability
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
945 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr7_v44_compr_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
947 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr8and9_v44_num_codewords_trans
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
949 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr10and11_v44_num_codewords_recv
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
951 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr12_v44_max_strlen_trans
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
953 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr13_v44_max_strlen_recv
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
955 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr14and15_v44_history_len_trans
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
957 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_xidxchg_xidlr16and17_v44_history_len_recv
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
960 case SPRT_MODEM_RELAY_MSG_ID_JM_INFO
:
962 do /* there may be multiple categories */
964 word
= tvb_get_ntohs(tvb
, offset
);
965 category_id
= (word
>> 12);
967 ti
= proto_tree_add_uint_format_value(sprt_payload_tree
, hf_sprt_payload_msg_jminfo_category_data
, tvb
, offset
, 2, word
,
968 "Item #%d: %s (0x%04x)", category_count
, val_to_str_const(category_id
, sprt_jm_info_cat_id_name
, "Unknown"), category_id
);
970 field_subtree
= proto_item_add_subtree(ti
, ett_jminfo_msg_cat_data
);
971 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
975 case SPRT_JM_INFO_CAT_ID_CALL_FUNCT
: /* 0x8 */
976 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_call_function
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
977 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_leftover_bits
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
979 case SPRT_JM_INFO_CAT_ID_MOD_MODES
: /* 0xA */
980 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v34_duplex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
981 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v34_half_duplex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
982 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v32bis_v32
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
983 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v22bis_v22
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
984 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v17
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
985 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v29_half_duplex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
986 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v27ter
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
987 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v26ter
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
988 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v26bis
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
989 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v23_duplex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
990 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v23_half_duplex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
991 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_mod_v21
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
993 case SPRT_JM_INFO_CAT_ID_PROTOCOLS
: /* 0x5 */
994 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_protocols
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
995 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_leftover_bits
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
997 case SPRT_JM_INFO_CAT_ID_PSTN_ACCESS
: /* 0xB */
998 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pstn_access_call_dce_cell
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
999 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pstn_access_answ_dce_cell
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1000 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pstn_access_dce_on_digital_net
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1001 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_leftover_bits
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1003 case SPRT_JM_INFO_CAT_ID_PCM_MODEM_AVAIL
: /* 0xE */
1004 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_analog
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1005 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_digital
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1006 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_pcm_modem_avail_v91
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1007 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_leftover_bits
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1009 case SPRT_JM_INFO_CAT_ID_CATEGORY_EXTENSION
: /* 0x0 */
1010 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_category_ext_info
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1012 default: /* unknown category ID */
1013 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_jminfo_unk_category_info
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1017 } while (tvb_length_remaining(tvb
, offset
) >= 2);
1019 case SPRT_MODEM_RELAY_MSG_ID_START_JM
:
1020 /* No additional content */
1022 case SPRT_MODEM_RELAY_MSG_ID_CONNECT
: /***/
1023 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_selmod
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1024 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_dir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1026 selcompr
= (tvb_get_guint8(tvb
, offset
) & 0xF0) >> 4;
1027 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_selected_compr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1028 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_selected_err_corr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1030 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_tdsr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1032 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_rdsr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1034 word
= tvb_get_ntohs(tvb
, offset
);
1035 /* is DLCI enabled (used w/I_OCTET messages)? */
1036 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_dlci_enabled
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1037 /* have we previously seen a CONNECT msg in this conversation (i.e., do we know if DLCI is used w/I_OCTET?) */
1038 if (p_conv_data
->connect_frame_number
== 0)
1040 p_conv_data
->connect_frame_number
= pinfo
->fd
->num
;
1043 p_conv_data
->i_octet_dlci_status
= DLCI_PRESENT
;
1045 p_conv_data
->i_octet_dlci_status
= DLCI_ABSENT
;
1049 /* do subtree for available data types */
1050 ti
= proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_avail_data_types
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1051 field_subtree
= proto_item_add_subtree(ti
, ett_connect_msg_adt
);
1052 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_octet_no_format_no_dlci
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1053 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_raw_bit
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1054 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_frame
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1055 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_char_stat
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1056 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_char_dyn
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1057 /* from V.150.1 amendment 2 (5-2006): */
1058 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_octet_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1059 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_char_stat_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1060 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_i_char_dyn_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1061 proto_tree_add_item(field_subtree
, hf_sprt_payload_msg_connect_adt_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1063 if (selcompr
!= SPRT_SELECTED_COMPR_NONE
&&
1064 selcompr
!= SPRT_SELECTED_COMPR_MNP5
)
1066 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_trans_dict_sz
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1068 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_recv_dict_sz
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1070 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_trans_str_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1072 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_recv_str_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1075 if (selcompr
!= SPRT_SELECTED_COMPR_NONE
&&
1076 selcompr
!= SPRT_SELECTED_COMPR_MNP5
&&
1077 selcompr
!= SPRT_SELECTED_COMPR_V42_BIS
)
1079 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_trans_hist_sz
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1081 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_connect_compr_recv_hist_sz
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1085 case SPRT_MODEM_RELAY_MSG_ID_BREAK
: /* no additional info */
1086 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_break_source_proto
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1087 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_break_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1089 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_break_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1092 case SPRT_MODEM_RELAY_MSG_ID_BREAK_ACK
:
1093 /* No additional content */
1095 case SPRT_MODEM_RELAY_MSG_ID_MR_EVENT
:
1096 mr_event_id
= tvb_get_guint8(tvb
, offset
);
1097 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_event_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1099 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_reason_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1101 if (mr_event_id
== SPRT_MREVT_EVENT_ID_PHYSUP
)
1103 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_selmod
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1104 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_txsen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1105 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_rxsen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1107 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_tdsr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1109 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_rdsr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1111 /* The next two fields are "optional"
1112 * they should only appear w/PHYSUP (MR_EVENT id = 3) messages, when TxSR and RxSR are true
1114 if (tvb_reported_length_remaining(tvb
, offset
) >= 2)
1116 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_txsr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1118 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_mr_evt_rxsr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1123 case SPRT_MODEM_RELAY_MSG_ID_CLEARDOWN
:
1124 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_cleardown_reason_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1126 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_cleardown_vendor_tag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1128 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_cleardown_vendor_info
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1131 case SPRT_MODEM_RELAY_MSG_ID_PROF_XCHG
:
1132 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_v42_lapm
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1133 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_annex_av42
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1134 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_v44_compr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1135 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_v42bis_compr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1137 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_mnp5_compr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1138 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1140 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr2_v42bis_compr_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1142 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr3and4_v42bis_num_codewords
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1144 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr5_v42bis_max_strlen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1146 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr6_v44_capability
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1148 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr7_v44_compr_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1150 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr8and9_v44_num_codewords_trans
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1152 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr10and11_v44_num_codewords_recv
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1154 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr12_v44_max_strlen_trans
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1156 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr13_v44_max_strlen_recv
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1158 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr14and15_v44_history_len_trans
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1160 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_msg_profxchg_xidlr16and17_v44_history_len_recv
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1163 case SPRT_MODEM_RELAY_MSG_ID_I_RAW_OCTET
: /* data */
1164 octet
= tvb_get_guint8(tvb
, offset
);
1165 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawoctet_n_field_present
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1166 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawoctet_l
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1167 if (octet
& 0x80) /* is N field present? */
1169 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawoctet_n
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1173 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1175 case SPRT_MODEM_RELAY_MSG_ID_I_RAW_BIT
: /* data */
1177 * L, P, N fields need to be parsed
1179 switch((tvb_get_guint8(tvb
, offset
) & 0xC0) >> 6)
1181 case 0x0: /* 00: get L (6 bits) */
1182 /* display leading "00" bits, followed by L */
1183 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_included_fields_l
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1184 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_len_a
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1188 case 0x1: /* 01: get L (3 bits) & P (3 bits) */
1189 /* display leading "01" bits, followed by L,P */
1190 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_included_fields_lp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1191 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_len_b
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1192 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_p
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1196 default: /* 10, 11: get L (4 bits), P (3 bits), N (8 bits) */
1197 /* display leading "1" bit, followed by L,P,N */
1198 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_included_fields_lpn
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1199 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_len_c
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1200 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_p
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1203 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_rawbit_n
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1208 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1210 case SPRT_MODEM_RELAY_MSG_ID_I_OCTET
: /* data */
1211 if (global_sprt_show_dlci_info
)
1213 /* DLCI field may be 0, 1, or 2 bytes, depending on CONNECT message (see "DLCI enabled")...
1214 * or UNKNOWN if we don't see the CONNECT message
1216 switch(p_conv_data
->i_octet_dlci_status
)
1219 octet
= tvb_get_guint8(tvb
, offset
);
1220 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_dlci1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1221 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_cr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1222 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_ea
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1225 /* check address extension... if ea bit == 0, then DLCI has another octet (see ITU-T V42 spec for more info) */
1226 if (!(octet
& 0x01))
1228 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_dlci2
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1229 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_ea
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1233 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
);
1234 PROTO_ITEM_SET_GENERATED(ti
);
1237 ti
= proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_no_dlci
, tvb
, 0, 0, ENC_NA
);
1238 PROTO_ITEM_SET_GENERATED(ti
);
1239 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
);
1240 PROTO_ITEM_SET_GENERATED(ti
);
1242 case DLCI_UNKNOWN
: /* e.g., we didn't see the CONNECT msg so we don't know if there is a DLCI */
1244 ti
= proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_i_octet_dlci_presence_unknown
, tvb
, 0, 0, ENC_NA
);
1245 PROTO_ITEM_SET_GENERATED(ti
);
1249 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1251 case SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT
: /* data */
1252 /* r: 1-bit reserved */
1253 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1254 /* D: 2-bit field indicating # of data bits */
1255 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_num_data_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1256 /* P: 3-bit field for parity type */
1257 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_parity_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1258 /* S: 2-bit field indicating # of stop bits */
1259 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_num_stop_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1263 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1265 case SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN
: /* data */
1266 /* r: 1-bit reserved */
1267 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1268 /* D: 2-bit field indicating # of data bits */
1269 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_num_data_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1270 /* P: 3-bit field for parity type */
1271 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_parity_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1272 /* S: 2-bit field indicating # of stop bits */
1273 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_num_stop_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1277 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1279 case SPRT_MODEM_RELAY_MSG_ID_I_FRAME
: /* data */
1280 /* R: 6 reserved bits */
1281 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_frame_reserved_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1282 /* Fr: data frame state */
1283 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_frame_state
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1287 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1289 case SPRT_MODEM_RELAY_MSG_ID_I_OCTET_CS
: /* data */
1290 /* CS: 2-byte character sequence number */
1291 /* TODO - does this msg type ever have a DLCI? */
1292 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1294 payload_length
-= 2;
1296 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1298 case SPRT_MODEM_RELAY_MSG_ID_I_CHAR_STAT_CS
: /* data */
1299 /* r: 1-bit reserved */
1300 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1301 /* D: 2-bit field indicating # of data bits */
1302 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_num_data_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1303 /* P: 3-bit field for parity type */
1304 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_parity_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1305 /* S: 2-bit field indicating # of stop bits */
1306 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_num_stop_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1309 /* CS: 2-byte character sequence number */
1310 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1312 payload_length
-= 2;
1314 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1316 case SPRT_MODEM_RELAY_MSG_ID_I_CHAR_DYN_CS
: /* data */
1317 /* r: 1-bit reserved */
1318 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1319 /* D: 2-bit field indicating # of data bits */
1320 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_num_data_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1321 /* P: 3-bit field for parity type */
1322 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_parity_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1323 /* S: 2-bit field indicating # of stop bits */
1324 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_num_stop_bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1327 /* CS: 2-byte character sequence number */
1328 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data_cs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1330 payload_length
-= 2;
1332 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1335 proto_tree_add_item(sprt_payload_tree
, hf_sprt_payload_data
, tvb
, offset
, payload_length
, ENC_NA
);
1339 proto_tree_add_item(sprt_tree
, hf_sprt_payload_no_data
, tvb
, offset
, 0, ENC_NA
);
1340 col_append_str(pinfo
->cinfo
, COL_INFO
, ", No Payload");
1347 dissect_sprt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
1349 /* Set up structures needed to add the protocol subtree and manage it */
1351 proto_tree
*sprt_tree
= NULL
;
1352 proto_tree
*sprt_ack_field_tree
;
1354 unsigned int offset
= 0;
1355 guint payload_length
;
1356 struct _sprt_conversation_info
*p_conv_data
= NULL
;
1360 guint16 seqnum
; /* 0 if TC = 0 or if no payload */
1366 /* Make entries in Protocol column and Info column on summary display */
1367 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "SPRT");
1368 col_clear(pinfo
->cinfo
, COL_INFO
);
1372 /* create the trees */
1373 ti
= proto_tree_add_item(tree
, proto_sprt
, tvb
, 0, -1, ENC_NA
);
1374 sprt_tree
= proto_item_add_subtree(ti
, ett_sprt
);
1376 /* show conversation setup info */
1377 if (global_sprt_show_setup_info
)
1379 show_setup_info(tvb
, pinfo
, sprt_tree
);
1383 /*SPRT header packet format
1384 +------+-------+-------+-------+-------+-------+---------+-------+
1385 |0 |1 |2 |3 |4 |5 |6 |7 |
1386 +------+-------+-------+-------+-------+-------+---------+-------+
1388 +----------------------------------------------------------------+
1390 +--------------+-------------------------------------------------+
1391 | TC | Sequence Number |
1392 +--------------+-------------------------------------------------+
1394 +----------------------------------------------------------------+
1395 | NOA | Base Sequence Number |
1396 +--------------+-------------------------------------------------+
1397 | Base Sequence Number |
1398 +----------------------------------------------------------------+
1400 +--------------+-------------------------------------------------+
1402 +----------------------------------------------------------------+
1404 +--------------+-------------------------------------------------+
1406 +----------------------------------------------------------------+
1408 +--------------+-------------------------------------------------+
1410 +----------------------------------------------------------------+
1413 /* Get fields needed for further dissection */
1414 word1
= tvb_get_ntohs(tvb
, offset
+ 2);
1415 tc
= (word1
& 0xC000) >> 14;
1416 seqnum
= word1
& 0x3FFF;
1418 noa
= (tvb_get_ntohs(tvb
, offset
+ 4) & 0xC000) >> 14;
1420 /* Get conversation data, or create it if not found */
1421 p_conv_data
= find_sprt_conversation_data(pinfo
);
1424 sprt_add_address(pinfo
,
1425 &pinfo
->src
, pinfo
->srcport
,
1429 p_conv_data
= find_sprt_conversation_data(pinfo
);
1432 proto_tree_add_item(sprt_tree
, hf_sprt_header_extension_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1433 proto_tree_add_item(sprt_tree
, hf_sprt_subsession_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1436 proto_tree_add_item(sprt_tree
, hf_sprt_reserved_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1437 proto_tree_add_item(sprt_tree
, hf_sprt_payload_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1440 proto_tree_add_item(sprt_tree
, hf_sprt_transport_channel_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1441 ti
= proto_tree_add_item(sprt_tree
, hf_sprt_sequence_number
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1442 if (tc
== 0 && seqnum
!= 0)
1443 expert_add_info(pinfo
, ti
, &ei_sprt_sequence_number_0
);
1445 p_conv_data
->seqnum
[tc
] = seqnum
; /* keep track of seqnum values */
1448 proto_tree_add_item(sprt_tree
, hf_sprt_number_of_ack_fields
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1449 proto_tree_add_item(sprt_tree
, hf_sprt_base_sequence_number
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1452 if (noa
) /* parse ack fields? There can be 0 - 3 */
1454 ti
= proto_tree_add_item(sprt_tree
, hf_sprt_ack_field_items
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1455 sprt_ack_field_tree
= proto_item_add_subtree(ti
, ett_sprt_ack_fields
);
1457 for(i
= 0; i
< noa
; i
++)
1459 proto_tree_add_item(sprt_ack_field_tree
, hf_sprt_transport_channel_item
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1460 proto_tree_add_item(sprt_ack_field_tree
, hf_sprt_sequence_item
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1465 /* put details in the info column */
1466 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "TC=%u", tc
);
1468 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Seq=%u", seqnum
);
1470 /* dissect the payload, if any */
1471 payload_length
= tvb_length(tvb
) - (6 + noa
* 2); /* total sprt length - header stuff */
1472 dissect_sprt_data(tvb
, pinfo
, p_conv_data
, sprt_tree
, offset
, payload_length
);
1475 col_append_str(pinfo
->cinfo
, COL_INFO
, " (ACK fields present)");
1477 return tvb_length(tvb
);
1480 /* heuristic dissector */
1482 dissect_sprt_heur(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
1484 guint8 octet
, extension_bit
, reserved_bit
, payload_type
;
1485 guint16 word
, tc
, seqnum
;
1486 unsigned int offset
= 0;
1488 /* This is a heuristic dissector, which means we get all the UDP
1489 * traffic not sent to a known dissector and not claimed by
1490 * a heuristic dissector called before us!
1493 if (tvb_length(tvb
) < 6)
1494 return FALSE
; /* packet is waay to short */
1496 /* Get the fields in the first two octets */
1497 extension_bit
= tvb_get_guint8(tvb
, offset
) & 0x7F;
1498 if (extension_bit
!= 0) /* must be 0 */
1501 octet
= tvb_get_guint8(tvb
, offset
+ 1);
1502 reserved_bit
= octet
& 80;
1503 payload_type
= octet
& 0x7F;
1504 if (reserved_bit
!= 0) /* must be 0 */
1506 if (payload_type
< 96 || payload_type
> 128) /* value within RTP dynamic payload type range */
1509 word
= tvb_get_ntohs(tvb
, offset
+ 2);
1511 seqnum
= word
& 0x3F;
1512 if ((tc
== 0 || tc
== 3) && (seqnum
!= 0)) /* seqnum only applies if tc is 1 or 2 */
1515 dissect_sprt(tvb
, pinfo
, tree
, NULL
);
1519 /* register the protocol with Wireshark */
1521 proto_register_sprt(void)
1523 module_t
*sprt_module
;
1524 expert_module_t
* expert_sprt
;
1526 static hf_register_info hf
[] =
1538 "Stream setup, method and frame number", HFILL
1542 &hf_sprt_setup_frame
,
1550 "Frame that set up this stream", HFILL
1554 &hf_sprt_setup_method
,
1557 "sprt.setup-method",
1562 "Method used to set up this stream", HFILL
1565 /* SPRT header fields: */
1567 &hf_sprt_header_extension_bit
,
1569 "Header extension bit",
1573 TFS(&tfs_set_notset
),
1579 &hf_sprt_subsession_id
,
1591 &hf_sprt_reserved_bit
,
1597 TFS(&tfs_set_notset
),
1603 &hf_sprt_payload_type
,
1615 &hf_sprt_transport_channel_id
,
1617 "Transport channel ID",
1621 VALS(sprt_transport_channel_characteristics
),
1627 &hf_sprt_sequence_number
,
1639 &hf_sprt_number_of_ack_fields
,
1641 "Number of ACK fields",
1651 &hf_sprt_base_sequence_number
,
1653 "Base sequence number",
1662 /* ACK fields, if any: */
1664 &hf_sprt_ack_field_items
, /* 0 to 3 items (TCN + SQN) */
1676 &hf_sprt_transport_channel_item
,
1678 "Transport control channel",
1688 &hf_sprt_sequence_item
,
1699 /* SPRT payload, if any: */
1703 "Payload (in bytes)",
1713 &hf_sprt_payload_no_data
,
1725 &hf_sprt_payload_reserved_bit
,
1728 "sprt.payload.reserved_bit",
1731 TFS(&tfs_set_notset
),
1737 &hf_sprt_payload_message_id
,
1739 "Payload message ID",
1740 "sprt.payload.msgid",
1742 BASE_DEC
| BASE_RANGE_STRING
,
1743 RVALS(sprt_modem_relay_msg_id_name
),
1748 /* SPRT payload fields, if any (depend on payload msgid): */
1751 &hf_sprt_payload_msg_init_all_fields
,
1753 "Init message fields",
1754 "sprt.payload.msg_init.all_fields",
1763 &hf_sprt_payload_msg_init_necrxch
,
1766 "sprt.payload.msg_init.NECRxCH",
1775 &hf_sprt_payload_msg_init_ecrxch
,
1778 "sprt.payload.msg_init.ECRxCH",
1787 &hf_sprt_payload_msg_init_xid_prof_exch
,
1789 "XID profile exchange",
1790 "sprt.payload.msg_init.XID_profile_exch",
1793 TFS(&tfs_supported_not_supported
),
1799 &hf_sprt_payload_msg_init_assym_data_types
,
1801 "Assymetrical data types",
1802 "sprt.payload.msg_init.assym_data_types",
1805 TFS(&tfs_supported_not_supported
),
1811 &hf_sprt_payload_msg_init_opt_moip_types_i_raw_bit
,
1814 "sprt.payload.msg_init.opt_moip_types_i_raw_bit",
1817 TFS(&tfs_supported_not_supported
),
1823 &hf_sprt_payload_msg_init_opt_moip_types_i_frame
,
1826 "sprt.payload.msg_init.opt_moip_types_i_frame",
1829 TFS(&tfs_supported_not_supported
),
1835 &hf_sprt_payload_msg_init_opt_moip_types_i_char_stat
,
1838 "sprt.payload.msg_init.opt_moip_types_i_char_stat",
1841 TFS(&tfs_supported_not_supported
),
1847 &hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn
,
1850 "sprt.payload.msg_init.opt_moip_types_i_char_dyn",
1853 TFS(&tfs_supported_not_supported
),
1859 &hf_sprt_payload_msg_init_opt_moip_types_i_octet_cs
,
1862 "sprt.payload.msg_init.opt_moip_types_i_octet_cs",
1865 TFS(&tfs_supported_not_supported
),
1871 &hf_sprt_payload_msg_init_opt_moip_types_i_char_stat_cs
,
1874 "sprt.payload.msg_init.opt_moip_types_i_char_stat_cs",
1877 TFS(&tfs_supported_not_supported
),
1883 &hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn_cs
,
1886 "sprt.payload.msg_init.opt_moip_types_i_char_dyn_cs",
1889 TFS(&tfs_supported_not_supported
),
1895 &hf_sprt_payload_msg_init_opt_moip_types_reserved
,
1897 "Reserved for ITU-T",
1898 "sprt.payload.msg_init.opt_moip_types_reserved",
1906 /* XID_XCHG message */
1908 &hf_sprt_payload_msg_xidxchg_ecp
,
1910 "Error correcting protocol",
1911 "sprt.payload.msg_xidxchg.ecp",
1913 BASE_DEC
| BASE_RANGE_STRING
,
1914 RVALS(sprt_ecp_name
),
1920 &hf_sprt_payload_msg_xidxchg_xidlr1_v42bis
,
1923 "sprt.payload.msg_xidxchg.xidlr1_v42bis",
1926 TFS(&tfs_supported_not_supported
),
1932 &hf_sprt_payload_msg_xidxchg_xidlr1_v44
,
1935 "sprt.payload.msg_xidxchg.xidlr1_v44",
1938 TFS(&tfs_supported_not_supported
),
1944 &hf_sprt_payload_msg_xidxchg_xidlr1_mnp5
,
1947 "sprt.payload.msg_xidxchg.xidlr1_mnp5",
1950 TFS(&tfs_supported_not_supported
),
1956 &hf_sprt_payload_msg_xidxchg_xidlr1_reserved
,
1958 "Reserved for ITU-T",
1959 "sprt.payload.msg_xidxchg.xidlr1_reserved",
1968 &hf_sprt_payload_msg_xidxchg_xidlr2_v42bis_compr_req
,
1970 "V.42bis data compression request",
1971 "sprt.payload.msg_xidxchg.xidlr2_v42bis_compr_req",
1980 &hf_sprt_payload_msg_xidxchg_xidlr3and4_v42bis_num_codewords
,
1982 "V.42bis number of codewords",
1983 "sprt.payload.msg_xidxchg.xidlr3and4_v42bis_num_codewords",
1992 &hf_sprt_payload_msg_xidxchg_xidlr5_v42bis_max_strlen
,
1994 "V.42bis maximum string length",
1995 "sprt.payload.msg_xidxchg.xidlr5_v42bis_max_strlen",
2004 &hf_sprt_payload_msg_xidxchg_xidlr6_v44_capability
,
2007 "sprt.payload.msg_xidxchg.xidlr6_v44_capability",
2016 &hf_sprt_payload_msg_xidxchg_xidlr7_v44_compr_req
,
2018 "V.44 data compression request",
2019 "sprt.payload.msg_xidxchg.xidlr7_v44_compr_req",
2028 &hf_sprt_payload_msg_xidxchg_xidlr8and9_v44_num_codewords_trans
,
2030 "V.44 number of codewords in transmit direction",
2031 "sprt.payload.msg_xidxchg.xidlr8and9_v44_num_codewords_trans",
2040 &hf_sprt_payload_msg_xidxchg_xidlr10and11_v44_num_codewords_recv
,
2042 "V.44 number of codewords in receive direction",
2043 "sprt.payload.msg_xidxchg.xidlr10and11_v44_num_codewords_recv",
2052 &hf_sprt_payload_msg_xidxchg_xidlr12_v44_max_strlen_trans
,
2054 "V.44 maximum string length in transmit direction",
2055 "sprt.payload.msg_xidxchg.xidlr12_v44_max_strlen_trans",
2064 &hf_sprt_payload_msg_xidxchg_xidlr13_v44_max_strlen_recv
,
2066 "V.44 maximum string length in receive direction",
2067 "sprt.payload.msg_xidxchg.xidlr13_v44_max_strlen_recv",
2076 &hf_sprt_payload_msg_xidxchg_xidlr14and15_v44_history_len_trans
,
2078 "V.44 length of history in transmit direction",
2079 "sprt.payload.msg_xidxchg.xidlr14and15_v44_history_len_trans",
2088 &hf_sprt_payload_msg_xidxchg_xidlr16and17_v44_history_len_recv
,
2090 "V.44 length of history in receive direction",
2091 "sprt.payload.msg_xidxchg.xidlr16and17_v44_history_len_recv",
2099 /* JM_INFO message */
2101 &hf_sprt_payload_msg_jminfo_category_data
,
2104 "sprt.payload.msg_jminfo.category_data",
2113 &hf_sprt_payload_msg_jminfo_category_id
,
2116 "sprt.payload.msg_jminfo.category_id",
2119 VALS(sprt_jm_info_cat_id_name
),
2125 &hf_sprt_payload_msg_jminfo_category_ext_info
,
2127 "Unrecognized category data",
2128 "sprt.payload.msg_jminfo.category_ext_info",
2137 &hf_sprt_payload_msg_jminfo_unk_category_info
,
2139 "Category extension data",
2140 "sprt.payload.msg_jminfo.unk_category_info",
2149 &hf_sprt_payload_msg_jminfo_category_leftover_bits
,
2151 "Leftover bits", /* "Category info leftover bits", */
2152 "sprt.payload.msg_jminfo.category_leftover_bits",
2161 &hf_sprt_payload_msg_jminfo_call_function
,
2164 "sprt.payload.msg_jminfo.call_function",
2167 VALS(sprt_jminfo_tbc_call_funct_name
),
2173 &hf_sprt_payload_msg_jminfo_mod_v34_duplex
,
2176 "sprt.payload.msg_jminfo.mod_v34_duplex",
2179 TFS(&tfs_available_not_available
),
2185 &hf_sprt_payload_msg_jminfo_mod_v34_half_duplex
,
2188 "sprt.payload.msg_jminfo.mod_v34_half_duplex",
2191 TFS(&tfs_available_not_available
),
2197 &hf_sprt_payload_msg_jminfo_mod_v32bis_v32
,
2200 "sprt.payload.msg_jminfo.mod_v32bis_v32",
2203 TFS(&tfs_available_not_available
),
2209 &hf_sprt_payload_msg_jminfo_mod_v22bis_v22
,
2212 "sprt.payload.msg_jminfo.mod_v22bis_v22",
2215 TFS(&tfs_available_not_available
),
2221 &hf_sprt_payload_msg_jminfo_mod_v17
,
2224 "sprt.payload.msg_jminfo.mod_v17",
2227 TFS(&tfs_available_not_available
),
2233 &hf_sprt_payload_msg_jminfo_mod_v29_half_duplex
,
2236 "sprt.payload.msg_jminfo.mod_v29_half_duplex",
2239 TFS(&tfs_available_not_available
),
2245 &hf_sprt_payload_msg_jminfo_mod_v27ter
,
2248 "sprt.payload.msg_jminfo.mod_v27ter",
2251 TFS(&tfs_available_not_available
),
2257 &hf_sprt_payload_msg_jminfo_mod_v26ter
,
2260 "sprt.payload.msg_jminfo.mod_v26ter",
2263 TFS(&tfs_available_not_available
),
2269 &hf_sprt_payload_msg_jminfo_mod_v26bis
,
2272 "sprt.payload.msg_jminfo.mod_v16bis",
2275 TFS(&tfs_available_not_available
),
2281 &hf_sprt_payload_msg_jminfo_mod_v23_duplex
,
2284 "sprt.payload.msg_jminfo.mod_v23_duplex",
2287 TFS(&tfs_available_not_available
),
2293 &hf_sprt_payload_msg_jminfo_mod_v23_half_duplex
,
2296 "sprt.payload.msg_jminfo.mod_v23_half_duplex",
2299 TFS(&tfs_available_not_available
),
2305 &hf_sprt_payload_msg_jminfo_mod_v21
,
2308 "sprt.payload.msg_jminfo.mod_v21",
2311 TFS(&tfs_available_not_available
),
2317 &hf_sprt_payload_msg_jminfo_protocols
,
2320 "sprt.payload.msg_jminfo.protocols",
2322 BASE_DEC
| BASE_RANGE_STRING
,
2323 RVALS(sprt_jminfo_tbc_protocol_name
),
2329 &hf_sprt_payload_msg_jminfo_pstn_access_call_dce_cell
,
2331 "Call DCE is on a cellular connection",
2332 "sprt.payload.msg_jminfo.pstn_access_call_dce_cell",
2341 &hf_sprt_payload_msg_jminfo_pstn_access_answ_dce_cell
,
2343 "Answer DCE is on a cellular connection",
2344 "sprt.payload.msg_jminfo.pstn_access_answ_dce_cell",
2353 &hf_sprt_payload_msg_jminfo_pstn_access_dce_on_digital_net
,
2355 "DCE is on a digital network connection",
2356 "sprt.payload.msg_jminfo.pstn_access_dce_on_digital_net",
2365 &hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_analog
,
2367 "V.90 or V.92 analog modem availability",
2368 "sprt.payload.msg_jminfo.pcm_modem_avail_v90_v92_analog",
2371 TFS(&tfs_available_not_available
),
2377 &hf_sprt_payload_msg_jminfo_pcm_modem_avail_v90_v92_digital
,
2379 "V.90 or V.92 digital modem availability",
2380 "sprt.payload.msg_jminfo.pcm_modem_avail_v90_v92_digital",
2383 TFS(&tfs_available_not_available
),
2389 &hf_sprt_payload_msg_jminfo_pcm_modem_avail_v91
,
2391 "V.91 modem availability",
2392 "sprt.payload.msg_jminfo.pcm_modem_avail_v91",
2395 TFS(&tfs_available_not_available
),
2400 /* START_JM message has no additional fields */
2401 /* CONNECT message */
2403 &hf_sprt_payload_msg_connect_selmod
,
2405 "Selected modulation",
2406 "sprt.payload.msg_connect.selmod",
2408 BASE_DEC
| BASE_RANGE_STRING
,
2409 RVALS(sprt_selmod_name
),
2415 &hf_sprt_payload_msg_connect_compr_dir
,
2417 "Compression direction",
2418 "sprt.payload.msg_connect.compr_dir",
2421 VALS(sprt_comp_direction
),
2427 &hf_sprt_payload_msg_connect_selected_compr
,
2429 "Selected compression",
2430 "sprt.payload.msg_connect.selected_compr",
2432 BASE_DEC
| BASE_RANGE_STRING
,
2433 RVALS(sprt_selected_compr_name
),
2439 &hf_sprt_payload_msg_connect_selected_err_corr
,
2441 "Selected error correction",
2442 "sprt.payload.msg_connect.selected_err_corr",
2444 BASE_DEC
| BASE_RANGE_STRING
,
2445 RVALS(sprt_selected_err_corr_name
),
2451 &hf_sprt_payload_msg_connect_tdsr
,
2453 "Transmit data signalling rate (bits/sec)",
2454 "sprt.payload.msg_connect.tdsr",
2463 &hf_sprt_payload_msg_connect_rdsr
,
2465 "Receive data signalling rate (bits/sec)",
2466 "sprt.payload.msg_connect.rdsr",
2475 &hf_sprt_payload_msg_connect_dlci_enabled
,
2478 "sprt.payload.msg_connect.dlci_enabled",
2481 TFS(&tfs_enabled_disabled
),
2487 &hf_sprt_payload_msg_connect_avail_data_types
,
2489 "Available data types",
2490 "sprt.payload.msg_connect.avail_data_types",
2499 &hf_sprt_payload_msg_connect_adt_octet_no_format_no_dlci
,
2501 "Octet w/o formatting with no DLCI",
2502 "sprt.payload.msg_connect.adt_octet_no_format_no_dlci",
2505 TFS(&tfs_available_not_available
),
2511 &hf_sprt_payload_msg_connect_adt_i_raw_bit
,
2514 "sprt.payload.msg_connect.adt_i_raw_bit",
2517 TFS(&tfs_available_not_available
),
2523 &hf_sprt_payload_msg_connect_adt_i_frame
,
2526 "sprt.payload.msg_connect.adt_i_frame",
2529 TFS(&tfs_available_not_available
),
2535 &hf_sprt_payload_msg_connect_adt_i_char_stat
,
2538 "sprt.payload.msg_connect.adt_i_char_stat",
2541 TFS(&tfs_available_not_available
),
2547 &hf_sprt_payload_msg_connect_adt_i_char_dyn
,
2550 "sprt.payload.msg_connect.adt_i_char_dyn",
2553 TFS(&tfs_available_not_available
),
2558 { /* from V.150.1 amendment 2 (5-2006): */
2559 &hf_sprt_payload_msg_connect_adt_i_octet_cs
,
2562 "sprt.payload.msg_connect.adt_i_octet_cs",
2565 TFS(&tfs_available_not_available
),
2570 { /* from V.150.1 amendment 2 (5-2006): */
2571 &hf_sprt_payload_msg_connect_adt_i_char_stat_cs
,
2574 "sprt.payload.msg_connect.adt_i_char_stat_cs",
2577 TFS(&tfs_available_not_available
),
2582 { /* from V.150.1 amendment 2 (5-2006): */
2583 &hf_sprt_payload_msg_connect_adt_i_char_dyn_cs
,
2586 "sprt.payload.msg_connect.adt_i_char_dyn_cs",
2589 TFS(&tfs_available_not_available
),
2595 &hf_sprt_payload_msg_connect_adt_reserved
,
2597 "Reserved for ITU-T",
2598 "sprt.payload.msg_connect.adt_reserved",
2607 &hf_sprt_payload_msg_connect_compr_trans_dict_sz
,
2609 "Compression transmit dictionary size",
2610 "sprt.payload.msg_connect.compr_trans_dict_sz",
2619 &hf_sprt_payload_msg_connect_compr_recv_dict_sz
,
2621 "Compression receive dictionary size",
2622 "sprt.payload.msg_connect.compr_recv_dict_sz",
2631 &hf_sprt_payload_msg_connect_compr_trans_str_len
,
2633 "Compression transmit string length",
2634 "sprt.payload.msg_connect.compr_trans_str_len",
2643 &hf_sprt_payload_msg_connect_compr_recv_str_len
,
2645 "Compression receive string length",
2646 "sprt.payload.msg_connect.compr_recv_str_len",
2655 &hf_sprt_payload_msg_connect_compr_trans_hist_sz
,
2657 "Compression transmit history size",
2658 "sprt.payload.msg_connect.compr_trans_hist_sz",
2667 &hf_sprt_payload_msg_connect_compr_recv_hist_sz
,
2669 "Compression receive history size",
2670 "sprt.payload.msg_connect.compr_recv_hist_sz",
2680 &hf_sprt_payload_msg_break_source_proto
,
2682 "Break source protocol",
2683 "sprt.payload.msg_break.source_proto",
2685 BASE_DEC
| BASE_RANGE_STRING
,
2686 RVALS(sprt_break_src_proto_name
),
2692 &hf_sprt_payload_msg_break_type
,
2695 "sprt.payload.msg_break.type",
2697 BASE_DEC
| BASE_RANGE_STRING
,
2698 RVALS(sprt_break_type_name
),
2704 &hf_sprt_payload_msg_break_length
,
2706 "Break length (x10 msec)",
2707 "sprt.payload.msg_break.length",
2715 /* BREAK_ACK message has no additional fields */
2716 /* MR_EVENT message */
2718 &hf_sprt_payload_msg_mr_event_id
,
2720 "Modem relay event ID",
2721 "sprt.payload.msg_mr_event.id",
2723 BASE_DEC
| BASE_RANGE_STRING
,
2724 RVALS(sprt_mrevent_id_name
),
2730 &hf_sprt_payload_msg_mr_evt_reason_code
,
2733 "sprt.payload.msg_mr_event.reason_code",
2735 BASE_DEC
| BASE_RANGE_STRING
,
2736 RVALS(sprt_mrevent_reason_code_name
),
2742 &hf_sprt_payload_msg_mr_evt_selmod
,
2744 "Selected modulation",
2745 "sprt.payload.msg_mr_event.selmod",
2747 BASE_DEC
| BASE_RANGE_STRING
,
2748 RVALS(sprt_selmod_name
),
2754 &hf_sprt_payload_msg_mr_evt_txsen
,
2757 "sprt.payload.msg_mr_event.txsen",
2760 TFS(&tfs_enabled_disabled
),
2766 &hf_sprt_payload_msg_mr_evt_rxsen
,
2769 "sprt.payload.msg_mr_event.rxsen",
2772 TFS(&tfs_enabled_disabled
),
2778 &hf_sprt_payload_msg_mr_evt_tdsr
,
2780 "Transmit data signalling rate (bits/sec)",
2781 "sprt.payload.msg_mr_event.tdsr",
2790 &hf_sprt_payload_msg_mr_evt_rdsr
,
2792 "Receive data signalling rate (bits/sec)",
2793 "sprt.payload.msg_mr_event.rdsr",
2802 &hf_sprt_payload_msg_mr_evt_txsr
,
2804 "Physical layer transmitter symbol rate (TxSR)",
2805 "sprt.payload.msg_mr_event.txsr",
2807 BASE_DEC
| BASE_RANGE_STRING
,
2808 RVALS(sprt_mrevent_phys_layer_symbol_rate
),
2814 &hf_sprt_payload_msg_mr_evt_rxsr
,
2816 "Physical layer receiver symbol rate (RxSR)",
2817 "sprt.payload.msg_mr_event.rxsr",
2819 BASE_DEC
| BASE_RANGE_STRING
,
2820 RVALS(sprt_mrevent_phys_layer_symbol_rate
),
2825 /* CLEARDOWN message */
2827 &hf_sprt_payload_msg_cleardown_reason_code
,
2830 "sprt.payload.msg_cleardown.reason_code",
2833 VALS(sprt_cleardown_reason
),
2839 &hf_sprt_payload_msg_cleardown_vendor_tag
,
2842 "sprt.payload.msg_cleardown.vendor_tag",
2851 &hf_sprt_payload_msg_cleardown_vendor_info
,
2854 "sprt.payload.msg_cleardown.vendor_info",
2862 /* PROF_XCHG message */
2864 &hf_sprt_payload_msg_profxchg_v42_lapm
,
2866 "V.42/LAPM protocol support",
2867 "sprt.payload.msg_profxchg.v42_lapm",
2870 VALS(sprt_prof_xchg_support
),
2876 &hf_sprt_payload_msg_profxchg_annex_av42
,
2878 "Annex A/V.42(1996) protocol support",
2879 "sprt.payload.msg_profxchg.annex_av42",
2882 VALS(sprt_prof_xchg_support
),
2888 &hf_sprt_payload_msg_profxchg_v44_compr
,
2890 "V.44 compression support",
2891 "sprt.payload.msg_profxchg.v44_compr",
2894 VALS(sprt_prof_xchg_support
),
2900 &hf_sprt_payload_msg_profxchg_v42bis_compr
,
2902 "V.42bis compression support",
2903 "sprt.payload.msg_profxchg.v42bis_compr",
2906 VALS(sprt_prof_xchg_support
),
2912 &hf_sprt_payload_msg_profxchg_mnp5_compr
,
2914 "MNP5 compression support",
2915 "sprt.payload.msg_profxchg.mnp5_compr",
2918 VALS(sprt_prof_xchg_support
),
2924 &hf_sprt_payload_msg_profxchg_reserved
,
2926 "Reserved for ITU-T",
2927 "sprt.payload.msg_profxchg.reserved",
2936 &hf_sprt_payload_msg_profxchg_xidlr2_v42bis_compr_req
,
2938 "V.42bis data compression request",
2939 "sprt.payload.msg_profxchg.xidlr2_v42bis_compr_req",
2948 &hf_sprt_payload_msg_profxchg_xidlr3and4_v42bis_num_codewords
,
2950 "V.42bis number of codewords",
2951 "sprt.payload.msg_profxchg.xidlr3and4_v42bis_num_codewords",
2960 &hf_sprt_payload_msg_profxchg_xidlr5_v42bis_max_strlen
,
2962 "V.42bis maximum string length",
2963 "sprt.payload.msg_profxchg.xidlr5_v42bis_max_strlen",
2972 &hf_sprt_payload_msg_profxchg_xidlr6_v44_capability
,
2975 "sprt.payload.msg_profxchg.xidlr6_v44_capability",
2984 &hf_sprt_payload_msg_profxchg_xidlr7_v44_compr_req
,
2986 "V.44 data compression request",
2987 "sprt.payload.msg_profxchg.xidlr7_v44_compr_req",
2996 &hf_sprt_payload_msg_profxchg_xidlr8and9_v44_num_codewords_trans
,
2998 "V.44 number of codewords in transmit direction",
2999 "sprt.payload.msg_profxchg.xidlr8and9_v44_num_codewords_trans",
3008 &hf_sprt_payload_msg_profxchg_xidlr10and11_v44_num_codewords_recv
,
3010 "V.44 number of codewords in receive direction",
3011 "sprt.payload.msg_profxchg.xidlr10and11_v44_num_codewords_recv",
3020 &hf_sprt_payload_msg_profxchg_xidlr12_v44_max_strlen_trans
,
3022 "V.44 maximum string length in transmit direction",
3023 "sprt.payload.msg_profxchg.xidlr12_v44_max_strlen_trans",
3032 &hf_sprt_payload_msg_profxchg_xidlr13_v44_max_strlen_recv
,
3034 "V.44 maximum string length in receive direction",
3035 "sprt.payload.msg_profxchg.xidlr13_v44_max_strlen_recv",
3044 &hf_sprt_payload_msg_profxchg_xidlr14and15_v44_history_len_trans
,
3046 "V.44 length of history in transmit direction",
3047 "sprt.payload.msg_profxchg.xidlr14and15_v44_history_len_trans",
3056 &hf_sprt_payload_msg_profxchg_xidlr16and17_v44_history_len_recv
,
3058 "V.44 length of history in receive direction",
3059 "sprt.payload.msg_profxchg.xidlr16and17_v44_history_len_recv",
3067 /* User data messages... */
3068 /* I_OCTET message: need to use DLCI field (8 or 16 bits) if indicated by CONNECT message */
3070 &hf_sprt_payload_i_octet_no_dlci
,
3073 "sprt.payload.i_octet_no_dlci",
3082 &hf_sprt_payload_i_octet_dlci_presence_unknown
,
3084 "Not known if DLCI field is present",
3085 "sprt.payload.i_octet_dlci_presence_unknown",
3094 &hf_sprt_payload_i_octet_dlci1
,
3097 "sprt.payload.i_octet_dlci1",
3099 BASE_DEC
| BASE_RANGE_STRING
,
3100 RVALS(sprt_payload_dlci1
),
3106 &hf_sprt_payload_i_octet_cr
,
3108 "Command/response bit",
3109 "sprt.payload.i_octet_cr",
3118 &hf_sprt_payload_i_octet_ea
,
3120 "Address field extension bit",
3121 "sprt.payload.i_octet_ea",
3124 TFS(&sprt_payload_ea_bit
),
3130 &hf_sprt_payload_i_octet_dlci2
,
3133 "sprt.payload.i_octet_dlci2",
3135 BASE_DEC
| BASE_RANGE_STRING
,
3136 RVALS(sprt_payload_dlci2
),
3142 &hf_sprt_payload_i_octet_dlci_setup_by_connect_frame
,
3144 "DLCI setup by CONNECT message at frame",
3145 "sprt.payload.i_octet_dlci_setup_by_connect_frame",
3153 /* fields for I_RAW_OCTET message (L; L,N) */
3155 &hf_sprt_payload_rawoctet_n_field_present
,
3158 "sprt.payload.rawoctet_n_field_present",
3161 TFS(&tfs_present_absent
),
3167 &hf_sprt_payload_rawoctet_l
,
3169 "L: # of octets in segment minus one",
3170 "sprt.payload.rawoctet_l",
3179 &hf_sprt_payload_rawoctet_n
,
3181 "N: # of times octets appear in data minus 2",
3182 "sprt.payload.rawoctet_n",
3190 /* fields for I_RAW_BIT (L; L,P; L,P,N) */
3192 &hf_sprt_payload_rawbit_included_fields_l
,
3194 "Include field L only",
3195 "sprt.payload.rawbit_included_fields_l",
3199 0xC0, /* top two bits: 00 */
3204 &hf_sprt_payload_rawbit_included_fields_lp
,
3206 "Include fields L, P",
3207 "sprt.payload.rawbit_field_format_lp",
3211 0xC0, /* top two bits: 01 */
3216 &hf_sprt_payload_rawbit_included_fields_lpn
,
3218 "Include fields L, P, N",
3219 "sprt.payload.rawbit_included_fields_lpn",
3223 0x80, /* top bit: 1 */
3228 &hf_sprt_payload_rawbit_len_a
,
3230 "L: # of octets in segment",
3231 "sprt.payload.rawbit_len_a",
3235 0x3F, /* six bits */
3240 &hf_sprt_payload_rawbit_len_b
,
3242 "L: # of octets in segment",
3243 "sprt.payload.rawbit_len_b",
3247 0x38, /* three bits */
3252 &hf_sprt_payload_rawbit_len_c
,
3254 "L: # of octets in segment",
3255 "sprt.payload.rawbit_len_c",
3259 0x78, /* four bits */
3264 &hf_sprt_payload_rawbit_p
,
3266 "P: # of low-order bits in last octet that are not in segment",
3267 "sprt.payload.rawbit_p",
3271 0x7, /* three bits */
3276 &hf_sprt_payload_rawbit_n
,
3278 "N: # of times octets appear in data minus 2",
3279 "sprt.payload.rawbit_n",
3283 0xFF, /* eight bits */
3287 /* fields in I_CHAR_STAT & I_CHAR_DYN messages */
3289 &hf_sprt_payload_data_reserved_bit
,
3292 "sprt.payload.reserved_bit",
3295 TFS(&tfs_set_notset
),
3301 &hf_sprt_payload_data_num_data_bits
,
3303 "D: Number of data bits",
3304 "sprt.payload.num_data_bits",
3307 VALS(sprt_payload_data_bits
),
3313 &hf_sprt_payload_data_parity_type
,
3316 "sprt.payload.parity_type",
3319 VALS(sprt_payload_parity
),
3325 &hf_sprt_payload_num_stop_bits
,
3327 "S: Number stop bits",
3328 "sprt.payload.num_stop_bits",
3331 VALS(sprt_payload_stop_bits
),
3336 /* sequence field in I_OCTET_CS, I_CHAR_STAT_CS, & I_CHAR_DYN_CS messages */
3338 &hf_sprt_payload_data_cs
,
3340 "Character sequence number",
3349 /* fields for I_FRAME: */
3351 &hf_sprt_payload_frame_reserved_bits
,
3354 "sprt.payload.frame_reserved_bits",
3363 &hf_sprt_payload_frame_state
,
3366 "sprt.payload.frame_state",
3369 VALS(sprt_payload_frame_state
),
3374 /* just dump remaining payload data: */
3376 &hf_sprt_payload_data
,
3379 "sprt.payload.data",
3387 }; /* hf_register_info hf[] */
3389 /* setup protocol subtree array */
3390 static gint
*ett
[] = {
3393 &ett_sprt_ack_fields
,
3395 &ett_init_msg_all_fields
,
3396 &ett_jminfo_msg_cat_data
,
3397 &ett_connect_msg_adt
3400 static ei_register_info ei
[] = {
3401 { &ei_sprt_sequence_number_0
, { "sprt.sequence_number_0", PI_PROTOCOL
, PI_WARN
, "Should be 0 for transport channel 0", EXPFILL
}},
3404 /* register protocol name & description */
3405 proto_sprt
= proto_register_protocol("Simple Packet Relay Transport", "SPRT", "sprt");
3407 /* required function calls to register the header fields and subtrees used */
3408 proto_register_field_array(proto_sprt
, hf
, array_length(hf
));
3409 proto_register_subtree_array(ett
, array_length(ett
));
3410 expert_sprt
= expert_register_protocol(proto_sprt
);
3411 expert_register_field_array(expert_sprt
, ei
, array_length(ei
));
3413 /* register the dissector */
3414 new_register_dissector("sprt", dissect_sprt
, proto_sprt
);
3416 sprt_module
= prefs_register_protocol(proto_sprt
, NULL
);
3419 prefs_register_bool_preference(sprt_module
, "show_setup_info",
3420 "Show stream setup information",
3421 "Where available, show which protocol and frame caused "
3422 "this SPRT stream to be created",
3423 &global_sprt_show_setup_info
);
3424 prefs_register_bool_preference(sprt_module
, "show_dlci_info",
3425 "Show DLCI in I_OCTET messages",
3426 "Show the DLCI field in I_OCTET messages as well as the frame that "
3427 "enabled/disabled the DLCI",
3428 &global_sprt_show_dlci_info
);
3433 proto_reg_handoff_sprt(void)
3435 sprt_handle
= find_dissector("sprt");
3436 dissector_add_handle("udp.port", sprt_handle
);
3438 heur_dissector_add( "udp", dissect_sprt_heur
, proto_sprt
);