2 * Routines for Q.933 frame disassembly
3 * Guy Harris <guy@alum.mit.edu>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include <epan/packet.h>
32 #include <epan/strutil.h>
33 #include <epan/nlpid.h>
35 static int proto_q933 = -1;
36 static int hf_q933_discriminator = -1;
37 static int hf_q933_coding_standard = -1;
38 static int hf_q933_information_transfer_capability = -1;
39 static int hf_q933_transfer_mode = -1;
40 static int hf_q933_uil1 = -1;
41 static int hf_q933_call_ref_len = -1;
42 static int hf_q933_call_ref_flag = -1;
43 static int hf_q933_call_ref = -1;
44 static int hf_q933_message_type = -1;
45 static int hf_q933_cause_location = -1;
46 static int hf_q933_cause_value = -1;
47 static int hf_q933_number_type = -1;
48 static int hf_q933_numbering_plan = -1;
49 static int hf_q933_extension_ind = -1;
50 static int hf_q933_calling_party_number = -1;
51 static int hf_q933_called_party_number = -1;
52 static int hf_q933_connected_number = -1;
53 static int hf_q933_redirecting_number = -1;
54 static int hf_q933_screening_ind = -1;
55 static int hf_q933_presentation_ind = -1;
56 static int hf_q933_report_type = -1;
57 static int hf_q933_link_verf_txseq = -1;
58 static int hf_q933_link_verf_rxseq = -1;
60 static gint ett_q933 = -1;
61 static gint ett_q933_ie = -1;
64 * Q.933 message types.
66 #define Q933_ESCAPE 0x00
67 #define Q933_ALERTING 0x01
68 #define Q933_CALL_PROCEEDING 0x02
69 #define Q933_CONNECT 0x07
70 #define Q933_CONNECT_ACK 0x0F
71 #define Q933_PROGRESS 0x03
72 #define Q933_SETUP 0x05
73 #define Q933_DISCONNECT 0x45
74 #define Q933_RELEASE 0x4D
75 #define Q933_RELEASE_COMPLETE 0x5A
76 #define Q933_SEGMENT 0x60
77 #define Q933_STATUS 0x7D
78 #define Q933_STATUS_ENQUIRY 0x75
80 static const value_string q933_message_type_vals[] = {
81 { Q933_ESCAPE, "ESCAPE" },
82 { Q933_ALERTING, "ALERTING" },
83 { Q933_CALL_PROCEEDING, "CALL PROCEEDING" },
84 { Q933_CONNECT, "CONNECT" },
85 { Q933_CONNECT_ACK, "CONNECT ACKNOWLEDGE" },
86 { Q933_PROGRESS, "PROGRESS" },
87 { Q933_SETUP, "SETUP" },
88 { Q933_DISCONNECT, "DISCONNECT" },
89 { Q933_RELEASE, "RELEASE" },
90 { Q933_RELEASE_COMPLETE, "RELEASE COMPLETE" },
91 { Q933_SEGMENT, "SEGMENT" },
92 { Q933_STATUS, "STATUS" },
93 { Q933_STATUS_ENQUIRY, "STATUS ENQUIRY" },
97 static const true_false_string tfs_call_ref_flag = {
98 "Message sent to originating side",
99 "Message sent from originating side"
103 * Information elements.
106 /* Shifted codeset values */
116 #define Q933_IE_SO_MASK 0x80 /* single-octet/variable-length mask */
120 #define Q933_IE_SO_IDENTIFIER_MASK 0xf0 /* IE identifier mask */
121 #define Q933_IE_SO_IDENTIFIER_SHIFT 4 /* IE identifier shift */
122 #define Q933_IE_SO_IE_MASK 0x0F /* IE mask */
124 #define Q933_IE_SHIFT 0x90
125 #define Q933_IE_SHIFT_NON_LOCKING 0x08 /* non-locking shift */
126 #define Q933_IE_SHIFT_CODESET 0x07 /* codeset */
128 #define Q933_IE_REPEAT_INDICATOR 0xD0
131 * Variable-length IEs.
133 #define Q933_IE_VL_EXTENSION 0x80 /* Extension flag */
134 /* extension bit. The bit value "0" indicates that the octet continues through the */
135 /* next octet. The bit value "1" indicates that this octet is the last octet */
137 static const true_false_string q933_extension_ind_value = {
139 "information continues through the next octet",
145 * Codeset 0 (default).
147 #define Q933_IE_SEGMENTED_MESSAGE 0x00
148 #define Q933_IE_BEARER_CAPABILITY 0x04
149 #define Q933_IE_CAUSE 0x08
150 #define Q933_IE_CALL_STATE 0x14
151 #define Q933_IE_CHANNEL_IDENTIFICATION 0x18
152 #define Q933_IE_DLCI 0x19
153 #define Q933_IE_PROGRESS_INDICATOR 0x1E
154 #define Q933_IE_NETWORK_SPECIFIC_FACIL 0x20 /* Network Specific Facilities */
155 #define Q933_IE_DISPLAY 0x28
156 #define Q933_IE_E2E_TRANSIT_DELAY 0x42 /* End-to-end Transit Delay */
157 #define Q933_IE_TD_SELECTION_AND_INT 0x43 /* Transit Delay Selection and Indication */
158 #define Q933_IE_PL_BINARY_PARAMETERS 0x44 /* Packet layer binary parameters */
159 #define Q933_IE_LL_CORE_PARAMETERS 0x48 /* Link layer core parameters */
160 #define Q933_IE_LL_PROTOCOL_PARAMETERS 0x49 /* Link layer protocol parameters */
161 #define Q933_IE_REVERSE_CHARGE_IND 0x4A /* Reverse charging indication */
162 #define Q933_IE_CONNECTED_NUMBER 0x4C /* Connected Number */
163 #define Q933_IE_CONNECTED_SUBADDR 0x4D /* Connected sub-address */
164 #define Q933_IE_X_213_PRIORITY 0x50 /* X.213 priority */
165 #define Q933_IE_REPORT_TYPE 0x51
166 #define Q933_IE_LINK_INTEGRITY_VERF 0x53 /* Link integrity verification */
167 #define Q933_IE_PVC_STATUS 0x57
168 #define Q933_IE_CALLING_PARTY_NUMBER 0x6C /* Calling Party Number */
169 #define Q933_IE_CALLING_PARTY_SUBADDR 0x6D /* Calling Party Subaddress */
170 #define Q933_IE_CALLED_PARTY_NUMBER 0x70 /* Called Party Number */
171 #define Q933_IE_CALLED_PARTY_SUBADDR 0x71 /* Called Party Subaddress */
172 #define Q933_IE_TRANSIT_NETWORK_SEL 0x78 /* Transit Network Selection */
173 #define Q933_IE_LOW_LAYER_COMPAT 0x7C /* Low-Layer Compatibility */
174 #define Q933_IE_HIGH_LAYER_COMPAT 0x7D /* High-Layer Compatibility */
175 #define Q933_IE_USER_USER 0x7E /* User-User */
176 #define Q933_IE_ESCAPE 0x7F /* Escape for extension */
179 static const value_string q933_info_element_vals0[] = {
180 { Q933_IE_SEGMENTED_MESSAGE, "Segmented message" },
181 { Q933_IE_BEARER_CAPABILITY, "Bearer capability" },
182 { Q933_IE_CAUSE, "Cause" },
183 { Q933_IE_CALL_STATE, "Call state" },
184 { Q933_IE_CHANNEL_IDENTIFICATION, "Channel identification" },
185 { Q933_IE_DLCI, "Data link connection identifier" },
186 { Q933_IE_PROGRESS_INDICATOR, "Progress indicator" },
187 { Q933_IE_NETWORK_SPECIFIC_FACIL, "Network specific facilities" },
188 { Q933_IE_E2E_TRANSIT_DELAY, "End-to-end transit delay" },
189 { Q933_IE_TD_SELECTION_AND_INT, "Transit delay selection and indication" },
190 { Q933_IE_PL_BINARY_PARAMETERS, "Packet layer binary parameters" },
191 { Q933_IE_LL_CORE_PARAMETERS, "Link layer core parameters" },
192 { Q933_IE_LL_PROTOCOL_PARAMETERS, "Link layer protocol parameters" },
193 { Q933_IE_REVERSE_CHARGE_IND, "Reverse charging indication" },
194 { Q933_IE_CONNECTED_NUMBER, "Connected number" },
195 { Q933_IE_CONNECTED_SUBADDR, "Connected subaddress" },
196 { Q933_IE_X_213_PRIORITY, "X.213 priority" },
197 { Q933_IE_REPORT_TYPE, "Report type" },
198 { Q933_IE_LINK_INTEGRITY_VERF, "Link integrity verification" },
199 { Q933_IE_PVC_STATUS, "PVC status" },
200 { Q933_IE_CALLING_PARTY_NUMBER, "Calling party number" },
201 { Q933_IE_CALLING_PARTY_SUBADDR, "Calling party subaddress" },
202 { Q933_IE_CALLED_PARTY_NUMBER, "Called party number" },
203 { Q933_IE_CALLED_PARTY_SUBADDR, "Called party subaddress" },
204 { Q933_IE_TRANSIT_NETWORK_SEL, "Transit network selection" },
205 { Q933_IE_LOW_LAYER_COMPAT, "Low-layer compatibility" },
206 { Q933_IE_HIGH_LAYER_COMPAT, "High-layer compatibility" },
207 { Q933_IE_USER_USER, "User-user" },
208 { Q933_IE_ESCAPE, "Escape" },
212 static const value_string q933_info_element_vals1[] = {
216 static const value_string q933_info_element_vals2[] = {
220 static const value_string q933_info_element_vals3[] = {
224 static const value_string q933_info_element_vals4[] = {
229 #define Q933_IE_ANSI_REPORT_TYPE 0x01
230 #define Q933_IE_ANSI_LINK_INTEGRITY_VERF 0x03
231 #define Q933_IE_ANSI_PVC_STATUS 0x07
234 static const value_string q933_info_element_vals5[] = {
235 { Q933_IE_ANSI_REPORT_TYPE, "Report type (ANSI)" },
236 { Q933_IE_REPORT_TYPE, "Report type (CCITT)" },
237 { Q933_IE_ANSI_LINK_INTEGRITY_VERF, "Keep Alive (ANSI)" },
238 { Q933_IE_LINK_INTEGRITY_VERF, "Keep Alive (CCITT)" },
239 { Q933_IE_ANSI_PVC_STATUS, "PVC Status (ANSI)" },
240 { Q933_IE_PVC_STATUS, "PVC Status (CCITT)" },
244 static const value_string q933_info_element_vals6[] = {
248 static const value_string q933_info_element_vals7[] = {
253 #define NUM_INFO_ELEMENT_VALS (Q933_IE_SHIFT_CODESET+1)
254 static const value_string *q933_info_element_vals[NUM_INFO_ELEMENT_VALS] = {
255 q933_info_element_vals0,
256 q933_info_element_vals1,
257 q933_info_element_vals2,
258 q933_info_element_vals3,
259 q933_info_element_vals4,
260 q933_info_element_vals5,
261 q933_info_element_vals6,
262 q933_info_element_vals7,
265 static const value_string q933_repeat_indication_vals[] = {
266 { 0x2, "Prioritized list" },
271 * ITU-standardized coding.
273 #define Q933_ITU_STANDARDIZED_CODING 0x00
276 * Dissect a Segmented message information element.
279 dissect_q933_segmented_message_ie(tvbuff_t *tvb, int offset, int len,
283 proto_tree_add_text(tree, tvb, offset, len,
284 "Segmented message: length is %d, should be 2", len);
287 if (tvb_get_guint8(tvb, offset) & 0x80) {
288 proto_tree_add_text(tree, tvb, offset, 1,
289 "First segment: %u segments remaining",
290 tvb_get_guint8(tvb, offset) & 0x7F);
292 proto_tree_add_text(tree, tvb, offset, 1,
293 "Not first segment: %u segments remaining",
294 tvb_get_guint8(tvb, offset) & 0x7F);
296 proto_tree_add_text(tree, tvb, offset + 1, 1,
297 "Segmented message type: %u", tvb_get_guint8(tvb, offset + 1));
301 * Dissect a Bearer capability or Low-layer compatibility information element.
303 static const value_string q933_coding_standard_vals[] = {
304 { 0x0, "ITU-T standardized coding" },
305 { 0x1, "ISO/IEC standard" },
306 { 0x2, "National standard" },
307 { 0x3, "Standard defined for this particular network" },
311 static const value_string q933_information_transfer_capability_vals[] = {
312 { 0x08, "Unrestricted digital information" },
316 static const value_string q933_transfer_mode_vals[] = {
317 { 0x01, "Frame mode" },
321 static const value_string q933_uil1_vals[] = {
322 { 0x01, "V.110/I.460/X.30 rate adaption" },
323 { 0x02, "Recommendation G.711 u-law" },
324 { 0x03, "Recommendation G.711 A-law" },
325 { 0x04, "Recommendation G.721 32 kbit/s ADPCM and Recommendation I.460" },
326 { 0x05, "Recommendation H.221 and H.242" },
327 { 0x06, "Recommendation H.223 and H.245" },
328 { 0x07, "Non-ITU-T-standardized rate adaption" },
329 { 0x08, "V.120 rate adaption" },
330 { 0x09, "X.31 HDLC flag stuffing" },
334 static const value_string q933_l1_user_rate_vals[] = {
335 { 0x00, "Rate indicated by E-bits" },
336 { 0x01, "0.6 kbit/s" },
337 { 0x02, "1.2 kbit/s" },
338 { 0x03, "2.4 kbit/s" },
339 { 0x04, "3.6 kbit/s" },
340 { 0x05, "4.8 kbit/s" },
341 { 0x06, "7.2 kbit/s" },
342 { 0x07, "8 kbit/s" },
343 { 0x08, "9.6 kbit/s" },
344 { 0x09, "14.4 kbit/s" },
345 { 0x0A, "16 kbit/s" },
346 { 0x0B, "19.2 kbit/s" },
347 { 0x0C, "32 kbit/s" },
348 { 0x0E, "48 kbit/s" },
349 { 0x0F, "56 kbit/s" },
350 { 0x10, "64 kbit/s "},
351 { 0x15, "0.1345 kbit/s" },
352 { 0x16, "0.100 kbit/s" },
353 { 0x17, "0.075/1.2 kbit/s" },
354 { 0x18, "1.2/0.075 kbit/s" },
355 { 0x19, "0.050 kbit/s" },
356 { 0x1A, "0.075 kbit/s" },
357 { 0x1B, "0.110 kbit/s" },
358 { 0x1C, "0.150 kbit/s" },
359 { 0x1D, "0.200 kbit/s" },
360 { 0x1E, "0.300 kbit/s" },
361 { 0x1F, "12 kbit/s" },
365 static const value_string q933_l1_stop_bits_vals[] = {
372 static const value_string q933_l1_data_bits_vals[] = {
379 static const value_string q933_l1_parity_vals[] = {
383 { 0x04, "Forced to 0" },
384 { 0x05, "Forced to 1" },
388 #define Q933_UIL2_USER_SPEC 0x10
390 static const value_string q933_uil2_vals[] = {
391 { 0x01, "Basic mode ISO 1745" },
392 { 0x06, "X.25, link level" },
393 { 0x07, "X.25 multilink" },
394 { 0x08, "T.71 Extended LAPB" },
395 { 0x09, "HDLC ARM" },
396 { 0x0A, "HDLC NRM" },
397 { 0x0B, "HDLC ABM" },
398 { 0x0C, "ISO 8802/2 LLC" },
399 { 0x0D, "X.75 Single Link Procedure" },
401 { 0x0F, "Core aspects of Q.922" },
402 { Q933_UIL2_USER_SPEC, "User-specified" },
403 { 0x11, "ISO 7776 DTE-DTE operation" },
407 static const value_string q933_address_inclusion_vals[] = {
408 { 0x01, "Address included" },
409 { 0x02, "Encapsulation of logical control frame" },
413 static const value_string q933_mode_vals[] = {
414 { 0x20, "Normal mode" },
415 { 0x40, "Extended mode" },
419 #define Q933_UIL3_X25_PL 0x06
420 #define Q933_UIL3_ISO_8208 0x07 /* X.25-based */
421 #define Q933_UIL3_X223 0x08 /* X.25-based */
422 #define Q933_UIL3_TR_9577 0x0B
423 #define Q933_UIL3_USER_SPEC 0x10
425 static const value_string q933_uil3_vals[] = {
426 { Q933_UIL3_X25_PL, "X.25, packet layer" },
427 { Q933_UIL3_ISO_8208, "ISO/IEC 8208" },
428 { Q933_UIL3_X223, "X.223/ISO 8878" },
429 { 0x09, "ISO/IEC 8473" },
431 { Q933_UIL3_TR_9577, "ISO/IEC TR 9577" },
432 { Q933_UIL3_USER_SPEC, "User-specified" },
437 dissect_q933_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree)
439 unsigned int discriminator = tvb_get_guint8(tvb, offset);
441 if (discriminator == NLPID_Q_933) {
442 proto_tree_add_uint_format(tree, hf_q933_discriminator,
443 tvb, offset, 1, discriminator,
444 "Protocol discriminator: Q.933");
445 } else if (discriminator == NLPID_Q_2931) {
446 proto_tree_add_uint_format(tree, hf_q933_discriminator,
447 tvb, offset, 1, discriminator,
448 "Protocol discriminator: Q.2931");
449 } else if ((discriminator >= 16 && discriminator < 63)
450 || ((discriminator >= 80) && (discriminator < 254))) {
451 proto_tree_add_uint_format(tree, hf_q933_discriminator,
452 tvb, offset, 1, discriminator,
453 "Protocol discriminator: Network layer or layer 3 protocol (0x%02X)",
455 } else if (discriminator >= 64 && discriminator <= 79) {
456 proto_tree_add_uint_format(tree, hf_q933_discriminator,
457 tvb, offset, 1, discriminator,
458 "Protocol discriminator: National use (0x%02X)",
461 proto_tree_add_uint_format(tree, hf_q933_discriminator,
462 tvb, offset, 1, discriminator,
463 "Protocol discriminator: Reserved (0x%02X)",
469 dissect_q933_bearer_capability_ie(tvbuff_t *tvb, int offset, int len,
473 guint8 coding_standard;
475 guint8 uil2_protocol;
476 guint8 uil3_protocol;
481 octet = tvb_get_guint8(tvb, offset);
482 coding_standard = octet & 0x60;
483 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
485 * We don't know how the bearer capability is encoded,
486 * so just dump it as data and be done with it.
488 proto_tree_add_text(tree, tvb, offset,
490 tvb_bytes_to_str(tvb, offset, len));
491 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
492 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
495 proto_tree_add_uint(tree, hf_q933_information_transfer_capability, tvb, offset, 1, octet);
496 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
497 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
502 * XXX - only in Low-layer compatibility information element.
504 if (!(octet & Q933_IE_VL_EXTENSION)) {
507 octet = tvb_get_guint8(tvb, offset);
508 proto_tree_add_text(tree, tvb, offset, 1,
509 "Out-band negotiation %spossible",
510 (octet & 0x40) ? "" : "not ");
517 octet = tvb_get_guint8(tvb, offset);
518 proto_tree_add_uint(tree, hf_q933_transfer_mode, tvb, offset, 1, octet);
519 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
525 octet = tvb_get_guint8(tvb, offset);
526 if ((octet & 0x60) == 0x20) {
528 * Layer 1 information.
530 proto_tree_add_uint(tree, hf_q933_uil1, tvb, offset, 1, octet);
531 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
535 if (octet & Q933_IE_VL_EXTENSION)
539 octet = tvb_get_guint8(tvb, offset);
540 proto_tree_add_text(tree, tvb, offset, 1,
542 (octet & 0x40) ? "Asynchronous" : "Synchronous");
543 proto_tree_add_text(tree, tvb, offset, 1,
545 val_to_str(octet & 0x1F, q933_l1_user_rate_vals,
546 "Unknown (0x%02X)"));
550 if (octet & Q933_IE_VL_EXTENSION)
554 octet = tvb_get_guint8(tvb, offset);
555 proto_tree_add_text(tree, tvb, offset, 1,
556 "Rate adaption header %sincluded",
557 (octet & 0x40) ? "" : "not ");
558 proto_tree_add_text(tree, tvb, offset, 1,
559 "Multiple frame establishment %ssupported",
560 (octet & 0x20) ? "" : "not ");
561 proto_tree_add_text(tree, tvb, offset, 1,
562 "%s mode of operation",
563 (octet & 0x10) ? "Protocol sensitive" : "Bit transparent");
567 if (octet & Q933_IE_VL_EXTENSION)
571 octet = tvb_get_guint8(tvb, offset);
572 proto_tree_add_text(tree, tvb, offset, 1,
574 val_to_str(octet & 0x60, q933_l1_stop_bits_vals,
576 proto_tree_add_text(tree, tvb, offset, 1,
578 val_to_str(octet & 0x18, q933_l1_data_bits_vals,
580 proto_tree_add_text(tree, tvb, offset, 1,
582 val_to_str(octet & 0x07, q933_l1_parity_vals,
587 if (octet & Q933_IE_VL_EXTENSION)
591 octet = tvb_get_guint8(tvb, offset);
592 proto_tree_add_text(tree, tvb, offset, 1,
594 (octet & 0x40) ? "Full" : "Half");
595 modem_type = octet & 0x3F;
596 proto_tree_add_text(tree, tvb, offset, 1,
597 "Modem type: Network-specific rules 0x%02X", modem_type);
606 octet = tvb_get_guint8(tvb, offset);
607 if ((octet & 0x60) == 0x40) {
609 * Layer 2 information.
611 uil2_protocol = octet & 0x1F;
612 proto_tree_add_text(tree, tvb, offset, 1,
613 "User information layer 2 protocol: %s",
614 val_to_str(uil2_protocol, q933_uil2_vals,
615 "Unknown (0x%02X)"));
620 * XXX - only in Low-layer compatibility information element.
622 if (octet & Q933_IE_VL_EXTENSION)
626 octet = tvb_get_guint8(tvb, offset);
627 if (uil2_protocol == Q933_UIL2_USER_SPEC) {
628 proto_tree_add_text(tree, tvb, offset, 1,
629 "User-specified layer 2 protocol information: 0x%02X",
632 proto_tree_add_text(tree, tvb, offset, 1,
633 "Address inclusion: %s",
634 val_to_str(octet & 0x03, q933_address_inclusion_vals,
635 "Unknown (0x%02X)"));
645 octet = tvb_get_guint8(tvb, offset);
646 if ((octet & 0x60) == 0x60) {
648 * Layer 3 information.
650 uil3_protocol = octet & 0x1F;
651 proto_tree_add_text(tree, tvb, offset, 1,
652 "User information layer 3 protocol: %s",
653 val_to_str(uil3_protocol, q933_uil3_vals,
654 "Unknown (0x%02X)"));
660 * XXX - only in Low-layer compatibility information element.
662 if (octet & Q933_IE_VL_EXTENSION)
666 octet = tvb_get_guint8(tvb, offset);
667 switch (uil3_protocol) {
669 case Q933_UIL3_X25_PL:
670 case Q933_UIL3_ISO_8208:
672 proto_tree_add_text(tree, tvb, offset, 1,
674 val_to_str(octet & 0x60, q933_mode_vals,
675 "Unknown (0x%02X)"));
679 if (octet & Q933_IE_VL_EXTENSION)
683 octet = tvb_get_guint8(tvb, offset);
684 proto_tree_add_text(tree, tvb, offset, 1,
685 "Default packet size: %u", octet & 0x0F);
689 if (octet & Q933_IE_VL_EXTENSION)
693 octet = tvb_get_guint8(tvb, offset);
694 proto_tree_add_text(tree, tvb, offset, 1,
695 "Packet window size: %u", octet & 0x7F);
700 case Q933_UIL3_USER_SPEC:
701 proto_tree_add_text(tree, tvb, offset, 1,
702 "Default packet size: %u octets",
703 1 << (octet & 0x0F));
708 case Q933_UIL3_TR_9577:
709 add_l3_info = (octet & 0x0F) << 4;
710 if (octet & Q933_IE_VL_EXTENSION)
712 #if 0 /* XXX: len is always >0 at this point; is field always 2 bytes (if not Q933_IE_VL_EXTENSION) ? */
716 octet = tvb_get_guint8(tvb, offset + 1);
717 add_l3_info |= (octet & 0x0F);
718 proto_tree_add_text(tree, tvb, offset, 2,
719 "Additional layer 3 protocol information: %s",
720 val_to_str(add_l3_info, nlpid_vals,
721 "Unknown (0x%02X)"));
732 * Dissect a Cause information element.
736 const value_string q933_cause_location_vals[] = {
737 { 0x00, "User (U)" },
738 { 0x01, "Private network serving the local user (LPN)" },
739 { 0x02, "Public network serving the local user (LN)" },
740 { 0x03, "Transit network (TN)" },
741 { 0x04, "Public network serving the remote user (RLN)" },
742 { 0x05, "Private network serving the remote user (RPN)" },
743 { 0x07, "International network (INTL)" },
744 { 0x0A, "Network beyond interworking point (BI)" },
748 static const value_string q933_cause_recommendation_vals[] = {
752 { 0x05, "Q.1031/Q.1051" },
757 * Cause codes for Cause.
759 #define Q933_CAUSE_UNALLOC_NUMBER 0x01
760 #define Q933_CAUSE_NO_ROUTE_TO_DEST 0x03
761 #define Q933_CAUSE_CALL_REJECTED 0x15
762 #define Q933_CAUSE_NUMBER_CHANGED 0x16
763 #define Q933_CAUSE_ACCESS_INFO_DISC 0x2B
764 #define Q933_CAUSE_QOS_UNAVAILABLE 0x31
765 #define Q933_CAUSE_CHAN_NONEXISTENT 0x52
766 #define Q933_CAUSE_INCOMPATIBLE_DEST 0x58
767 #define Q933_CAUSE_MAND_IE_MISSING 0x60
768 #define Q933_CAUSE_MT_NONEX_OR_UNIMPL 0x61
769 #define Q933_CAUSE_IE_NONEX_OR_UNIMPL 0x63
770 #define Q933_CAUSE_INVALID_IE_CONTENTS 0x64
771 #define Q933_CAUSE_MSG_INCOMPAT_W_CS 0x65
772 #define Q933_CAUSE_REC_TIMER_EXP 0x66
774 const value_string q933_cause_code_vals[] = {
775 { 0x00, "Valid cause code not yet received" },
776 { Q933_CAUSE_UNALLOC_NUMBER, "Unallocated (unassigned) number" },
777 { 0x02, "No route to specified transit network" },
778 { Q933_CAUSE_NO_ROUTE_TO_DEST, "No route to destination" },
779 { 0x04, "Send special information tone" },
780 { 0x05, "Misdialled trunk prefix" },
781 { 0x06, "Channel unacceptable" },
782 { 0x07, "Call awarded and being delivered in an established channel" },
783 { 0x08, "Prefix 0 dialed but not allowed" },
784 /* Q.850 - "Preemption" */
785 { 0x09, "Prefix 1 dialed but not allowed" },
786 /* Q.850 - "Preemption - circuit reserved for reuse" */
787 { 0x0A, "Prefix 1 dialed but not required" },
788 { 0x0B, "More digits received than allowed, call is proceeding" },
789 { 0x0E, "QoR: ported number" },
790 { 0x10, "Normal call clearing" },
791 { 0x11, "User busy" },
792 { 0x12, "No user responding" },
793 { 0x13, "No answer from user (user alerted)" },
794 { 0x14, "Subscriber absent" },
795 { Q933_CAUSE_CALL_REJECTED, "Call rejected" },
796 { Q933_CAUSE_NUMBER_CHANGED, "Number changed" },
797 { 0x17, "Reverse charging rejected" },
798 /* Q.850 - "Redirection to new destination" */
799 { 0x18, "Call suspended" },
800 /* Q.850 Amendment 1 - "Call rejected due to feature at the destination" */
801 { 0x19, "Call resumed" },
802 /* Q.850 - "Exchange routing error */
803 { 0x1A, "Non-selected user clearing" },
804 { 0x1B, "Destination out of order" },
805 { 0x1C, "Invalid number format (incomplete number)" },
806 { 0x1D, "Facility rejected" },
807 { 0x1E, "Response to STATUS ENQUIRY" },
808 { 0x1F, "Normal unspecified" },
809 { 0x21, "Circuit out of order" },
810 { 0x22, "No circuit/channel available" },
811 { 0x23, "Destination unattainable" },
812 { 0x25, "Degraded service" },
813 { 0x26, "Network out of order" },
814 { 0x27, "Transit delay range cannot be achieved" },
815 /* Q.850 - "Permanent frame mode connection out of service" */
816 { 0x28, "Throughput range cannot be achieved" },
817 /* Q.850 - "Permanent frame mode connection operational" */
818 { 0x29, "Temporary failure" },
819 { 0x2A, "Switching equipment congestion" },
820 { Q933_CAUSE_ACCESS_INFO_DISC, "Access information discarded" },
821 { 0x2C, "Requested circuit/channel not available" },
822 { 0x2D, "Pre-empted" },
823 { 0x2E, "Precedence call blocked" },
824 { 0x2F, "Resources unavailable, unspecified" },
825 { Q933_CAUSE_QOS_UNAVAILABLE, "Quality of service unavailable" },
826 { 0x32, "Requested facility not subscribed" },
827 { 0x33, "Reverse charging not allowed" },
828 { 0x34, "Outgoing calls barred" },
829 { 0x35, "Outgoing calls barred within CUG" },
830 { 0x36, "Incoming calls barred" },
831 { 0x37, "Incoming calls barred within CUG" },
832 { 0x38, "Call waiting not subscribed" },
833 { 0x39, "Bearer capability not authorized" },
834 { 0x3A, "Bearer capability not presently available" },
835 { 0x3E, "Inconsistency in designated outgoing access information and subscriber class" },
836 { 0x3F, "Service or option not available, unspecified" },
837 { 0x41, "Bearer capability not implemented" },
838 { 0x42, "Channel type not implemented" },
839 { 0x43, "Transit network selection not implemented" },
840 { 0x44, "Message not implemented" },
841 { 0x45, "Requested facility not implemented" },
842 { 0x46, "Only restricted digital information bearer capability is available" },
843 { 0x4F, "Service or option not implemented, unspecified" },
844 { 0x51, "Invalid call reference value" },
845 { Q933_CAUSE_CHAN_NONEXISTENT, "Identified channel does not exist" },
846 { 0x53, "Call identity does not exist for suspended call" },
847 { 0x54, "Call identity in use" },
848 { 0x55, "No call suspended" },
849 { 0x56, "Call having the requested call identity has been cleared" },
850 { 0x57, "Called user not member of CUG" },
851 { Q933_CAUSE_INCOMPATIBLE_DEST, "Incompatible destination" },
852 { 0x59, "Non-existent abbreviated address entry" },
853 { 0x5A, "Destination address missing, and direct call not subscribed" },
854 /* Q.850 - "Non-existent CUG" */
855 { 0x5B, "Invalid transit network selection (national use)" },
856 { 0x5C, "Invalid facility parameter" },
857 { 0x5D, "Mandatory information element is missing" },
858 { 0x5F, "Invalid message, unspecified" },
859 { Q933_CAUSE_MAND_IE_MISSING, "Mandatory information element is missing" },
860 { Q933_CAUSE_MT_NONEX_OR_UNIMPL,"Message type non-existent or not implemented" },
861 { 0x62, "Message not compatible with call state or message type non-existent or not implemented" },
862 { Q933_CAUSE_IE_NONEX_OR_UNIMPL,"Information element non-existent or not implemented" },
863 { Q933_CAUSE_INVALID_IE_CONTENTS,"Invalid information element contents" },
864 { Q933_CAUSE_MSG_INCOMPAT_W_CS, "Message not compatible with call state" },
865 { Q933_CAUSE_REC_TIMER_EXP, "Recovery on timer expiry" },
866 { 0x67, "Parameter non-existent or not implemented - passed on" },
867 { 0x6E, "Message with unrecognized parameter discarded" },
868 { 0x6F, "Protocol error, unspecified" },
869 { 0x7F, "Internetworking, unspecified" },
873 static const value_string q933_cause_condition_vals[] = {
875 { 0x01, "Permanent" },
876 { 0x02, "Transient" },
880 #define Q933_REJ_USER_SPECIFIC 0x00
881 #define Q933_REJ_IE_MISSING 0x04
882 #define Q933_REJ_IE_INSUFFICIENT 0x08
884 static const value_string q933_rejection_reason_vals[] = {
885 { 0x00, "User specific" },
886 { 0x04, "Information element missing" },
887 { 0x08, "Information element contents are not sufficient" },
892 dissect_q933_cause_ie(tvbuff_t *tvb, int offset, int len,
893 proto_tree *tree, int hf_cause_value)
897 guint8 coding_standard;
898 guint8 rejection_reason;
902 octet = tvb_get_guint8(tvb, offset);
903 coding_standard = octet & 0x60;
904 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
906 * We don't know how the cause is encoded,
907 * so just dump it as data and be done with it.
909 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
910 proto_tree_add_text(tree, tvb, offset,
912 tvb_bytes_to_str(tvb, offset, len));
915 proto_tree_add_uint(tree, hf_q933_cause_location, tvb, offset, 1, octet);
916 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
917 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
921 if (!(octet & Q933_IE_VL_EXTENSION)) {
924 octet = tvb_get_guint8(tvb, offset);
925 proto_tree_add_text(tree, tvb, offset, 1,
926 "Recommendation: %s",
927 val_to_str(octet & 0x7F, q933_cause_recommendation_vals,
928 "Unknown (0x%02X)"));
929 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
936 octet = tvb_get_guint8(tvb, offset);
937 cause_value = octet & 0x7F;
938 proto_tree_add_uint(tree, hf_cause_value, tvb, offset, 1, cause_value);
939 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
945 switch (cause_value) {
947 case Q933_CAUSE_UNALLOC_NUMBER:
948 case Q933_CAUSE_NO_ROUTE_TO_DEST:
949 case Q933_CAUSE_QOS_UNAVAILABLE:
950 octet = tvb_get_guint8(tvb, offset);
951 proto_tree_add_text(tree, tvb, offset, 1,
952 "Network service: %s",
953 (octet & 0x80) ? "User" : "Provider");
954 proto_tree_add_text(tree, tvb, offset, 1,
956 (octet & 0x40) ? "Abnormal" : "Normal");
957 proto_tree_add_text(tree, tvb, offset, 1,
959 val_to_str(octet & 0x03, q933_cause_condition_vals,
963 case Q933_CAUSE_CALL_REJECTED:
964 rejection_reason = octet & 0x7C;
965 proto_tree_add_text(tree, tvb, offset, 1,
966 "Rejection reason: %s",
967 val_to_str(octet & 0x7C, q933_rejection_reason_vals,
969 proto_tree_add_text(tree, tvb, offset, 1,
971 val_to_str(octet & 0x03, q933_cause_condition_vals,
978 switch (rejection_reason) {
980 case Q933_REJ_USER_SPECIFIC:
981 proto_tree_add_text(tree, tvb, offset, len,
982 "User specific diagnostic: %s",
983 tvb_bytes_to_str(tvb, offset, len));
986 case Q933_REJ_IE_MISSING:
987 proto_tree_add_text(tree, tvb, offset, 1,
988 "Missing information element: %s",
989 val_to_str(tvb_get_guint8(tvb, offset), q933_info_element_vals0,
990 "Unknown (0x%02X)"));
993 case Q933_REJ_IE_INSUFFICIENT:
994 proto_tree_add_text(tree, tvb, offset, 1,
995 "Insufficient information element: %s",
996 val_to_str(tvb_get_guint8(tvb, offset), q933_info_element_vals0,
997 "Unknown (0x%02X)"));
1001 proto_tree_add_text(tree, tvb, offset, len,
1003 tvb_bytes_to_str(tvb, offset, len));
1008 case Q933_CAUSE_ACCESS_INFO_DISC:
1009 case Q933_CAUSE_INCOMPATIBLE_DEST:
1010 case Q933_CAUSE_MAND_IE_MISSING:
1011 case Q933_CAUSE_IE_NONEX_OR_UNIMPL:
1012 case Q933_CAUSE_INVALID_IE_CONTENTS:
1014 proto_tree_add_text(tree, tvb, offset, 1,
1015 "Information element: %s",
1016 val_to_str(tvb_get_guint8(tvb, offset), q933_info_element_vals0,
1017 "Unknown (0x%02X)"));
1023 case Q933_CAUSE_MT_NONEX_OR_UNIMPL:
1024 case Q933_CAUSE_MSG_INCOMPAT_W_CS:
1025 proto_tree_add_text(tree, tvb, offset, 1,
1027 val_to_str(tvb_get_guint8(tvb, offset), q933_message_type_vals,
1028 "Unknown (0x%02X)"));
1031 case Q933_CAUSE_REC_TIMER_EXP:
1034 proto_tree_add_text(tree, tvb, offset, 3,
1035 "Timer: %.3s", tvb_get_ephemeral_string(tvb, offset, 3));
1039 proto_tree_add_text(tree, tvb, offset, len,
1041 tvb_bytes_to_str(tvb, offset, len));
1046 * Dissect a Call state information element.
1048 static const value_string q933_call_state_vals[] = {
1050 { 0x01, "Call initiated" },
1051 { 0x02, "Overlap sending" },
1052 { 0x03, "Outgoing call proceeding" },
1053 { 0x04, "Call delivered" },
1054 { 0x06, "Call present" },
1055 { 0x07, "Call received" },
1056 { 0x08, "Connect request" },
1057 { 0x09, "Incoming call proceeding" },
1059 { 0x0B, "Disconnect request" },
1060 { 0x0C, "Disconnect indication" },
1061 { 0x0F, "Suspend request" },
1062 { 0x12, "Resume request" },
1063 { 0x13, "Release request" },
1064 { 0x16, "Call abort"},
1065 { 0x19, "Overlap receiving" },
1066 { 0x3D, "Restart request" },
1067 { 0x3E, "Restart" },
1072 dissect_q933_call_state_ie(tvbuff_t *tvb, int offset, int len,
1076 guint8 coding_standard;
1080 octet = tvb_get_guint8(tvb, offset);
1081 coding_standard = octet & 0x60;
1082 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
1083 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
1085 * We don't know how the call state is encoded,
1086 * so just dump it as data and be done with it.
1088 proto_tree_add_text(tree, tvb, offset,
1090 tvb_bytes_to_str(tvb, offset, len));
1093 proto_tree_add_text(tree, tvb, offset, 1,
1095 val_to_str(octet & 0x3F, q933_call_state_vals,
1096 "Unknown (0x%02X)"));
1100 * Dissect a Report Type information element.
1102 #define Q933_IE_REPORT_TYPE_FULL_STATUS 0x00
1103 #define Q933_IE_REPORT_TYPE_LINK_VERIFY 0x01
1104 #define Q933_IE_REPORT_TYPE_ASYNC_PVC_STATUS 0x02
1106 static const value_string q933_report_type_vals[] = {
1107 { Q933_IE_REPORT_TYPE_FULL_STATUS, "Full Status" },
1108 { Q933_IE_REPORT_TYPE_LINK_VERIFY, "Link verify" },
1109 { Q933_IE_REPORT_TYPE_ASYNC_PVC_STATUS, "Async PVC Status" },
1114 dissect_q933_report_type_ie(tvbuff_t *tvb, int offset, int len,
1122 report_type = tvb_get_guint8(tvb, offset);
1123 proto_tree_add_uint(tree, hf_q933_report_type, tvb, offset, 1, report_type);
1127 * Dissect a Link Integrity Verification information element.
1130 dissect_q933_link_integrity_verf_ie(tvbuff_t *tvb, int offset, int len,
1138 txseq = tvb_get_guint8(tvb, offset);
1139 rxseq = tvb_get_guint8(tvb, offset+1);
1141 proto_tree_add_uint(tree, hf_q933_link_verf_txseq, tvb, offset, 1, txseq);
1142 proto_tree_add_uint(tree, hf_q933_link_verf_rxseq, tvb, offset+1, 1, rxseq);
1147 * Dissect a PVC status information element.
1149 static const value_string q933_pvc_status_vals[] = {
1153 {0x0a, "New, Active"},
1158 dissect_q933_pvc_status_ie(tvbuff_t *tvb, int offset, int len,
1162 guint8 dlci_status,dlci_len=2;
1167 dlci = ((tvb_get_guint8(tvb, offset) & 0x3F) << 4) |
1168 ((tvb_get_guint8(tvb, offset+1) & 0x78) >> 3);
1170 /* first determine the DLCI field length */
1172 dlci = (dlci << 6) | ((tvb_get_guint8(tvb, offset+2) & 0x7E) >> 1);
1174 } else if (len == 5) {
1175 dlci = (dlci << 13) | (tvb_get_guint8(tvb, offset+3) & 0x7F) |
1176 ((tvb_get_guint8(tvb, offset+4) & 0x7E) >> 1);
1179 dlci_status=tvb_get_guint8(tvb, offset+dlci_len)&0x0a;
1181 proto_tree_add_text(tree, tvb, offset, dlci_len, "DLCI: %u", dlci);
1182 proto_tree_add_text(tree, tvb, offset+dlci_len, 1, "Status: %s",
1183 val_to_str(dlci_status, q933_pvc_status_vals, "Unknown"));
1187 * Dissect a Channel identification information element.
1189 #define Q933_INTERFACE_IDENTIFIED 0x40
1190 #define Q933_NOT_BASIC_CHANNEL 0x20
1192 static const value_string q933_basic_channel_selection_vals[] = {
1193 { 0x00, "No channel" },
1194 { 0x01, "B1 channel" },
1195 { 0x02, "B2 channel" },
1196 { 0x03, "Any channel" },
1200 static const value_string q933_not_basic_channel_selection_vals[] = {
1201 { 0x00, "No channel" },
1202 { 0x01, "Channel indicated in following octets" },
1203 { 0x03, "Any channel" },
1207 #define Q933_IS_SLOT_MAP 0x10
1209 static const value_string q933_element_type_vals[] = {
1210 { 0x03, "B-channel units" },
1211 { 0x06, "H0-channel units" },
1212 { 0x08, "H11-channel units" },
1213 { 0x09, "H12-channel units" },
1218 dissect_q933_channel_identification_ie(tvbuff_t *tvb, int offset, int len,
1222 int identifier_offset;
1224 guint8 coding_standard;
1228 octet = tvb_get_guint8(tvb, offset);
1229 proto_tree_add_text(tree, tvb, offset, 1,
1230 "Interface %s identified",
1231 (octet & Q933_INTERFACE_IDENTIFIED) ? "explicitly" : "implicitly");
1232 proto_tree_add_text(tree, tvb, offset, 1,
1234 (octet & Q933_NOT_BASIC_CHANNEL) ? "Not basic" : "Basic");
1235 proto_tree_add_text(tree, tvb, offset, 1,
1236 "Indicated channel is %s",
1237 (octet & 0x08) ? "required" : "preferred");
1238 proto_tree_add_text(tree, tvb, offset, 1,
1239 "Indicated channel is %sthe D-channel",
1240 (octet & 0x04) ? "" : "not ");
1241 if (octet & Q933_NOT_BASIC_CHANNEL) {
1242 proto_tree_add_text(tree, tvb, offset, 1,
1243 "Channel selection: %s",
1244 val_to_str(octet & 0x03, q933_not_basic_channel_selection_vals,
1247 proto_tree_add_text(tree, tvb, offset, 1,
1248 "Channel selection: %s",
1249 val_to_str(octet & 0x03, q933_basic_channel_selection_vals,
1255 if (octet & Q933_INTERFACE_IDENTIFIED) {
1256 identifier_offset = offset;
1261 octet = tvb_get_guint8(tvb, offset);
1265 } while (!(octet & Q933_IE_VL_EXTENSION));
1268 * XXX - do we want to strip off the 8th bit on the
1269 * last octet of the interface identifier?
1271 if (identifier_len != 0) {
1272 proto_tree_add_text(tree, tvb, identifier_offset,
1273 identifier_len, "Interface identifier: %s",
1274 tvb_bytes_to_str(tvb, identifier_offset, identifier_len));
1278 if (octet & Q933_NOT_BASIC_CHANNEL) {
1281 octet = tvb_get_guint8(tvb, offset);
1282 coding_standard = octet & 0x60;
1283 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
1284 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
1286 * We don't know how the channel identifier is
1287 * encoded, so just dump it as data and be done
1290 proto_tree_add_text(tree, tvb, offset,
1292 tvb_bytes_to_str(tvb, offset, len));
1295 proto_tree_add_text(tree, tvb, offset, 1,
1296 "Channel is indicated by %s",
1297 (octet & Q933_IS_SLOT_MAP) ? "slot map" : "number");
1298 proto_tree_add_text(tree, tvb, offset, 1,
1300 (octet & Q933_IS_SLOT_MAP) ? "Map element" : "Channel",
1301 val_to_str(octet & 0x0F, q933_element_type_vals,
1302 "Unknown (0x%02X)"));
1305 * XXX - dump the channel number or slot map.
1311 * Dissect a Progress indicator information element.
1313 static const value_string q933_progress_description_vals[] = {
1314 { 0x01, "Call is not end-to-end ISDN - progress information available in-band" },
1315 { 0x02, "Destination address is non-ISDN" },
1316 { 0x03, "Origination address is non-ISDN" },
1317 { 0x04, "Call has returned to the ISDN" },
1318 { 0x05, "Interworking has occurred and has resulted in a telecommunications service change" },
1319 { 0x08, "In-band information or an appropriate pattern is now available" },
1324 dissect_q933_progress_indicator_ie(tvbuff_t *tvb, int offset, int len,
1328 guint8 coding_standard;
1332 octet = tvb_get_guint8(tvb, offset);
1333 coding_standard = octet & 0x60;
1334 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
1335 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
1337 * We don't know how the progress indicator is encoded,
1338 * so just dump it as data and be done with it.
1340 proto_tree_add_text(tree, tvb, offset,
1342 tvb_bytes_to_str(tvb, offset, len));
1345 proto_tree_add_text(tree, tvb, offset, 1,
1347 val_to_str(octet & 0x0F, q933_cause_location_vals,
1354 octet = tvb_get_guint8(tvb, offset);
1355 proto_tree_add_text(tree, tvb, offset, 1,
1356 "Progress description: %s",
1357 val_to_str(octet & 0x7F, q933_progress_description_vals,
1358 "Unknown (0x%02X)"));
1362 * Dissect a Network-specific facilities or Transit network selection
1363 * information element.
1365 static const value_string q933_netid_type_vals[] = {
1366 { 0x00, "User specified" },
1367 { 0x20, "National network identification" },
1368 { 0x30, "International network identification" },
1372 static const value_string q933_netid_plan_vals[] = {
1373 { 0x00, "Unknown" },
1374 { 0x01, "Carrier Identification Code" },
1375 { 0x03, "X.121 data network identification code" },
1380 dissect_q933_ns_facilities_ie(tvbuff_t *tvb, int offset, int len,
1388 octet = tvb_get_guint8(tvb, offset);
1389 netid_len = octet & 0x7F;
1390 proto_tree_add_text(tree, tvb, offset, 1,
1391 "Network identification length: %u",
1395 if (netid_len != 0) {
1398 octet = tvb_get_guint8(tvb, offset);
1399 proto_tree_add_text(tree, tvb, offset, 1,
1400 "Type of network identification: %s",
1401 val_to_str(octet & 0x70, q933_netid_type_vals,
1402 "Unknown (0x%02X)"));
1403 proto_tree_add_text(tree, tvb, offset, 1,
1404 "Network identification plan: %s",
1405 val_to_str(octet & 0x0F, q933_netid_plan_vals,
1406 "Unknown (0x%02X)"));
1413 if (netid_len > len)
1415 if (netid_len != 0) {
1416 proto_tree_add_text(tree, tvb, offset, netid_len,
1417 "Network identification: %s",
1418 tvb_format_text(tvb, offset, netid_len));
1419 offset += netid_len;
1425 * Whatever is left is the network-specific facility
1430 proto_tree_add_text(tree, tvb, offset,
1431 len, "Network-specific facility specification: %s",
1432 tvb_bytes_to_str(tvb, offset, len));
1436 dissect_q933_guint16_value(tvbuff_t *tvb, int offset, int len,
1437 proto_tree *tree, const char *label)
1445 octet = tvb_get_guint8(tvb, offset);
1446 if (octet & Q933_IE_VL_EXTENSION) {
1448 * Only one octet long - error.
1452 value = (octet & 0x3) << 14;
1459 * We've reached the end of the information element - error.
1463 octet = tvb_get_guint8(tvb, offset);
1464 if (octet & Q933_IE_VL_EXTENSION) {
1466 * Only two octets long - error.
1470 value |= (octet & 0x7F) << 7;
1477 * We've reached the end of the information element - error.
1481 octet = tvb_get_guint8(tvb, offset);
1482 if (!(octet & Q933_IE_VL_EXTENSION)) {
1484 * More than three octets long - error.
1488 value |= (octet & 0x7F);
1493 proto_tree_add_text(tree, tvb, offset, value_len, "%s: %u ms", label,
1498 proto_tree_add_text(tree, tvb, offset, len,
1499 "%s goes past end of information element", label);
1503 proto_tree_add_text(tree, tvb, offset, len, "%s isn't 3 octets long",
1509 * Dissect an End-to-end transit delay information element.
1512 dissect_q933_e2e_transit_delay_ie(tvbuff_t *tvb, int offset, int len,
1519 value_len = dissect_q933_guint16_value(tvb, offset, len, tree,
1520 "Cumulative transit delay");
1523 offset += value_len;
1528 value_len = dissect_q933_guint16_value(tvb, offset, len, tree,
1529 "Requested end-to-end transit delay");
1532 offset += value_len;
1537 value_len = dissect_q933_guint16_value(tvb, offset, len, tree,
1538 "Maximum end-to-end transit delay");
1542 * Dissect a Transit delay selection and indication information element.
1545 dissect_q933_td_selection_and_int_ie(tvbuff_t *tvb, int offset, int len,
1550 dissect_q933_guint16_value(tvb, offset, len, tree,
1555 dissect_q933_pl_binary_parameters_ie(tvbuff_t *tvb, int offset, int len,
1562 octet = tvb_get_guint8(tvb, offset);
1563 proto_tree_add_text(tree, tvb, offset, 1,
1565 (octet & 0x04) ? "No request/request denied" :
1566 "Request indicated/request accepted");
1567 proto_tree_add_text(tree, tvb, offset, 1,
1569 (octet & 0x02) ? "Link-by-link" : "End-to-end");
1573 * Dissect a Reverse charging indication information element.
1575 static const value_string q933_reverse_charging_indication_vals[] = {
1576 { 0x01, "Reverse charging requested" },
1581 dissect_q933_reverse_charge_ind_ie(tvbuff_t *tvb, int offset, int len,
1586 proto_tree_add_text(tree, tvb, offset, 1,
1587 "Reverse charging indication: %s",
1588 val_to_str(tvb_get_guint8(tvb, offset) & 0x07,
1589 q933_reverse_charging_indication_vals, "Unknown (0x%02X)"));
1593 * Dissect a (phone) number information element.
1595 static const value_string q933_number_type_vals[] = {
1597 { 0x1, "International number" },
1598 { 0x2, "National number" },
1599 { 0x3, "Network specific number" },
1600 { 0x4, "Subscriber number" },
1601 { 0x6, "Abbreviated number" },
1605 static const value_string q933_numbering_plan_vals[] = {
1606 { 0x00, "Unknown" },
1607 { 0x01, "E.164 ISDN/telephony numbering" },
1608 { 0x03, "X.121 data numbering" },
1609 { 0x04, "F.69 Telex numbering" },
1610 { 0x08, "National standard numbering" },
1611 { 0x09, "Private numbering" },
1615 static const value_string q933_presentation_indicator_vals[] = {
1616 { 0x00, "Presentation allowed" },
1617 { 0x01, "Presentation restricted" },
1618 { 0x02, "Number not available due to interworking" },
1622 static const value_string q933_screening_indicator_vals[] = {
1623 { 0x00, "User-provided, not screened" },
1624 { 0x01, "User-provided, verified and passed" },
1625 { 0x02, "User-provided, verified and failed" },
1626 { 0x03, "Network-provided" },
1630 static const value_string q933_redirection_reason_vals[] = {
1631 { 0x00, "Unknown" },
1632 { 0x01, "Call forwarding busy or called DTE busy" },
1633 { 0x02, "Call forwarding no reply" },
1634 { 0x04, "Call deflection" },
1635 { 0x09, "Called DTE out of order" },
1636 { 0x0A, "Call forwarding by the called DTE" },
1637 { 0x0F, "Call forwarding unconditional or systematic call redirection" },
1642 dissect_q933_number_ie(tvbuff_t *tvb, int offset, int len,
1643 proto_tree *tree, int hfindex)
1649 octet = tvb_get_guint8(tvb, offset);
1650 proto_tree_add_uint(tree, hf_q933_numbering_plan, tvb, offset, 1, octet);
1651 proto_tree_add_uint(tree, hf_q933_number_type, tvb, offset, 1, octet);
1652 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
1657 if (!(octet & Q933_IE_VL_EXTENSION)) {
1660 octet = tvb_get_guint8(tvb, offset);
1661 proto_tree_add_uint(tree, hf_q933_screening_ind, tvb, offset, 1, octet);
1662 proto_tree_add_uint(tree, hf_q933_presentation_ind, tvb, offset, 1, octet);
1663 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
1669 * XXX - only in a Redirecting number information element.
1671 if (!(octet & Q933_IE_VL_EXTENSION)) {
1674 octet = tvb_get_guint8(tvb, offset);
1675 proto_tree_add_text(tree, tvb, offset, 1,
1676 "Reason for redirection: %s",
1677 val_to_str(octet & 0x0F, q933_redirection_reason_vals,
1685 proto_tree_add_item(tree, hfindex, tvb, offset, len, ENC_ASCII|ENC_NA);
1689 * Dissect a party subaddress information element.
1691 static const value_string q933_subaddress_type_vals[] = {
1692 { 0x00, "X.213/ISO 8348 Add.2 NSAP" },
1693 { 0x20, "User-specified" },
1697 static const value_string q933_odd_even_indicator_vals[] = {
1698 { 0x00, "Even number of address signals" },
1699 { 0x10, "Odd number of address signals" },
1704 dissect_q933_party_subaddr_ie(tvbuff_t *tvb, int offset, int len,
1711 octet = tvb_get_guint8(tvb, offset);
1712 proto_tree_add_text(tree, tvb, offset, 1,
1713 "Type of subaddress: %s",
1714 val_to_str(octet & 0x70, q933_subaddress_type_vals,
1715 "Unknown (0x%02X)"));
1716 proto_tree_add_text(tree, tvb, offset, 1,
1717 "Odd/even indicator: %s",
1718 val_to_str(octet & 0x10, q933_odd_even_indicator_vals,
1719 "Unknown (0x%02X)"));
1725 proto_tree_add_text(tree, tvb, offset, len, "Subaddress: %s",
1726 tvb_bytes_to_str(tvb, offset, len));
1730 * Dissect a High-layer compatibility information element.
1732 #define Q933_AUDIOVISUAL 0x60
1733 static const value_string q933_high_layer_characteristics_vals[] = {
1734 { 0x01, "Telephony" },
1735 { 0x04, "F.182 Facsimile Group 2/3" },
1736 { 0x21, "F.184 Facsimile Group 4 Class I" },
1737 { 0x24, "F.230 Teletex, basic and mixed mode, and F.184 Facsimile Group 4, Classes II and III" },
1738 { 0x28, "F.220 Teletex, basic and processable mode" },
1739 { 0x31, "F.200 Teletex, basic mode" },
1740 { 0x32, "F.300 and T.102 syntax-based Videotex" },
1741 { 0x33, "F.300 and T.101 international Videotex interworking" },
1742 { 0x35, "F.60 Telex" },
1743 { 0x38, "X.400 Message Handling Systems" },
1744 { 0x41, "X.200 OSI application" },
1745 { 0x42, "FTAM application" },
1746 { 0x5E, "Reserved for maintenance" },
1747 { 0x5F, "Reserved for management" },
1748 { Q933_AUDIOVISUAL, "F.720/F.821 and F.731 Profile 1a videotelephony" },
1749 { 0x61, "F.702 and F.731 Profile 1b videoconferencing" },
1750 { 0x62, "F.702 and F.731 audiographic conferencing" },
1754 static const value_string q933_audiovisual_characteristics_vals[] = {
1755 { 0x01, "Capability set of initial channel of H.221" },
1756 { 0x02, "Capability set of subsequent channel of H.221" },
1757 { 0x21, "Capability set of initial channel of an active 3.1kHz audio or speech call" },
1762 dissect_q933_high_layer_compat_ie(tvbuff_t *tvb, int offset, int len,
1766 guint8 coding_standard;
1767 guint8 characteristics;
1771 octet = tvb_get_guint8(tvb, offset);
1772 coding_standard = octet & 0x60;
1773 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
1776 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
1778 * We don't know how the call state is encoded,
1779 * so just dump it as data and be done with it.
1781 proto_tree_add_text(tree, tvb, offset,
1783 tvb_bytes_to_str(tvb, offset, len));
1789 octet = tvb_get_guint8(tvb, offset);
1790 characteristics = octet & 0x7F;
1791 proto_tree_add_text(tree, tvb, offset, 1,
1792 "High layer characteristics identification: %s",
1793 val_to_str(characteristics, q933_high_layer_characteristics_vals,
1794 "Unknown (0x%02X)"));
1798 if (!(octet & Q933_IE_VL_EXTENSION)) {
1801 octet = tvb_get_guint8(tvb, offset);
1802 if (characteristics == Q933_AUDIOVISUAL) {
1803 proto_tree_add_text(tree, tvb, offset, 1,
1804 "Extended audiovisual characteristics identification: %s",
1805 val_to_str(octet & 0x7F,
1806 q933_audiovisual_characteristics_vals,
1807 "Unknown (0x%02X)"));
1809 proto_tree_add_text(tree, tvb, offset, 1,
1810 "Extended high layer characteristics identification: %s",
1811 val_to_str(octet & 0x7F,
1812 q933_high_layer_characteristics_vals,
1813 "Unknown (0x%02X)"));
1820 * Dissect a User-user information element.
1822 #define Q933_PROTOCOL_DISCRIMINATOR_IA5 0x04
1823 #define Q933_PROTOCOL_DISCRIMINATOR_ASN1 0x05
1825 static const value_string q933_protocol_discriminator_vals[] = {
1826 { 0x00, "User-specific protocol" },
1827 { 0x01, "OSI high layer protocols" },
1829 { Q933_PROTOCOL_DISCRIMINATOR_IA5, "IA5 characters" },
1830 { Q933_PROTOCOL_DISCRIMINATOR_ASN1, "X.208 and X.209 coded user information" },
1831 { 0x07, "V.120 rate adaption" },
1832 { 0x08, "Q.933/I.451 user-network call control messages" },
1837 dissect_q933_user_user_ie(tvbuff_t *tvb, int offset, int len,
1844 octet = tvb_get_guint8(tvb, offset);
1845 proto_tree_add_text(tree, tvb, offset, 1,
1846 "Protocol discriminator: %s",
1847 val_to_str(octet, q933_protocol_discriminator_vals,
1848 "Unknown (0x%02x)"));
1856 case Q933_PROTOCOL_DISCRIMINATOR_IA5:
1857 proto_tree_add_text(tree, tvb, offset, len, "User information: %s",
1858 tvb_format_text(tvb, offset, len));
1862 proto_tree_add_text(tree, tvb, offset, len, "User information: %s",
1863 tvb_bytes_to_str(tvb, offset, len));
1869 * Dissect information elements consisting of ASCII^H^H^H^H^HIA5 text.
1872 dissect_q933_ia5_ie(tvbuff_t *tvb, int offset, int len, proto_tree *tree,
1876 proto_tree_add_text(tree, tvb, offset, len, "%s: %s", label,
1877 tvb_format_text(tvb, offset, len));
1881 static const value_string q933_codeset_vals[] = {
1882 { 0x00, "Q.933 information elements" },
1883 { 0x04, "Information elements for ISO/IEC use" },
1884 { 0x05, "Information elements for national use" },
1885 { 0x06, "Information elements specific to the local network" },
1886 { 0x07, "User-specific information elements" },
1891 dissect_q933(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1894 proto_tree *q933_tree = NULL;
1896 proto_tree *ie_tree = NULL;
1897 guint8 call_ref_len;
1898 guint8 call_ref[15];
1899 guint8 message_type;
1900 guint8 info_element;
1901 guint16 info_element_len;
1902 int codeset, locked_codeset;
1903 gboolean non_locking_shift;
1905 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Q.933");
1908 ti = proto_tree_add_item(tree, proto_q933, tvb, offset, -1,
1910 q933_tree = proto_item_add_subtree(ti, ett_q933);
1912 dissect_q933_protocol_discriminator(tvb, offset, q933_tree);
1915 call_ref_len = tvb_get_guint8(tvb, offset) & 0xF; /* XXX - do as a bit field? */
1916 if (q933_tree != NULL)
1917 proto_tree_add_uint(q933_tree, hf_q933_call_ref_len, tvb, offset, 1, call_ref_len);
1919 if (call_ref_len != 0) {
1920 tvb_memcpy(tvb, call_ref, offset, call_ref_len);
1921 if (q933_tree != NULL) {
1922 proto_tree_add_boolean(q933_tree, hf_q933_call_ref_flag,
1923 tvb, offset, 1, (call_ref[0] & 0x80) != 0);
1924 call_ref[0] &= 0x7F;
1925 proto_tree_add_bytes(q933_tree, hf_q933_call_ref,
1926 tvb, offset, call_ref_len, call_ref);
1928 offset += call_ref_len;
1930 message_type = tvb_get_guint8(tvb, offset);
1931 if (check_col(pinfo->cinfo, COL_INFO)) {
1932 col_add_str(pinfo->cinfo, COL_INFO,
1933 val_to_str(message_type, q933_message_type_vals,
1934 "Unknown message type (0x%02X)"));
1936 if (q933_tree != NULL)
1937 proto_tree_add_uint(q933_tree, hf_q933_message_type, tvb, offset, 1, message_type);
1941 * And now for the information elements....
1943 codeset = locked_codeset = 0; /* start out in codeset 0 */
1944 non_locking_shift = TRUE;
1945 while (tvb_reported_length_remaining(tvb, offset) > 0) {
1946 info_element = tvb_get_guint8(tvb, offset);
1948 /* Check for the codeset shift */
1949 if ((info_element & Q933_IE_SO_MASK) &&
1950 ((info_element & Q933_IE_SO_IDENTIFIER_MASK) == Q933_IE_SHIFT)) {
1951 non_locking_shift = info_element & Q933_IE_SHIFT_NON_LOCKING;
1952 codeset = info_element & Q933_IE_SHIFT_CODESET;
1953 if (!non_locking_shift)
1954 locked_codeset = codeset;
1955 if (q933_tree != NULL) {
1956 proto_tree_add_text(q933_tree, tvb, offset, 1,
1957 "%s shift to codeset %u: %s",
1958 (non_locking_shift ? "Non-locking" : "Locking"),
1960 val_to_str(codeset, q933_codeset_vals,
1961 "Unknown (0x%02X)"));
1968 * Check for the single-octet IEs.
1970 if (info_element & Q933_IE_SO_MASK) {
1971 switch ((codeset << 8) | (info_element & Q933_IE_SO_IDENTIFIER_MASK)) {
1973 case CS0 | Q933_IE_REPEAT_INDICATOR:
1974 if (q933_tree != NULL) {
1975 proto_tree_add_text(q933_tree, tvb, offset, 1,
1976 "Repeat indicator: %s",
1977 val_to_str(info_element & Q933_IE_SO_IE_MASK,
1978 q933_repeat_indication_vals,
1984 if (q933_tree != NULL) {
1985 proto_tree_add_text(q933_tree, tvb, offset, 1,
1986 "Unknown information element (0x%02X)",
1992 codeset = locked_codeset;
1997 * Variable-length IE.
1999 info_element_len = tvb_get_guint8(tvb, offset + 1);
2000 if (q933_tree != NULL) {
2001 ti = proto_tree_add_text(q933_tree, tvb, offset,
2002 1+1+info_element_len, "%s",
2003 val_to_str(info_element, q933_info_element_vals[codeset],
2004 "Unknown information element (0x%02X)"));
2005 ie_tree = proto_item_add_subtree(ti, ett_q933_ie);
2006 proto_tree_add_text(ie_tree, tvb, offset, 1,
2007 "Information element: %s",
2008 val_to_str(info_element, q933_info_element_vals[codeset],
2009 "Unknown (0x%02X)"));
2010 proto_tree_add_text(ie_tree, tvb, offset + 1, 1,
2011 "Length: %u", info_element_len);
2013 switch ((codeset << 8) | info_element) {
2015 case CS0 | Q933_IE_SEGMENTED_MESSAGE:
2016 dissect_q933_segmented_message_ie(tvb,
2017 offset + 2, info_element_len,
2021 case CS0 | Q933_IE_BEARER_CAPABILITY:
2022 case CS0 | Q933_IE_LOW_LAYER_COMPAT:
2023 dissect_q933_bearer_capability_ie(tvb,
2024 offset + 2, info_element_len,
2028 case CS0 | Q933_IE_CAUSE:
2029 dissect_q933_cause_ie(tvb,
2030 offset + 2, info_element_len,
2032 hf_q933_cause_value);
2035 case CS0 | Q933_IE_CALL_STATE:
2036 dissect_q933_call_state_ie(tvb,
2037 offset + 2, info_element_len,
2041 case CS0 | Q933_IE_CHANNEL_IDENTIFICATION:
2042 dissect_q933_channel_identification_ie(
2043 tvb, offset + 2, info_element_len,
2047 case CS0 | Q933_IE_PROGRESS_INDICATOR:
2048 dissect_q933_progress_indicator_ie(tvb,
2049 offset + 2, info_element_len,
2053 case CS0 | Q933_IE_NETWORK_SPECIFIC_FACIL:
2054 case CS0 | Q933_IE_TRANSIT_NETWORK_SEL:
2055 dissect_q933_ns_facilities_ie(tvb,
2056 offset + 2, info_element_len,
2060 case CS0 | Q933_IE_DISPLAY:
2061 dissect_q933_ia5_ie(tvb, offset + 2,
2062 info_element_len, ie_tree,
2063 "Display information");
2066 case CS0 | Q933_IE_E2E_TRANSIT_DELAY:
2067 dissect_q933_e2e_transit_delay_ie(tvb,
2068 offset + 2, info_element_len,
2072 case CS0 | Q933_IE_TD_SELECTION_AND_INT:
2073 dissect_q933_td_selection_and_int_ie(
2074 tvb, offset + 2, info_element_len,
2078 case CS0 | Q933_IE_PL_BINARY_PARAMETERS:
2079 dissect_q933_pl_binary_parameters_ie(
2080 tvb, offset + 2, info_element_len,
2084 case CS0 | Q933_IE_REVERSE_CHARGE_IND:
2085 dissect_q933_reverse_charge_ind_ie(tvb,
2086 offset + 2, info_element_len,
2090 case CS0 | Q933_IE_CALLING_PARTY_NUMBER:
2091 dissect_q933_number_ie(tvb,
2092 offset + 2, info_element_len,
2094 hf_q933_calling_party_number);
2097 case CS0 | Q933_IE_CONNECTED_NUMBER:
2098 dissect_q933_number_ie(tvb,
2099 offset + 2, info_element_len,
2101 hf_q933_connected_number);
2104 case CS0 | Q933_IE_CALLED_PARTY_NUMBER:
2105 dissect_q933_number_ie(tvb,
2106 offset + 2, info_element_len,
2108 hf_q933_called_party_number);
2111 case CS0 | Q933_IE_CALLING_PARTY_SUBADDR:
2112 case CS0 | Q933_IE_CALLED_PARTY_SUBADDR:
2113 dissect_q933_party_subaddr_ie(tvb,
2114 offset + 2, info_element_len,
2118 case CS0 | Q933_IE_HIGH_LAYER_COMPAT:
2119 dissect_q933_high_layer_compat_ie(tvb,
2120 offset + 2, info_element_len,
2124 case CS0 | Q933_IE_USER_USER:
2125 dissect_q933_user_user_ie(tvb,
2126 offset + 2, info_element_len,
2131 case CS0 | Q933_IE_REPORT_TYPE:
2132 case CS5 | Q933_IE_REPORT_TYPE:
2133 case CS5 | Q933_IE_ANSI_REPORT_TYPE:
2134 dissect_q933_report_type_ie(tvb,
2135 offset + 2, info_element_len,
2139 case CS5 | Q933_IE_LINK_INTEGRITY_VERF:
2140 case CS5 | Q933_IE_ANSI_LINK_INTEGRITY_VERF:
2141 dissect_q933_link_integrity_verf_ie(tvb,
2142 offset + 2, info_element_len,
2146 case CS5 | Q933_IE_PVC_STATUS:
2147 case CS5 | Q933_IE_ANSI_PVC_STATUS:
2148 dissect_q933_pvc_status_ie(tvb,
2149 offset + 2, info_element_len,
2154 proto_tree_add_text(ie_tree, tvb,
2155 offset + 2, info_element_len,
2157 tvb_bytes_to_str(tvb, offset + 2,
2162 offset += 1 + 1 + info_element_len;
2163 codeset = locked_codeset;
2168 proto_register_q933(void)
2170 static hf_register_info hf[] = {
2171 { &hf_q933_discriminator,
2172 { "Protocol discriminator", "q933.disc", FT_UINT8, BASE_HEX, NULL, 0x0,
2175 { &hf_q933_call_ref_flag,
2176 { "Call reference flag", "q933.call_ref_flag", FT_BOOLEAN, BASE_NONE, TFS(&tfs_call_ref_flag), 0x0,
2179 { &hf_q933_call_ref,
2180 { "Call reference value", "q933.call_ref", FT_BYTES, BASE_NONE, NULL, 0x0,
2184 { &hf_q933_coding_standard,
2185 { "Coding standard", "q933.coding_standard", FT_UINT8, BASE_HEX,
2186 VALS(q933_coding_standard_vals), 0x60,NULL, HFILL }},
2188 { &hf_q933_information_transfer_capability,
2189 { "Information transfer capability", "q933.information_transfer_capability", FT_UINT8, BASE_HEX,
2190 VALS(q933_information_transfer_capability_vals), 0x1f,NULL, HFILL }},
2192 { &hf_q933_transfer_mode,
2193 { "Transfer mode", "q933.transfer_mode", FT_UINT8, BASE_HEX,
2194 VALS(q933_transfer_mode_vals), 0x60,NULL, HFILL }},
2197 { "User information layer 1 protocol", "q933.uil1", FT_UINT8, BASE_HEX,
2198 VALS(q933_uil1_vals), 0x1f,NULL, HFILL }},
2200 { &hf_q933_call_ref_len,
2201 { "Call reference value length", "q933.call_ref_len", FT_UINT8, BASE_DEC, NULL, 0x0,
2204 { &hf_q933_message_type,
2205 { "Message type", "q933.message_type", FT_UINT8, BASE_HEX, VALS(q933_message_type_vals), 0x0,
2208 { &hf_q933_cause_location,
2209 { "Cause location", "q933.cause_location", FT_UINT8, BASE_DEC, VALS(q933_cause_location_vals), 0x0f,
2212 { &hf_q933_cause_value,
2213 { "Cause value", "q933.cause_value", FT_UINT8, BASE_DEC, VALS(q933_cause_code_vals), 0x7f,
2216 { &hf_q933_number_type,
2217 { "Number type", "q933.number_type", FT_UINT8, BASE_HEX, VALS(q933_number_type_vals), 0x70,
2220 { &hf_q933_numbering_plan,
2221 { "numbering plan", "q933.numbering_plan", FT_UINT8, BASE_HEX, VALS(q933_numbering_plan_vals), 0x0f,
2224 { &hf_q933_screening_ind,
2225 { "Screening indicator", "q933.screening_ind", FT_UINT8, BASE_HEX, VALS(q933_screening_indicator_vals), 0x03,
2228 { &hf_q933_presentation_ind,
2229 { "Presentation indicator", "q933.presentation_ind", FT_UINT8, BASE_HEX, VALS(q933_presentation_indicator_vals), 0x60,
2232 { &hf_q933_extension_ind,
2233 { "Extension indicator", "q933.extension_ind",
2234 FT_BOOLEAN, 8, TFS(&q933_extension_ind_value), 0x80,
2237 { &hf_q933_calling_party_number,
2238 { "Calling party number digits", "q933.calling_party_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2241 { &hf_q933_called_party_number,
2242 { "Called party number digits", "q933.called_party_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2245 { &hf_q933_connected_number,
2246 { "Connected party number digits", "q933.connected_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2249 { &hf_q933_redirecting_number,
2250 { "Redirecting party number digits", "q933.redirecting_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2252 { &hf_q933_report_type,
2253 { "Report type", "q933.report_type", FT_UINT8, BASE_DEC, VALS(q933_report_type_vals), 0x0,
2255 { &hf_q933_link_verf_txseq,
2256 { "TX Sequence", "q933.link_verification.txseq", FT_UINT8, BASE_DEC, NULL, 0x0,
2258 { &hf_q933_link_verf_rxseq,
2259 { "RX Sequence", "q933.link_verification.rxseq", FT_UINT8, BASE_DEC, NULL, 0x0,
2263 static gint *ett[] = {
2268 proto_q933 = proto_register_protocol("Q.933", "Q.933", "q933");
2269 proto_register_field_array (proto_q933, hf, array_length(hf));
2270 proto_register_subtree_array(ett, array_length(ett));
2272 register_dissector("q933", dissect_q933, proto_q933);
2276 proto_reg_handoff_q933(void)
2278 dissector_handle_t q933_handle;
2280 q933_handle = find_dissector("q933");
2281 dissector_add_uint("fr.osinl", NLPID_Q_933, q933_handle);