2 * Routines for Q.931 frame disassembly
3 * Guy Harris <guy@alum.mit.edu>
5 * $Id: packet-q931.c,v 1.60 2003/09/21 20:06:00 gerald Exp $
7 * Modified by Andreas Sikkema for possible use with H.323
9 * Ethereal - Network traffic analyzer
10 * By Gerald Combs <gerald@ethereal.com>
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
35 #include <epan/packet.h>
36 #include <epan/strutil.h>
38 #include "packet-q931.h"
41 #include "packet-tpkt.h"
45 * http://www.acacia-net.com/Clarinet/Protocol/q9313svn.htm
46 * http://www.acacia-net.com/Clarinet/Protocol/q9311sc3.htm
47 * http://www.acacia-net.com/Clarinet/Protocol/q9317oz7.htm
48 * http://www.protocols.com/pbook/isdn.htm
49 * http://freesoft.org/CIE/Topics/126.htm
50 * http://noc.comstar.ru/miscdocs/ascend-faq-cause-codes.html
51 * http://www.andrews-arnold.co.uk/isdn/q931cause.html
52 * http://www.tulatelecom.ru/staff/german/DSSHelp/MessList/InfEl/InfElList.html
55 static int proto_q931 = -1;
56 static int hf_q931_discriminator = -1;
57 static int hf_q931_call_ref_len = -1;
58 static int hf_q931_call_ref_flag = -1;
59 static int hf_q931_call_ref = -1;
60 static int hf_q931_message_type = -1;
61 static int hf_q931_cause_value = -1;
62 static int hf_q931_calling_party_number = -1;
63 static int hf_q931_called_party_number = -1;
64 static int hf_q931_connected_number = -1;
65 static int hf_q931_redirecting_number = -1;
67 static gint ett_q931 = -1;
68 static gint ett_q931_ie = -1;
70 static dissector_table_t codeset_dissector_table;
71 static dissector_table_t ie_dissector_table;
73 /* desegmentation of Q.931 over TPKT over TCP */
74 static gboolean q931_desegment = TRUE;
76 static dissector_handle_t h225_handle;
77 static dissector_handle_t q931_tpkt_pdu_handle;
80 * Q.931 message types.
82 #define Q931_ESCAPE 0x00
83 #define Q931_ALERTING 0x01
84 #define Q931_CALL_PROCEEDING 0x02
85 #define Q931_CONNECT 0x07
86 #define Q931_CONNECT_ACK 0x0F
87 #define Q931_PROGRESS 0x03
88 #define Q931_SETUP 0x05
89 #define Q931_SETUP_ACK 0x0D
90 #define Q931_HOLD 0x24
91 #define Q931_HOLD_ACK 0x28
92 #define Q931_HOLD_REJECT 0x30
93 #define Q931_RESUME 0x26
94 #define Q931_RESUME_ACK 0x2E
95 #define Q931_RESUME_REJECT 0x22
96 #define Q931_RETRIEVE 0x31
97 #define Q931_RETRIEVE_ACK 0x33
98 #define Q931_RETRIEVE_REJECT 0x37
99 #define Q931_SUSPEND 0x25
100 #define Q931_SUSPEND_ACK 0x2D
101 #define Q931_SUSPEND_REJECT 0x21
102 #define Q931_USER_INFORMATION 0x20
103 #define Q931_DISCONNECT 0x45
104 #define Q931_RELEASE 0x4D
105 #define Q931_RELEASE_COMPLETE 0x5A
106 #define Q931_RESTART 0x46
107 #define Q931_RESTART_ACK 0x4E
108 #define Q931_CONGESTION_CONTROL 0x79
109 #define Q931_FACILITY 0x62
110 #define Q931_INFORMATION 0x7B
111 #define Q931_NOTIFY 0x6E
112 #define Q931_REGISTER 0x64
113 #define Q931_SEGMENT 0x60
114 #define Q931_STATUS 0x7D
115 #define Q931_STATUS_ENQUIRY 0x75
117 static const value_string q931_message_type_vals[] = {
118 { Q931_ESCAPE, "ESCAPE" },
119 { Q931_ALERTING, "ALERTING" },
120 { Q931_CALL_PROCEEDING, "CALL PROCEEDING" },
121 { Q931_CONNECT, "CONNECT" },
122 { Q931_CONNECT_ACK, "CONNECT ACKNOWLEDGE" },
123 { Q931_PROGRESS, "PROGRESS" },
124 { Q931_SETUP, "SETUP" },
125 { Q931_SETUP_ACK, "SETUP ACKNOWLEDGE" },
126 { Q931_HOLD, "HOLD" },
127 { Q931_HOLD_ACK, "HOLD_ACKNOWLEDGE" },
128 { Q931_HOLD_REJECT, "HOLD_REJECT" },
129 { Q931_RESUME, "RESUME" },
130 { Q931_RESUME_ACK, "RESUME ACKNOWLEDGE" },
131 { Q931_RESUME_REJECT, "RESUME REJECT" },
132 { Q931_RETRIEVE, "RETRIEVE" },
133 { Q931_RETRIEVE_ACK, "RETRIEVE ACKNOWLEDGE" },
134 { Q931_RETRIEVE_REJECT, "RETRIEVE REJECT" },
135 { Q931_SUSPEND, "SUSPEND" },
136 { Q931_SUSPEND_ACK, "SUSPEND ACKNOWLEDGE" },
137 { Q931_SUSPEND_REJECT, "SUSPEND REJECT" },
138 { Q931_USER_INFORMATION, "USER INFORMATION" },
139 { Q931_DISCONNECT, "DISCONNECT" },
140 { Q931_RELEASE, "RELEASE" },
141 { Q931_RELEASE_COMPLETE, "RELEASE COMPLETE" },
142 { Q931_RESTART, "RESTART" },
143 { Q931_RESTART_ACK, "RESTART ACKNOWLEDGE" },
144 { Q931_CONGESTION_CONTROL, "CONGESTION CONTROL" },
145 { Q931_FACILITY, "FACILITY" },
146 { Q931_INFORMATION, "INFORMATION" },
147 { Q931_NOTIFY, "NOTIFY" },
148 { Q931_REGISTER, "REGISTER" },
149 { Q931_SEGMENT, "SEGMENT" },
150 { Q931_STATUS, "STATUS" },
151 { Q931_STATUS_ENQUIRY, "STATUS ENQUIRY" },
155 static const true_false_string tfs_call_ref_flag = {
156 "Message sent to originating side",
157 "Message sent from originating side"
161 * Information elements.
164 /* Shifted codeset values */
174 #define Q931_IE_SO_MASK 0x80 /* single-octet/variable-length mask */
178 #define Q931_IE_SO_IDENTIFIER_MASK 0xf0 /* IE identifier mask */
179 #define Q931_IE_SO_IDENTIFIER_SHIFT 4 /* IE identifier shift */
180 #define Q931_IE_SO_IE_MASK 0x0F /* IE mask */
182 #define Q931_IE_SHIFT 0x90
183 #define Q931_IE_SHIFT_NON_LOCKING 0x08 /* non-locking shift */
184 #define Q931_IE_SHIFT_CODESET 0x0F /* codeset */
186 #define Q931_IE_MORE_DATA_OR_SEND_COMP 0xA0 /* More Data or Sending Complete */
187 #define Q931_IE_MORE_DATA 0xA0
188 #define Q931_IE_SENDING_COMPLETE 0xA1
190 #define Q931_IE_CONGESTION_LEVEL 0xB0
191 #define Q931_IE_REPEAT_INDICATOR 0xD0
194 * Variable-length IEs.
196 #define Q931_IE_VL_EXTENSION 0x80 /* Extension flag */
199 * Codeset 0 (default).
201 #define Q931_IE_SEGMENTED_MESSAGE 0x00
202 #define Q931_IE_BEARER_CAPABILITY 0x04
203 #define Q931_IE_CAUSE 0x08
204 #define Q931_IE_CALL_IDENTITY 0x10
205 #define Q931_IE_CALL_STATE 0x14
206 #define Q931_IE_CHANNEL_IDENTIFICATION 0x18
207 #define Q931_IE_FACILITY 0x1C
208 #define Q931_IE_PROGRESS_INDICATOR 0x1E
209 #define Q931_IE_NETWORK_SPECIFIC_FACIL 0x20 /* Network Specific Facilities */
210 #define Q931_IE_NOTIFICATION_INDICATOR 0x27
211 #define Q931_IE_DISPLAY 0x28
212 #define Q931_IE_DATE_TIME 0x29
213 #define Q931_IE_KEYPAD_FACILITY 0x2C
214 #define Q931_IE_INFORMATION_REQUEST 0x32
215 #define Q931_IE_SIGNAL 0x34
216 #define Q931_IE_SWITCHHOOK 0x36
217 #define Q931_IE_FEATURE_ACTIVATION 0x38
218 #define Q931_IE_FEATURE_INDICATION 0x39
219 #define Q931_IE_ENDPOINT_IDENTIFIER 0x3B
220 #define Q931_IE_SERVICE_PROFILE_ID 0x3A
221 #define Q931_IE_INFORMATION_RATE 0x40
222 #define Q931_IE_E2E_TRANSIT_DELAY 0x42 /* End-to-end Transit Delay */
223 #define Q931_IE_TD_SELECTION_AND_INT 0x43 /* Transit Delay Selection and Indication */
224 #define Q931_IE_PL_BINARY_PARAMETERS 0x44 /* Packet layer binary parameters */
225 #define Q931_IE_PL_WINDOW_SIZE 0x45 /* Packet layer window size */
226 #define Q931_IE_PACKET_SIZE 0x46 /* Packet size */
227 #define Q931_IE_CUG 0x47 /* Closed user group */
228 #define Q931_IE_REVERSE_CHARGE_IND 0x4A /* Reverse charging indication */
229 #define Q931_IE_CONNECTED_NUMBER_DEFAULT 0x4C /* Connected Number */
230 #define Q931_IE_CALLING_PARTY_NUMBER 0x6C /* Calling Party Number */
231 #define Q931_IE_CALLING_PARTY_SUBADDR 0x6D /* Calling Party Subaddress */
232 #define Q931_IE_CALLED_PARTY_NUMBER 0x70 /* Called Party Number */
233 #define Q931_IE_CALLED_PARTY_SUBADDR 0x71 /* Called Party Subaddress */
234 #define Q931_IE_REDIRECTING_NUMBER 0x74
235 #define Q931_IE_REDIRECTION_NUMBER 0x76
236 #define Q931_IE_TRANSIT_NETWORK_SEL 0x78 /* Transit Network Selection */
237 #define Q931_IE_RESTART_INDICATOR 0x79
238 #define Q931_IE_LOW_LAYER_COMPAT 0x7C /* Low-Layer Compatibility */
239 #define Q931_IE_HIGH_LAYER_COMPAT 0x7D /* High-Layer Compatibility */
240 #define Q931_IE_USER_USER 0x7E /* User-User */
241 #define Q931_IE_ESCAPE 0x7F /* Escape for extension */
246 #define Q931_IE_CONNECTED_NUMBER 0x8C
247 #define Q931_IE_CONNECTED_SUBADDR 0x8D
250 * Codeset 5 (National-specific) Belgium.
252 #define Q931_IE_CHARGING_ADVICE 0x1A
255 * Codeset 5 (National-specific) Bellcore National ISDN.
257 #define Q931_IE_OPERATOR_SYSTEM_ACCESS 0x1D
260 * Codeset 6 (Network-specific) Belgium.
262 /* 0x1A is Charging Advice, as with Codeset 5 */
263 #define Q931_IE_REDIRECTING_NUMBER 0x74
266 * Codeset 6 (Network-specific) FT-Numeris.
268 /* 0x1D is User Capability */
271 * Codeset 6 (Network-specific) Bellcore National ISDN.
273 #define Q931_IE_REDIRECTING_SUBADDR 0x75 /* Redirecting Subaddress */
274 /* 0x76 is Redirection Number, but that's also Codeset 0 */
275 #define Q931_IE_CALL_APPEARANCE 0x7B
278 static const value_string q931_info_element_vals0[] = {
279 { Q931_IE_SEGMENTED_MESSAGE, "Segmented message" },
280 { Q931_IE_BEARER_CAPABILITY, "Bearer capability" },
281 { Q931_IE_CAUSE, "Cause" },
282 { Q931_IE_CALL_IDENTITY, "Call identity" },
283 { Q931_IE_CALL_STATE, "Call state" },
284 { Q931_IE_CHANNEL_IDENTIFICATION, "Channel identification" },
285 { Q931_IE_FACILITY, "Facility" },
286 { Q931_IE_PROGRESS_INDICATOR, "Progress indicator" },
287 { Q931_IE_NETWORK_SPECIFIC_FACIL, "Network specific facilities" },
288 { Q931_IE_NOTIFICATION_INDICATOR, "Notification indicator" },
289 { Q931_IE_DISPLAY, "Display" },
290 { Q931_IE_DATE_TIME, "Date/Time" },
291 { Q931_IE_KEYPAD_FACILITY, "Keypad facility" },
292 { Q931_IE_INFORMATION_REQUEST, "Information request" },
293 { Q931_IE_SIGNAL, "Signal" },
294 { Q931_IE_SWITCHHOOK, "Switchhook" },
295 { Q931_IE_FEATURE_ACTIVATION, "Feature activation" },
296 { Q931_IE_FEATURE_INDICATION, "Feature Indication" },
297 { Q931_IE_ENDPOINT_IDENTIFIER, "Endpoint identifier" },
298 { Q931_IE_SERVICE_PROFILE_ID, "Service profile ID" },
299 { Q931_IE_INFORMATION_RATE, "Information rate" },
300 { Q931_IE_E2E_TRANSIT_DELAY, "End-to-end transit delay" },
301 { Q931_IE_TD_SELECTION_AND_INT, "Transit delay selection and indication" },
302 { Q931_IE_PL_BINARY_PARAMETERS, "Packet layer binary parameters" },
303 { Q931_IE_PL_WINDOW_SIZE, "Packet layer window size" },
304 { Q931_IE_PACKET_SIZE, "Packet size" },
305 { Q931_IE_CUG, "Closed user group" },
306 { Q931_IE_REVERSE_CHARGE_IND, "Reverse charging indication" },
307 { Q931_IE_CONNECTED_NUMBER_DEFAULT, "Connected number" },
308 { Q931_IE_CALLING_PARTY_NUMBER, "Calling party number" },
309 { Q931_IE_CALLING_PARTY_SUBADDR, "Calling party subaddress" },
310 { Q931_IE_CALLED_PARTY_NUMBER, "Called party number" },
311 { Q931_IE_CALLED_PARTY_SUBADDR, "Called party subaddress" },
312 { Q931_IE_REDIRECTING_NUMBER, "Redirecting number" },
313 { Q931_IE_REDIRECTION_NUMBER, "Redirection number" },
314 { Q931_IE_TRANSIT_NETWORK_SEL, "Transit network selection" },
315 { Q931_IE_RESTART_INDICATOR, "Restart indicator" },
316 { Q931_IE_LOW_LAYER_COMPAT, "Low-layer compatibility" },
317 { Q931_IE_HIGH_LAYER_COMPAT, "High-layer compatibility" },
318 { Q931_IE_USER_USER, "User-user" },
319 { Q931_IE_ESCAPE, "Escape" },
320 { Q931_IE_CONNECTED_NUMBER, "Connected number" },
321 { Q931_IE_CONNECTED_SUBADDR, "Connected subaddress" },
325 static const value_string q931_info_element_vals1[] = {
329 static const value_string q931_info_element_vals2[] = {
333 static const value_string q931_info_element_vals3[] = {
337 static const value_string q931_info_element_vals4[] = {
341 static const value_string q931_info_element_vals5[] = {
342 { Q931_IE_CHARGING_ADVICE, "Charging advice" },
343 { Q931_IE_OPERATOR_SYSTEM_ACCESS, "Operator system access" },
347 static const value_string q931_info_element_vals6[] = {
348 { Q931_IE_REDIRECTING_NUMBER, "Redirecting number" },
349 { Q931_IE_REDIRECTING_SUBADDR, "Redirecting subaddress" },
350 { Q931_IE_CALL_APPEARANCE, "Call appearance" },
354 static const value_string q931_info_element_vals7[] = {
359 static const value_string *q931_info_element_vals[] = {
360 q931_info_element_vals0,
361 q931_info_element_vals1,
362 q931_info_element_vals2,
363 q931_info_element_vals3,
364 q931_info_element_vals4,
365 q931_info_element_vals5,
366 q931_info_element_vals6,
367 q931_info_element_vals7,
370 static const value_string q931_congestion_level_vals[] = {
371 { 0x0, "Receiver ready" },
372 { 0xF, "Receiver not ready" },
376 static const value_string q931_repeat_indication_vals[] = {
377 { 0x2, "Prioritized list" },
382 * ITU-standardized coding.
384 #define Q931_ITU_STANDARDIZED_CODING 0x00
387 * Dissect a Segmented message information element.
390 dissect_q931_segmented_message_ie(tvbuff_t *tvb, int offset, int len,
394 proto_tree_add_text(tree, tvb, offset, len,
395 "Segmented message: length is %d, should be 2\n", len);
398 if (tvb_get_guint8(tvb, offset) & 0x80) {
399 proto_tree_add_text(tree, tvb, offset, 1,
400 "First segment: %u segments remaining",
401 tvb_get_guint8(tvb, offset) & 0x7F);
403 proto_tree_add_text(tree, tvb, offset, 1,
404 "Not first segment: %u segments remaining",
405 tvb_get_guint8(tvb, offset) & 0x7F);
407 proto_tree_add_text(tree, tvb, offset + 1, 1,
408 "Segmented message type: %u\n", tvb_get_guint8(tvb, offset + 1));
412 * Dissect a Bearer capability or Low-layer compatibility information element.
414 static const value_string q931_bc_coding_standard_vals[] = {
415 { 0x00, "ITU-T standardized coding" },
416 { 0x20, "ISO/IEC standard" },
417 { 0x40, "National standard" },
418 { 0x60, "Standard defined for this particular network" },
422 static const value_string q931_information_transfer_capability_vals[] = {
424 { 0x08, "Unrestricted digital information" },
425 { 0x09, "Restricted digital information" },
426 { 0x10, "3.1 kHz audio" },
427 { 0x11, "Unrestricted digital information with tones/announcements" },
432 static const value_string q931_transfer_mode_vals[] = {
433 { 0x00, "Circuit mode" },
434 { 0x40, "Packet mode" },
438 #define Q931_IT_RATE_MULTIRATE 0x18
440 static const value_string q931_information_transfer_rate_vals[] = {
441 { 0x00, "Packet mode" },
442 { 0x10, "64 kbit/s" },
443 { 0x11, "2 x 64 kbit/s" },
444 { 0x13, "384 kbit/s" },
445 { 0x15, "1536 kbit/s" },
446 { 0x17, "1920 kbit/s" },
447 { Q931_IT_RATE_MULTIRATE, "Multirate (64 kbit/s base rate)" },
451 static const value_string q931_uil1_vals[] = {
452 { 0x01, "V.110/I.460/X.30 rate adaption" },
453 { 0x02, "Recommendation G.711 u-law" },
454 { 0x03, "Recommendation G.711 A-law" },
455 { 0x04, "Recommendation G.721 32 kbit/s ADPCM and Recommendation I.460" },
456 { 0x05, "Recommendation H.221 and H.242" },
457 { 0x06, "Recommendation H.223 and H.245" },
458 { 0x07, "Non-ITU-T-standardized rate adaption" },
459 { 0x08, "V.120 rate adaption" },
460 { 0x09, "X.31 HDLC flag stuffing" },
464 static const value_string q931_l1_user_rate_vals[] = {
465 { 0x00, "Rate indicated by E-bits" },
466 { 0x01, "0.6 kbit/s" },
467 { 0x02, "1.2 kbit/s" },
468 { 0x03, "2.4 kbit/s" },
469 { 0x04, "3.6 kbit/s" },
470 { 0x05, "4.8 kbit/s" },
471 { 0x06, "7.2 kbit/s" },
472 { 0x07, "8 kbit/s" },
473 { 0x08, "9.6 kbit/s" },
474 { 0x09, "14.4 kbit/s" },
475 { 0x0A, "16 kbit/s" },
476 { 0x0B, "19.2 kbit/s" },
477 { 0x0C, "32 kbit/s" },
478 { 0x0E, "48 kbit/s" },
479 { 0x0F, "56 kbit/s" },
480 { 0x10, "64 kbit/s "},
481 { 0x15, "0.1345 kbit/s" },
482 { 0x16, "0.100 kbit/s" },
483 { 0x17, "0.075/1.2 kbit/s" },
484 { 0x18, "1.2/0.075 kbit/s" },
485 { 0x19, "0.050 kbit/s" },
486 { 0x1A, "0.075 kbit/s" },
487 { 0x1B, "0.110 kbit/s" },
488 { 0x1C, "0.150 kbit/s" },
489 { 0x1D, "0.200 kbit/s" },
490 { 0x1E, "0.300 kbit/s" },
491 { 0x1F, "12 kbit/s" },
495 static const value_string q931_l1_intermediate_rate_vals[] = {
496 { 0x20, "8 kbit/s" },
497 { 0x40, "16 kbit/s" },
498 { 0x60, "32 kbit/s" },
502 static const value_string q931_l1_stop_bits_vals[] = {
509 static const value_string q931_l1_data_bits_vals[] = {
516 static const value_string q931_l1_parity_vals[] = {
520 { 0x04, "Forced to 0" },
521 { 0x05, "Forced to 1" },
525 static const value_string q931_l1_modem_type_vals[] = {
528 { 0x13, "V.22 bis" },
531 { 0x16, "V.26 bis" },
532 { 0x17, "V.26 ter" },
534 { 0x19, "V.27 bis" },
535 { 0x1A, "V.27 ter" },
542 #define Q931_UIL2_USER_SPEC 0x10
544 static const value_string q931_uil2_vals[] = {
545 { 0x01, "Basic mode ISO 1745" },
546 { 0x02, "Q.921/I.441" }, /* LAPD */
547 { 0x06, "X.25, link layer" }, /* LAPB */
548 { 0x07, "X.25 multilink" }, /* or 0x0F? */
549 { 0x08, "T.71 Extended LAPB" },
550 { 0x09, "HDLC ARM" },
551 { 0x0A, "HDLC NRM" },
552 { 0x0B, "HDLC ABM" },
553 { 0x0C, "ISO 8802/2 LLC" },
554 { 0x0D, "X.75 Single Link Procedure" },
556 { 0x0F, "Core aspects of Q.922" },
557 { Q931_UIL2_USER_SPEC, "User-specified" },
558 { 0x11, "ISO 7776 DTE-DTE operation" },
562 static const value_string q931_mode_vals[] = {
563 { 0x20, "Normal mode" },
564 { 0x40, "Extended mode" },
568 #define Q931_UIL3_X25_PL 0x06
569 #define Q931_UIL3_ISO_8208 0x07 /* X.25-based */
570 #define Q931_UIL3_X223 0x08 /* X.25-based */
571 #define Q931_UIL3_TR_9577 0x0B
572 #define Q931_UIL3_USER_SPEC 0x10
574 static const value_string q931_uil3_vals[] = {
575 { 0x02, "Q.931/I.451" },
576 { Q931_UIL3_X25_PL, "X.25, packet layer" },
577 { Q931_UIL3_ISO_8208, "ISO/IEC 8208" },
578 { Q931_UIL3_X223, "X.223/ISO 8878" },
579 { 0x09, "ISO/IEC 8473" },
581 { Q931_UIL3_TR_9577, "ISO/IEC TR 9577" },
582 { Q931_UIL3_USER_SPEC, "User-specified" },
587 dissect_q931_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree)
589 unsigned int discriminator = tvb_get_guint8(tvb, offset);
591 if (discriminator == NLPID_Q_931) {
592 proto_tree_add_uint_format(tree, hf_q931_discriminator,
593 tvb, offset, 1, discriminator,
594 "Protocol discriminator: Q.931");
595 } else if (discriminator == NLPID_Q_2931) {
596 proto_tree_add_uint_format(tree, hf_q931_discriminator,
597 tvb, offset, 1, discriminator,
598 "Protocol discriminator: Q.2931");
599 } else if ((discriminator >= 16 && discriminator < 63)
600 || ((discriminator >= 80) && (discriminator < 254))) {
601 proto_tree_add_uint_format(tree, hf_q931_discriminator,
602 tvb, offset, 1, discriminator,
603 "Protocol discriminator: Network layer or layer 3 protocol (0x%02X)",
605 } else if (discriminator >= 64 && discriminator <= 79) {
606 proto_tree_add_uint_format(tree, hf_q931_discriminator,
607 tvb, offset, 1, discriminator,
608 "Protocol discriminator: National use (0x%02X)",
611 proto_tree_add_uint_format(tree, hf_q931_discriminator,
612 tvb, offset, 1, discriminator,
613 "Protocol discriminator: Reserved (0x%02X)",
619 dissect_q931_bearer_capability_ie(tvbuff_t *tvb, int offset, int len,
623 guint8 coding_standard;
626 guint8 uil2_protocol;
627 guint8 uil3_protocol;
632 octet = tvb_get_guint8(tvb, offset);
633 coding_standard = octet & 0x60;
634 proto_tree_add_text(tree, tvb, offset, 1,
635 "Coding standard: %s",
636 val_to_str(coding_standard, q931_bc_coding_standard_vals, NULL));
637 if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
639 * We don't know how the bearer capability is encoded,
640 * so just dump it as data and be done with it.
642 proto_tree_add_text(tree, tvb, offset,
644 tvb_bytes_to_str(tvb, offset, len));
647 proto_tree_add_text(tree, tvb, offset, 1,
648 "Information transfer capability: %s",
649 val_to_str(octet & 0x1F, q931_information_transfer_capability_vals,
650 "Unknown (0x%02X)"));
655 * XXX - only in Low-layer compatibility information element.
657 if (!(octet & Q931_IE_VL_EXTENSION)) {
660 octet = tvb_get_guint8(tvb, offset);
661 proto_tree_add_text(tree, tvb, offset, 1,
662 "Out-band negotiation %spossible",
663 (octet & 0x40) ? "" : "not ");
670 octet = tvb_get_guint8(tvb, offset);
671 proto_tree_add_text(tree, tvb, offset, 1,
673 val_to_str(octet & 0x60, q931_transfer_mode_vals,
674 "Unknown (0x%02X)"));
675 it_rate = octet & 0x1F;
676 proto_tree_add_text(tree, tvb, offset, 1,
677 "Information transfer rate: %s",
678 val_to_str(it_rate, q931_information_transfer_rate_vals,
679 "Unknown (0x%02X)"));
683 if (it_rate == Q931_IT_RATE_MULTIRATE) {
686 proto_tree_add_text(tree, tvb, offset, 1, "Rate multiplier: %u", tvb_get_guint8(tvb, offset));
693 octet = tvb_get_guint8(tvb, offset);
694 if ((octet & 0x60) == 0x20) {
696 * Layer 1 information.
698 proto_tree_add_text(tree, tvb, offset, 1,
699 "User information layer 1 protocol: %s",
700 val_to_str(octet & 0x1F, q931_uil1_vals,
701 "Unknown (0x%02X)"));
705 if (octet & Q931_IE_VL_EXTENSION)
709 octet = tvb_get_guint8(tvb, offset);
710 proto_tree_add_text(tree, tvb, offset, 1,
712 (octet & 0x40) ? "Asynchronous" : "Synchronous");
713 proto_tree_add_text(tree, tvb, offset, 1,
714 "Layer 1 in-band negotiation is %spossible",
715 (octet & 0x20) ? "" : "not ");
716 proto_tree_add_text(tree, tvb, offset, 1,
718 val_to_str(octet & 0x1F, q931_l1_user_rate_vals,
719 "Unknown (0x%02X)"));
723 if (octet & Q931_IE_VL_EXTENSION)
727 octet = tvb_get_guint8(tvb, offset);
728 proto_tree_add_text(tree, tvb, offset, 1,
729 "Intermediate rate: %s",
730 val_to_str(octet & 0x60, q931_l1_intermediate_rate_vals,
732 proto_tree_add_text(tree, tvb, offset, 1,
733 "%s to send data with network independent clock",
734 (octet & 0x10) ? "Required" : "Not required");
735 proto_tree_add_text(tree, tvb, offset, 1,
736 "%s accept data with network independent clock",
737 (octet & 0x08) ? "Can" : "Cannot");
738 proto_tree_add_text(tree, tvb, offset, 1,
739 "%s to send data with flow control mechanism",
740 (octet & 0x04) ? "Required" : "Not required");
741 proto_tree_add_text(tree, tvb, offset, 1,
742 "%s accept data with flow control mechanism",
743 (octet & 0x02) ? "Can" : "Cannot");
747 if (octet & Q931_IE_VL_EXTENSION)
751 octet = tvb_get_guint8(tvb, offset);
752 proto_tree_add_text(tree, tvb, offset, 1,
753 "Rate adaption header %sincluded",
754 (octet & 0x40) ? "" : "not ");
755 proto_tree_add_text(tree, tvb, offset, 1,
756 "Multiple frame establishment %ssupported",
757 (octet & 0x20) ? "" : "not ");
758 proto_tree_add_text(tree, tvb, offset, 1,
759 "%s mode of operation",
760 (octet & 0x10) ? "Protocol sensitive" : "Bit transparent");
761 proto_tree_add_text(tree, tvb, offset, 1,
763 "Full protocol negotiation" : "LLI = 256 only");
764 proto_tree_add_text(tree, tvb, offset, 1,
765 "Message originator is %s",
766 (octet & 0x04) ? "Assignor only" : "Default assignee");
767 proto_tree_add_text(tree, tvb, offset, 1,
768 "Negotiation is done %s",
769 (octet & 0x02) ? "in-band" : "out-of-band");
773 if (octet & Q931_IE_VL_EXTENSION)
777 octet = tvb_get_guint8(tvb, offset);
778 proto_tree_add_text(tree, tvb, offset, 1,
780 val_to_str(octet & 0x60, q931_l1_stop_bits_vals,
782 proto_tree_add_text(tree, tvb, offset, 1,
784 val_to_str(octet & 0x18, q931_l1_data_bits_vals,
786 proto_tree_add_text(tree, tvb, offset, 1,
788 val_to_str(octet & 0x07, q931_l1_parity_vals,
791 if (octet & Q931_IE_VL_EXTENSION)
795 octet = tvb_get_guint8(tvb, offset);
796 proto_tree_add_text(tree, tvb, offset, 1,
798 (octet & 0x40) ? "Full" : "Half");
799 modem_type = octet & 0x3F;
800 if (modem_type <= 0x5 ||
801 (modem_type >= 0x20 && modem_type <= 0x2F)) {
802 proto_tree_add_text(tree, tvb, offset, 1,
803 "Modem type: National use 0x%02X", modem_type);
804 } else if (modem_type >= 0x30) {
805 proto_tree_add_text(tree, tvb, offset, 1,
806 "Modem type: User specified 0x%02X", modem_type);
808 proto_tree_add_text(tree, tvb, offset, 1,
810 val_to_str(modem_type, q931_l1_modem_type_vals,
811 "Unknown (0x%02X)"));
821 octet = tvb_get_guint8(tvb, offset);
822 if ((octet & 0x60) == 0x40) {
824 * Layer 2 information.
826 uil2_protocol = octet & 0x1F;
827 proto_tree_add_text(tree, tvb, offset, 1,
828 "User information layer 2 protocol: %s",
829 val_to_str(uil2_protocol, q931_uil2_vals,
830 "Unknown (0x%02X)"));
835 * XXX - only in Low-layer compatibility information element.
837 if (octet & Q931_IE_VL_EXTENSION)
841 octet = tvb_get_guint8(tvb, offset);
842 if (uil2_protocol == Q931_UIL2_USER_SPEC) {
843 proto_tree_add_text(tree, tvb, offset, 1,
844 "User-specified layer 2 protocol information: 0x%02X",
847 proto_tree_add_text(tree, tvb, offset, 1,
849 val_to_str(octet & 0x60, q931_mode_vals,
850 "Unknown (0x%02X)"));
855 if (octet & Q931_IE_VL_EXTENSION)
859 octet = tvb_get_guint8(tvb, offset);
860 proto_tree_add_text(tree, tvb, offset, 1,
861 "Window size: %u k", octet & 0x7F);
870 octet = tvb_get_guint8(tvb, offset);
871 if ((octet & 0x60) == 0x60) {
873 * Layer 3 information.
875 uil3_protocol = octet & 0x1F;
876 proto_tree_add_text(tree, tvb, offset, 1,
877 "User information layer 3 protocol: %s",
878 val_to_str(uil3_protocol, q931_uil3_vals,
879 "Unknown (0x%02X)"));
885 * XXX - only in Low-layer compatibility information element.
887 if (octet & Q931_IE_VL_EXTENSION)
891 octet = tvb_get_guint8(tvb, offset);
892 switch (uil3_protocol) {
894 case Q931_UIL3_X25_PL:
895 case Q931_UIL3_ISO_8208:
897 proto_tree_add_text(tree, tvb, offset, 1,
899 val_to_str(octet & 0x60, q931_mode_vals,
900 "Unknown (0x%02X)"));
904 if (octet & Q931_IE_VL_EXTENSION)
908 octet = tvb_get_guint8(tvb, offset);
909 proto_tree_add_text(tree, tvb, offset, 1,
910 "Default packet size: %u", octet & 0x0F);
914 if (octet & Q931_IE_VL_EXTENSION)
918 octet = tvb_get_guint8(tvb, offset);
919 proto_tree_add_text(tree, tvb, offset, 1,
920 "Packet window size: %u", octet & 0x7F);
925 case Q931_UIL3_USER_SPEC:
926 proto_tree_add_text(tree, tvb, offset, 1,
927 "Default packet size: %u octets",
928 1 << (octet & 0x0F));
933 case Q931_UIL3_TR_9577:
934 add_l3_info = (octet & 0x0F) << 4;
935 if (octet & Q931_IE_VL_EXTENSION)
939 octet = tvb_get_guint8(tvb, offset + 1);
940 add_l3_info |= (octet & 0x0F);
941 proto_tree_add_text(tree, tvb, offset, 2,
942 "Additional layer 3 protocol information: %s",
943 val_to_str(add_l3_info, nlpid_vals,
944 "Unknown (0x%02X)"));
955 * Dissect a Cause information element.
957 static const value_string q931_cause_coding_standard_vals[] = {
958 { 0x00, "ITU-T standardized coding" },
959 { 0x20, "ISO/IEC standard" },
960 { 0x40, "National standard" },
961 { 0x60, "Standard specific to identified location" },
965 const value_string q931_cause_location_vals[] = {
966 { 0x00, "User (U)" },
967 { 0x01, "Private network serving the local user (LPN)" },
968 { 0x02, "Public network serving the local user (LN)" },
969 { 0x03, "Transit network (TN)" },
970 { 0x04, "Public network serving the remote user (RLN)" },
971 { 0x05, "Private network serving the remote user (RPN)" },
972 { 0x07, "International network (INTL)" },
973 { 0x0A, "Network beyond interworking point (BI)" },
977 static const value_string q931_cause_recommendation_vals[] = {
981 { 0x05, "Q.1031/Q.1051" },
986 * Cause codes for Cause.
988 #define Q931_CAUSE_UNALLOC_NUMBER 0x01
989 #define Q931_CAUSE_NO_ROUTE_TO_DEST 0x03
990 #define Q931_CAUSE_CALL_REJECTED 0x15
991 #define Q931_CAUSE_NUMBER_CHANGED 0x16
992 #define Q931_CAUSE_ACCESS_INFO_DISC 0x2B
993 #define Q931_CAUSE_QOS_UNAVAILABLE 0x31
994 #define Q931_CAUSE_CHAN_NONEXISTENT 0x52
995 #define Q931_CAUSE_INCOMPATIBLE_DEST 0x58
996 #define Q931_CAUSE_MAND_IE_MISSING 0x60
997 #define Q931_CAUSE_MT_NONEX_OR_UNIMPL 0x61
998 #define Q931_CAUSE_IE_NONEX_OR_UNIMPL 0x63
999 #define Q931_CAUSE_INVALID_IE_CONTENTS 0x64
1000 #define Q931_CAUSE_MSG_INCOMPAT_W_CS 0x65
1001 #define Q931_CAUSE_REC_TIMER_EXP 0x66
1003 const value_string q931_cause_code_vals[] = {
1004 { 0x00, "Valid cause code not yet received" },
1005 { Q931_CAUSE_UNALLOC_NUMBER, "Unallocated (unassigned) number" },
1006 { 0x02, "No route to specified transit network" },
1007 { Q931_CAUSE_NO_ROUTE_TO_DEST, "No route to destination" },
1008 { 0x04, "Send special information tone" },
1009 { 0x05, "Misdialled trunk prefix" },
1010 { 0x06, "Channel unacceptable" },
1011 { 0x07, "Call awarded and being delivered in an established channel" },
1012 { 0x08, "Prefix 0 dialed but not allowed" },
1013 /* Q.850 - "Preemption" */
1014 { 0x09, "Prefix 1 dialed but not allowed" },
1015 /* Q.850 - "Preemption - circuit reserved for reuse" */
1016 { 0x0A, "Prefix 1 dialed but not required" },
1017 { 0x0B, "More digits received than allowed, call is proceeding" },
1018 { 0x0E, "QoR: ported number" },
1019 { 0x10, "Normal call clearing" },
1020 { 0x11, "User busy" },
1021 { 0x12, "No user responding" },
1022 { 0x13, "No answer from user (user alerted)" },
1023 { 0x14, "Subscriber absent" },
1024 { Q931_CAUSE_CALL_REJECTED, "Call rejected" },
1025 { Q931_CAUSE_NUMBER_CHANGED, "Number changed" },
1026 { 0x17, "Reverse charging rejected" },
1027 /* Q.850 - "Redirection to new destination" */
1028 { 0x18, "Call suspended" },
1029 /* Q.850 Amendment 1 - "Call rejected due to feature at the destination" */
1030 { 0x19, "Call resumed" },
1031 /* Q.850 - "Exchange routing error */
1032 { 0x1A, "Non-selected user clearing" },
1033 { 0x1B, "Destination out of order" },
1034 { 0x1C, "Invalid number format (incomplete number)" },
1035 { 0x1D, "Facility rejected" },
1036 { 0x1E, "Response to STATUS ENQUIRY" },
1037 { 0x1F, "Normal unspecified" },
1038 { 0x21, "Circuit out of order" },
1039 { 0x22, "No circuit/channel available" },
1040 { 0x23, "Destination unattainable" },
1041 { 0x25, "Degraded service" },
1042 { 0x26, "Network out of order" },
1043 { 0x27, "Transit delay range cannot be achieved" },
1044 /* Q.850 - "Permanent frame mode connection out of service" */
1045 { 0x28, "Throughput range cannot be achieved" },
1046 /* Q.850 - "Permanent frame mode connection operational" */
1047 { 0x29, "Temporary failure" },
1048 { 0x2A, "Switching equipment congestion" },
1049 { Q931_CAUSE_ACCESS_INFO_DISC, "Access information discarded" },
1050 { 0x2C, "Requested circuit/channel not available" },
1051 { 0x2D, "Pre-empted" },
1052 { 0x2E, "Precedence call blocked" },
1053 { 0x2F, "Resources unavailable, unspecified" },
1054 { Q931_CAUSE_QOS_UNAVAILABLE, "Quality of service unavailable" },
1055 { 0x32, "Requested facility not subscribed" },
1056 { 0x33, "Reverse charging not allowed" },
1057 { 0x34, "Outgoing calls barred" },
1058 { 0x35, "Outgoing calls barred within CUG" },
1059 { 0x36, "Incoming calls barred" },
1060 { 0x37, "Incoming calls barred within CUG" },
1061 { 0x38, "Call waiting not subscribed" },
1062 { 0x39, "Bearer capability not authorized" },
1063 { 0x3A, "Bearer capability not presently available" },
1064 { 0x3E, "Inconsistency in designated outgoing access information and subscriber class" },
1065 { 0x3F, "Service or option not available, unspecified" },
1066 { 0x41, "Bearer capability not implemented" },
1067 { 0x42, "Channel type not implemented" },
1068 { 0x43, "Transit network selection not implemented" },
1069 { 0x44, "Message not implemented" },
1070 { 0x45, "Requested facility not implemented" },
1071 { 0x46, "Only restricted digital information bearer capability is available" },
1072 { 0x4F, "Service or option not implemented, unspecified" },
1073 { 0x51, "Invalid call reference value" },
1074 { Q931_CAUSE_CHAN_NONEXISTENT, "Identified channel does not exist" },
1075 { 0x53, "Call identity does not exist for suspended call" },
1076 { 0x54, "Call identity in use" },
1077 { 0x55, "No call suspended" },
1078 { 0x56, "Call having the requested call identity has been cleared" },
1079 { 0x57, "Called user not member of CUG" },
1080 { Q931_CAUSE_INCOMPATIBLE_DEST, "Incompatible destination" },
1081 { 0x59, "Non-existent abbreviated address entry" },
1082 { 0x5A, "Destination address missing, and direct call not subscribed" },
1083 /* Q.850 - "Non-existent CUG" */
1084 { 0x5B, "Invalid transit network selection (national use)" },
1085 { 0x5C, "Invalid facility parameter" },
1086 { 0x5D, "Mandatory information element is missing" },
1087 { 0x5F, "Invalid message, unspecified" },
1088 { Q931_CAUSE_MAND_IE_MISSING, "Mandatory information element is missing" },
1089 { Q931_CAUSE_MT_NONEX_OR_UNIMPL,"Message type non-existent or not implemented" },
1090 { 0x62, "Message not compatible with call state or message type non-existent or not implemented" },
1091 { Q931_CAUSE_IE_NONEX_OR_UNIMPL,"Information element nonexistant or not implemented" },
1092 { Q931_CAUSE_INVALID_IE_CONTENTS,"Invalid information element contents" },
1093 { Q931_CAUSE_MSG_INCOMPAT_W_CS, "Message not compatible with call state" },
1094 { Q931_CAUSE_REC_TIMER_EXP, "Recovery on timer expiry" },
1095 { 0x67, "Parameter non-existent or not implemented - passed on" },
1096 { 0x6E, "Message with unrecognized parameter discarded" },
1097 { 0x6F, "Protocol error, unspecified" },
1098 { 0x7F, "Internetworking, unspecified" },
1102 static const value_string q931_cause_condition_vals[] = {
1103 { 0x00, "Unknown" },
1104 { 0x01, "Permanent" },
1105 { 0x02, "Transient" },
1109 #define Q931_REJ_USER_SPECIFIC 0x00
1110 #define Q931_REJ_IE_MISSING 0x04
1111 #define Q931_REJ_IE_INSUFFICIENT 0x08
1113 static const value_string q931_rejection_reason_vals[] = {
1114 { 0x00, "User specific" },
1115 { 0x04, "Information element missing" },
1116 { 0x08, "Information element contents are not sufficient" },
1121 dissect_q931_cause_ie(tvbuff_t *tvb, int offset, int len,
1122 proto_tree *tree, int hf_cause_value)
1126 guint8 coding_standard;
1127 guint8 rejection_reason;
1131 octet = tvb_get_guint8(tvb, offset);
1132 coding_standard = octet & 0x60;
1133 proto_tree_add_text(tree, tvb, offset, 1,
1134 "Coding standard: %s",
1135 val_to_str(coding_standard, q931_cause_coding_standard_vals, NULL));
1136 if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
1138 * We don't know how the cause is encoded,
1139 * so just dump it as data and be done with it.
1141 proto_tree_add_text(tree, tvb, offset,
1143 tvb_bytes_to_str(tvb, offset, len));
1146 proto_tree_add_text(tree, tvb, offset, 1,
1148 val_to_str(octet & 0x0F, q931_cause_location_vals,
1153 if (!(octet & Q931_IE_VL_EXTENSION)) {
1156 octet = tvb_get_guint8(tvb, offset);
1157 proto_tree_add_text(tree, tvb, offset, 1,
1158 "Recommendation: %s",
1159 val_to_str(octet & 0x7F, q931_cause_recommendation_vals,
1160 "Unknown (0x%02X)"));
1167 octet = tvb_get_guint8(tvb, offset);
1168 cause_value = octet & 0x7F;
1169 proto_tree_add_uint(tree, hf_cause_value, tvb, 0, 1, cause_value);
1175 switch (cause_value) {
1177 case Q931_CAUSE_UNALLOC_NUMBER:
1178 case Q931_CAUSE_NO_ROUTE_TO_DEST:
1179 case Q931_CAUSE_QOS_UNAVAILABLE:
1180 octet = tvb_get_guint8(tvb, offset);
1181 proto_tree_add_text(tree, tvb, offset, 1,
1182 "Network service: %s",
1183 (octet & 0x80) ? "User" : "Provider");
1184 proto_tree_add_text(tree, tvb, offset, 1,
1186 (octet & 0x40) ? "Abnormal" : "Normal");
1187 proto_tree_add_text(tree, tvb, offset, 1,
1189 val_to_str(octet & 0x03, q931_cause_condition_vals,
1193 case Q931_CAUSE_CALL_REJECTED:
1194 rejection_reason = octet & 0x7C;
1195 proto_tree_add_text(tree, tvb, offset, 1,
1196 "Rejection reason: %s",
1197 val_to_str(octet & 0x7C, q931_rejection_reason_vals,
1199 proto_tree_add_text(tree, tvb, offset, 1,
1201 val_to_str(octet & 0x03, q931_cause_condition_vals,
1208 switch (rejection_reason) {
1210 case Q931_REJ_USER_SPECIFIC:
1211 proto_tree_add_text(tree, tvb, offset, len,
1212 "User specific diagnostic: %s",
1213 tvb_bytes_to_str(tvb, offset, len));
1216 case Q931_REJ_IE_MISSING:
1217 proto_tree_add_text(tree, tvb, offset, 1,
1218 "Missing information element: %s",
1219 val_to_str(tvb_get_guint8(tvb, offset), q931_info_element_vals0,
1220 "Unknown (0x%02X)"));
1223 case Q931_REJ_IE_INSUFFICIENT:
1224 proto_tree_add_text(tree, tvb, offset, 1,
1225 "Insufficient information element: %s",
1226 val_to_str(tvb_get_guint8(tvb, offset), q931_info_element_vals0,
1227 "Unknown (0x%02X)"));
1231 proto_tree_add_text(tree, tvb, offset, len,
1233 tvb_bytes_to_str(tvb, offset, len));
1238 case Q931_CAUSE_ACCESS_INFO_DISC:
1239 case Q931_CAUSE_INCOMPATIBLE_DEST:
1240 case Q931_CAUSE_MAND_IE_MISSING:
1241 case Q931_CAUSE_IE_NONEX_OR_UNIMPL:
1242 case Q931_CAUSE_INVALID_IE_CONTENTS:
1244 proto_tree_add_text(tree, tvb, offset, 1,
1245 "Information element: %s",
1246 val_to_str(tvb_get_guint8(tvb, offset), q931_info_element_vals0,
1247 "Unknown (0x%02X)"));
1253 case Q931_CAUSE_MT_NONEX_OR_UNIMPL:
1254 case Q931_CAUSE_MSG_INCOMPAT_W_CS:
1255 proto_tree_add_text(tree, tvb, offset, 1,
1257 val_to_str(tvb_get_guint8(tvb, offset), q931_message_type_vals,
1258 "Unknown (0x%02X)"));
1261 case Q931_CAUSE_REC_TIMER_EXP:
1264 proto_tree_add_text(tree, tvb, offset, 3,
1265 "Timer: %.3s", tvb_get_ptr(tvb, offset, 3));
1269 proto_tree_add_text(tree, tvb, offset, len,
1271 tvb_bytes_to_str(tvb, offset, len));
1276 * Dissect a Call state information element.
1278 static const value_string q931_coding_standard_vals[] = {
1279 { 0x00, "ITU-T standardized coding" },
1280 { 0x20, "ISO/IEC standard" },
1281 { 0x40, "National standard" },
1282 { 0x60, "Standard defined for the network" },
1286 static const value_string q931_call_state_vals[] = {
1288 { 0x01, "Call initiated" },
1289 { 0x02, "Overlap sending" },
1290 { 0x03, "Outgoing call proceeding" },
1291 { 0x04, "Call delivered" },
1292 { 0x06, "Call present" },
1293 { 0x07, "Call received" },
1294 { 0x08, "Connect request" },
1295 { 0x09, "Incoming call proceeding" },
1297 { 0x0B, "Disconnect request" },
1298 { 0x0C, "Disconnect indication" },
1299 { 0x0F, "Suspend request" },
1300 { 0x12, "Resume request" },
1301 { 0x13, "Release request" },
1302 { 0x16, "Call abort"},
1303 { 0x19, "Overlap receiving" },
1304 { 0x3D, "Restart request" },
1305 { 0x3E, "Restart" },
1310 dissect_q931_call_state_ie(tvbuff_t *tvb, int offset, int len,
1314 guint8 coding_standard;
1318 octet = tvb_get_guint8(tvb, offset);
1319 coding_standard = octet & 0x60;
1320 proto_tree_add_text(tree, tvb, offset, 1,
1321 "Coding standard: %s",
1322 val_to_str(coding_standard, q931_coding_standard_vals, NULL));
1323 if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
1325 * We don't know how the call state is encoded,
1326 * so just dump it as data and be done with it.
1328 proto_tree_add_text(tree, tvb, offset,
1330 tvb_bytes_to_str(tvb, offset, len));
1333 proto_tree_add_text(tree, tvb, offset, 1,
1335 val_to_str(octet & 0x3F, q931_call_state_vals,
1336 "Unknown (0x%02X)"));
1340 * Dissect a Channel identification information element.
1342 #define Q931_INTERFACE_IDENTIFIED 0x40
1343 #define Q931_NOT_BASIC_CHANNEL 0x20
1345 static const value_string q931_basic_channel_selection_vals[] = {
1346 { 0x00, "No channel" },
1347 { 0x01, "B1 channel" },
1348 { 0x02, "B2 channel" },
1349 { 0x03, "Any channel" },
1353 static const value_string q931_not_basic_channel_selection_vals[] = {
1354 { 0x00, "No channel" },
1355 { 0x01, "Channel indicated in following octets" },
1356 { 0x03, "Any channel" },
1360 #define Q931_IS_SLOT_MAP 0x10
1362 static const value_string q931_element_type_vals[] = {
1363 { 0x03, "B-channel units" },
1364 { 0x06, "H0-channel units" },
1365 { 0x08, "H11-channel units" },
1366 { 0x09, "H12-channel units" },
1371 dissect_q931_channel_identification_ie(tvbuff_t *tvb, int offset, int len,
1375 int identifier_offset;
1377 guint8 coding_standard;
1381 octet = tvb_get_guint8(tvb, offset);
1382 proto_tree_add_text(tree, tvb, offset, 1,
1383 "Interface %s identified",
1384 (octet & Q931_INTERFACE_IDENTIFIED) ? "explicitly" : "implicitly");
1385 proto_tree_add_text(tree, tvb, offset, 1,
1387 (octet & Q931_NOT_BASIC_CHANNEL) ? "Not basic" : "Basic");
1388 proto_tree_add_text(tree, tvb, offset, 1,
1389 "Indicated channel is %s",
1390 (octet & 0x08) ? "required" : "preferred");
1391 proto_tree_add_text(tree, tvb, offset, 1,
1392 "Indicated channel is %sthe D-channel",
1393 (octet & 0x04) ? "" : "not ");
1394 if (octet & Q931_NOT_BASIC_CHANNEL) {
1395 proto_tree_add_text(tree, tvb, offset, 1,
1396 "Channel selection: %s",
1397 val_to_str(octet & 0x03, q931_not_basic_channel_selection_vals,
1400 proto_tree_add_text(tree, tvb, offset, 1,
1401 "Channel selection: %s",
1402 val_to_str(octet & 0x03, q931_basic_channel_selection_vals,
1408 if (octet & Q931_INTERFACE_IDENTIFIED) {
1409 identifier_offset = offset;
1414 octet = tvb_get_guint8(tvb, offset);
1418 } while (!(octet & Q931_IE_VL_EXTENSION));
1421 * XXX - do we want to strip off the 8th bit on the
1422 * last octet of the interface identifier?
1424 if (identifier_len != 0) {
1425 proto_tree_add_text(tree, tvb, identifier_offset,
1426 identifier_len, "Interface identifier: %s",
1428 tvb_get_ptr(tvb, identifier_offset, identifier_len),
1433 if (octet & Q931_NOT_BASIC_CHANNEL) {
1436 octet = tvb_get_guint8(tvb, offset);
1437 coding_standard = octet & 0x60;
1438 proto_tree_add_text(tree, tvb, offset, 1,
1439 "Coding standard: %s",
1440 val_to_str(coding_standard, q931_coding_standard_vals,
1442 if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
1444 * We don't know how the channel identifier is
1445 * encoded, so just dump it as data and be done
1448 proto_tree_add_text(tree, tvb, offset,
1450 tvb_bytes_to_str(tvb, offset, len));
1453 proto_tree_add_text(tree, tvb, offset, 1,
1454 "Channel is indicated by %s",
1455 (octet & Q931_IS_SLOT_MAP) ? "slot map" : "number");
1456 proto_tree_add_text(tree, tvb, offset, 1,
1458 (octet & Q931_IS_SLOT_MAP) ? "Map element" : "Channel",
1459 val_to_str(octet & 0x0F, q931_element_type_vals,
1460 "Unknown (0x%02X)"));
1463 * XXX - dump the channel number or slot map.
1469 * Dissect a Progress indicator information element.
1471 static const value_string q931_progress_description_vals[] = {
1472 { 0x01, "Call is not end-to-end ISDN - progress information available in-band" },
1473 { 0x02, "Destination address is non-ISDN" },
1474 { 0x03, "Origination address is non-ISDN" },
1475 { 0x04, "Call has returned to the ISDN" },
1476 { 0x05, "Interworking has occurred and has resulted in a telecommunications service change" },
1477 { 0x08, "In-band information or an appropriate pattern is now available" },
1482 dissect_q931_progress_indicator_ie(tvbuff_t *tvb, int offset, int len,
1486 guint8 coding_standard;
1490 octet = tvb_get_guint8(tvb, offset);
1491 coding_standard = octet & 0x60;
1492 proto_tree_add_text(tree, tvb, offset, 1,
1493 "Coding standard: %s",
1494 val_to_str(coding_standard, q931_cause_coding_standard_vals, NULL));
1495 if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
1497 * We don't know how the progress indicator is encoded,
1498 * so just dump it as data and be done with it.
1500 proto_tree_add_text(tree, tvb, offset,
1502 tvb_bytes_to_str(tvb, offset, len));
1505 proto_tree_add_text(tree, tvb, offset, 1,
1507 val_to_str(octet & 0x0F, q931_cause_location_vals,
1514 octet = tvb_get_guint8(tvb, offset);
1515 proto_tree_add_text(tree, tvb, offset, 1,
1516 "Progress description: %s",
1517 val_to_str(octet & 0x7F, q931_progress_description_vals,
1518 "Unknown (0x%02X)"));
1522 * Dissect a Network-specific facilities or Transit network selection
1523 * information element.
1525 static const value_string q931_netid_type_vals[] = {
1526 { 0x00, "User specified" },
1527 { 0x20, "National network identification" },
1528 { 0x30, "International network identification" },
1532 static const value_string q931_netid_plan_vals[] = {
1533 { 0x00, "Unknown" },
1534 { 0x01, "Carrier Identification Code" },
1535 { 0x03, "X.121 data network identification code" },
1540 dissect_q931_ns_facilities_ie(tvbuff_t *tvb, int offset, int len,
1548 octet = tvb_get_guint8(tvb, offset);
1549 netid_len = octet & 0x7F;
1550 proto_tree_add_text(tree, tvb, offset, 1,
1551 "Network identification length: %u",
1555 if (netid_len != 0) {
1558 octet = tvb_get_guint8(tvb, offset);
1559 proto_tree_add_text(tree, tvb, offset, 1,
1560 "Type of network identification: %s",
1561 val_to_str(octet & 0x70, q931_netid_type_vals,
1562 "Unknown (0x%02X)"));
1563 proto_tree_add_text(tree, tvb, offset, 1,
1564 "Network identification plan: %s",
1565 val_to_str(octet & 0x0F, q931_netid_plan_vals,
1566 "Unknown (0x%02X)"));
1573 if (netid_len > len)
1575 if (netid_len != 0) {
1576 proto_tree_add_text(tree, tvb, offset, netid_len,
1577 "Network identification: %s",
1578 tvb_format_text(tvb, offset, netid_len));
1579 offset += netid_len;
1585 * Whatever is left is the network-specific facility
1590 proto_tree_add_text(tree, tvb, offset,
1591 len, "Network-specific facility specification: %s",
1592 tvb_bytes_to_str(tvb, offset, len));
1596 * Dissect a Notification indicator information element.
1598 static const value_string q931_notification_description_vals[] = {
1599 { 0x00, "User suspended" },
1600 { 0x01, "User resumed" },
1601 { 0x02, "Bearer service change" },
1606 dissect_q931_notification_indicator_ie(tvbuff_t *tvb, int offset, int len,
1613 octet = tvb_get_guint8(tvb, offset);
1614 proto_tree_add_text(tree, tvb, offset, 1,
1615 "Notification description: %s",
1616 val_to_str(octet & 0x7F, q931_notification_description_vals,
1617 "Unknown (0x%02X)"));
1621 * Dissect a Date/time information element.
1624 dissect_q931_date_time_ie(tvbuff_t *tvb, int offset, int len,
1628 proto_tree_add_text(tree, tvb, offset, len,
1629 "Date/time: length is %d, should be 6\n", len);
1633 * XXX - what is "year" relative to? Is "month" 0-origin or
1634 * 1-origin? Q.931 doesn't say....
1636 proto_tree_add_text(tree, tvb, offset, 6,
1637 "Date/time: %02u-%02u-%02u %02u:%02u:%02u",
1638 tvb_get_guint8(tvb, offset + 0), tvb_get_guint8(tvb, offset + 1), tvb_get_guint8(tvb, offset + 2),
1639 tvb_get_guint8(tvb, offset + 3), tvb_get_guint8(tvb, offset + 4), tvb_get_guint8(tvb, offset + 5));
1643 * Dissect a Signal information element.
1645 static const value_string q931_signal_vals[] = {
1646 { 0x00, "Dial tone on" },
1647 { 0x01, "Ring tone on" },
1648 { 0x02, "Intercept tone on" },
1649 { 0x03, "Network congestion tone on" }, /* "fast busy" */
1650 { 0x04, "Busy tone on" },
1651 { 0x05, "Confirm tone on" },
1652 { 0x06, "Answer tone on" },
1653 { 0x07, "Call waiting tone on" },
1654 { 0x08, "Off-hook warning tone on" },
1655 { 0x09, "Preemption tone on" },
1656 { 0x3F, "Tones off" },
1657 { 0x40, "Alerting on - pattern 0" },
1658 { 0x41, "Alerting on - pattern 1" },
1659 { 0x42, "Alerting on - pattern 2" },
1660 { 0x43, "Alerting on - pattern 3" },
1661 { 0x44, "Alerting on - pattern 4" },
1662 { 0x45, "Alerting on - pattern 5" },
1663 { 0x46, "Alerting on - pattern 6" },
1664 { 0x47, "Alerting on - pattern 7" },
1665 { 0x4F, "Alerting off" },
1670 dissect_q931_signal_ie(tvbuff_t *tvb, int offset, int len,
1674 proto_tree_add_text(tree, tvb, offset, len,
1675 "Signal: length is %d, should be 1\n", len);
1678 proto_tree_add_text(tree, tvb, offset, 1,
1680 val_to_str(tvb_get_guint8(tvb, offset), q931_signal_vals,
1681 "Unknown (0x%02X)"));
1685 * Dissect an Information rate information element.
1687 static const value_string q931_throughput_class_vals[] = {
1688 { 0x03, "75 bit/s" },
1689 { 0x04, "150 bit/s" },
1690 { 0x05, "300 bit/s" },
1691 { 0x06, "600 bit/s" },
1692 { 0x07, "1200 bit/s" },
1693 { 0x08, "2400 bit/s" },
1694 { 0x09, "4800 bit/s" },
1695 { 0x0A, "9600 bit/s" },
1696 { 0x0B, "19200 bit/s" },
1697 { 0x0C, "48000 bit/s" },
1698 { 0x0D, "64000 bit/s" },
1703 dissect_q931_information_rate_ie(tvbuff_t *tvb, int offset, int len,
1707 proto_tree_add_text(tree, tvb, offset, len,
1708 "Information rate: length is %d, should be 4\n", len);
1711 proto_tree_add_text(tree, tvb, offset + 0, 1,
1712 "Incoming information rate: %s",
1713 val_to_str(tvb_get_guint8(tvb, offset + 0) & 0x1F,
1714 q931_throughput_class_vals, "Unknown (0x%02X)"));
1715 proto_tree_add_text(tree, tvb, offset + 1, 1,
1716 "Outgoing information rate: %s",
1717 val_to_str(tvb_get_guint8(tvb, offset + 1) & 0x1F,
1718 q931_throughput_class_vals, "Unknown (0x%02X)"));
1719 proto_tree_add_text(tree, tvb, offset + 2, 1,
1720 "Minimum incoming information rate: %s",
1721 val_to_str(tvb_get_guint8(tvb, offset + 2) & 0x1F,
1722 q931_throughput_class_vals, "Unknown (0x%02X)"));
1723 proto_tree_add_text(tree, tvb, offset + 3, 1,
1724 "Minimum outgoing information rate: %s",
1725 val_to_str(tvb_get_guint8(tvb, offset + 3) & 0x1F,
1726 q931_throughput_class_vals, "Unknown (0x%02X)"));
1730 dissect_q931_guint16_value(tvbuff_t *tvb, int offset, int len,
1731 proto_tree *tree, char *label)
1739 octet = tvb_get_guint8(tvb, offset);
1740 if (octet & Q931_IE_VL_EXTENSION) {
1742 * Only one octet long - error.
1746 value = (octet & 0x3) << 14;
1753 * We've reached the end of the information element - error.
1757 octet = tvb_get_guint8(tvb, offset);
1758 if (octet & Q931_IE_VL_EXTENSION) {
1760 * Only two octets long - error.
1764 value |= (octet & 0x7F) << 7;
1771 * We've reached the end of the information element - error.
1775 octet = tvb_get_guint8(tvb, offset);
1776 if (!(octet & Q931_IE_VL_EXTENSION)) {
1778 * More than three octets long - error.
1782 value |= (octet & 0x7F);
1787 proto_tree_add_text(tree, tvb, offset, value_len, "%s: %u ms", label,
1792 proto_tree_add_text(tree, tvb, offset, len,
1793 "%s goes past end of information element", label);
1797 proto_tree_add_text(tree, tvb, offset, len, "%s isn't 3 octets long",
1803 * Dissect an End-to-end transit delay information element.
1806 dissect_q931_e2e_transit_delay_ie(tvbuff_t *tvb, int offset, int len,
1813 value_len = dissect_q931_guint16_value(tvb, offset, len, tree,
1814 "Cumulative transit delay");
1817 offset += value_len;
1822 value_len = dissect_q931_guint16_value(tvb, offset, len, tree,
1823 "Requested end-to-end transit delay");
1826 offset += value_len;
1831 value_len = dissect_q931_guint16_value(tvb, offset, len, tree,
1832 "Maximum end-to-end transit delay");
1836 * Dissect a Transit delay selection and indication information element.
1839 dissect_q931_td_selection_and_int_ie(tvbuff_t *tvb, int offset, int len,
1844 dissect_q931_guint16_value(tvb, offset, len, tree,
1849 * Dissect a Packet layer binary parameters information element.
1851 static const value_string q931_fast_selected_vals[] = {
1852 { 0x00, "Fast select not requested" },
1853 { 0x08, "Fast select not requested" },
1854 { 0x10, "Fast select requested with no restriction of response" },
1855 { 0x18, "Fast select requested with restrictions of response" },
1860 dissect_q931_pl_binary_parameters_ie(tvbuff_t *tvb, int offset, int len,
1867 octet = tvb_get_guint8(tvb, offset);
1868 proto_tree_add_text(tree, tvb, offset, 1,
1870 val_to_str(octet & 0x18, q931_fast_selected_vals, NULL));
1871 proto_tree_add_text(tree, tvb, offset, 1,
1873 (octet & 0x04) ? "No request/request denied" :
1874 "Request indicated/request accepted");
1875 proto_tree_add_text(tree, tvb, offset, 1,
1877 (octet & 0x02) ? "Link-by-link" : "End-to-end");
1878 proto_tree_add_text(tree, tvb, offset, 1,
1879 "Modulus %u sequencing",
1880 (octet & 0x01) ? 8 : 128);
1884 * Dissect a Packet layer window size information element.
1887 dissect_q931_pl_window_size_ie(tvbuff_t *tvb, int offset, int len,
1892 proto_tree_add_text(tree, tvb, offset, 1,
1893 "Forward value: %u", tvb_get_guint8(tvb, offset) & 0x7F);
1899 proto_tree_add_text(tree, tvb, offset, 1,
1900 "Backward value: %u", tvb_get_guint8(tvb, offset) & 0x7F);
1904 * Dissect a Packet size information element.
1907 dissect_q931_packet_size_ie(tvbuff_t *tvb, int offset, int len,
1912 proto_tree_add_text(tree, tvb, offset, 1,
1913 "Forward value: %u", tvb_get_guint8(tvb, offset) & 0x7F);
1919 proto_tree_add_text(tree, tvb, offset, 1,
1920 "Backward value: %u", tvb_get_guint8(tvb, offset) & 0x7F);
1924 * Dissect a Closed user group information element.
1926 static const value_string q931_cug_indication_vals[] = {
1927 { 0x01, "Closed user group selection" },
1928 { 0x02, "Closed user group with outgoing access selection and indication" },
1933 dissect_q931_cug_ie(tvbuff_t *tvb, int offset, int len, proto_tree *tree)
1937 proto_tree_add_text(tree, tvb, offset, 1,
1938 "CUG indication: %s",
1939 val_to_str(tvb_get_guint8(tvb, offset) & 0x07,
1940 q931_cug_indication_vals, "Unknown (0x%02X)"));
1946 proto_tree_add_text(tree, tvb, offset, len, "CUG index code: %s",
1947 tvb_format_text(tvb, offset, len));
1951 * Dissect a Reverse charging indication information element.
1953 static const value_string q931_reverse_charging_indication_vals[] = {
1954 { 0x01, "Reverse charging requested" },
1959 dissect_q931_reverse_charge_ind_ie(tvbuff_t *tvb, int offset, int len,
1964 proto_tree_add_text(tree, tvb, offset, 1,
1965 "Reverse charging indication: %s",
1966 val_to_str(tvb_get_guint8(tvb, offset) & 0x07,
1967 q931_reverse_charging_indication_vals, "Unknown (0x%02X)"));
1971 * Dissect a (phone) number information element.
1973 static const value_string q931_number_type_vals[] = {
1974 { 0x00, "Unknown" },
1975 { 0x10, "International number" },
1976 { 0x20, "National number" },
1977 { 0x30, "Network specific number" },
1978 { 0x40, "Subscriber number" },
1979 { 0x60, "Abbreviated number" },
1983 static const value_string q931_numbering_plan_vals[] = {
1984 { 0x00, "Unknown" },
1985 { 0x01, "E.164 ISDN/telephony numbering" },
1986 { 0x03, "X.121 data numbering" },
1987 { 0x04, "F.69 Telex numbering" },
1988 { 0x08, "National standard numbering" },
1989 { 0x09, "Private numbering" },
1993 static const value_string q931_presentation_indicator_vals[] = {
1994 { 0x00, "Presentation allowed" },
1995 { 0x20, "Presentation restricted" },
1996 { 0x40, "Number not available due to interworking" },
2000 static const value_string q931_screening_indicator_vals[] = {
2001 { 0x00, "User-provided, not screened" },
2002 { 0x01, "User-provided, verified and passed" },
2003 { 0x02, "User-provided, verified and failed" },
2004 { 0x03, "Network-provided" },
2008 static const value_string q931_redirection_reason_vals[] = {
2009 { 0x00, "Unknown" },
2010 { 0x01, "Call forwarding busy or called DTE busy" },
2011 { 0x02, "Call forwarding no reply" },
2012 { 0x04, "Call deflection" },
2013 { 0x09, "Called DTE out of order" },
2014 { 0x0A, "Call forwarding by the called DTE" },
2015 { 0x0F, "Call forwarding unconditional or systematic call redirection" },
2020 dissect_q931_number_ie(tvbuff_t *tvb, int offset, int len,
2021 proto_tree *tree, int hfindex)
2027 octet = tvb_get_guint8(tvb, offset);
2028 proto_tree_add_text(tree, tvb, offset, 1,
2029 "Type of number: %s",
2030 val_to_str(octet & 0x70, q931_number_type_vals,
2031 "Unknown (0x%02X)"));
2032 proto_tree_add_text(tree, tvb, offset, 1,
2033 "Numbering plan: %s",
2034 val_to_str(octet & 0x0F, q931_numbering_plan_vals,
2035 "Unknown (0x%02X)"));
2039 if (!(octet & Q931_IE_VL_EXTENSION)) {
2042 octet = tvb_get_guint8(tvb, offset);
2043 proto_tree_add_text(tree, tvb, offset, 1,
2044 "Presentation indicator: %s",
2045 val_to_str(octet & 0x60, q931_presentation_indicator_vals,
2047 proto_tree_add_text(tree, tvb, offset, 1,
2048 "Screening indicator: %s",
2049 val_to_str(octet & 0x03, q931_screening_indicator_vals,
2056 * XXX - only in a Redirecting number information element.
2058 if (!(octet & Q931_IE_VL_EXTENSION)) {
2061 octet = tvb_get_guint8(tvb, offset);
2062 proto_tree_add_text(tree, tvb, offset, 1,
2063 "Reason for redirection: %s",
2064 val_to_str(octet & 0x0F, q931_redirection_reason_vals,
2072 proto_tree_add_item(tree, hfindex, tvb, offset, len, FALSE);
2076 * Dissect a party subaddress information element.
2078 static const value_string q931_subaddress_type_vals[] = {
2079 { 0x00, "X.213/ISO 8348 Add.2 NSAP" },
2080 { 0x20, "User-specified" },
2084 static const value_string q931_odd_even_indicator_vals[] = {
2085 { 0x00, "Even number of address signals" },
2086 { 0x10, "Odd number of address signals" },
2091 dissect_q931_party_subaddr_ie(tvbuff_t *tvb, int offset, int len,
2098 octet = tvb_get_guint8(tvb, offset);
2099 proto_tree_add_text(tree, tvb, offset, 1,
2100 "Type of subaddress: %s",
2101 val_to_str(octet & 0x70, q931_subaddress_type_vals,
2102 "Unknown (0x%02X)"));
2103 proto_tree_add_text(tree, tvb, offset, 1,
2104 "Odd/even indicator: %s",
2105 val_to_str(octet & 0x10, q931_odd_even_indicator_vals,
2112 proto_tree_add_text(tree, tvb, offset, len, "Subaddress: %s",
2113 tvb_bytes_to_str(tvb, offset, len));
2117 * Dissect a Restart indicator information element.
2119 static const value_string q931_restart_indicator_class_vals[] = {
2120 { 0x00, "Indicated channels" },
2121 { 0x06, "Single interface" },
2122 { 0x07, "All interfaces" },
2127 dissect_q931_restart_indicator_ie(tvbuff_t *tvb, int offset, int len,
2131 proto_tree_add_text(tree, tvb, offset, len,
2132 "Restart indicator: length is %d, should be 1\n", len);
2135 proto_tree_add_text(tree, tvb, offset, 1,
2136 "Restart indicator: %s",
2137 val_to_str(tvb_get_guint8(tvb, offset) & 0x07,
2138 q931_restart_indicator_class_vals, "Unknown (0x%02X)"));
2142 * Dissect a High-layer compatibility information element.
2144 #define Q931_AUDIOVISUAL 0x60
2145 static const value_string q931_high_layer_characteristics_vals[] = {
2146 { 0x01, "Telephony" },
2147 { 0x04, "F.182 Facsimile Group 2/3" },
2148 { 0x21, "F.184 Facsimile Group 4 Class I" },
2149 { 0x24, "F.230 Teletex, basic and mixed mode, and F.184 Facsimile Group 4, Classes II and III" },
2150 { 0x28, "F.220 Teletex, basic and processable mode" },
2151 { 0x31, "F.200 Teletex, basic mode" },
2152 { 0x32, "F.300 and T.102 syntax-based Videotex" },
2153 { 0x33, "F.300 and T.101 international Videotex interworking" },
2154 { 0x35, "F.60 Telex" },
2155 { 0x38, "X.400 Message Handling Systems" },
2156 { 0x41, "X.200 OSI application" },
2157 { 0x42, "FTAM application" },
2158 { 0x5E, "Reserved for maintenance" },
2159 { 0x5F, "Reserved for management" },
2160 { Q931_AUDIOVISUAL, "F.720/F.821 and F.731 Profile 1a videotelephony" },
2161 { 0x61, "F.702 and F.731 Profile 1b videoconferencing" },
2162 { 0x62, "F.702 and F.731 audiographic conferencing" },
2166 static const value_string q931_audiovisual_characteristics_vals[] = {
2167 { 0x01, "Capability set of initial channel of H.221" },
2168 { 0x02, "Capability set of subsequent channel of H.221" },
2169 { 0x21, "Capability set of initial channel of an active 3.1kHz audio or speech call" },
2174 dissect_q931_high_layer_compat_ie(tvbuff_t *tvb, int offset, int len,
2178 guint8 coding_standard;
2179 guint8 characteristics;
2183 octet = tvb_get_guint8(tvb, offset);
2184 coding_standard = octet & 0x60;
2185 proto_tree_add_text(tree, tvb, offset, 1,
2186 "Coding standard: %s",
2187 val_to_str(coding_standard, q931_coding_standard_vals, NULL));
2190 if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
2192 * We don't know how the call state is encoded,
2193 * so just dump it as data and be done with it.
2195 proto_tree_add_text(tree, tvb, offset,
2197 tvb_bytes_to_str(tvb, offset, len));
2203 octet = tvb_get_guint8(tvb, offset);
2204 characteristics = octet & 0x7F;
2205 proto_tree_add_text(tree, tvb, offset, 1,
2206 "High layer characteristics identification: %s",
2207 val_to_str(characteristics, q931_high_layer_characteristics_vals,
2208 "Unknown (0x%02X)"));
2212 if (!(octet & Q931_IE_VL_EXTENSION)) {
2215 octet = tvb_get_guint8(tvb, offset);
2216 if (characteristics == Q931_AUDIOVISUAL) {
2217 proto_tree_add_text(tree, tvb, offset, 1,
2218 "Extended audiovisual characteristics identification: %s",
2219 val_to_str(octet & 0x7F,
2220 q931_audiovisual_characteristics_vals,
2221 "Unknown (0x%02X)"));
2223 proto_tree_add_text(tree, tvb, offset, 1,
2224 "Extended high layer characteristics identification: %s",
2225 val_to_str(octet & 0x7F,
2226 q931_high_layer_characteristics_vals,
2227 "Unknown (0x%02X)"));
2234 * Dissect a User-user information element.
2236 #define Q931_PROTOCOL_DISCRIMINATOR_IA5 0x04
2237 #define Q931_PROTOCOL_DISCRIMINATOR_ASN1 0x05
2239 static const value_string q931_protocol_discriminator_vals[] = {
2240 { 0x00, "User-specific protocol" },
2241 { 0x01, "OSI high layer protocols" },
2243 { Q931_PROTOCOL_DISCRIMINATOR_IA5, "IA5 characters" },
2244 { Q931_PROTOCOL_DISCRIMINATOR_ASN1, "X.208 and X.209 coded user information" },
2245 { 0x07, "V.120 rate adaption" },
2246 { 0x08, "Q.931/I.451 user-network call control messages" },
2251 dissect_q931_user_user_ie(tvbuff_t *tvb, int offset, int len,
2258 octet = tvb_get_guint8(tvb, offset);
2259 proto_tree_add_text(tree, tvb, offset, 1,
2260 "Protocol discriminator: %s",
2261 val_to_str(octet, q931_protocol_discriminator_vals,
2262 "Unknown (0x%02x)"));
2270 case Q931_PROTOCOL_DISCRIMINATOR_IA5:
2271 proto_tree_add_text(tree, tvb, offset, len, "User information: %s",
2272 tvb_format_text(tvb, offset, len));
2276 proto_tree_add_text(tree, tvb, offset, len, "User information: %s",
2277 tvb_bytes_to_str(tvb, offset, len));
2283 * Dissect information elements consisting of ASCII^H^H^H^H^HIA5 text.
2286 dissect_q931_ia5_ie(tvbuff_t *tvb, int offset, int len, proto_tree *tree,
2290 proto_tree_add_text(tree, tvb, offset, len, "%s: %s", label,
2291 tvb_format_text(tvb, offset, len));
2295 static const value_string q931_codeset_vals[] = {
2296 { 0x00, "Q.931 information elements" },
2297 { 0x04, "Information elements for ISO/IEC use" },
2298 { 0x05, "Information elements for national use" },
2299 { 0x06, "Information elements specific to the local network" },
2300 { 0x07, "User-specific information elements" },
2305 dissect_q931_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2309 proto_tree *q931_tree = NULL;
2311 proto_tree *ie_tree = NULL;
2312 guint8 call_ref_len;
2313 guint8 call_ref[15];
2314 guint8 message_type;
2315 guint8 info_element;
2316 guint16 info_element_len;
2317 int codeset, locked_codeset;
2318 gboolean non_locking_shift;
2319 tvbuff_t *h225_tvb, *next_tvb;
2321 if (check_col(pinfo->cinfo, COL_PROTOCOL))
2322 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Q.931");
2325 ti = proto_tree_add_item(tree, proto_q931, tvb, offset, -1,
2327 q931_tree = proto_item_add_subtree(ti, ett_q931);
2329 dissect_q931_protocol_discriminator(tvb, offset, q931_tree);
2332 call_ref_len = tvb_get_guint8(tvb, offset) & 0xF; /* XXX - do as a bit field? */
2333 if (q931_tree != NULL)
2334 proto_tree_add_uint(q931_tree, hf_q931_call_ref_len, tvb, offset, 1, call_ref_len);
2336 if (call_ref_len != 0) {
2337 tvb_memcpy(tvb, call_ref, offset, call_ref_len);
2338 if (q931_tree != NULL) {
2339 proto_tree_add_boolean(q931_tree, hf_q931_call_ref_flag,
2340 tvb, offset, 1, (call_ref[0] & 0x80) != 0);
2341 call_ref[0] &= 0x7F;
2342 proto_tree_add_bytes(q931_tree, hf_q931_call_ref,
2343 tvb, offset, call_ref_len, call_ref);
2345 offset += call_ref_len;
2347 message_type = tvb_get_guint8(tvb, offset);
2348 if (check_col(pinfo->cinfo, COL_INFO)) {
2349 col_add_str(pinfo->cinfo, COL_INFO,
2350 val_to_str(message_type, q931_message_type_vals,
2351 "Unknown message type (0x%02X)"));
2353 if (q931_tree != NULL)
2354 proto_tree_add_uint(q931_tree, hf_q931_message_type, tvb, offset, 1, message_type);
2358 * And now for the information elements....
2360 codeset = locked_codeset = 0; /* start out in codeset 0 */
2361 non_locking_shift = TRUE;
2362 while (tvb_reported_length_remaining(tvb, offset) > 0) {
2363 info_element = tvb_get_guint8(tvb, offset);
2365 /* Check for the codeset shift */
2366 if ((info_element & Q931_IE_SO_MASK) &&
2367 ((info_element & Q931_IE_SO_IDENTIFIER_MASK) == Q931_IE_SHIFT)) {
2368 non_locking_shift = info_element & Q931_IE_SHIFT_NON_LOCKING;
2369 codeset = info_element & Q931_IE_SHIFT_CODESET;
2370 if (!non_locking_shift)
2371 locked_codeset = codeset;
2372 if (q931_tree != NULL) {
2373 proto_tree_add_text(q931_tree, tvb, offset, 1,
2374 "%s shift to codeset %u: %s",
2375 (non_locking_shift ? "Non-locking" : "Locking"),
2377 val_to_str(codeset, q931_codeset_vals,
2378 "Unknown (0x%02X)"));
2385 * Check for the single-octet IEs.
2387 if (info_element & Q931_IE_SO_MASK) {
2389 * Check for subdissectors for this IE or
2390 * for all IEs in this codeset.
2392 if (dissector_get_port_handle(codeset_dissector_table, codeset) ||
2393 dissector_get_port_handle(ie_dissector_table, (codeset << 8) | (info_element & Q931_IE_SO_IDENTIFIER_MASK))) {
2394 next_tvb = tvb_new_subset (tvb, offset, 1, 1);
2395 if (dissector_try_port(ie_dissector_table, (codeset << 8) | (info_element & Q931_IE_SO_IDENTIFIER_MASK), next_tvb, pinfo, q931_tree) ||
2396 dissector_try_port(codeset_dissector_table, codeset, next_tvb, pinfo, q931_tree)) {
2398 codeset = locked_codeset;
2403 switch ((codeset << 8) | (info_element & Q931_IE_SO_IDENTIFIER_MASK)) {
2405 case CS0 | Q931_IE_MORE_DATA_OR_SEND_COMP:
2406 switch (info_element) {
2408 case Q931_IE_MORE_DATA:
2409 if (q931_tree != NULL) {
2410 proto_tree_add_text(q931_tree, tvb, offset, 1,
2415 case Q931_IE_SENDING_COMPLETE:
2416 if (q931_tree != NULL) {
2417 proto_tree_add_text(q931_tree, tvb, offset, 1,
2418 "Sending complete");
2423 if (q931_tree != NULL) {
2424 proto_tree_add_text(q931_tree, tvb, offset, 1,
2425 "Unknown information element (0x%02X)",
2432 case CS0 | Q931_IE_CONGESTION_LEVEL:
2433 if (q931_tree != NULL) {
2434 proto_tree_add_text(q931_tree, tvb, offset, 1,
2435 "Congestion level: %s",
2436 val_to_str(info_element & Q931_IE_SO_IE_MASK,
2437 q931_congestion_level_vals,
2442 case CS0 | Q931_IE_REPEAT_INDICATOR:
2443 if (q931_tree != NULL) {
2444 proto_tree_add_text(q931_tree, tvb, offset, 1,
2445 "Repeat indicator: %s",
2446 val_to_str(info_element & Q931_IE_SO_IE_MASK,
2447 q931_repeat_indication_vals,
2453 if (q931_tree != NULL) {
2454 proto_tree_add_text(q931_tree, tvb, offset, 1,
2455 "Unknown information element (0x%02X)",
2461 codeset = locked_codeset;
2466 * Variable-length IE.
2468 * According to page 18 from Recommendation H.225.0 :
2469 * " Length of user-user contents contents
2470 * - Shall be 2 octets instead of 1 (as in Figure 4-36/Q.931)"
2472 * We assume that if this is Q.931-over-TPKT, it might
2473 * be H.225 traffic, and check for the IE being a user-user
2474 * IE with ASN.1 encoding of the user information.
2476 if (is_tpkt && tvb_bytes_exist(tvb, offset, 4) &&
2477 codeset == 0 && tvb_get_guint8(tvb, offset) == Q931_IE_USER_USER &&
2478 tvb_get_guint8(tvb, offset + 3) == Q931_PROTOCOL_DISCRIMINATOR_ASN1) {
2479 info_element_len = tvb_get_ntohs(tvb, offset + 1);
2480 if (q931_tree != NULL) {
2481 ti = proto_tree_add_text(q931_tree, tvb, offset,
2482 1+2+info_element_len, "%s",
2483 val_to_str(info_element,
2484 q931_info_element_vals[codeset],
2485 "Unknown information element (0x%02X)"));
2486 ie_tree = proto_item_add_subtree(ti,
2488 proto_tree_add_text(ie_tree, tvb, offset, 1,
2489 "Information element: %s",
2490 val_to_str(info_element,
2491 q931_info_element_vals[codeset], "Unknown (0x%02X)"));
2492 proto_tree_add_text(ie_tree, tvb, offset + 1,
2493 2, "Length: %u", info_element_len);
2494 proto_tree_add_text(ie_tree, tvb, offset + 3,
2495 1, "Protocol discriminator: %s",
2496 val_to_str(tvb_get_guint8(tvb, offset + 3),
2497 q931_protocol_discriminator_vals,
2498 "Unknown (0x%02x)"));
2501 if (info_element_len > 1) {
2503 * Do we have a handle for the H.225
2506 if (h225_handle != NULL) {
2508 * Yes - call it, regardless of
2509 * whether we're building a
2510 * protocol tree or not.
2512 h225_tvb = tvb_new_subset(tvb,
2513 offset + 4, info_element_len - 1,
2514 info_element_len - 1);
2515 call_dissector(h225_handle, h225_tvb,
2519 * No - just show it as "User
2520 * information" (if "ie_tree" is
2521 * null, this won't add anything).
2523 proto_tree_add_text(ie_tree, tvb,
2524 offset + 4, info_element_len - 1,
2525 "User information: %s",
2526 tvb_bytes_to_str(tvb, offset + 4,
2527 info_element_len - 1));
2530 offset += 1 + 2 + info_element_len;
2532 info_element_len = tvb_get_guint8(tvb, offset + 1);
2535 * Check for subdissectors for this IE or
2536 * for all IEs in this codeset.
2538 if (dissector_get_port_handle(codeset_dissector_table, codeset) ||
2539 dissector_get_port_handle(ie_dissector_table, (codeset << 8) | info_element)) {
2540 next_tvb = tvb_new_subset (tvb, offset, info_element_len + 2, info_element_len + 2);
2541 if (dissector_try_port(ie_dissector_table, (codeset << 8) | info_element, next_tvb, pinfo, q931_tree) ||
2542 dissector_try_port(codeset_dissector_table, codeset, next_tvb, pinfo, q931_tree)) {
2543 offset += 2 + info_element_len;
2544 codeset = locked_codeset;
2549 if (q931_tree != NULL) {
2550 ti = proto_tree_add_text(q931_tree, tvb, offset,
2551 1+1+info_element_len, "%s",
2552 val_to_str(info_element, q931_info_element_vals[codeset],
2553 "Unknown information element (0x%02X)"));
2554 ie_tree = proto_item_add_subtree(ti, ett_q931_ie);
2555 proto_tree_add_text(ie_tree, tvb, offset, 1,
2556 "Information element: %s",
2557 val_to_str(info_element, q931_info_element_vals[codeset],
2558 "Unknown (0x%02X)"));
2559 proto_tree_add_text(ie_tree, tvb, offset + 1, 1,
2560 "Length: %u", info_element_len);
2562 switch ((codeset << 8) | info_element) {
2564 case CS0 | Q931_IE_SEGMENTED_MESSAGE:
2565 dissect_q931_segmented_message_ie(tvb,
2566 offset + 2, info_element_len,
2570 case CS0 | Q931_IE_BEARER_CAPABILITY:
2571 case CS0 | Q931_IE_LOW_LAYER_COMPAT:
2572 dissect_q931_bearer_capability_ie(tvb,
2573 offset + 2, info_element_len,
2577 case CS0 | Q931_IE_CAUSE:
2578 dissect_q931_cause_ie(tvb,
2579 offset + 2, info_element_len,
2581 hf_q931_cause_value);
2584 case CS0 | Q931_IE_CALL_STATE:
2585 dissect_q931_call_state_ie(tvb,
2586 offset + 2, info_element_len,
2590 case CS0 | Q931_IE_CHANNEL_IDENTIFICATION:
2591 dissect_q931_channel_identification_ie(
2592 tvb, offset + 2, info_element_len,
2596 case CS0 | Q931_IE_PROGRESS_INDICATOR:
2597 dissect_q931_progress_indicator_ie(tvb,
2598 offset + 2, info_element_len,
2602 case CS0 | Q931_IE_NETWORK_SPECIFIC_FACIL:
2603 case CS0 | Q931_IE_TRANSIT_NETWORK_SEL:
2604 dissect_q931_ns_facilities_ie(tvb,
2605 offset + 2, info_element_len,
2609 case CS0 | Q931_IE_NOTIFICATION_INDICATOR:
2610 dissect_q931_notification_indicator_ie(
2611 tvb, offset + 2, info_element_len,
2615 case CS0 | Q931_IE_DISPLAY:
2616 dissect_q931_ia5_ie(tvb, offset + 2,
2617 info_element_len, ie_tree,
2618 "Display information");
2621 case CS0 | Q931_IE_DATE_TIME:
2622 dissect_q931_date_time_ie(tvb,
2623 offset + 2, info_element_len,
2627 case CS0 | Q931_IE_KEYPAD_FACILITY:
2628 dissect_q931_ia5_ie(tvb, offset + 2,
2629 info_element_len, ie_tree,
2633 case CS0 | Q931_IE_SIGNAL:
2634 dissect_q931_signal_ie(tvb,
2635 offset + 2, info_element_len,
2639 case CS0 | Q931_IE_INFORMATION_RATE:
2640 dissect_q931_information_rate_ie(tvb,
2641 offset + 2, info_element_len,
2645 case CS0 | Q931_IE_E2E_TRANSIT_DELAY:
2646 dissect_q931_e2e_transit_delay_ie(tvb,
2647 offset + 2, info_element_len,
2651 case CS0 | Q931_IE_TD_SELECTION_AND_INT:
2652 dissect_q931_td_selection_and_int_ie(
2653 tvb, offset + 2, info_element_len,
2657 case CS0 | Q931_IE_PL_BINARY_PARAMETERS:
2658 dissect_q931_pl_binary_parameters_ie(
2659 tvb, offset + 2, info_element_len,
2663 case CS0 | Q931_IE_PL_WINDOW_SIZE:
2664 dissect_q931_pl_window_size_ie(tvb,
2665 offset + 2, info_element_len,
2669 case CS0 | Q931_IE_PACKET_SIZE:
2670 dissect_q931_packet_size_ie(tvb,
2671 offset + 2, info_element_len,
2675 case CS0 | Q931_IE_CUG:
2676 dissect_q931_cug_ie(tvb,
2677 offset + 2, info_element_len,
2681 case CS0 | Q931_IE_REVERSE_CHARGE_IND:
2682 dissect_q931_reverse_charge_ind_ie(tvb,
2683 offset + 2, info_element_len,
2687 case CS0 | Q931_IE_CALLING_PARTY_NUMBER:
2688 dissect_q931_number_ie(tvb,
2689 offset + 2, info_element_len,
2691 hf_q931_calling_party_number);
2694 case CS0 | Q931_IE_CONNECTED_NUMBER_DEFAULT:
2695 dissect_q931_number_ie(tvb,
2696 offset + 2, info_element_len,
2698 hf_q931_connected_number);
2701 case CS0 | Q931_IE_CALLED_PARTY_NUMBER:
2702 dissect_q931_number_ie(tvb,
2703 offset + 2, info_element_len,
2705 hf_q931_called_party_number);
2708 case CS0 | Q931_IE_REDIRECTING_NUMBER:
2709 dissect_q931_number_ie(tvb,
2710 offset + 2, info_element_len,
2712 hf_q931_redirecting_number);
2715 case CS0 | Q931_IE_CALLING_PARTY_SUBADDR:
2716 case CS0 | Q931_IE_CALLED_PARTY_SUBADDR:
2717 dissect_q931_party_subaddr_ie(tvb,
2718 offset + 2, info_element_len,
2722 case CS0 | Q931_IE_RESTART_INDICATOR:
2723 dissect_q931_restart_indicator_ie(tvb,
2724 offset + 2, info_element_len,
2728 case CS0 | Q931_IE_HIGH_LAYER_COMPAT:
2729 dissect_q931_high_layer_compat_ie(tvb,
2730 offset + 2, info_element_len,
2734 case CS0 | Q931_IE_USER_USER:
2735 dissect_q931_user_user_ie(tvb,
2736 offset + 2, info_element_len,
2741 proto_tree_add_text(ie_tree, tvb,
2742 offset + 2, info_element_len,
2745 tvb_get_ptr(tvb, offset + 2,
2751 offset += 1 + 1 + info_element_len;
2753 codeset = locked_codeset;
2758 * Q.931-over-TPKT-over-TCP.
2761 dissect_q931_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2766 * Check whether this looks like a TPKT-encapsulated
2769 * The minimum length of a Q.931 message is 3:
2770 * 1 byte for the protocol discriminator,
2771 * 1 for the call_reference length,
2772 * and one for the message type.
2774 lv_tpkt_len = is_tpkt(tvb, 3);
2775 if (lv_tpkt_len == -1) {
2777 * It's not a TPKT packet; reject it.
2783 * If this segment is *exactly* the length of a TPKT header,
2784 * we assume that, as it looks like a TPKT header, it
2785 * is one, and that the code put a TPKT header in one
2786 * segment and the rest of the PDU in another.
2788 if (tvb_length(tvb) == 4) {
2790 * It is - call the "dissect TPKT over a TCP stream"
2793 dissect_tpkt_encap(tvb, pinfo, tree, q931_desegment,
2794 q931_tpkt_pdu_handle);
2799 * Well, we have more data than just the TPKT header;
2800 * check whether it looks like the beginning of a
2803 * The minimum length of a Q.931 message is 3, as per the
2806 * Check that we have that many bytes past the TPKT header in
2807 * the tvbuff; we already know that the TPKT header says we
2808 * have that many bytes (as we passed 3 as the "min_len" argument
2811 if (!tvb_bytes_exist(tvb, 4, 3))
2814 /* Check the protocol discriminator */
2815 if (tvb_get_guint8(tvb, 4) != NLPID_Q_931) {
2816 /* Doesn't look like Q.931 inside TPKT */
2821 * OK, it looks like Q.931-over-TPKT.
2822 * Call the "dissect TPKT over a TCP stream" routine.
2824 dissect_tpkt_encap(tvb, pinfo, tree, q931_desegment,
2825 q931_tpkt_pdu_handle);
2831 dissect_q931_tpkt_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2833 dissect_q931_pdu(tvb, pinfo, tree, TRUE);
2837 dissect_q931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2839 dissect_q931_pdu(tvb, pinfo, tree, FALSE);
2843 proto_register_q931(void)
2845 static hf_register_info hf[] = {
2846 { &hf_q931_discriminator,
2847 { "Protocol discriminator", "q931.disc", FT_UINT8, BASE_HEX, NULL, 0x0,
2850 { &hf_q931_call_ref_len,
2851 { "Call reference value length", "q931.call_ref_len", FT_UINT8, BASE_DEC, NULL, 0x0,
2854 { &hf_q931_call_ref_flag,
2855 { "Call reference flag", "q931.call_ref_flag", FT_BOOLEAN, BASE_NONE, TFS(&tfs_call_ref_flag), 0x0,
2858 { &hf_q931_call_ref,
2859 { "Call reference value", "q931.call_ref", FT_BYTES, BASE_HEX, NULL, 0x0,
2862 { &hf_q931_message_type,
2863 { "Message type", "q931.message_type", FT_UINT8, BASE_HEX, VALS(q931_message_type_vals), 0x0,
2866 { &hf_q931_cause_value,
2867 { "Cause value", "q931.cause_value", FT_UINT8, BASE_DEC, VALS(q931_cause_code_vals), 0x0,
2870 { &hf_q931_calling_party_number,
2871 { "Calling party number digits", "q931.calling_party_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2874 { &hf_q931_called_party_number,
2875 { "Called party number digits", "q931.called_party_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2878 { &hf_q931_connected_number,
2879 { "Connected party number digits", "q931.connected_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2882 { &hf_q931_redirecting_number,
2883 { "Redirecting party number digits", "q931.redirecting_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2886 static gint *ett[] = {
2890 module_t *q931_module;
2892 proto_q931 = proto_register_protocol("Q.931", "Q.931", "q931");
2893 proto_register_field_array (proto_q931, hf, array_length(hf));
2894 proto_register_subtree_array(ett, array_length(ett));
2896 register_dissector("q931", dissect_q931, proto_q931);
2897 q931_tpkt_pdu_handle = create_dissector_handle(dissect_q931_tpkt_pdu,
2900 /* subdissector code */
2901 codeset_dissector_table = register_dissector_table("q931.codeset", "Q.931 Codeset", FT_UINT8, BASE_HEX);
2902 ie_dissector_table = register_dissector_table("q931.ie", "Q.931 IE", FT_UINT16, BASE_HEX);
2904 q931_module = prefs_register_protocol(proto_q931, NULL);
2905 prefs_register_bool_preference(q931_module, "desegment_h323_messages",
2906 "Desegment all Q.931 messages spanning multiple TCP segments",
2907 "Whether the Q.931 dissector should desegment all messages spanning multiple TCP segments",
2912 proto_reg_handoff_q931(void)
2915 * Attempt to get a handle for the H.225 dissector.
2916 * If we can't, the handle we get is null, and we'll just
2917 * dissect putatively-H.255 Call Signaling stuff as User
2920 h225_handle = find_dissector("h225");
2925 heur_dissector_add("tcp", dissect_q931_tpkt, proto_q931);