HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-sprt.c
blobb47ff436c7ec16f8f32e700c503c14f5126693fc
1 /* packet-sprt.h
3 * Routines for SPRT dissection
4 * SPRT = Simple Packet Relay Transport
6 * $Id$
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.
31 /* TODO:
32 * - work on conversations
36 #include "config.h"
38 #include <glib.h>
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 */
58 typedef enum {
59 DLCI_UNKNOWN,
60 DLCI_PRESENT,
61 DLCI_ABSENT
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: */
75 guint32 seqnum[4];
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
97 /* 11 -15 Reserved */
98 #define SPRT_MODEM_RELAY_MSG_ID_RESERVED1_START 11
99 #define SPRT_MODEM_RELAY_MSG_ID_RESERVED1_END 15
100 /* Data */
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.: */
281 /* # of data bits */
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
288 /* parity */
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
299 /* # of stop bits */
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 */
338 /* INIT msg: */
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;
395 /* CONNECT msg: */
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;
419 /* BREAK msg: */
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;
423 /* MR_EVENT msg: */
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;
433 /* CLEARDOWN msg: */
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;
437 /* PROF_XCHG msg: */
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;
455 /* I_OCTET */
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;
484 /* Preferences */
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" },
510 { 0, NULL}
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" },
537 { 0, 0, NULL }
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" },
545 { 0, 0, NULL }
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" },
555 { 0, NULL }
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)" },
565 { 0, NULL }
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" },
570 { 0, 0, NULL }
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" },
594 { 0, 0, NULL }
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" },
602 { 0, NULL }
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" },
611 { 0, 0, NULL }
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" },
619 { 0, 0, NULL }
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" },
627 { 0, 0, NULL }
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" },
636 { 0, 0, NULL }
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" },
645 { 0, 0, NULL }
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" },
653 { 0, 0, NULL }
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" },
669 { 0, 0, NULL }
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" },
681 { 0, NULL }
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" },
688 { 0, NULL }
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" },
696 { 0, 0, NULL }
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" },
705 { 0, 0, NULL }
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" },
713 { 0, NULL }
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" },
725 { 0, NULL }
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" },
733 { 0, NULL }
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" },
741 { 0, NULL }
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,
753 &pinfo->src,
754 &pinfo->dst,
755 pinfo->ptype,
756 pinfo->srcport,
757 pinfo->destport,
758 NO_ADDR_B|NO_PORT_B);
759 if (p_conv)
761 p_conv_data = (struct _sprt_conversation_info*)conversation_get_proto_data(p_conv, proto_sprt);
763 return p_conv_data;
768 /* set up SPRT conversation */
769 void sprt_add_address(packet_info *pinfo,
770 address *addr, int port,
771 int other_port,
772 const gchar *setup_method,
773 guint32 setup_frame_number)
775 address null_addr;
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
782 * again.
784 if (pinfo->fd->flags.visited)
786 return;
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));
807 /* Set dissector */
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.
818 if (!p_conv_data) {
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;
843 proto_item *ti;
845 /* look up the conversation & get the data */
846 p_conv_data = find_sprt_conversation_data(pinfo);
848 if (!p_conv_data)
850 proto_tree_add_string_format(tree, hf_sprt_setup, tvb, 0, 0, "", "No setup info found");
851 return;
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)",
858 p_conv_data->method,
859 p_conv_data->frame_number);
860 PROTO_ITEM_SET_GENERATED(ti);
861 sprt_setup_tree = proto_item_add_subtree(ti, ett_sprt_setup);
862 if (sprt_setup_tree)
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 */
876 static int
877 dissect_sprt_data(tvbuff_t *tvb,
878 packet_info *pinfo,
879 struct _sprt_conversation_info *p_conv_data,
880 proto_tree *sprt_tree,
881 unsigned int offset,
882 guint payload_length)
884 proto_item *ti;
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);
901 offset++;
902 payload_length--;
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:
911 /* make subtree */
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);
927 offset += 2;
928 break;
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);
931 offset++;
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);
936 offset++;
937 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr2_v42bis_compr_req, tvb, offset, 1, ENC_BIG_ENDIAN);
938 offset++;
939 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr3and4_v42bis_num_codewords, tvb, offset, 2, ENC_BIG_ENDIAN);
940 offset += 2;
941 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr5_v42bis_max_strlen, tvb, offset, 1, ENC_BIG_ENDIAN);
942 offset++;
943 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr6_v44_capability, tvb, offset, 1, ENC_BIG_ENDIAN);
944 offset++;
945 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr7_v44_compr_req, tvb, offset, 1, ENC_BIG_ENDIAN);
946 offset++;
947 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr8and9_v44_num_codewords_trans, tvb, offset, 2, ENC_BIG_ENDIAN);
948 offset += 2;
949 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr10and11_v44_num_codewords_recv, tvb, offset, 2, ENC_BIG_ENDIAN);
950 offset += 2;
951 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr12_v44_max_strlen_trans, tvb, offset, 1, ENC_BIG_ENDIAN);
952 offset++;
953 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr13_v44_max_strlen_recv, tvb, offset, 1, ENC_BIG_ENDIAN);
954 offset++;
955 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr14and15_v44_history_len_trans, tvb, offset, 2, ENC_BIG_ENDIAN);
956 offset += 2;
957 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_xidxchg_xidlr16and17_v44_history_len_recv, tvb, offset, 2, ENC_BIG_ENDIAN);
958 offset += 2;
959 break;
960 case SPRT_MODEM_RELAY_MSG_ID_JM_INFO:
961 category_count = 1;
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);
969 category_count++;
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);
973 switch(category_id)
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);
978 break;
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);
992 break;
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);
996 break;
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);
1002 break;
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);
1008 break;
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);
1011 break;
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);
1014 break;
1016 offset += 2;
1017 } while (tvb_length_remaining(tvb, offset) >= 2);
1018 break;
1019 case SPRT_MODEM_RELAY_MSG_ID_START_JM:
1020 /* No additional content */
1021 break;
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);
1025 offset++;
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);
1029 offset++;
1030 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_connect_tdsr, tvb, offset, 2, ENC_BIG_ENDIAN);
1031 offset += 2;
1032 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_connect_rdsr, tvb, offset, 2, ENC_BIG_ENDIAN);
1033 offset += 2;
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;
1041 if (word & 0x8000)
1043 p_conv_data->i_octet_dlci_status = DLCI_PRESENT;
1044 } else {
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);
1062 offset += 2;
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);
1067 offset += 2;
1068 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_connect_compr_recv_dict_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
1069 offset += 2;
1070 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_connect_compr_trans_str_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1071 offset++;
1072 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_connect_compr_recv_str_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1073 offset++;
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);
1080 offset += 2;
1081 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_connect_compr_recv_hist_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
1082 offset += 2;
1084 break;
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);
1088 offset++;
1089 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_break_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1090 offset++;
1091 break;
1092 case SPRT_MODEM_RELAY_MSG_ID_BREAK_ACK:
1093 /* No additional content */
1094 break;
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);
1098 offset++;
1099 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_mr_evt_reason_code, tvb, offset, 1, ENC_BIG_ENDIAN);
1100 offset++;
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);
1106 offset++;
1107 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_mr_evt_tdsr, tvb, offset, 2, ENC_BIG_ENDIAN);
1108 offset += 2;
1109 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_mr_evt_rdsr, tvb, offset, 2, ENC_BIG_ENDIAN);
1110 offset += 2;
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);
1117 offset++;
1118 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_mr_evt_rxsr, tvb, offset, 1, ENC_BIG_ENDIAN);
1119 offset++;
1122 break;
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);
1125 offset++;
1126 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_cleardown_vendor_tag, tvb, offset, 1, ENC_BIG_ENDIAN);
1127 offset++;
1128 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_cleardown_vendor_info, tvb, offset, 1, ENC_BIG_ENDIAN);
1129 offset++;
1130 break;
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);
1136 offset++;
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);
1139 offset++;
1140 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr2_v42bis_compr_req, tvb, offset, 1, ENC_BIG_ENDIAN);
1141 offset++;
1142 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr3and4_v42bis_num_codewords, tvb, offset, 2, ENC_BIG_ENDIAN);
1143 offset += 2;
1144 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr5_v42bis_max_strlen, tvb, offset, 1, ENC_BIG_ENDIAN);
1145 offset++;
1146 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr6_v44_capability, tvb, offset, 1, ENC_BIG_ENDIAN);
1147 offset++;
1148 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr7_v44_compr_req, tvb, offset, 1, ENC_BIG_ENDIAN);
1149 offset++;
1150 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr8and9_v44_num_codewords_trans, tvb, offset, 2, ENC_BIG_ENDIAN);
1151 offset += 2;
1152 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr10and11_v44_num_codewords_recv, tvb, offset, 2, ENC_BIG_ENDIAN);
1153 offset += 2;
1154 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr12_v44_max_strlen_trans, tvb, offset, 1, ENC_BIG_ENDIAN);
1155 offset++;
1156 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr13_v44_max_strlen_recv, tvb, offset, 1, ENC_BIG_ENDIAN);
1157 offset++;
1158 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr14and15_v44_history_len_trans, tvb, offset, 2, ENC_BIG_ENDIAN);
1159 offset += 2;
1160 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_msg_profxchg_xidlr16and17_v44_history_len_recv, tvb, offset, 2, ENC_BIG_ENDIAN);
1161 offset += 2;
1162 break;
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);
1171 offset++;
1172 payload_length--;
1173 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_data, tvb, offset, payload_length, ENC_NA);
1174 break;
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);
1185 offset++;
1186 payload_length--;
1187 break;
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);
1193 offset++;
1194 payload_length--;
1195 break;
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);
1201 offset++;
1202 payload_length--;
1203 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_rawbit_n, tvb, offset, 1, ENC_BIG_ENDIAN);
1204 offset++;
1205 payload_length--;
1206 break;
1208 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_data, tvb, offset, payload_length, ENC_NA);
1209 break;
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)
1218 case DLCI_PRESENT:
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);
1223 offset++;
1224 payload_length--;
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);
1230 offset++;
1231 payload_length--;
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);
1235 break;
1236 case DLCI_ABSENT:
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);
1241 break;
1242 case DLCI_UNKNOWN: /* e.g., we didn't see the CONNECT msg so we don't know if there is a DLCI */
1243 default:
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);
1246 break;
1249 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_data, tvb, offset, payload_length, ENC_NA);
1250 break;
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);
1260 offset++;
1261 payload_length--;
1262 /* octets */
1263 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_data, tvb, offset, payload_length, ENC_NA);
1264 break;
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);
1274 offset++;
1275 payload_length--;
1276 /* octets */
1277 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_data, tvb, offset, payload_length, ENC_NA);
1278 break;
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);
1284 offset++;
1285 payload_length--;
1286 /* octets */
1287 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_data, tvb, offset, payload_length, ENC_NA);
1288 break;
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);
1293 offset += 2;
1294 payload_length -= 2;
1295 /* octets */
1296 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_data, tvb, offset, payload_length, ENC_NA);
1297 break;
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);
1307 offset++;
1308 payload_length--;
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);
1311 offset += 2;
1312 payload_length -= 2;
1313 /* octets */
1314 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_data, tvb, offset, payload_length, ENC_NA);
1315 break;
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);
1325 offset++;
1326 payload_length--;
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);
1329 offset += 2;
1330 payload_length -= 2;
1331 /* octets */
1332 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_data, tvb, offset, payload_length, ENC_NA);
1333 break;
1334 default:
1335 proto_tree_add_item(sprt_payload_tree, hf_sprt_payload_data, tvb, offset, payload_length, ENC_NA);
1336 break;
1338 } else {
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");
1343 return offset;
1346 static int
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 */
1350 proto_item *ti;
1351 proto_tree *sprt_tree = NULL;
1352 proto_tree *sprt_ack_field_tree;
1353 guint16 word1;
1354 unsigned int offset = 0;
1355 guint payload_length;
1356 struct _sprt_conversation_info *p_conv_data = NULL;
1357 int i;
1359 guint16 tc;
1360 guint16 seqnum; /* 0 if TC = 0 or if no payload */
1361 guint16 noa;
1362 /* ack fields */
1363 /*guint16 tcn;*/
1364 /*guint16 sqn;*/
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);
1370 if (tree)
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 +------+-------+-------+-------+-------+-------+---------+-------+
1387 | X | SSID |
1388 +----------------------------------------------------------------+
1389 | R | PT |
1390 +--------------+-------------------------------------------------+
1391 | TC | Sequence Number |
1392 +--------------+-------------------------------------------------+
1393 | Sequence Number |
1394 +----------------------------------------------------------------+
1395 | NOA | Base Sequence Number |
1396 +--------------+-------------------------------------------------+
1397 | Base Sequence Number |
1398 +----------------------------------------------------------------+
1399 | TCN | SQN |
1400 +--------------+-------------------------------------------------+
1401 | SQN |
1402 +----------------------------------------------------------------+
1403 | TCN | SQN |
1404 +--------------+-------------------------------------------------+
1405 | SQN |
1406 +----------------------------------------------------------------+
1407 | TCN | SQN |
1408 +--------------+-------------------------------------------------+
1409 | SQN |
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);
1422 if (!p_conv_data)
1424 sprt_add_address(pinfo,
1425 &pinfo->src, pinfo->srcport,
1427 "SPRT stream",
1428 pinfo->fd->num);
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);
1434 offset++;
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);
1438 offset++;
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 */
1446 offset+=2;
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);
1450 offset+=2;
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);
1461 offset += 2;
1465 /* put details in the info column */
1466 col_append_fstr(pinfo->cinfo, COL_INFO, "TC=%u", tc);
1467 if (tc != 0)
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);
1474 if (noa)
1475 col_append_str(pinfo->cinfo, COL_INFO, " (ACK fields present)");
1477 return tvb_length(tvb);
1480 /* heuristic dissector */
1481 static gboolean
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 */
1499 return FALSE;
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 */
1505 return FALSE;
1506 if (payload_type < 96 || payload_type > 128) /* value within RTP dynamic payload type range */
1507 return FALSE;
1509 word = tvb_get_ntohs(tvb, offset + 2);
1510 tc = word >> 14;
1511 seqnum = word & 0x3F;
1512 if ((tc == 0 || tc == 3) && (seqnum != 0)) /* seqnum only applies if tc is 1 or 2 */
1513 return FALSE;
1515 dissect_sprt(tvb, pinfo, tree, NULL);
1516 return TRUE;
1519 /* register the protocol with Wireshark */
1520 void
1521 proto_register_sprt(void)
1523 module_t *sprt_module;
1524 expert_module_t* expert_sprt;
1526 static hf_register_info hf[] =
1528 /* set up fields */
1530 &hf_sprt_setup,
1532 "Stream setup",
1533 "sprt.setup",
1534 FT_STRING,
1535 BASE_NONE,
1536 NULL,
1537 0x0,
1538 "Stream setup, method and frame number", HFILL
1542 &hf_sprt_setup_frame,
1544 "Setup frame",
1545 "sprt.setup-frame",
1546 FT_FRAMENUM,
1547 BASE_NONE,
1548 NULL,
1549 0x0,
1550 "Frame that set up this stream", HFILL
1554 &hf_sprt_setup_method,
1556 "Setup Method",
1557 "sprt.setup-method",
1558 FT_STRING,
1559 BASE_NONE,
1560 NULL,
1561 0x0,
1562 "Method used to set up this stream", HFILL
1565 /* SPRT header fields: */
1567 &hf_sprt_header_extension_bit,
1569 "Header extension bit",
1570 "sprt.x",
1571 FT_BOOLEAN,
1573 TFS(&tfs_set_notset),
1574 0x80,
1575 NULL, HFILL
1579 &hf_sprt_subsession_id,
1581 "Sub session ID",
1582 "sprt.ssid",
1583 FT_UINT8,
1584 BASE_DEC,
1585 NULL,
1586 0x7F,
1587 NULL, HFILL
1591 &hf_sprt_reserved_bit,
1593 "Reserved bit",
1594 "sprt.reserved",
1595 FT_BOOLEAN,
1597 TFS(&tfs_set_notset),
1598 0x80,
1599 NULL, HFILL
1603 &hf_sprt_payload_type,
1605 "Payload type",
1606 "sprt.pt",
1607 FT_UINT8,
1608 BASE_DEC,
1609 NULL,
1610 0x7F,
1611 NULL, HFILL
1615 &hf_sprt_transport_channel_id,
1617 "Transport channel ID",
1618 "sprt.tc",
1619 FT_UINT16,
1620 BASE_DEC,
1621 VALS(sprt_transport_channel_characteristics),
1622 0xC000,
1623 NULL, HFILL
1627 &hf_sprt_sequence_number,
1629 "Sequence number",
1630 "sprt.seq",
1631 FT_UINT16,
1632 BASE_DEC,
1633 NULL,
1634 0x3FFF,
1635 NULL, HFILL
1639 &hf_sprt_number_of_ack_fields,
1641 "Number of ACK fields",
1642 "sprt.noa",
1643 FT_UINT16,
1644 BASE_DEC,
1645 NULL,
1646 0xC000,
1647 NULL, HFILL
1651 &hf_sprt_base_sequence_number,
1653 "Base sequence number",
1654 "sprt.bsqn",
1655 FT_UINT16,
1656 BASE_DEC,
1657 NULL,
1658 0x3FFF,
1659 NULL, HFILL
1662 /* ACK fields, if any: */
1664 &hf_sprt_ack_field_items, /* 0 to 3 items (TCN + SQN) */
1666 "ACK fields",
1667 "sprt.ack.field",
1668 FT_UINT16,
1669 BASE_DEC,
1670 NULL,
1671 0xC000,
1672 NULL, HFILL
1676 &hf_sprt_transport_channel_item,
1678 "Transport control channel",
1679 "sprt.tcn",
1680 FT_UINT16,
1681 BASE_DEC,
1682 NULL,
1683 0xC000,
1684 NULL, HFILL
1688 &hf_sprt_sequence_item,
1690 "Sequence number",
1691 "sprt.sqn",
1692 FT_UINT16,
1693 BASE_DEC,
1694 NULL,
1695 0x3FFF,
1696 NULL, HFILL
1699 /* SPRT payload, if any: */
1701 &hf_sprt_payload,
1703 "Payload (in bytes)",
1704 "sprt.payload",
1705 FT_UINT32,
1706 BASE_DEC,
1707 NULL,
1708 0x0,
1709 NULL, HFILL
1713 &hf_sprt_payload_no_data,
1715 "No payload",
1716 "sprt.payload",
1717 FT_NONE,
1718 BASE_NONE,
1719 NULL,
1720 0x0,
1721 NULL, HFILL
1725 &hf_sprt_payload_reserved_bit,
1727 "Reserved bit",
1728 "sprt.payload.reserved_bit",
1729 FT_BOOLEAN,
1731 TFS(&tfs_set_notset),
1732 0x80,
1733 NULL, HFILL
1737 &hf_sprt_payload_message_id,
1739 "Payload message ID",
1740 "sprt.payload.msgid",
1741 FT_UINT8,
1742 BASE_DEC | BASE_RANGE_STRING,
1743 RVALS(sprt_modem_relay_msg_id_name),
1744 0x7F,
1745 NULL, HFILL
1748 /* SPRT payload fields, if any (depend on payload msgid): */
1749 /* INIT message */
1751 &hf_sprt_payload_msg_init_all_fields,
1753 "Init message fields",
1754 "sprt.payload.msg_init.all_fields",
1755 FT_UINT16,
1756 BASE_HEX,
1757 NULL,
1758 0xFFFF, /* 0x0 */
1759 NULL, HFILL
1763 &hf_sprt_payload_msg_init_necrxch,
1765 "NECRxCH",
1766 "sprt.payload.msg_init.NECRxCH",
1767 FT_BOOLEAN,
1769 NULL,
1770 0x8000,
1771 NULL, HFILL
1775 &hf_sprt_payload_msg_init_ecrxch,
1777 "ECRxCH",
1778 "sprt.payload.msg_init.ECRxCH",
1779 FT_BOOLEAN,
1781 NULL,
1782 0x4000,
1783 NULL, HFILL
1787 &hf_sprt_payload_msg_init_xid_prof_exch,
1789 "XID profile exchange",
1790 "sprt.payload.msg_init.XID_profile_exch",
1791 FT_BOOLEAN,
1793 TFS(&tfs_supported_not_supported),
1794 0x2000,
1795 NULL, HFILL
1799 &hf_sprt_payload_msg_init_assym_data_types,
1801 "Assymetrical data types",
1802 "sprt.payload.msg_init.assym_data_types",
1803 FT_BOOLEAN,
1805 TFS(&tfs_supported_not_supported),
1806 0x1000,
1807 NULL, HFILL
1811 &hf_sprt_payload_msg_init_opt_moip_types_i_raw_bit,
1813 "I_RAW-BIT",
1814 "sprt.payload.msg_init.opt_moip_types_i_raw_bit",
1815 FT_BOOLEAN,
1817 TFS(&tfs_supported_not_supported),
1818 0x0800,
1819 NULL, HFILL
1823 &hf_sprt_payload_msg_init_opt_moip_types_i_frame,
1825 "I_FRAME",
1826 "sprt.payload.msg_init.opt_moip_types_i_frame",
1827 FT_BOOLEAN,
1829 TFS(&tfs_supported_not_supported),
1830 0x0400,
1831 NULL, HFILL
1835 &hf_sprt_payload_msg_init_opt_moip_types_i_char_stat,
1837 "I_CHAR-STAT",
1838 "sprt.payload.msg_init.opt_moip_types_i_char_stat",
1839 FT_BOOLEAN,
1841 TFS(&tfs_supported_not_supported),
1842 0x0200,
1843 NULL, HFILL
1847 &hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn,
1849 "I_CHAR-DYN",
1850 "sprt.payload.msg_init.opt_moip_types_i_char_dyn",
1851 FT_BOOLEAN,
1853 TFS(&tfs_supported_not_supported),
1854 0x0100,
1855 NULL, HFILL
1859 &hf_sprt_payload_msg_init_opt_moip_types_i_octet_cs,
1861 "I_OCTET-CS",
1862 "sprt.payload.msg_init.opt_moip_types_i_octet_cs",
1863 FT_BOOLEAN,
1865 TFS(&tfs_supported_not_supported),
1866 0x0080,
1867 NULL, HFILL
1871 &hf_sprt_payload_msg_init_opt_moip_types_i_char_stat_cs,
1873 "I_CHAR-STAT-CS",
1874 "sprt.payload.msg_init.opt_moip_types_i_char_stat_cs",
1875 FT_BOOLEAN,
1877 TFS(&tfs_supported_not_supported),
1878 0x0040,
1879 NULL, HFILL
1883 &hf_sprt_payload_msg_init_opt_moip_types_i_char_dyn_cs,
1885 "I_CHAR-DYN-CS",
1886 "sprt.payload.msg_init.opt_moip_types_i_char_dyn_cs",
1887 FT_BOOLEAN,
1889 TFS(&tfs_supported_not_supported),
1890 0x0020,
1891 NULL, HFILL
1895 &hf_sprt_payload_msg_init_opt_moip_types_reserved,
1897 "Reserved for ITU-T",
1898 "sprt.payload.msg_init.opt_moip_types_reserved",
1899 FT_UINT16,
1900 BASE_HEX,
1901 NULL,
1902 0x001F,
1903 NULL, HFILL
1906 /* XID_XCHG message */
1908 &hf_sprt_payload_msg_xidxchg_ecp,
1910 "Error correcting protocol",
1911 "sprt.payload.msg_xidxchg.ecp",
1912 FT_UINT8,
1913 BASE_DEC | BASE_RANGE_STRING,
1914 RVALS(sprt_ecp_name),
1915 0x0,
1916 NULL, HFILL
1920 &hf_sprt_payload_msg_xidxchg_xidlr1_v42bis,
1922 "V.42 bis",
1923 "sprt.payload.msg_xidxchg.xidlr1_v42bis",
1924 FT_BOOLEAN,
1926 TFS(&tfs_supported_not_supported),
1927 0x80,
1928 NULL, HFILL
1932 &hf_sprt_payload_msg_xidxchg_xidlr1_v44,
1934 "V.44",
1935 "sprt.payload.msg_xidxchg.xidlr1_v44",
1936 FT_BOOLEAN,
1938 TFS(&tfs_supported_not_supported),
1939 0x40,
1940 NULL, HFILL
1944 &hf_sprt_payload_msg_xidxchg_xidlr1_mnp5,
1946 "MNP5",
1947 "sprt.payload.msg_xidxchg.xidlr1_mnp5",
1948 FT_BOOLEAN,
1950 TFS(&tfs_supported_not_supported),
1951 0x20,
1952 NULL, HFILL
1956 &hf_sprt_payload_msg_xidxchg_xidlr1_reserved,
1958 "Reserved for ITU-T",
1959 "sprt.payload.msg_xidxchg.xidlr1_reserved",
1960 FT_UINT8,
1961 BASE_HEX,
1962 NULL,
1963 0x1F,
1964 NULL, HFILL
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",
1972 FT_UINT8,
1973 BASE_DEC,
1974 NULL,
1975 0x0,
1976 NULL, HFILL
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",
1984 FT_UINT16,
1985 BASE_DEC,
1986 NULL,
1987 0x0,
1988 NULL, HFILL
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",
1996 FT_UINT8,
1997 BASE_DEC,
1998 NULL,
1999 0x0,
2000 NULL, HFILL
2004 &hf_sprt_payload_msg_xidxchg_xidlr6_v44_capability,
2006 "V.44 capability",
2007 "sprt.payload.msg_xidxchg.xidlr6_v44_capability",
2008 FT_UINT8,
2009 BASE_DEC,
2010 NULL,
2011 0x0,
2012 NULL, HFILL
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",
2020 FT_UINT8,
2021 BASE_DEC,
2022 NULL,
2023 0x0,
2024 NULL, HFILL
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",
2032 FT_UINT16,
2033 BASE_DEC,
2034 NULL,
2035 0x0,
2036 NULL, HFILL
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",
2044 FT_UINT16,
2045 BASE_DEC,
2046 NULL,
2047 0x0,
2048 NULL, HFILL
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",
2056 FT_UINT8,
2057 BASE_DEC,
2058 NULL,
2059 0x0,
2060 NULL, HFILL
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",
2068 FT_UINT8,
2069 BASE_DEC,
2070 NULL,
2071 0x0,
2072 NULL, HFILL
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",
2080 FT_UINT16,
2081 BASE_DEC,
2082 NULL,
2083 0x0,
2084 NULL, HFILL
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",
2092 FT_UINT16,
2093 BASE_DEC,
2094 NULL,
2095 0x0,
2096 NULL, HFILL
2099 /* JM_INFO message */
2101 &hf_sprt_payload_msg_jminfo_category_data,
2103 "Category data",
2104 "sprt.payload.msg_jminfo.category_data",
2105 FT_UINT16,
2106 BASE_DEC,
2107 NULL,
2108 0xFFFF,
2109 NULL, HFILL
2113 &hf_sprt_payload_msg_jminfo_category_id,
2115 "Category ID",
2116 "sprt.payload.msg_jminfo.category_id",
2117 FT_UINT16,
2118 BASE_HEX,
2119 VALS(sprt_jm_info_cat_id_name),
2120 0xF000,
2121 NULL, HFILL
2125 &hf_sprt_payload_msg_jminfo_category_ext_info,
2127 "Unrecognized category data",
2128 "sprt.payload.msg_jminfo.category_ext_info",
2129 FT_UINT16,
2130 BASE_DEC,
2131 NULL,
2132 0x0FFF,
2133 NULL, HFILL
2137 &hf_sprt_payload_msg_jminfo_unk_category_info,
2139 "Category extension data",
2140 "sprt.payload.msg_jminfo.unk_category_info",
2141 FT_UINT16,
2142 BASE_DEC,
2143 NULL,
2144 0x0FFF,
2145 NULL, HFILL
2149 &hf_sprt_payload_msg_jminfo_category_leftover_bits,
2151 "Leftover bits", /* "Category info leftover bits", */
2152 "sprt.payload.msg_jminfo.category_leftover_bits",
2153 FT_UINT16,
2154 BASE_HEX,
2155 NULL,
2156 0x01FF,
2157 NULL, HFILL
2161 &hf_sprt_payload_msg_jminfo_call_function,
2163 "Call function",
2164 "sprt.payload.msg_jminfo.call_function",
2165 FT_UINT16,
2166 BASE_DEC,
2167 VALS(sprt_jminfo_tbc_call_funct_name),
2168 0x0E00,
2169 NULL, HFILL
2173 &hf_sprt_payload_msg_jminfo_mod_v34_duplex,
2175 "V.34 duplex",
2176 "sprt.payload.msg_jminfo.mod_v34_duplex",
2177 FT_BOOLEAN,
2179 TFS(&tfs_available_not_available),
2180 0x0800,
2181 NULL, HFILL
2185 &hf_sprt_payload_msg_jminfo_mod_v34_half_duplex,
2187 "V.34 half-duplex",
2188 "sprt.payload.msg_jminfo.mod_v34_half_duplex",
2189 FT_BOOLEAN,
2191 TFS(&tfs_available_not_available),
2192 0x0400,
2193 NULL, HFILL
2197 &hf_sprt_payload_msg_jminfo_mod_v32bis_v32,
2199 "V.32bis/V.32",
2200 "sprt.payload.msg_jminfo.mod_v32bis_v32",
2201 FT_BOOLEAN,
2203 TFS(&tfs_available_not_available),
2204 0x0200,
2205 NULL, HFILL
2209 &hf_sprt_payload_msg_jminfo_mod_v22bis_v22,
2211 "V.22bis/V.22",
2212 "sprt.payload.msg_jminfo.mod_v22bis_v22",
2213 FT_BOOLEAN,
2215 TFS(&tfs_available_not_available),
2216 0x0100,
2217 NULL, HFILL
2221 &hf_sprt_payload_msg_jminfo_mod_v17,
2223 "V.17",
2224 "sprt.payload.msg_jminfo.mod_v17",
2225 FT_BOOLEAN,
2227 TFS(&tfs_available_not_available),
2228 0x0080,
2229 NULL, HFILL
2233 &hf_sprt_payload_msg_jminfo_mod_v29_half_duplex,
2235 "V.29 half-duplex",
2236 "sprt.payload.msg_jminfo.mod_v29_half_duplex",
2237 FT_BOOLEAN,
2239 TFS(&tfs_available_not_available),
2240 0x0040,
2241 NULL, HFILL
2245 &hf_sprt_payload_msg_jminfo_mod_v27ter,
2247 "V.27ter",
2248 "sprt.payload.msg_jminfo.mod_v27ter",
2249 FT_BOOLEAN,
2251 TFS(&tfs_available_not_available),
2252 0x0020,
2253 NULL, HFILL
2257 &hf_sprt_payload_msg_jminfo_mod_v26ter,
2259 "V.26ter",
2260 "sprt.payload.msg_jminfo.mod_v26ter",
2261 FT_BOOLEAN,
2263 TFS(&tfs_available_not_available),
2264 0x0010,
2265 NULL, HFILL
2269 &hf_sprt_payload_msg_jminfo_mod_v26bis,
2271 "V.26bis",
2272 "sprt.payload.msg_jminfo.mod_v16bis",
2273 FT_BOOLEAN,
2275 TFS(&tfs_available_not_available),
2276 0x0008,
2277 NULL, HFILL
2281 &hf_sprt_payload_msg_jminfo_mod_v23_duplex,
2283 "V.23 duplex",
2284 "sprt.payload.msg_jminfo.mod_v23_duplex",
2285 FT_BOOLEAN,
2287 TFS(&tfs_available_not_available),
2288 0x0004,
2289 NULL, HFILL
2293 &hf_sprt_payload_msg_jminfo_mod_v23_half_duplex,
2295 "V.23 half-duplex",
2296 "sprt.payload.msg_jminfo.mod_v23_half_duplex",
2297 FT_BOOLEAN,
2299 TFS(&tfs_available_not_available),
2300 0x0002,
2301 NULL, HFILL
2305 &hf_sprt_payload_msg_jminfo_mod_v21,
2307 "V.21",
2308 "sprt.payload.msg_jminfo.mod_v21",
2309 FT_BOOLEAN,
2311 TFS(&tfs_available_not_available),
2312 0x0001,
2313 NULL, HFILL
2317 &hf_sprt_payload_msg_jminfo_protocols,
2319 "Protocols",
2320 "sprt.payload.msg_jminfo.protocols",
2321 FT_UINT16,
2322 BASE_DEC | BASE_RANGE_STRING,
2323 RVALS(sprt_jminfo_tbc_protocol_name),
2324 0x0E00,
2325 NULL, HFILL
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",
2333 FT_BOOLEAN,
2335 NULL,
2336 0x0800,
2337 NULL, HFILL
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",
2345 FT_BOOLEAN,
2347 NULL,
2348 0x0400,
2349 NULL, HFILL
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",
2357 FT_BOOLEAN,
2359 NULL,
2360 0x0200,
2361 NULL, HFILL
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",
2369 FT_BOOLEAN,
2371 TFS(&tfs_available_not_available),
2372 0x0800,
2373 NULL, HFILL
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",
2381 FT_BOOLEAN,
2383 TFS(&tfs_available_not_available),
2384 0x0400,
2385 NULL, HFILL
2389 &hf_sprt_payload_msg_jminfo_pcm_modem_avail_v91,
2391 "V.91 modem availability",
2392 "sprt.payload.msg_jminfo.pcm_modem_avail_v91",
2393 FT_BOOLEAN,
2395 TFS(&tfs_available_not_available),
2396 0x0200,
2397 NULL, HFILL
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",
2407 FT_UINT8,
2408 BASE_DEC | BASE_RANGE_STRING,
2409 RVALS(sprt_selmod_name),
2410 0xFC,
2411 NULL, HFILL
2415 &hf_sprt_payload_msg_connect_compr_dir,
2417 "Compression direction",
2418 "sprt.payload.msg_connect.compr_dir",
2419 FT_UINT8,
2420 BASE_DEC,
2421 VALS(sprt_comp_direction),
2422 0x03,
2423 NULL, HFILL
2427 &hf_sprt_payload_msg_connect_selected_compr,
2429 "Selected compression",
2430 "sprt.payload.msg_connect.selected_compr",
2431 FT_UINT8,
2432 BASE_DEC | BASE_RANGE_STRING,
2433 RVALS(sprt_selected_compr_name),
2434 0xF0,
2435 NULL, HFILL
2439 &hf_sprt_payload_msg_connect_selected_err_corr,
2441 "Selected error correction",
2442 "sprt.payload.msg_connect.selected_err_corr",
2443 FT_UINT8,
2444 BASE_DEC | BASE_RANGE_STRING,
2445 RVALS(sprt_selected_err_corr_name),
2446 0x0F,
2447 NULL, HFILL
2451 &hf_sprt_payload_msg_connect_tdsr,
2453 "Transmit data signalling rate (bits/sec)",
2454 "sprt.payload.msg_connect.tdsr",
2455 FT_UINT16,
2456 BASE_DEC,
2457 NULL,
2458 0x0,
2459 NULL, HFILL
2463 &hf_sprt_payload_msg_connect_rdsr,
2465 "Receive data signalling rate (bits/sec)",
2466 "sprt.payload.msg_connect.rdsr",
2467 FT_UINT16,
2468 BASE_DEC,
2469 NULL,
2470 0x0,
2471 NULL, HFILL
2475 &hf_sprt_payload_msg_connect_dlci_enabled,
2477 "DLCI",
2478 "sprt.payload.msg_connect.dlci_enabled",
2479 FT_BOOLEAN,
2481 TFS(&tfs_enabled_disabled),
2482 0x8000,
2483 NULL, HFILL
2487 &hf_sprt_payload_msg_connect_avail_data_types,
2489 "Available data types",
2490 "sprt.payload.msg_connect.avail_data_types",
2491 FT_UINT16,
2492 BASE_HEX,
2493 NULL,
2494 0x7FFF,
2495 NULL, HFILL
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",
2503 FT_BOOLEAN,
2505 TFS(&tfs_available_not_available),
2506 0x4000,
2507 NULL, HFILL
2511 &hf_sprt_payload_msg_connect_adt_i_raw_bit,
2513 "I_RAW-BIT",
2514 "sprt.payload.msg_connect.adt_i_raw_bit",
2515 FT_BOOLEAN,
2517 TFS(&tfs_available_not_available),
2518 0x2000,
2519 NULL, HFILL
2523 &hf_sprt_payload_msg_connect_adt_i_frame,
2525 "I_FRAME",
2526 "sprt.payload.msg_connect.adt_i_frame",
2527 FT_BOOLEAN,
2529 TFS(&tfs_available_not_available),
2530 0x1000,
2531 NULL, HFILL
2535 &hf_sprt_payload_msg_connect_adt_i_char_stat,
2537 "I_CHAR-STAT",
2538 "sprt.payload.msg_connect.adt_i_char_stat",
2539 FT_BOOLEAN,
2541 TFS(&tfs_available_not_available),
2542 0x0800,
2543 NULL, HFILL
2547 &hf_sprt_payload_msg_connect_adt_i_char_dyn,
2549 "I_CHAR-DYN",
2550 "sprt.payload.msg_connect.adt_i_char_dyn",
2551 FT_BOOLEAN,
2553 TFS(&tfs_available_not_available),
2554 0x0400,
2555 NULL, HFILL
2558 { /* from V.150.1 amendment 2 (5-2006): */
2559 &hf_sprt_payload_msg_connect_adt_i_octet_cs,
2561 "I_OCTET-CS",
2562 "sprt.payload.msg_connect.adt_i_octet_cs",
2563 FT_BOOLEAN,
2565 TFS(&tfs_available_not_available),
2566 0x0200,
2567 NULL, HFILL
2570 { /* from V.150.1 amendment 2 (5-2006): */
2571 &hf_sprt_payload_msg_connect_adt_i_char_stat_cs,
2573 "I_CHAR-STAT-CS",
2574 "sprt.payload.msg_connect.adt_i_char_stat_cs",
2575 FT_BOOLEAN,
2577 TFS(&tfs_available_not_available),
2578 0x0100,
2579 NULL, HFILL
2582 { /* from V.150.1 amendment 2 (5-2006): */
2583 &hf_sprt_payload_msg_connect_adt_i_char_dyn_cs,
2585 "I_CHAR-DYN-CS",
2586 "sprt.payload.msg_connect.adt_i_char_dyn_cs",
2587 FT_BOOLEAN,
2589 TFS(&tfs_available_not_available),
2590 0x0080,
2591 NULL, HFILL
2595 &hf_sprt_payload_msg_connect_adt_reserved,
2597 "Reserved for ITU-T",
2598 "sprt.payload.msg_connect.adt_reserved",
2599 FT_UINT16,
2600 BASE_HEX,
2601 NULL,
2602 0x007F,
2603 NULL, HFILL
2607 &hf_sprt_payload_msg_connect_compr_trans_dict_sz,
2609 "Compression transmit dictionary size",
2610 "sprt.payload.msg_connect.compr_trans_dict_sz",
2611 FT_UINT16,
2612 BASE_DEC,
2613 NULL,
2614 0x0,
2615 NULL, HFILL
2619 &hf_sprt_payload_msg_connect_compr_recv_dict_sz,
2621 "Compression receive dictionary size",
2622 "sprt.payload.msg_connect.compr_recv_dict_sz",
2623 FT_UINT16,
2624 BASE_DEC,
2625 NULL,
2626 0x0,
2627 NULL, HFILL
2631 &hf_sprt_payload_msg_connect_compr_trans_str_len,
2633 "Compression transmit string length",
2634 "sprt.payload.msg_connect.compr_trans_str_len",
2635 FT_UINT8,
2636 BASE_DEC,
2637 NULL,
2638 0x0,
2639 NULL, HFILL
2643 &hf_sprt_payload_msg_connect_compr_recv_str_len,
2645 "Compression receive string length",
2646 "sprt.payload.msg_connect.compr_recv_str_len",
2647 FT_UINT8,
2648 BASE_DEC,
2649 NULL,
2650 0x0,
2651 NULL, HFILL
2655 &hf_sprt_payload_msg_connect_compr_trans_hist_sz,
2657 "Compression transmit history size",
2658 "sprt.payload.msg_connect.compr_trans_hist_sz",
2659 FT_UINT16,
2660 BASE_DEC,
2661 NULL,
2662 0x0,
2663 NULL, HFILL
2667 &hf_sprt_payload_msg_connect_compr_recv_hist_sz,
2669 "Compression receive history size",
2670 "sprt.payload.msg_connect.compr_recv_hist_sz",
2671 FT_UINT16,
2672 BASE_DEC,
2673 NULL,
2674 0x0,
2675 NULL, HFILL
2678 /* BREAK message */
2680 &hf_sprt_payload_msg_break_source_proto,
2682 "Break source protocol",
2683 "sprt.payload.msg_break.source_proto",
2684 FT_UINT8,
2685 BASE_DEC | BASE_RANGE_STRING,
2686 RVALS(sprt_break_src_proto_name),
2687 0xF0,
2688 NULL, HFILL
2692 &hf_sprt_payload_msg_break_type,
2694 "Break type",
2695 "sprt.payload.msg_break.type",
2696 FT_UINT8,
2697 BASE_DEC | BASE_RANGE_STRING,
2698 RVALS(sprt_break_type_name),
2699 0x0F,
2700 NULL, HFILL
2704 &hf_sprt_payload_msg_break_length,
2706 "Break length (x10 msec)",
2707 "sprt.payload.msg_break.length",
2708 FT_UINT8,
2709 BASE_DEC,
2710 NULL,
2711 0x0,
2712 NULL, HFILL
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",
2722 FT_UINT8,
2723 BASE_DEC | BASE_RANGE_STRING,
2724 RVALS(sprt_mrevent_id_name),
2725 0x0,
2726 NULL, HFILL
2730 &hf_sprt_payload_msg_mr_evt_reason_code,
2732 "Reason code",
2733 "sprt.payload.msg_mr_event.reason_code",
2734 FT_UINT8,
2735 BASE_DEC | BASE_RANGE_STRING,
2736 RVALS(sprt_mrevent_reason_code_name),
2737 0x0,
2738 NULL, HFILL
2742 &hf_sprt_payload_msg_mr_evt_selmod,
2744 "Selected modulation",
2745 "sprt.payload.msg_mr_event.selmod",
2746 FT_UINT8,
2747 BASE_DEC | BASE_RANGE_STRING,
2748 RVALS(sprt_selmod_name),
2749 0xFC,
2750 NULL, HFILL
2754 &hf_sprt_payload_msg_mr_evt_txsen,
2756 "TxSEN",
2757 "sprt.payload.msg_mr_event.txsen",
2758 FT_BOOLEAN,
2760 TFS(&tfs_enabled_disabled),
2761 0x02,
2762 NULL, HFILL
2766 &hf_sprt_payload_msg_mr_evt_rxsen,
2768 "RxSEN",
2769 "sprt.payload.msg_mr_event.rxsen",
2770 FT_BOOLEAN,
2772 TFS(&tfs_enabled_disabled),
2773 0x01,
2774 NULL, HFILL
2778 &hf_sprt_payload_msg_mr_evt_tdsr,
2780 "Transmit data signalling rate (bits/sec)",
2781 "sprt.payload.msg_mr_event.tdsr",
2782 FT_UINT16,
2783 BASE_DEC,
2784 NULL,
2785 0x0,
2786 NULL, HFILL
2790 &hf_sprt_payload_msg_mr_evt_rdsr,
2792 "Receive data signalling rate (bits/sec)",
2793 "sprt.payload.msg_mr_event.rdsr",
2794 FT_UINT16,
2795 BASE_DEC,
2796 NULL,
2797 0x0,
2798 NULL, HFILL
2802 &hf_sprt_payload_msg_mr_evt_txsr,
2804 "Physical layer transmitter symbol rate (TxSR)",
2805 "sprt.payload.msg_mr_event.txsr",
2806 FT_UINT8,
2807 BASE_DEC | BASE_RANGE_STRING,
2808 RVALS(sprt_mrevent_phys_layer_symbol_rate),
2809 0x0,
2810 NULL, HFILL
2814 &hf_sprt_payload_msg_mr_evt_rxsr,
2816 "Physical layer receiver symbol rate (RxSR)",
2817 "sprt.payload.msg_mr_event.rxsr",
2818 FT_UINT8,
2819 BASE_DEC | BASE_RANGE_STRING,
2820 RVALS(sprt_mrevent_phys_layer_symbol_rate),
2821 0x0,
2822 NULL, HFILL
2825 /* CLEARDOWN message */
2827 &hf_sprt_payload_msg_cleardown_reason_code,
2829 "Reason code",
2830 "sprt.payload.msg_cleardown.reason_code",
2831 FT_UINT8,
2832 BASE_DEC,
2833 VALS(sprt_cleardown_reason),
2834 0x0,
2835 NULL, HFILL
2839 &hf_sprt_payload_msg_cleardown_vendor_tag,
2841 "Vendor tag",
2842 "sprt.payload.msg_cleardown.vendor_tag",
2843 FT_UINT8,
2844 BASE_DEC,
2845 NULL,
2846 0x0,
2847 NULL, HFILL
2851 &hf_sprt_payload_msg_cleardown_vendor_info,
2853 "Vendor info",
2854 "sprt.payload.msg_cleardown.vendor_info",
2855 FT_UINT8,
2856 BASE_DEC,
2857 NULL,
2858 0x0,
2859 NULL, HFILL
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",
2868 FT_UINT8,
2869 BASE_DEC,
2870 VALS(sprt_prof_xchg_support),
2871 0xC0,
2872 NULL, HFILL
2876 &hf_sprt_payload_msg_profxchg_annex_av42,
2878 "Annex A/V.42(1996) protocol support",
2879 "sprt.payload.msg_profxchg.annex_av42",
2880 FT_UINT8,
2881 BASE_DEC,
2882 VALS(sprt_prof_xchg_support),
2883 0x30,
2884 NULL, HFILL
2888 &hf_sprt_payload_msg_profxchg_v44_compr,
2890 "V.44 compression support",
2891 "sprt.payload.msg_profxchg.v44_compr",
2892 FT_UINT8,
2893 BASE_DEC,
2894 VALS(sprt_prof_xchg_support),
2895 0x0C,
2896 NULL, HFILL
2900 &hf_sprt_payload_msg_profxchg_v42bis_compr,
2902 "V.42bis compression support",
2903 "sprt.payload.msg_profxchg.v42bis_compr",
2904 FT_UINT8,
2905 BASE_DEC,
2906 VALS(sprt_prof_xchg_support),
2907 0x03,
2908 NULL, HFILL
2912 &hf_sprt_payload_msg_profxchg_mnp5_compr,
2914 "MNP5 compression support",
2915 "sprt.payload.msg_profxchg.mnp5_compr",
2916 FT_UINT8,
2917 BASE_DEC,
2918 VALS(sprt_prof_xchg_support),
2919 0xC0,
2920 NULL, HFILL
2924 &hf_sprt_payload_msg_profxchg_reserved,
2926 "Reserved for ITU-T",
2927 "sprt.payload.msg_profxchg.reserved",
2928 FT_UINT8,
2929 BASE_HEX,
2930 NULL,
2931 0x3F,
2932 NULL, HFILL
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",
2940 FT_UINT8,
2941 BASE_DEC,
2942 NULL,
2943 0x0,
2944 NULL, HFILL
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",
2952 FT_UINT16,
2953 BASE_DEC,
2954 NULL,
2955 0x0,
2956 NULL, HFILL
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",
2964 FT_UINT8,
2965 BASE_DEC,
2966 NULL,
2967 0x0,
2968 NULL, HFILL
2972 &hf_sprt_payload_msg_profxchg_xidlr6_v44_capability,
2974 "V.44 capability",
2975 "sprt.payload.msg_profxchg.xidlr6_v44_capability",
2976 FT_UINT8,
2977 BASE_DEC,
2978 NULL,
2979 0x0,
2980 NULL, HFILL
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",
2988 FT_UINT8,
2989 BASE_DEC,
2990 NULL,
2991 0x0,
2992 NULL, HFILL
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",
3000 FT_UINT16,
3001 BASE_DEC,
3002 NULL,
3003 0x0,
3004 NULL, HFILL
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",
3012 FT_UINT16,
3013 BASE_DEC,
3014 NULL,
3015 0x0,
3016 NULL, HFILL
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",
3024 FT_UINT8,
3025 BASE_DEC,
3026 NULL,
3027 0x0,
3028 NULL, HFILL
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",
3036 FT_UINT8,
3037 BASE_DEC,
3038 NULL,
3039 0x0,
3040 NULL, HFILL
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",
3048 FT_UINT16,
3049 BASE_DEC,
3050 NULL,
3051 0x0,
3052 NULL, HFILL
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",
3060 FT_UINT16,
3061 BASE_DEC,
3062 NULL,
3063 0x0,
3064 NULL, HFILL
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,
3072 "No DLCI field",
3073 "sprt.payload.i_octet_no_dlci",
3074 FT_NONE,
3075 BASE_NONE,
3076 NULL,
3077 0x0,
3078 NULL, HFILL
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",
3086 FT_NONE,
3087 BASE_NONE,
3088 NULL,
3089 0x0,
3090 NULL, HFILL
3094 &hf_sprt_payload_i_octet_dlci1,
3096 "DLCI #1",
3097 "sprt.payload.i_octet_dlci1",
3098 FT_UINT8,
3099 BASE_DEC | BASE_RANGE_STRING,
3100 RVALS(sprt_payload_dlci1),
3101 0xFC,
3102 NULL, HFILL
3106 &hf_sprt_payload_i_octet_cr,
3108 "Command/response bit",
3109 "sprt.payload.i_octet_cr",
3110 FT_BOOLEAN,
3112 NULL,
3113 0x02,
3114 NULL, HFILL
3118 &hf_sprt_payload_i_octet_ea,
3120 "Address field extension bit",
3121 "sprt.payload.i_octet_ea",
3122 FT_BOOLEAN,
3124 TFS(&sprt_payload_ea_bit),
3125 0x01,
3126 NULL, HFILL
3130 &hf_sprt_payload_i_octet_dlci2,
3132 "DLCI #2",
3133 "sprt.payload.i_octet_dlci2",
3134 FT_UINT8,
3135 BASE_DEC | BASE_RANGE_STRING,
3136 RVALS(sprt_payload_dlci2),
3137 0xFE,
3138 NULL, HFILL
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",
3146 FT_FRAMENUM,
3147 BASE_NONE,
3148 NULL,
3149 0x0,
3150 NULL, HFILL
3153 /* fields for I_RAW_OCTET message (L; L,N) */
3155 &hf_sprt_payload_rawoctet_n_field_present,
3157 "N field",
3158 "sprt.payload.rawoctet_n_field_present",
3159 FT_BOOLEAN,
3161 TFS(&tfs_present_absent),
3162 0x80,
3163 NULL, HFILL
3167 &hf_sprt_payload_rawoctet_l,
3169 "L: # of octets in segment minus one",
3170 "sprt.payload.rawoctet_l",
3171 FT_UINT8,
3172 BASE_DEC,
3173 NULL,
3174 0x7F,
3175 NULL, HFILL
3179 &hf_sprt_payload_rawoctet_n,
3181 "N: # of times octets appear in data minus 2",
3182 "sprt.payload.rawoctet_n",
3183 FT_UINT8,
3184 BASE_DEC,
3185 NULL,
3186 0xFF,
3187 NULL, HFILL
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",
3196 FT_UINT8,
3197 BASE_DEC,
3198 NULL,
3199 0xC0, /* top two bits: 00 */
3200 NULL, HFILL
3204 &hf_sprt_payload_rawbit_included_fields_lp,
3206 "Include fields L, P",
3207 "sprt.payload.rawbit_field_format_lp",
3208 FT_UINT8,
3209 BASE_DEC,
3210 NULL,
3211 0xC0, /* top two bits: 01 */
3212 NULL, HFILL
3216 &hf_sprt_payload_rawbit_included_fields_lpn,
3218 "Include fields L, P, N",
3219 "sprt.payload.rawbit_included_fields_lpn",
3220 FT_UINT8,
3221 BASE_DEC,
3222 NULL,
3223 0x80, /* top bit: 1 */
3224 NULL, HFILL
3228 &hf_sprt_payload_rawbit_len_a,
3230 "L: # of octets in segment",
3231 "sprt.payload.rawbit_len_a",
3232 FT_UINT8,
3233 BASE_DEC,
3234 NULL,
3235 0x3F, /* six bits */
3236 NULL, HFILL
3240 &hf_sprt_payload_rawbit_len_b,
3242 "L: # of octets in segment",
3243 "sprt.payload.rawbit_len_b",
3244 FT_UINT8,
3245 BASE_DEC,
3246 NULL,
3247 0x38, /* three bits */
3248 NULL, HFILL
3252 &hf_sprt_payload_rawbit_len_c,
3254 "L: # of octets in segment",
3255 "sprt.payload.rawbit_len_c",
3256 FT_UINT8,
3257 BASE_DEC,
3258 NULL,
3259 0x78, /* four bits */
3260 NULL, HFILL
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",
3268 FT_UINT8,
3269 BASE_DEC,
3270 NULL,
3271 0x7, /* three bits */
3272 NULL, HFILL
3276 &hf_sprt_payload_rawbit_n,
3278 "N: # of times octets appear in data minus 2",
3279 "sprt.payload.rawbit_n",
3280 FT_UINT8,
3281 BASE_DEC,
3282 NULL,
3283 0xFF, /* eight bits */
3284 NULL, HFILL
3287 /* fields in I_CHAR_STAT & I_CHAR_DYN messages */
3289 &hf_sprt_payload_data_reserved_bit,
3291 "Reserved bit",
3292 "sprt.payload.reserved_bit",
3293 FT_BOOLEAN,
3295 TFS(&tfs_set_notset),
3296 0x80,
3297 NULL, HFILL
3301 &hf_sprt_payload_data_num_data_bits,
3303 "D: Number of data bits",
3304 "sprt.payload.num_data_bits",
3305 FT_UINT8,
3306 BASE_DEC,
3307 VALS(sprt_payload_data_bits),
3308 0x60,
3309 NULL, HFILL
3313 &hf_sprt_payload_data_parity_type,
3315 "P: Parity type",
3316 "sprt.payload.parity_type",
3317 FT_UINT8,
3318 BASE_DEC,
3319 VALS(sprt_payload_parity),
3320 0x1C,
3321 NULL, HFILL
3325 &hf_sprt_payload_num_stop_bits,
3327 "S: Number stop bits",
3328 "sprt.payload.num_stop_bits",
3329 FT_UINT8,
3330 BASE_DEC,
3331 VALS(sprt_payload_stop_bits),
3332 0x03,
3333 NULL, HFILL
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",
3341 "sprt.payload.cs",
3342 FT_UINT16,
3343 BASE_DEC,
3344 NULL,
3345 0x0,
3346 NULL, HFILL
3349 /* fields for I_FRAME: */
3351 &hf_sprt_payload_frame_reserved_bits,
3353 "Reserved bits",
3354 "sprt.payload.frame_reserved_bits",
3355 FT_UINT8,
3356 BASE_HEX,
3357 NULL,
3358 0xFC,
3359 NULL, HFILL
3363 &hf_sprt_payload_frame_state,
3365 "Frame state",
3366 "sprt.payload.frame_state",
3367 FT_UINT8,
3368 BASE_DEC,
3369 VALS(sprt_payload_frame_state),
3370 0x03,
3371 NULL, HFILL
3374 /* just dump remaining payload data: */
3376 &hf_sprt_payload_data,
3378 "Payload data",
3379 "sprt.payload.data",
3380 FT_BYTES,
3381 BASE_NONE,
3382 NULL,
3383 0x0,
3384 NULL, HFILL
3387 }; /* hf_register_info hf[] */
3389 /* setup protocol subtree array */
3390 static gint *ett[] = {
3391 &ett_sprt,
3392 &ett_sprt_setup,
3393 &ett_sprt_ack_fields,
3394 &ett_payload,
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);
3418 /* preferences */
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);
3432 void
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);