epan/dissectors/pidl/samr/samr.cnf cnf_dissect_lsa_BinaryString => lsarpc_dissect_str...
[wireshark-sm.git] / epan / dissectors / packet-q933.c
blob52e246c72078c6c13b3977b6e6ec85a0d67ff396
1 /* packet-q933.c
2 * Routines for Q.933 frame disassembly
3 * Guy Harris <guy@alum.mit.edu>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include "config.h"
14 #include <epan/packet.h>
15 #include <epan/expert.h>
16 #include <epan/nlpid.h>
17 #include <epan/tfs.h>
18 #include <epan/unit_strings.h>
19 #include "packet-juniper.h"
21 void proto_register_q933(void);
22 void proto_reg_handoff_q933(void);
24 static int proto_q933;
25 static int hf_q933_discriminator;
26 static int hf_q933_coding_standard;
27 static int hf_q933_information_transfer_capability;
28 static int hf_q933_transfer_mode;
29 static int hf_q933_uil1;
30 static int hf_q933_call_ref_len;
31 static int hf_q933_call_ref_flag;
32 static int hf_q933_call_ref;
33 static int hf_q933_message_type;
34 static int hf_q933_cause_location;
35 static int hf_q933_cause_value;
36 static int hf_q933_number_type;
37 static int hf_q933_numbering_plan;
38 static int hf_q933_extension_ind;
39 static int hf_q933_calling_party_number;
40 static int hf_q933_called_party_number;
41 static int hf_q933_connected_number;
42 /* static int hf_q933_redirecting_number; */
43 static int hf_q933_screening_ind;
44 static int hf_q933_presentation_ind;
45 static int hf_q933_report_type;
46 static int hf_q933_link_verf_txseq;
47 static int hf_q933_link_verf_rxseq;
48 static int hf_q933_data;
50 /* Generated from convert_proto_tree_add_text.pl */
51 static int hf_q933_user_information_layer_3_protocol;
52 static int hf_q933_additional_layer_3_protocol_information;
53 static int hf_q933_network_identification_plan;
54 static int hf_q933_map_element_type;
55 static int hf_q933_channel_type;
56 static int hf_q933_channel_indicated_by;
57 static int hf_q933_extended_audiovisual_characteristics_id;
58 static int hf_q933_location;
59 static int hf_q933_subaddress;
60 static int hf_q933_type_of_network_identification;
61 static int hf_q933_address_inclusion;
62 static int hf_q933_odd_even_indicator;
63 static int hf_q933_reverse_charging_indication;
64 static int hf_q933_call_state;
65 static int hf_q933_user_information_layer_2_protocol;
66 static int hf_q933_packet_window_size;
67 static int hf_q933_locking_shift_to_codeset;
68 static int hf_q933_non_locking_shift_to_codeset;
69 static int hf_q933_not_first_segment;
70 static int hf_q933_user_rate;
71 static int hf_q933_indicated_channel_required;
72 static int hf_q933_high_layer_characteristics_identification;
73 static int hf_q933_rejection_reason;
74 static int hf_q933_progress_description;
75 static int hf_q933_parity;
76 static int hf_q933_extended_high_layer_characteristics_id;
77 static int hf_q933_dlci;
78 static int hf_q933_recommendation;
79 static int hf_q933_mode;
80 static int hf_q933_user_information_str;
81 static int hf_q933_network_service;
82 static int hf_q933_interface_basic;
83 static int hf_q933_missing_information_element;
84 static int hf_q933_information_element;
85 static int hf_q933_condition_normal;
86 static int hf_q933_not_channel_selection;
87 static int hf_q933_network_identification_length;
88 static int hf_q933_segmented_message_type;
89 static int hf_q933_diagnostic;
90 static int hf_q933_user_specified_layer_2_protocol_information;
91 static int hf_q933_interface_identified;
92 static int hf_q933_network_specific_facility_specification;
93 static int hf_q933_data_bits;
94 static int hf_q933_default_packet_size;
95 static int hf_q933_insufficient_information_element;
96 static int hf_q933_modem_type;
97 static int hf_q933_user_information_bytes;
98 static int hf_q933_multiple_frame_establishment;
99 static int hf_q933_duplex;
100 static int hf_q933_mode_of_operation;
101 static int hf_q933_condition;
102 static int hf_q933_status;
103 static int hf_q933_repeat_indicator;
104 static int hf_q933_confirmation;
105 static int hf_q933_default_packet_size_0F;
106 static int hf_q933_interface_identifier;
107 static int hf_q933_stop_bits;
108 static int hf_q933_indicated_channel_d_channel;
109 static int hf_q933_channel_selection;
110 static int hf_q933_user_specific_diagnostic;
111 static int hf_q933_timer;
112 static int hf_q933_first_segment;
113 static int hf_q933_network_identification;
114 static int hf_q933_out_band_negotiation;
115 static int hf_q933_layer_1;
116 static int hf_q933_type_of_subaddress;
117 static int hf_q933_protocol_discriminator;
118 static int hf_q933_rate_adaption_header;
119 static int hf_q933_reason_for_redirection;
120 static int hf_q933_length;
121 static int hf_q933_diagnostics;
122 static int hf_q933_display_information;
123 static int hf_q933_cumulative_transit_delay;
124 static int hf_q933_requested_end_to_end_transit_delay;
125 static int hf_q933_max_end_to_end_transit_delay;
126 static int hf_q933_transit_delay;
127 static int hf_q933_request;
129 static int ett_q933;
130 static int ett_q933_ie;
132 static expert_field ei_q933_invalid_length;
133 static expert_field ei_q933_information_element;
135 static dissector_handle_t q933_handle;
138 * Q.933 message types.
140 #define Q933_ESCAPE 0x00
141 #define Q933_ALERTING 0x01
142 #define Q933_CALL_PROCEEDING 0x02
143 #define Q933_CONNECT 0x07
144 #define Q933_CONNECT_ACK 0x0F
145 #define Q933_PROGRESS 0x03
146 #define Q933_SETUP 0x05
147 #define Q933_DISCONNECT 0x45
148 #define Q933_RELEASE 0x4D
149 #define Q933_RELEASE_COMPLETE 0x5A
150 #define Q933_SEGMENT 0x60
151 #define Q933_STATUS 0x7D
152 #define Q933_STATUS_ENQUIRY 0x75
154 static const value_string q933_message_type_vals[] = {
155 { Q933_ESCAPE, "ESCAPE" },
156 { Q933_ALERTING, "ALERTING" },
157 { Q933_CALL_PROCEEDING, "CALL PROCEEDING" },
158 { Q933_CONNECT, "CONNECT" },
159 { Q933_CONNECT_ACK, "CONNECT ACKNOWLEDGE" },
160 { Q933_PROGRESS, "PROGRESS" },
161 { Q933_SETUP, "SETUP" },
162 { Q933_DISCONNECT, "DISCONNECT" },
163 { Q933_RELEASE, "RELEASE" },
164 { Q933_RELEASE_COMPLETE, "RELEASE COMPLETE" },
165 { Q933_SEGMENT, "SEGMENT" },
166 { Q933_STATUS, "STATUS" },
167 { Q933_STATUS_ENQUIRY, "STATUS ENQUIRY" },
168 { 0, NULL }
171 static const true_false_string tfs_call_ref_flag = {
172 "Message sent to originating side",
173 "Message sent from originating side"
177 * Information elements.
180 /* Shifted codeset values */
181 #define CS0 0x000
182 #define CS1 0x100
183 #define CS2 0x200
184 #define CS3 0x300
185 #define CS4 0x400
186 #define CS5 0x500
187 #define CS6 0x600
188 #define CS7 0x700
190 #define Q933_IE_SO_MASK 0x80 /* single-octet/variable-length mask */
192 * Single-octet IEs.
194 #define Q933_IE_SO_IDENTIFIER_MASK 0xf0 /* IE identifier mask */
195 #define Q933_IE_SO_IDENTIFIER_SHIFT 4 /* IE identifier shift */
196 #define Q933_IE_SO_IE_MASK 0x0F /* IE mask */
198 #define Q933_IE_SHIFT 0x90
199 #define Q933_IE_SHIFT_NON_LOCKING 0x08 /* non-locking shift */
200 #define Q933_IE_SHIFT_CODESET 0x07 /* codeset */
202 #define Q933_IE_REPEAT_INDICATOR 0xD0
205 * Variable-length IEs.
207 #define Q933_IE_VL_EXTENSION 0x80 /* Extension flag */
208 /* extension bit. The bit value "0" indicates that the octet continues through the */
209 /* next octet. The bit value "1" indicates that this octet is the last octet */
211 static const true_false_string q933_extension_ind_value = {
212 "last octet",
213 "information continues through the next octet",
219 * Codeset 0 (default).
221 #define Q933_IE_SEGMENTED_MESSAGE 0x00
222 #define Q933_IE_BEARER_CAPABILITY 0x04
223 #define Q933_IE_CAUSE 0x08
224 #define Q933_IE_CALL_STATE 0x14
225 #define Q933_IE_CHANNEL_IDENTIFICATION 0x18
226 #define Q933_IE_DLCI 0x19
227 #define Q933_IE_PROGRESS_INDICATOR 0x1E
228 #define Q933_IE_NETWORK_SPECIFIC_FACIL 0x20 /* Network Specific Facilities */
229 #define Q933_IE_DISPLAY 0x28
230 #define Q933_IE_E2E_TRANSIT_DELAY 0x42 /* End-to-end Transit Delay */
231 #define Q933_IE_TD_SELECTION_AND_INT 0x43 /* Transit Delay Selection and Indication */
232 #define Q933_IE_PL_BINARY_PARAMETERS 0x44 /* Packet layer binary parameters */
233 #define Q933_IE_LL_CORE_PARAMETERS 0x48 /* Link layer core parameters */
234 #define Q933_IE_LL_PROTOCOL_PARAMETERS 0x49 /* Link layer protocol parameters */
235 #define Q933_IE_REVERSE_CHARGE_IND 0x4A /* Reverse charging indication */
236 #define Q933_IE_CONNECTED_NUMBER 0x4C /* Connected Number */
237 #define Q933_IE_CONNECTED_SUBADDR 0x4D /* Connected sub-address */
238 #define Q933_IE_X_213_PRIORITY 0x50 /* X.213 priority */
239 #define Q933_IE_REPORT_TYPE 0x51
240 #define Q933_IE_LINK_INTEGRITY_VERF 0x53 /* Link integrity verification */
241 #define Q933_IE_PVC_STATUS 0x57
242 #define Q933_IE_CALLING_PARTY_NUMBER 0x6C /* Calling Party Number */
243 #define Q933_IE_CALLING_PARTY_SUBADDR 0x6D /* Calling Party Subaddress */
244 #define Q933_IE_CALLED_PARTY_NUMBER 0x70 /* Called Party Number */
245 #define Q933_IE_CALLED_PARTY_SUBADDR 0x71 /* Called Party Subaddress */
246 #define Q933_IE_TRANSIT_NETWORK_SEL 0x78 /* Transit Network Selection */
247 #define Q933_IE_LOW_LAYER_COMPAT 0x7C /* Low-Layer Compatibility */
248 #define Q933_IE_HIGH_LAYER_COMPAT 0x7D /* High-Layer Compatibility */
249 #define Q933_IE_USER_USER 0x7E /* User-User */
250 #define Q933_IE_ESCAPE 0x7F /* Escape for extension */
252 /* Codeset 0 */
253 static const value_string q933_info_element_vals0[] = {
254 { Q933_IE_SEGMENTED_MESSAGE, "Segmented message" },
255 { Q933_IE_BEARER_CAPABILITY, "Bearer capability" },
256 { Q933_IE_CAUSE, "Cause" },
257 { Q933_IE_CALL_STATE, "Call state" },
258 { Q933_IE_CHANNEL_IDENTIFICATION, "Channel identification" },
259 { Q933_IE_DLCI, "Data link connection identifier" },
260 { Q933_IE_PROGRESS_INDICATOR, "Progress indicator" },
261 { Q933_IE_NETWORK_SPECIFIC_FACIL, "Network specific facilities" },
262 { Q933_IE_E2E_TRANSIT_DELAY, "End-to-end transit delay" },
263 { Q933_IE_TD_SELECTION_AND_INT, "Transit delay selection and indication" },
264 { Q933_IE_PL_BINARY_PARAMETERS, "Packet layer binary parameters" },
265 { Q933_IE_LL_CORE_PARAMETERS, "Link layer core parameters" },
266 { Q933_IE_LL_PROTOCOL_PARAMETERS, "Link layer protocol parameters" },
267 { Q933_IE_REVERSE_CHARGE_IND, "Reverse charging indication" },
268 { Q933_IE_CONNECTED_NUMBER, "Connected number" },
269 { Q933_IE_CONNECTED_SUBADDR, "Connected subaddress" },
270 { Q933_IE_X_213_PRIORITY, "X.213 priority" },
271 { Q933_IE_REPORT_TYPE, "Report type" },
272 { Q933_IE_LINK_INTEGRITY_VERF, "Link integrity verification" },
273 { Q933_IE_PVC_STATUS, "PVC status" },
274 { Q933_IE_CALLING_PARTY_NUMBER, "Calling party number" },
275 { Q933_IE_CALLING_PARTY_SUBADDR, "Calling party subaddress" },
276 { Q933_IE_CALLED_PARTY_NUMBER, "Called party number" },
277 { Q933_IE_CALLED_PARTY_SUBADDR, "Called party subaddress" },
278 { Q933_IE_TRANSIT_NETWORK_SEL, "Transit network selection" },
279 { Q933_IE_LOW_LAYER_COMPAT, "Low-layer compatibility" },
280 { Q933_IE_HIGH_LAYER_COMPAT, "High-layer compatibility" },
281 { Q933_IE_USER_USER, "User-user" },
282 { Q933_IE_ESCAPE, "Escape" },
283 { 0, NULL }
285 /* Codeset 1 */
286 static const value_string q933_info_element_vals1[] = {
287 { 0, NULL }
289 /* Codeset 2 */
290 static const value_string q933_info_element_vals2[] = {
291 { 0, NULL }
293 /* Codeset 3 */
294 static const value_string q933_info_element_vals3[] = {
295 { 0, NULL }
297 /* Codeset 4 */
298 static const value_string q933_info_element_vals4[] = {
299 { 0, NULL }
302 /* Codeset 5 */
303 #define Q933_IE_ANSI_REPORT_TYPE 0x01
304 #define Q933_IE_ANSI_LINK_INTEGRITY_VERF 0x03
305 #define Q933_IE_ANSI_PVC_STATUS 0x07
307 /* Codeset 5 */
308 static const value_string q933_info_element_vals5[] = {
309 { Q933_IE_ANSI_REPORT_TYPE, "Report type (ANSI)" },
310 { Q933_IE_REPORT_TYPE, "Report type (CCITT)" },
311 { Q933_IE_ANSI_LINK_INTEGRITY_VERF, "Keep Alive (ANSI)" },
312 { Q933_IE_LINK_INTEGRITY_VERF, "Keep Alive (CCITT)" },
313 { Q933_IE_ANSI_PVC_STATUS, "PVC Status (ANSI)" },
314 { Q933_IE_PVC_STATUS, "PVC Status (CCITT)" },
315 { 0, NULL }
317 /* Codeset 6 */
318 static const value_string q933_info_element_vals6[] = {
319 { 0, NULL }
321 /* Codeset 7 */
322 static const value_string q933_info_element_vals7[] = {
323 { 0, NULL }
326 /* Codeset array */
327 #define NUM_INFO_ELEMENT_VALS (Q933_IE_SHIFT_CODESET+1)
328 static const value_string *q933_info_element_vals[NUM_INFO_ELEMENT_VALS] = {
329 q933_info_element_vals0,
330 q933_info_element_vals1,
331 q933_info_element_vals2,
332 q933_info_element_vals3,
333 q933_info_element_vals4,
334 q933_info_element_vals5,
335 q933_info_element_vals6,
336 q933_info_element_vals7,
339 static const value_string q933_repeat_indication_vals[] = {
340 { 0x2, "Prioritized list" },
341 { 0, NULL }
345 * ITU-standardized coding.
347 #define Q933_ITU_STANDARDIZED_CODING 0x00
350 * Dissect a Segmented message information element.
352 static void
353 dissect_q933_segmented_message_ie(tvbuff_t *tvb, packet_info *pinfo, int offset, int len,
354 proto_tree *tree)
356 uint8_t octet;
357 if (len != 2) {
358 proto_tree_add_expert_format(tree, pinfo, &ei_q933_invalid_length, tvb, offset, len, "Segmented message: length is %d, should be 2", len);
359 return;
362 octet = tvb_get_uint8(tvb, offset);
363 if (octet & 0x80) {
364 proto_tree_add_item(tree, hf_q933_first_segment, tvb, offset, 1, ENC_NA);
365 } else {
366 proto_tree_add_item(tree, hf_q933_not_first_segment, tvb, offset, 1, ENC_NA);
368 proto_tree_add_item(tree, hf_q933_segmented_message_type, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
372 * Dissect a Bearer capability or Low-layer compatibility information element.
374 static const value_string q933_coding_standard_vals[] = {
375 { 0x0, "ITU-T standardized coding" },
376 { 0x1, "ISO/IEC standard" },
377 { 0x2, "National standard" },
378 { 0x3, "Standard defined for this particular network" },
379 { 0, NULL }
382 static const value_string q933_information_transfer_capability_vals[] = {
383 { 0x08, "Unrestricted digital information" },
384 { 0, NULL }
387 static const value_string q933_transfer_mode_vals[] = {
388 { 0x01, "Frame mode" },
389 { 0, NULL }
392 static const value_string q933_uil1_vals[] = {
393 { 0x01, "V.110/I.460/X.30 rate adaption" },
394 { 0x02, "Recommendation G.711 u-law" },
395 { 0x03, "Recommendation G.711 A-law" },
396 { 0x04, "Recommendation G.721 32 kbit/s ADPCM and Recommendation I.460" },
397 { 0x05, "Recommendation H.221 and H.242" },
398 { 0x06, "Recommendation H.223 and H.245" },
399 { 0x07, "Non-ITU-T-standardized rate adaption" },
400 { 0x08, "V.120 rate adaption" },
401 { 0x09, "X.31 HDLC flag stuffing" },
402 { 0, NULL },
405 static const value_string q933_l1_user_rate_vals[] = {
406 { 0x00, "Rate indicated by E-bits" },
407 { 0x01, "0.6 kbit/s" },
408 { 0x02, "1.2 kbit/s" },
409 { 0x03, "2.4 kbit/s" },
410 { 0x04, "3.6 kbit/s" },
411 { 0x05, "4.8 kbit/s" },
412 { 0x06, "7.2 kbit/s" },
413 { 0x07, "8 kbit/s" },
414 { 0x08, "9.6 kbit/s" },
415 { 0x09, "14.4 kbit/s" },
416 { 0x0A, "16 kbit/s" },
417 { 0x0B, "19.2 kbit/s" },
418 { 0x0C, "32 kbit/s" },
419 { 0x0E, "48 kbit/s" },
420 { 0x0F, "56 kbit/s" },
421 { 0x10, "64 kbit/s "},
422 { 0x15, "0.1345 kbit/s" },
423 { 0x16, "0.100 kbit/s" },
424 { 0x17, "0.075/1.2 kbit/s" },
425 { 0x18, "1.2/0.075 kbit/s" },
426 { 0x19, "0.050 kbit/s" },
427 { 0x1A, "0.075 kbit/s" },
428 { 0x1B, "0.110 kbit/s" },
429 { 0x1C, "0.150 kbit/s" },
430 { 0x1D, "0.200 kbit/s" },
431 { 0x1E, "0.300 kbit/s" },
432 { 0x1F, "12 kbit/s" },
433 { 0, NULL }
436 static const value_string q933_l1_stop_bits_vals[] = {
437 { 1, "1" },
438 { 2, "1.5" },
439 { 3, "2" },
440 { 0, NULL }
443 static const value_string q933_l1_data_bits_vals[] = {
444 { 1, "5" },
445 { 2, "7" },
446 { 3, "8" },
447 { 0, NULL }
450 static const value_string q933_l1_parity_vals[] = {
451 { 0x00, "Odd" },
452 { 0x02, "Even" },
453 { 0x03, "None" },
454 { 0x04, "Forced to 0" },
455 { 0x05, "Forced to 1" },
456 { 0, NULL }
459 #define Q933_UIL2_USER_SPEC 0x10
461 static const value_string q933_uil2_vals[] = {
462 { 0x01, "Basic mode ISO 1745" },
463 { 0x06, "X.25, link level" },
464 { 0x07, "X.25 multilink" },
465 { 0x08, "T.71 Extended LAPB" },
466 { 0x09, "HDLC ARM" },
467 { 0x0A, "HDLC NRM" },
468 { 0x0B, "HDLC ABM" },
469 { 0x0C, "ISO 8802/2 LLC" },
470 { 0x0D, "X.75 Single Link Procedure" },
471 { 0x0E, "Q.922" },
472 { 0x0F, "Core aspects of Q.922" },
473 { Q933_UIL2_USER_SPEC, "User-specified" },
474 { 0x11, "ISO 7776 DTE-DTE operation" },
475 { 0, NULL }
478 static const value_string q933_address_inclusion_vals[] = {
479 { 0x01, "Address included" },
480 { 0x02, "Encapsulation of logical control frame" },
481 { 0, NULL }
484 static const value_string q933_mode_vals[] = {
485 { 1, "Normal mode" },
486 { 2, "Extended mode" },
487 { 0, NULL }
490 #define Q933_UIL3_X25_PL 0x06
491 #define Q933_UIL3_ISO_8208 0x07 /* X.25-based */
492 #define Q933_UIL3_X223 0x08 /* X.25-based */
493 #define Q933_UIL3_TR_9577 0x0B
494 #define Q933_UIL3_USER_SPEC 0x10
496 static const value_string q933_uil3_vals[] = {
497 { Q933_UIL3_X25_PL, "X.25, packet layer" },
498 { Q933_UIL3_ISO_8208, "ISO/IEC 8208" },
499 { Q933_UIL3_X223, "X.223/ISO 8878" },
500 { 0x09, "ISO/IEC 8473" },
501 { 0x0A, "T.70" },
502 { Q933_UIL3_TR_9577, "ISO/IEC TR 9577" },
503 { Q933_UIL3_USER_SPEC, "User-specified" },
504 { 0, NULL }
507 static void
508 dissect_q933_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree)
510 unsigned int discriminator = tvb_get_uint8(tvb, offset);
512 if (discriminator == NLPID_Q_933) {
513 proto_tree_add_uint_format_value(tree, hf_q933_discriminator,
514 tvb, offset, 1, discriminator,
515 "Q.933");
516 } else if (discriminator == NLPID_Q_2931) {
517 proto_tree_add_uint_format_value(tree, hf_q933_discriminator,
518 tvb, offset, 1, discriminator,
519 "Q.2931");
520 } else if ((discriminator >= 16 && discriminator < 63)
521 || ((discriminator >= 80) && (discriminator < 254))) {
522 proto_tree_add_uint_format_value(tree, hf_q933_discriminator,
523 tvb, offset, 1, discriminator,
524 "Network layer or layer 3 protocol (0x%02X)",
525 discriminator);
526 } else if (discriminator >= 64 && discriminator <= 79) {
527 proto_tree_add_uint_format_value(tree, hf_q933_discriminator,
528 tvb, offset, 1, discriminator,
529 "National use (0x%02X)",
530 discriminator);
531 } else {
532 proto_tree_add_uint_format_value(tree, hf_q933_discriminator,
533 tvb, offset, 1, discriminator,
534 "Reserved (0x%02X)",
535 discriminator);
539 static void
540 dissect_q933_bearer_capability_ie(tvbuff_t *tvb, int offset, int len,
541 proto_tree *tree)
543 uint8_t octet;
544 uint8_t coding_standard;
545 uint8_t uil2_protocol;
546 uint8_t uil3_protocol;
548 if (len == 0)
549 return;
550 octet = tvb_get_uint8(tvb, offset);
551 coding_standard = octet & 0x60;
552 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
554 * We don't know how the bearer capability is encoded,
555 * so just dump it as data and be done with it.
557 proto_tree_add_item(tree, hf_q933_data, tvb, offset, len, ENC_NA);
558 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
559 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
560 return;
562 proto_tree_add_uint(tree, hf_q933_information_transfer_capability, tvb, offset, 1, octet);
563 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
564 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
565 offset += 1;
566 len -= 1;
569 * XXX - only in Low-layer compatibility information element.
571 if (!(octet & Q933_IE_VL_EXTENSION)) {
572 if (len == 0)
573 return;
574 proto_tree_add_item(tree, hf_q933_out_band_negotiation, tvb, offset, 1, ENC_NA);
575 offset += 1;
576 len -= 1;
579 if (len == 0)
580 return;
581 octet = tvb_get_uint8(tvb, offset);
582 proto_tree_add_uint(tree, hf_q933_transfer_mode, tvb, offset, 1, octet);
583 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
584 offset += 1;
585 len -= 1;
587 if (len == 0)
588 return;
589 octet = tvb_get_uint8(tvb, offset);
590 if ((octet & 0x60) == 0x20) {
592 * Layer 1 information.
594 proto_tree_add_uint(tree, hf_q933_uil1, tvb, offset, 1, octet);
595 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
596 offset += 1;
597 len -= 1;
599 if (octet & Q933_IE_VL_EXTENSION)
600 goto l1_done;
601 if (len == 0)
602 return;
603 octet = tvb_get_uint8(tvb, offset);
604 proto_tree_add_item(tree, hf_q933_layer_1, tvb, offset, 1, ENC_NA);
605 proto_tree_add_item(tree, hf_q933_user_rate, tvb, offset, 1, ENC_BIG_ENDIAN);
606 offset += 1;
607 len -= 1;
609 if (octet & Q933_IE_VL_EXTENSION)
610 goto l1_done;
611 if (len == 0)
612 return;
613 octet = tvb_get_uint8(tvb, offset);
614 proto_tree_add_item(tree, hf_q933_rate_adaption_header, tvb, offset, 1, ENC_NA);
615 proto_tree_add_item(tree, hf_q933_multiple_frame_establishment, tvb, offset, 1, ENC_NA);
616 proto_tree_add_item(tree, hf_q933_mode_of_operation, tvb, offset, 1, ENC_NA);
617 offset += 1;
618 len -= 1;
620 if (octet & Q933_IE_VL_EXTENSION)
621 goto l1_done;
622 if (len == 0)
623 return;
624 octet = tvb_get_uint8(tvb, offset);
625 proto_tree_add_item(tree, hf_q933_stop_bits, tvb, offset, 1, ENC_BIG_ENDIAN);
626 proto_tree_add_item(tree, hf_q933_data_bits, tvb, offset, 1, ENC_BIG_ENDIAN);
627 proto_tree_add_item(tree, hf_q933_parity, tvb, offset, 1, ENC_BIG_ENDIAN);
628 offset += 1;
629 len -= 1;
631 if (octet & Q933_IE_VL_EXTENSION)
632 goto l1_done;
633 if (len == 0)
634 return;
635 proto_tree_add_item(tree, hf_q933_duplex, tvb, offset, 1, ENC_NA);
636 proto_tree_add_item(tree, hf_q933_modem_type, tvb, offset, 1, ENC_BIG_ENDIAN);
637 offset += 1;
638 len -= 1;
640 l1_done:
643 if (len == 0)
644 return;
645 octet = tvb_get_uint8(tvb, offset);
646 if ((octet & 0x60) == 0x40) {
648 * Layer 2 information.
650 uil2_protocol = octet & 0x1F;
651 proto_tree_add_item(tree, hf_q933_user_information_layer_2_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
652 offset += 1;
653 len -= 1;
656 * XXX - only in Low-layer compatibility information element.
658 if (octet & Q933_IE_VL_EXTENSION)
659 goto l2_done;
660 if (len == 0)
661 return;
662 if (uil2_protocol == Q933_UIL2_USER_SPEC) {
663 proto_tree_add_item(tree, hf_q933_user_specified_layer_2_protocol_information, tvb, offset, 1, ENC_BIG_ENDIAN);
664 } else {
665 proto_tree_add_item(tree, hf_q933_address_inclusion, tvb, offset, 1, ENC_BIG_ENDIAN);
667 offset += 1;
668 len -= 1;
670 l2_done:
673 if (len == 0)
674 return;
675 octet = tvb_get_uint8(tvb, offset);
676 if ((octet & 0x60) == 0x60) {
678 * Layer 3 information.
680 uil3_protocol = octet & 0x1F;
681 proto_tree_add_item(tree, hf_q933_user_information_layer_3_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
682 offset += 1;
683 len -= 1;
687 * XXX - only in Low-layer compatibility information element.
689 if (octet & Q933_IE_VL_EXTENSION)
690 goto l3_done;
691 if (len == 0)
692 return;
693 octet = tvb_get_uint8(tvb, offset);
694 switch (uil3_protocol) {
696 case Q933_UIL3_X25_PL:
697 case Q933_UIL3_ISO_8208:
698 case Q933_UIL3_X223:
699 proto_tree_add_item(tree, hf_q933_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
700 offset += 1;
701 len -= 1;
703 if (octet & Q933_IE_VL_EXTENSION)
704 goto l3_done;
705 if (len == 0)
706 return;
707 octet = tvb_get_uint8(tvb, offset);
708 proto_tree_add_item(tree, hf_q933_default_packet_size_0F, tvb, offset, 1, ENC_BIG_ENDIAN);
709 offset += 1;
710 len -= 1;
712 if (octet & Q933_IE_VL_EXTENSION)
713 goto l3_done;
714 if (len == 0)
715 return;
716 proto_tree_add_item(tree, hf_q933_packet_window_size, tvb, offset, 1, ENC_BIG_ENDIAN);
717 /*offset += 1;*/
718 /*len -= 1;*/
719 break;
721 case Q933_UIL3_USER_SPEC:
722 proto_tree_add_uint_format_value(tree, hf_q933_default_packet_size, tvb, offset, 1,
723 1 << (octet & 0x0F), "%u octets", 1 << (octet & 0x0F));
724 /*offset += 1;*/
725 /*len -= 1;*/
726 break;
728 case Q933_UIL3_TR_9577:
729 if (octet & Q933_IE_VL_EXTENSION)
730 goto l3_done;
731 #if 0 /* XXX: len is always >0 at this point; is field always 2 bytes (if not Q933_IE_VL_EXTENSION) ? */
732 if (len == 0)
733 return;
734 #endif
735 proto_tree_add_item(tree, hf_q933_additional_layer_3_protocol_information, tvb, offset, 2, ENC_BIG_ENDIAN);
736 /*offset += 2;*/
737 /*len -= 2;*/
738 break;
741 l3_done:
746 * Dissect a Cause information element.
750 static const value_string q933_cause_location_vals[] = {
751 { 0x00, "User (U)" },
752 { 0x01, "Private network serving the local user (LPN)" },
753 { 0x02, "Public network serving the local user (LN)" },
754 { 0x03, "Transit network (TN)" },
755 { 0x04, "Public network serving the remote user (RLN)" },
756 { 0x05, "Private network serving the remote user (RPN)" },
757 { 0x07, "International network (INTL)" },
758 { 0x0A, "Network beyond interworking point (BI)" },
759 { 0, NULL }
762 static const value_string q933_cause_recommendation_vals[] = {
763 { 0x00, "Q.933" },
764 { 0x03, "X.21" },
765 { 0x04, "X.25" },
766 { 0x05, "Q.1031/Q.1051" },
767 { 0, NULL }
771 * Cause codes for Cause.
773 #define Q933_CAUSE_UNALLOC_NUMBER 0x01
774 #define Q933_CAUSE_NO_ROUTE_TO_DEST 0x03
775 #define Q933_CAUSE_CALL_REJECTED 0x15
776 #define Q933_CAUSE_NUMBER_CHANGED 0x16
777 #define Q933_CAUSE_ACCESS_INFO_DISC 0x2B
778 #define Q933_CAUSE_QOS_UNAVAILABLE 0x31
779 #define Q933_CAUSE_CHAN_NONEXISTENT 0x52
780 #define Q933_CAUSE_INCOMPATIBLE_DEST 0x58
781 #define Q933_CAUSE_MAND_IE_MISSING 0x60
782 #define Q933_CAUSE_MT_NONEX_OR_UNIMPL 0x61
783 #define Q933_CAUSE_IE_NONEX_OR_UNIMPL 0x63
784 #define Q933_CAUSE_INVALID_IE_CONTENTS 0x64
785 #define Q933_CAUSE_MSG_INCOMPAT_W_CS 0x65
786 #define Q933_CAUSE_REC_TIMER_EXP 0x66
788 static const value_string q933_cause_code_vals[] = {
789 { 0x00, "Valid cause code not yet received" },
790 { Q933_CAUSE_UNALLOC_NUMBER, "Unallocated (unassigned) number" },
791 { 0x02, "No route to specified transit network" },
792 { Q933_CAUSE_NO_ROUTE_TO_DEST, "No route to destination" },
793 { 0x04, "Send special information tone" },
794 { 0x05, "Misdialled trunk prefix" },
795 { 0x06, "Channel unacceptable" },
796 { 0x07, "Call awarded and being delivered in an established channel" },
797 { 0x08, "Prefix 0 dialed but not allowed" },
798 /* Q.850 - "Preemption" */
799 { 0x09, "Prefix 1 dialed but not allowed" },
800 /* Q.850 - "Preemption - circuit reserved for reuse" */
801 { 0x0A, "Prefix 1 dialed but not required" },
802 { 0x0B, "More digits received than allowed, call is proceeding" },
803 { 0x0E, "QoR: ported number" },
804 { 0x10, "Normal call clearing" },
805 { 0x11, "User busy" },
806 { 0x12, "No user responding" },
807 { 0x13, "No answer from user (user alerted)" },
808 { 0x14, "Subscriber absent" },
809 { Q933_CAUSE_CALL_REJECTED, "Call rejected" },
810 { Q933_CAUSE_NUMBER_CHANGED, "Number changed" },
811 { 0x17, "Reverse charging rejected" },
812 /* Q.850 - "Redirection to new destination" */
813 { 0x18, "Call suspended" },
814 /* Q.850 Amendment 1 - "Call rejected due to feature at the destination" */
815 { 0x19, "Call resumed" },
816 /* Q.850 - "Exchange routing error */
817 { 0x1A, "Non-selected user clearing" },
818 { 0x1B, "Destination out of order" },
819 { 0x1C, "Invalid number format (incomplete number)" },
820 { 0x1D, "Facility rejected" },
821 { 0x1E, "Response to STATUS ENQUIRY" },
822 { 0x1F, "Normal unspecified" },
823 { 0x21, "Circuit out of order" },
824 { 0x22, "No circuit/channel available" },
825 { 0x23, "Destination unattainable" },
826 { 0x25, "Degraded service" },
827 { 0x26, "Network out of order" },
828 { 0x27, "Transit delay range cannot be achieved" },
829 /* Q.850 - "Permanent frame mode connection out of service" */
830 { 0x28, "Throughput range cannot be achieved" },
831 /* Q.850 - "Permanent frame mode connection operational" */
832 { 0x29, "Temporary failure" },
833 { 0x2A, "Switching equipment congestion" },
834 { Q933_CAUSE_ACCESS_INFO_DISC, "Access information discarded" },
835 { 0x2C, "Requested circuit/channel not available" },
836 { 0x2D, "Pre-empted" },
837 { 0x2E, "Precedence call blocked" },
838 { 0x2F, "Resources unavailable, unspecified" },
839 { Q933_CAUSE_QOS_UNAVAILABLE, "Quality of service unavailable" },
840 { 0x32, "Requested facility not subscribed" },
841 { 0x33, "Reverse charging not allowed" },
842 { 0x34, "Outgoing calls barred" },
843 { 0x35, "Outgoing calls barred within CUG" },
844 { 0x36, "Incoming calls barred" },
845 { 0x37, "Incoming calls barred within CUG" },
846 { 0x38, "Call waiting not subscribed" },
847 { 0x39, "Bearer capability not authorized" },
848 { 0x3A, "Bearer capability not presently available" },
849 { 0x3E, "Inconsistency in designated outgoing access information and subscriber class" },
850 { 0x3F, "Service or option not available, unspecified" },
851 { 0x41, "Bearer capability not implemented" },
852 { 0x42, "Channel type not implemented" },
853 { 0x43, "Transit network selection not implemented" },
854 { 0x44, "Message not implemented" },
855 { 0x45, "Requested facility not implemented" },
856 { 0x46, "Only restricted digital information bearer capability is available" },
857 { 0x4F, "Service or option not implemented, unspecified" },
858 { 0x51, "Invalid call reference value" },
859 { Q933_CAUSE_CHAN_NONEXISTENT, "Identified channel does not exist" },
860 { 0x53, "Call identity does not exist for suspended call" },
861 { 0x54, "Call identity in use" },
862 { 0x55, "No call suspended" },
863 { 0x56, "Call having the requested call identity has been cleared" },
864 { 0x57, "Called user not member of CUG" },
865 { Q933_CAUSE_INCOMPATIBLE_DEST, "Incompatible destination" },
866 { 0x59, "Non-existent abbreviated address entry" },
867 { 0x5A, "Destination address missing, and direct call not subscribed" },
868 /* Q.850 - "Non-existent CUG" */
869 { 0x5B, "Invalid transit network selection (national use)" },
870 { 0x5C, "Invalid facility parameter" },
871 { 0x5D, "Mandatory information element is missing" },
872 { 0x5F, "Invalid message, unspecified" },
873 { Q933_CAUSE_MAND_IE_MISSING, "Mandatory information element is missing" },
874 { Q933_CAUSE_MT_NONEX_OR_UNIMPL,"Message type non-existent or not implemented" },
875 { 0x62, "Message not compatible with call state or message type non-existent or not implemented" },
876 { Q933_CAUSE_IE_NONEX_OR_UNIMPL,"Information element non-existent or not implemented" },
877 { Q933_CAUSE_INVALID_IE_CONTENTS,"Invalid information element contents" },
878 { Q933_CAUSE_MSG_INCOMPAT_W_CS, "Message not compatible with call state" },
879 { Q933_CAUSE_REC_TIMER_EXP, "Recovery on timer expiry" },
880 { 0x67, "Parameter non-existent or not implemented - passed on" },
881 { 0x6E, "Message with unrecognized parameter discarded" },
882 { 0x6F, "Protocol error, unspecified" },
883 { 0x7F, "Internetworking, unspecified" },
884 { 0, NULL }
887 static const value_string q933_cause_condition_vals[] = {
888 { 0x00, "Unknown" },
889 { 0x01, "Permanent" },
890 { 0x02, "Transient" },
891 { 0x00, NULL }
894 #define Q933_REJ_USER_SPECIFIC 0x00
895 #define Q933_REJ_IE_MISSING 0x04
896 #define Q933_REJ_IE_INSUFFICIENT 0x08
898 static const value_string q933_rejection_reason_vals[] = {
899 { 0x00, "User specific" },
900 { 0x04, "Information element missing" },
901 { 0x08, "Information element contents are not sufficient" },
902 { 0x00, NULL }
906 static void
907 dissect_q933_cause_ie(tvbuff_t *tvb, int offset, int len,
908 proto_tree *tree, int hf_cause_value)
910 uint8_t octet;
911 uint8_t cause_value;
912 uint8_t coding_standard;
913 uint8_t rejection_reason;
915 if (len == 0)
916 return;
917 octet = tvb_get_uint8(tvb, offset);
918 coding_standard = octet & 0x60;
919 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
921 * We don't know how the cause is encoded,
922 * so just dump it as data and be done with it.
924 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
925 proto_tree_add_item(tree, hf_q933_data, tvb, offset, len, ENC_NA);
926 return;
928 proto_tree_add_uint(tree, hf_q933_cause_location, tvb, offset, 1, octet);
929 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
930 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
931 offset += 1;
932 len -= 1;
934 if (!(octet & Q933_IE_VL_EXTENSION)) {
935 if (len == 0)
936 return;
937 octet = tvb_get_uint8(tvb, offset);
938 proto_tree_add_item(tree, hf_q933_recommendation, tvb, offset, 1, ENC_BIG_ENDIAN);
939 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
940 offset += 1;
941 len -= 1;
944 if (len == 0)
945 return;
946 octet = tvb_get_uint8(tvb, offset);
947 cause_value = octet & 0x7F;
948 proto_tree_add_uint(tree, hf_cause_value, tvb, offset, 1, cause_value);
949 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
950 offset += 1;
951 len -= 1;
953 if (len == 0)
954 return;
955 switch (cause_value) {
957 case Q933_CAUSE_UNALLOC_NUMBER:
958 case Q933_CAUSE_NO_ROUTE_TO_DEST:
959 case Q933_CAUSE_QOS_UNAVAILABLE:
960 proto_tree_add_item(tree, hf_q933_network_service, tvb, offset, 1, ENC_NA);
961 proto_tree_add_item(tree, hf_q933_condition_normal, tvb, offset, 1, ENC_NA);
962 proto_tree_add_item(tree, hf_q933_condition, tvb, offset, 1, ENC_BIG_ENDIAN);
963 break;
965 case Q933_CAUSE_CALL_REJECTED:
966 rejection_reason = octet & 0x7C;
967 proto_tree_add_item(tree, hf_q933_rejection_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
968 proto_tree_add_item(tree, hf_q933_condition, tvb, offset, 1, ENC_BIG_ENDIAN);
969 offset += 1;
970 len -= 1;
972 if (len == 0)
973 return;
974 switch (rejection_reason) {
976 case Q933_REJ_USER_SPECIFIC:
977 proto_tree_add_item(tree, hf_q933_user_specific_diagnostic, tvb, offset, len, ENC_NA);
978 break;
980 case Q933_REJ_IE_MISSING:
981 proto_tree_add_item(tree, hf_q933_missing_information_element, tvb, offset, 1, ENC_BIG_ENDIAN);
982 break;
984 case Q933_REJ_IE_INSUFFICIENT:
985 proto_tree_add_item(tree, hf_q933_insufficient_information_element, tvb, offset, 1, ENC_BIG_ENDIAN);
986 break;
988 default:
989 proto_tree_add_item(tree, hf_q933_diagnostic, tvb, offset, len, ENC_NA);
990 break;
992 break;
994 case Q933_CAUSE_ACCESS_INFO_DISC:
995 case Q933_CAUSE_INCOMPATIBLE_DEST:
996 case Q933_CAUSE_MAND_IE_MISSING:
997 case Q933_CAUSE_IE_NONEX_OR_UNIMPL:
998 case Q933_CAUSE_INVALID_IE_CONTENTS:
999 do {
1000 proto_tree_add_item(tree, hf_q933_information_element, tvb, offset, 1, ENC_BIG_ENDIAN);
1001 offset += 1;
1002 len -= 1;
1003 } while (len != 0);
1004 break;
1006 case Q933_CAUSE_MT_NONEX_OR_UNIMPL:
1007 case Q933_CAUSE_MSG_INCOMPAT_W_CS:
1008 proto_tree_add_item(tree, hf_q933_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1009 break;
1011 case Q933_CAUSE_REC_TIMER_EXP:
1012 if (len < 3)
1013 return;
1014 proto_tree_add_item(tree, hf_q933_timer, tvb, offset, 3, ENC_ASCII);
1015 break;
1017 default:
1018 proto_tree_add_item(tree, hf_q933_diagnostics, tvb, offset, len, ENC_NA);
1023 * Dissect a Call state information element.
1025 static const value_string q933_call_state_vals[] = {
1026 { 0x00, "Null" },
1027 { 0x01, "Call initiated" },
1028 { 0x02, "Overlap sending" },
1029 { 0x03, "Outgoing call proceeding" },
1030 { 0x04, "Call delivered" },
1031 { 0x06, "Call present" },
1032 { 0x07, "Call received" },
1033 { 0x08, "Connect request" },
1034 { 0x09, "Incoming call proceeding" },
1035 { 0x0A, "Active" },
1036 { 0x0B, "Disconnect request" },
1037 { 0x0C, "Disconnect indication" },
1038 { 0x0F, "Suspend request" },
1039 { 0x12, "Resume request" },
1040 { 0x13, "Release request" },
1041 { 0x16, "Call abort"},
1042 { 0x19, "Overlap receiving" },
1043 { 0x3D, "Restart request" },
1044 { 0x3E, "Restart" },
1045 { 0, NULL }
1048 static void
1049 dissect_q933_call_state_ie(tvbuff_t *tvb, int offset, int len,
1050 proto_tree *tree)
1052 uint8_t octet;
1053 uint8_t coding_standard;
1055 if (len == 0)
1056 return;
1057 octet = tvb_get_uint8(tvb, offset);
1058 coding_standard = octet & 0x60;
1059 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
1060 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
1062 * We don't know how the call state is encoded,
1063 * so just dump it as data and be done with it.
1065 proto_tree_add_item(tree, hf_q933_data, tvb, offset, len, ENC_NA);
1066 return;
1068 proto_tree_add_item(tree, hf_q933_call_state, tvb, offset, 1, ENC_BIG_ENDIAN);
1072 * Dissect a Report Type information element.
1074 #define Q933_IE_REPORT_TYPE_FULL_STATUS 0x00
1075 #define Q933_IE_REPORT_TYPE_LINK_VERIFY 0x01
1076 #define Q933_IE_REPORT_TYPE_ASYNC_PVC_STATUS 0x02
1078 static const value_string q933_report_type_vals[] = {
1079 { Q933_IE_REPORT_TYPE_FULL_STATUS, "Full Status" },
1080 { Q933_IE_REPORT_TYPE_LINK_VERIFY, "Link verify" },
1081 { Q933_IE_REPORT_TYPE_ASYNC_PVC_STATUS, "Async PVC Status" },
1082 { 0, NULL }
1085 static void
1086 dissect_q933_report_type_ie(tvbuff_t *tvb, int offset, int len,
1087 proto_tree *tree)
1089 uint8_t report_type;
1091 if (len == 0)
1092 return;
1094 report_type = tvb_get_uint8(tvb, offset);
1095 proto_tree_add_uint(tree, hf_q933_report_type, tvb, offset, 1, report_type);
1099 * Dissect a Link Integrity Verification information element.
1101 static void
1102 dissect_q933_link_integrity_verf_ie(tvbuff_t *tvb, int offset, int len,
1103 proto_tree *tree)
1105 uint8_t txseq,rxseq;
1107 if (len < 2)
1108 return;
1110 txseq = tvb_get_uint8(tvb, offset);
1111 rxseq = tvb_get_uint8(tvb, offset+1);
1113 proto_tree_add_uint(tree, hf_q933_link_verf_txseq, tvb, offset, 1, txseq);
1114 proto_tree_add_uint(tree, hf_q933_link_verf_rxseq, tvb, offset+1, 1, rxseq);
1119 * Dissect a PVC status information element.
1121 static const value_string q933_pvc_status_vals[] = {
1122 {0x00, "Inactive"},
1123 {0x01, "Active"},
1124 {0x02, "Deleted"},
1125 {0x04, "New"},
1126 {0x05, "New, Active"},
1127 {0, NULL}
1130 static void
1131 dissect_q933_pvc_status_ie(tvbuff_t *tvb, int offset, int len,
1132 proto_tree *tree)
1134 uint32_t dlci;
1135 uint8_t dlci_len=2;
1137 if (len < 3)
1138 return;
1140 dlci = ((tvb_get_uint8(tvb, offset) & 0x3F) << 4) |
1141 ((tvb_get_uint8(tvb, offset+1) & 0x78) >> 3);
1143 /* first determine the DLCI field length */
1144 if (len == 4) {
1145 dlci = (dlci << 6) | ((tvb_get_uint8(tvb, offset+2) & 0x7E) >> 1);
1146 dlci_len++;
1147 } else if (len == 5) {
1148 dlci = (dlci << 13) | (tvb_get_uint8(tvb, offset+3) & 0x7F) |
1149 ((tvb_get_uint8(tvb, offset+4) & 0x7E) >> 1);
1150 dlci_len+=2;
1153 proto_tree_add_uint(tree, hf_q933_dlci, tvb, offset, dlci_len, dlci);
1154 proto_tree_add_item(tree, hf_q933_status, tvb, offset+dlci_len, 1, ENC_BIG_ENDIAN);
1158 * Dissect a Channel identification information element.
1160 #define Q933_INTERFACE_IDENTIFIED 0x40
1161 #define Q933_NOT_BASIC_CHANNEL 0x20
1163 static const value_string q933_basic_channel_selection_vals[] = {
1164 { 0x00, "No channel" },
1165 { 0x01, "B1 channel" },
1166 { 0x02, "B2 channel" },
1167 { 0x03, "Any channel" },
1168 { 0, NULL }
1171 static const value_string q933_not_basic_channel_selection_vals[] = {
1172 { 0x00, "No channel" },
1173 { 0x01, "Channel indicated in following octets" },
1174 { 0x03, "Any channel" },
1175 { 0, NULL }
1178 #define Q933_IS_SLOT_MAP 0x10
1180 static const value_string q933_element_type_vals[] = {
1181 { 0x03, "B-channel units" },
1182 { 0x06, "H0-channel units" },
1183 { 0x08, "H11-channel units" },
1184 { 0x09, "H12-channel units" },
1185 { 0, NULL }
1188 static const true_false_string tfs_explicitly_implicitly_identified = { "Explicitly identified", "Implicitly identified" };
1189 static const true_false_string tfs_not_basic_basic = { "Not basic", "Basic" };
1190 static const true_false_string tfs_required_preferred = { "Required", "Preferred" };
1191 static const true_false_string tfs_dchannel_not_dchannel = { "D-channel", "Not D-channel" };
1192 static const true_false_string tfs_slot_map_number = { "slot map", "number" };
1195 static void
1196 dissect_q933_channel_identification_ie(tvbuff_t *tvb, int offset, int len,
1197 proto_tree *tree)
1199 uint8_t octet;
1200 int identifier_offset;
1201 int identifier_len;
1202 uint8_t coding_standard;
1204 if (len == 0)
1205 return;
1206 octet = tvb_get_uint8(tvb, offset);
1207 proto_tree_add_item(tree, hf_q933_interface_identified, tvb, offset, 1, ENC_NA);
1208 proto_tree_add_item(tree, hf_q933_interface_basic, tvb, offset, 1, ENC_NA);
1209 proto_tree_add_item(tree, hf_q933_indicated_channel_required, tvb, offset, 1, ENC_NA);
1210 proto_tree_add_item(tree, hf_q933_indicated_channel_d_channel, tvb, offset, 1, ENC_NA);
1211 if (octet & Q933_NOT_BASIC_CHANNEL) {
1212 proto_tree_add_item(tree, hf_q933_not_channel_selection, tvb, offset, 1, ENC_BIG_ENDIAN);
1213 } else {
1214 proto_tree_add_item(tree, hf_q933_channel_selection, tvb, offset, 1, ENC_BIG_ENDIAN);
1216 offset += 1;
1217 len -= 1;
1219 if (octet & Q933_INTERFACE_IDENTIFIED) {
1220 identifier_offset = offset;
1221 identifier_len = 0;
1222 do {
1223 if (len == 0)
1224 break;
1225 octet = tvb_get_uint8(tvb, offset);
1226 offset += 1;
1227 len -= 1;
1228 identifier_len++;
1229 } while (!(octet & Q933_IE_VL_EXTENSION));
1232 * XXX - do we want to strip off the 8th bit on the
1233 * last octet of the interface identifier?
1235 if (identifier_len != 0) {
1236 proto_tree_add_item(tree, hf_q933_interface_identifier, tvb, identifier_offset, identifier_len, ENC_NA);
1240 if (octet & Q933_NOT_BASIC_CHANNEL) {
1241 if (len == 0)
1242 return;
1243 octet = tvb_get_uint8(tvb, offset);
1244 coding_standard = octet & 0x60;
1245 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
1246 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
1248 * We don't know how the channel identifier is
1249 * encoded, so just dump it as data and be done
1250 * with it.
1252 proto_tree_add_item(tree, hf_q933_data, tvb, offset, len, ENC_NA);
1253 return;
1255 proto_tree_add_item(tree, hf_q933_channel_indicated_by, tvb, offset, 1, ENC_NA);
1256 proto_tree_add_item(tree, (octet & Q933_IS_SLOT_MAP) ? hf_q933_map_element_type : hf_q933_channel_type, tvb, offset, 1, ENC_NA);
1259 * XXX - dump the channel number or slot map.
1265 * Dissect a Progress indicator information element.
1267 static const value_string q933_progress_description_vals[] = {
1268 { 0x01, "Call is not end-to-end ISDN - progress information available in-band" },
1269 { 0x02, "Destination address is non-ISDN" },
1270 { 0x03, "Origination address is non-ISDN" },
1271 { 0x04, "Call has returned to the ISDN" },
1272 { 0x05, "Interworking has occurred and has resulted in a telecommunications service change" },
1273 { 0x08, "In-band information or an appropriate pattern is now available" },
1274 { 0, NULL }
1277 static void
1278 dissect_q933_progress_indicator_ie(tvbuff_t *tvb, int offset, int len,
1279 proto_tree *tree)
1281 uint8_t octet;
1282 uint8_t coding_standard;
1284 if (len == 0)
1285 return;
1286 octet = tvb_get_uint8(tvb, offset);
1287 coding_standard = octet & 0x60;
1288 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
1289 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
1291 * We don't know how the progress indicator is encoded,
1292 * so just dump it as data and be done with it.
1294 proto_tree_add_item(tree, hf_q933_data, tvb, offset, len, ENC_NA);
1295 return;
1297 proto_tree_add_item(tree, hf_q933_location, tvb, offset, 1, ENC_BIG_ENDIAN);
1298 offset += 1;
1299 len -= 1;
1301 if (len == 0)
1302 return;
1303 proto_tree_add_item(tree, hf_q933_progress_description, tvb, offset, 1, ENC_BIG_ENDIAN);
1307 * Dissect a Network-specific facilities or Transit network selection
1308 * information element.
1310 static const value_string q933_netid_type_vals[] = {
1311 { 0, "User specified" },
1312 { 2, "National network identification" },
1313 { 3, "International network identification" },
1314 { 0, NULL }
1317 static const value_string q933_netid_plan_vals[] = {
1318 { 0x00, "Unknown" },
1319 { 0x01, "Carrier Identification Code" },
1320 { 0x03, "X.121 data network identification code" },
1321 { 0, NULL }
1324 static void
1325 dissect_q933_ns_facilities_ie(tvbuff_t *tvb, int offset, int len,
1326 proto_tree *tree)
1328 uint8_t octet;
1329 int netid_len;
1331 if (len == 0)
1332 return;
1333 octet = tvb_get_uint8(tvb, offset);
1334 netid_len = octet & 0x7F;
1335 proto_tree_add_item(tree, hf_q933_network_identification_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1336 offset += 1;
1337 len -= 1;
1338 if (netid_len != 0) {
1339 if (len == 0)
1340 return;
1341 proto_tree_add_item(tree, hf_q933_type_of_network_identification, tvb, offset, 1, ENC_BIG_ENDIAN);
1342 proto_tree_add_item(tree, hf_q933_network_identification_plan, tvb, offset, 1, ENC_BIG_ENDIAN);
1343 offset += 1;
1344 len -= 1;
1345 netid_len--;
1347 if (len == 0)
1348 return;
1349 if (netid_len > len)
1350 netid_len = len;
1351 if (netid_len != 0) {
1352 proto_tree_add_item(tree, hf_q933_network_identification, tvb, offset, netid_len, ENC_NA|ENC_ASCII);
1353 offset += netid_len;
1354 len -= netid_len;
1359 * Whatever is left is the network-specific facility
1360 * specification.
1362 if (len == 0)
1363 return;
1364 proto_tree_add_item(tree, hf_q933_network_specific_facility_specification, tvb, offset, len, ENC_NA);
1367 static int
1368 dissect_q933_uint16_value(tvbuff_t *tvb, packet_info *pinfo, int offset, int len,
1369 proto_tree *tree, int hf)
1371 uint8_t octet;
1372 uint16_t value;
1373 int value_len;
1375 value_len = 0;
1377 octet = tvb_get_uint8(tvb, offset);
1378 if (octet & Q933_IE_VL_EXTENSION) {
1380 * Only one octet long - error.
1382 goto bad_length;
1384 value = (octet & 0x3) << 14;
1385 offset += 1;
1386 len -= 1;
1387 value_len++;
1389 if (len == 0) {
1391 * We've reached the end of the information element - error.
1393 goto past_end;
1395 octet = tvb_get_uint8(tvb, offset);
1396 if (octet & Q933_IE_VL_EXTENSION) {
1398 * Only two octets long - error.
1400 goto bad_length;
1402 value |= (octet & 0x7F) << 7;
1403 offset += 1;
1404 len -= 1;
1405 value_len++;
1407 if (len == 0) {
1409 * We've reached the end of the information element - error.
1411 goto past_end;
1413 octet = tvb_get_uint8(tvb, offset);
1414 if (!(octet & Q933_IE_VL_EXTENSION)) {
1416 * More than three octets long - error.
1418 goto bad_length;
1420 value |= (octet & 0x7F);
1421 offset += 1;
1422 /*len -= 1;*/
1423 value_len++;
1425 proto_tree_add_uint(tree, hf, tvb, offset, value_len, value);
1426 return value_len;
1428 past_end:
1429 proto_tree_add_expert_format(tree, pinfo, &ei_q933_invalid_length, tvb, offset, len,
1430 "%s goes past end of information element", proto_registrar_get_name(hf));
1431 return -1;
1433 bad_length:
1434 proto_tree_add_expert_format(tree, pinfo, &ei_q933_invalid_length, tvb, offset, len,
1435 "%s isn't 3 octets long", proto_registrar_get_name(hf));
1436 return -1;
1440 * Dissect an End-to-end transit delay information element.
1442 static void
1443 dissect_q933_e2e_transit_delay_ie(tvbuff_t *tvb, packet_info *pinfo, int offset, int len,
1444 proto_tree *tree)
1446 int value_len;
1448 if (len == 0)
1449 return;
1450 value_len = dissect_q933_uint16_value(tvb, pinfo, offset, len, tree,
1451 hf_q933_cumulative_transit_delay);
1452 if (value_len < 0)
1453 return; /* error */
1454 offset += value_len;
1455 len -= value_len;
1457 if (len == 0)
1458 return;
1459 value_len = dissect_q933_uint16_value(tvb, pinfo, offset, len, tree,
1460 hf_q933_requested_end_to_end_transit_delay);
1461 if (value_len < 0)
1462 return; /* error */
1463 offset += value_len;
1464 len -= value_len;
1466 if (len == 0)
1467 return;
1468 /*value_len = */dissect_q933_uint16_value(tvb, pinfo, offset, len, tree,
1469 hf_q933_max_end_to_end_transit_delay);
1473 * Dissect a Transit delay selection and indication information element.
1475 static void
1476 dissect_q933_td_selection_and_int_ie(tvbuff_t *tvb, packet_info *pinfo, int offset, int len,
1477 proto_tree *tree)
1479 if (len == 0)
1480 return;
1481 dissect_q933_uint16_value(tvb, pinfo, offset, len, tree, hf_q933_transit_delay);
1484 static const true_false_string tfs_link_by_link_end_to_end = { "Link-by-link", "End-to-end" };
1485 static const true_false_string tfs_no_request_request_indicated = { "No request/request denied", "Request indicated/request accepted" };
1488 static void
1489 dissect_q933_pl_binary_parameters_ie(tvbuff_t *tvb, int offset, int len,
1490 proto_tree *tree)
1492 if (len == 0)
1493 return;
1495 proto_tree_add_item(tree, hf_q933_request, tvb, offset, 1, ENC_NA);
1496 proto_tree_add_item(tree, hf_q933_confirmation, tvb, offset, 1, ENC_NA);
1500 * Dissect a Reverse charging indication information element.
1502 static const value_string q933_reverse_charging_indication_vals[] = {
1503 { 0x01, "Reverse charging requested" },
1504 { 0, NULL }
1507 static void
1508 dissect_q933_reverse_charge_ind_ie(tvbuff_t *tvb, int offset, int len,
1509 proto_tree *tree)
1511 if (len == 0)
1512 return;
1513 proto_tree_add_item(tree, hf_q933_reverse_charging_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
1517 * Dissect a (phone) number information element.
1519 static const value_string q933_number_type_vals[] = {
1520 { 0x0, "Unknown" },
1521 { 0x1, "International number" },
1522 { 0x2, "National number" },
1523 { 0x3, "Network specific number" },
1524 { 0x4, "Subscriber number" },
1525 { 0x6, "Abbreviated number" },
1526 { 0, NULL }
1529 static const value_string q933_numbering_plan_vals[] = {
1530 { 0x00, "Unknown" },
1531 { 0x01, "E.164 ISDN/telephony numbering" },
1532 { 0x03, "X.121 data numbering" },
1533 { 0x04, "F.69 Telex numbering" },
1534 { 0x08, "National standard numbering" },
1535 { 0x09, "Private numbering" },
1536 { 0, NULL }
1539 static const value_string q933_presentation_indicator_vals[] = {
1540 { 0x00, "Presentation allowed" },
1541 { 0x01, "Presentation restricted" },
1542 { 0x02, "Number not available due to interworking" },
1543 { 0, NULL }
1546 static const value_string q933_screening_indicator_vals[] = {
1547 { 0x00, "User-provided, not screened" },
1548 { 0x01, "User-provided, verified and passed" },
1549 { 0x02, "User-provided, verified and failed" },
1550 { 0x03, "Network-provided" },
1551 { 0, NULL }
1554 static const value_string q933_redirection_reason_vals[] = {
1555 { 0x00, "Unknown" },
1556 { 0x01, "Call forwarding busy or called DTE busy" },
1557 { 0x02, "Call forwarding no reply" },
1558 { 0x04, "Call deflection" },
1559 { 0x09, "Called DTE out of order" },
1560 { 0x0A, "Call forwarding by the called DTE" },
1561 { 0x0F, "Call forwarding unconditional or systematic call redirection" },
1562 { 0, NULL }
1565 static void
1566 dissect_q933_number_ie(tvbuff_t *tvb, int offset, int len,
1567 proto_tree *tree, int hfindex)
1569 uint8_t octet;
1571 if (len == 0)
1572 return;
1573 octet = tvb_get_uint8(tvb, offset);
1574 proto_tree_add_uint(tree, hf_q933_numbering_plan, tvb, offset, 1, octet);
1575 proto_tree_add_uint(tree, hf_q933_number_type, tvb, offset, 1, octet);
1576 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
1578 offset += 1;
1579 len -= 1;
1581 if (!(octet & Q933_IE_VL_EXTENSION)) {
1582 if (len == 0)
1583 return;
1584 octet = tvb_get_uint8(tvb, offset);
1585 proto_tree_add_uint(tree, hf_q933_screening_ind, tvb, offset, 1, octet);
1586 proto_tree_add_uint(tree, hf_q933_presentation_ind, tvb, offset, 1, octet);
1587 proto_tree_add_boolean(tree, hf_q933_extension_ind, tvb, offset, 1, octet);
1588 offset += 1;
1589 len -= 1;
1593 * XXX - only in a Redirecting number information element.
1595 if (!(octet & Q933_IE_VL_EXTENSION)) {
1596 if (len == 0)
1597 return;
1598 proto_tree_add_item(tree, hf_q933_reason_for_redirection, tvb, offset, 1, ENC_BIG_ENDIAN);
1599 offset += 1;
1600 len -= 1;
1603 if (len == 0)
1604 return;
1605 proto_tree_add_item(tree, hfindex, tvb, offset, len, ENC_ASCII|ENC_NA);
1609 * Dissect a party subaddress information element.
1611 static const value_string q933_subaddress_type_vals[] = {
1612 { 0, "X.213/ISO 8348 Add.2 NSAP" },
1613 { 2, "User-specified" },
1614 { 0, NULL }
1617 static const value_string q933_odd_even_indicator_vals[] = {
1618 { 0, "Even number of address signals" },
1619 { 1, "Odd number of address signals" },
1620 { 0, NULL }
1623 static void
1624 dissect_q933_party_subaddr_ie(tvbuff_t *tvb, int offset, int len,
1625 proto_tree *tree)
1627 if (len == 0)
1628 return;
1630 proto_tree_add_item(tree, hf_q933_type_of_subaddress, tvb, offset, 1, ENC_BIG_ENDIAN);
1631 proto_tree_add_item(tree, hf_q933_odd_even_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1632 offset += 1;
1633 len -= 1;
1635 if (len == 0)
1636 return;
1637 proto_tree_add_item(tree, hf_q933_subaddress, tvb, offset, len, ENC_NA);
1641 * Dissect a High-layer compatibility information element.
1643 #define Q933_AUDIOVISUAL 0x60
1644 static const value_string q933_high_layer_characteristics_vals[] = {
1645 { 0x01, "Telephony" },
1646 { 0x04, "F.182 Facsimile Group 2/3" },
1647 { 0x21, "F.184 Facsimile Group 4 Class I" },
1648 { 0x24, "F.230 Teletex, basic and mixed mode, and F.184 Facsimile Group 4, Classes II and III" },
1649 { 0x28, "F.220 Teletex, basic and processable mode" },
1650 { 0x31, "F.200 Teletex, basic mode" },
1651 { 0x32, "F.300 and T.102 syntax-based Videotex" },
1652 { 0x33, "F.300 and T.101 international Videotex interworking" },
1653 { 0x35, "F.60 Telex" },
1654 { 0x38, "X.400 Message Handling Systems" },
1655 { 0x41, "X.200 OSI application" },
1656 { 0x42, "FTAM application" },
1657 { 0x5E, "Reserved for maintenance" },
1658 { 0x5F, "Reserved for management" },
1659 { Q933_AUDIOVISUAL, "F.720/F.821 and F.731 Profile 1a videotelephony" },
1660 { 0x61, "F.702 and F.731 Profile 1b videoconferencing" },
1661 { 0x62, "F.702 and F.731 audiographic conferencing" },
1662 { 0, NULL }
1665 static const value_string q933_audiovisual_characteristics_vals[] = {
1666 { 0x01, "Capability set of initial channel of H.221" },
1667 { 0x02, "Capability set of subsequent channel of H.221" },
1668 { 0x21, "Capability set of initial channel of an active 3.1kHz audio or speech call" },
1669 { 0x00, NULL }
1672 static void
1673 dissect_q933_high_layer_compat_ie(tvbuff_t *tvb, int offset, int len,
1674 proto_tree *tree)
1676 uint8_t octet;
1677 uint8_t coding_standard;
1678 uint8_t characteristics;
1680 if (len == 0)
1681 return;
1682 octet = tvb_get_uint8(tvb, offset);
1683 coding_standard = octet & 0x60;
1684 proto_tree_add_uint(tree, hf_q933_coding_standard, tvb, offset, 1, octet);
1685 offset += 1;
1686 len -= 1;
1687 if (coding_standard != Q933_ITU_STANDARDIZED_CODING) {
1689 * We don't know how the call state is encoded,
1690 * so just dump it as data and be done with it.
1692 proto_tree_add_item(tree, hf_q933_data, tvb, offset, len, ENC_NA);
1693 return;
1696 if (len == 0)
1697 return;
1698 octet = tvb_get_uint8(tvb, offset);
1699 characteristics = octet & 0x7F;
1700 proto_tree_add_item(tree, hf_q933_high_layer_characteristics_identification, tvb, offset, 1, ENC_BIG_ENDIAN);
1701 offset += 1;
1702 len -= 1;
1704 if (!(octet & Q933_IE_VL_EXTENSION)) {
1705 if (len == 0)
1706 return;
1707 if (characteristics == Q933_AUDIOVISUAL) {
1708 proto_tree_add_item(tree, hf_q933_extended_audiovisual_characteristics_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1709 } else {
1710 proto_tree_add_item(tree, hf_q933_extended_high_layer_characteristics_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1717 * Dissect a User-user information element.
1719 #define Q933_PROTOCOL_DISCRIMINATOR_IA5 0x04
1720 #define Q933_PROTOCOL_DISCRIMINATOR_ASN1 0x05
1722 static const value_string q933_protocol_discriminator_vals[] = {
1723 { 0x00, "User-specific protocol" },
1724 { 0x01, "OSI high layer protocols" },
1725 { 0x02, "X.244" },
1726 { Q933_PROTOCOL_DISCRIMINATOR_IA5, "IA5 characters" },
1727 { Q933_PROTOCOL_DISCRIMINATOR_ASN1, "X.208 and X.209 coded user information" },
1728 { 0x07, "V.120 rate adaption" },
1729 { 0x08, "Q.933/I.451 user-network call control messages" },
1730 { 0, NULL }
1733 static void
1734 dissect_q933_user_user_ie(tvbuff_t *tvb, int offset, int len,
1735 proto_tree *tree)
1737 uint8_t octet;
1739 if (len == 0)
1740 return;
1741 octet = tvb_get_uint8(tvb, offset);
1742 proto_tree_add_item(tree, hf_q933_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
1743 offset += 1;
1744 len -= 1;
1746 if (len == 0)
1747 return;
1748 switch (octet) {
1750 case Q933_PROTOCOL_DISCRIMINATOR_IA5:
1751 proto_tree_add_item(tree, hf_q933_user_information_str, tvb, offset, len, ENC_NA|ENC_ASCII);
1752 break;
1754 default:
1755 proto_tree_add_item(tree, hf_q933_user_information_bytes, tvb, offset, len, ENC_NA);
1756 break;
1761 * Dissect information elements consisting of ASCII^H^H^H^H^HIA5 text.
1763 static void
1764 dissect_q933_ia5_ie(tvbuff_t *tvb, int offset, int len, proto_tree *tree, int hf)
1766 if (len != 0) {
1767 proto_tree_add_item(tree, hf, tvb, offset, len, ENC_ASCII|ENC_NA);
1771 static const value_string q933_codeset_vals[] = {
1772 { 0x00, "Q.933 information elements" },
1773 { 0x04, "Information elements for ISO/IEC use" },
1774 { 0x05, "Information elements for national use" },
1775 { 0x06, "Information elements specific to the local network" },
1776 { 0x07, "User-specific information elements" },
1777 { 0x00, NULL },
1780 static int
1781 dissect_q933(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1783 int offset = 0;
1784 proto_tree *q933_tree = NULL;
1785 proto_item *ti;
1786 proto_tree *ie_tree = NULL;
1787 uint8_t call_ref_len;
1788 uint8_t call_ref[16];
1789 uint8_t message_type;
1790 uint8_t info_element;
1791 uint16_t info_element_len;
1792 int codeset, locked_codeset;
1793 bool non_locking_shift;
1795 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Q.933");
1797 if (tree) {
1798 ti = proto_tree_add_item(tree, proto_q933, tvb, offset, -1,
1799 ENC_NA);
1800 q933_tree = proto_item_add_subtree(ti, ett_q933);
1802 dissect_q933_protocol_discriminator(tvb, offset, q933_tree);
1804 offset += 1;
1805 call_ref_len = tvb_get_uint8(tvb, offset) & 0xF; /* XXX - do as a bit field? */
1806 if (q933_tree != NULL)
1807 proto_tree_add_uint(q933_tree, hf_q933_call_ref_len, tvb, offset, 1, call_ref_len);
1808 offset += 1;
1809 if (call_ref_len != 0) {
1810 tvb_memcpy(tvb, call_ref, offset, call_ref_len);
1811 proto_tree_add_boolean(q933_tree, hf_q933_call_ref_flag,
1812 tvb, offset, 1, (call_ref[0] & 0x80) != 0);
1813 call_ref[0] &= 0x7F;
1814 proto_tree_add_bytes(q933_tree, hf_q933_call_ref,
1815 tvb, offset, call_ref_len, call_ref);
1816 offset += call_ref_len;
1818 message_type = tvb_get_uint8(tvb, offset);
1819 col_add_str(pinfo->cinfo, COL_INFO,
1820 val_to_str(message_type, q933_message_type_vals,
1821 "Unknown message type (0x%02X)"));
1823 proto_tree_add_uint(q933_tree, hf_q933_message_type, tvb, offset, 1, message_type);
1824 offset += 1;
1827 * And now for the information elements....
1829 codeset = locked_codeset = 0; /* start out in codeset 0 */
1830 while (tvb_reported_length_remaining(tvb, offset) > 0) {
1831 info_element = tvb_get_uint8(tvb, offset);
1833 /* Check for the codeset shift */
1834 if ((info_element & Q933_IE_SO_MASK) &&
1835 ((info_element & Q933_IE_SO_IDENTIFIER_MASK) == Q933_IE_SHIFT)) {
1836 non_locking_shift = info_element & Q933_IE_SHIFT_NON_LOCKING;
1837 codeset = info_element & Q933_IE_SHIFT_CODESET;
1838 if (!non_locking_shift)
1839 locked_codeset = codeset;
1840 proto_tree_add_item(q933_tree, non_locking_shift ? hf_q933_non_locking_shift_to_codeset : hf_q933_locking_shift_to_codeset, tvb, offset, 1, ENC_NA);
1841 offset += 1;
1842 continue;
1846 * Check for the single-octet IEs.
1848 if (info_element & Q933_IE_SO_MASK) {
1849 switch ((codeset << 8) | (info_element & Q933_IE_SO_IDENTIFIER_MASK)) {
1851 case CS0 | Q933_IE_REPEAT_INDICATOR:
1852 proto_tree_add_item(q933_tree, hf_q933_repeat_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1853 break;
1855 default:
1856 proto_tree_add_expert_format(q933_tree, pinfo, &ei_q933_information_element, tvb, offset, 1,
1857 "Unknown information element (0x%02X)", info_element);
1858 break;
1860 offset += 1;
1861 codeset = locked_codeset;
1862 continue;
1866 * Variable-length IE.
1868 info_element_len = tvb_get_uint8(tvb, offset + 1);
1869 if (q933_tree != NULL) {
1870 ie_tree = proto_tree_add_subtree(q933_tree, tvb, offset,
1871 1+1+info_element_len, ett_q933_ie, NULL,
1872 val_to_str(info_element, q933_info_element_vals[codeset],
1873 "Unknown information element (0x%02X)"));
1874 proto_tree_add_uint_format_value(ie_tree, hf_q933_information_element, tvb, offset, 1, info_element,
1875 "%s", val_to_str(info_element, q933_info_element_vals[codeset], "Unknown (0x%02X)"));
1876 proto_tree_add_item(ie_tree, hf_q933_length, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
1878 switch ((codeset << 8) | info_element) {
1880 case CS0 | Q933_IE_SEGMENTED_MESSAGE:
1881 dissect_q933_segmented_message_ie(tvb,
1882 pinfo, offset + 2, info_element_len,
1883 ie_tree);
1884 break;
1886 case CS0 | Q933_IE_BEARER_CAPABILITY:
1887 case CS0 | Q933_IE_LOW_LAYER_COMPAT:
1888 dissect_q933_bearer_capability_ie(tvb,
1889 offset + 2, info_element_len,
1890 ie_tree);
1891 break;
1893 case CS0 | Q933_IE_CAUSE:
1894 dissect_q933_cause_ie(tvb,
1895 offset + 2, info_element_len,
1896 ie_tree,
1897 hf_q933_cause_value);
1898 break;
1900 case CS0 | Q933_IE_CALL_STATE:
1901 dissect_q933_call_state_ie(tvb,
1902 offset + 2, info_element_len,
1903 ie_tree);
1904 break;
1906 case CS0 | Q933_IE_CHANNEL_IDENTIFICATION:
1907 dissect_q933_channel_identification_ie(
1908 tvb, offset + 2, info_element_len,
1909 ie_tree);
1910 break;
1912 case CS0 | Q933_IE_PROGRESS_INDICATOR:
1913 dissect_q933_progress_indicator_ie(tvb,
1914 offset + 2, info_element_len,
1915 ie_tree);
1916 break;
1918 case CS0 | Q933_IE_NETWORK_SPECIFIC_FACIL:
1919 case CS0 | Q933_IE_TRANSIT_NETWORK_SEL:
1920 dissect_q933_ns_facilities_ie(tvb,
1921 offset + 2, info_element_len,
1922 ie_tree);
1923 break;
1925 case CS0 | Q933_IE_DISPLAY:
1926 dissect_q933_ia5_ie(tvb, offset + 2,
1927 info_element_len, ie_tree,
1928 hf_q933_display_information);
1929 break;
1931 case CS0 | Q933_IE_E2E_TRANSIT_DELAY:
1932 dissect_q933_e2e_transit_delay_ie(tvb,
1933 pinfo, offset + 2, info_element_len,
1934 ie_tree);
1935 break;
1937 case CS0 | Q933_IE_TD_SELECTION_AND_INT:
1938 dissect_q933_td_selection_and_int_ie(
1939 tvb, pinfo, offset + 2, info_element_len,
1940 ie_tree);
1941 break;
1943 case CS0 | Q933_IE_PL_BINARY_PARAMETERS:
1944 dissect_q933_pl_binary_parameters_ie(
1945 tvb, offset + 2, info_element_len,
1946 ie_tree);
1947 break;
1949 case CS0 | Q933_IE_REVERSE_CHARGE_IND:
1950 dissect_q933_reverse_charge_ind_ie(tvb,
1951 offset + 2, info_element_len,
1952 ie_tree);
1953 break;
1955 case CS0 | Q933_IE_CALLING_PARTY_NUMBER:
1956 dissect_q933_number_ie(tvb,
1957 offset + 2, info_element_len,
1958 ie_tree,
1959 hf_q933_calling_party_number);
1960 break;
1962 case CS0 | Q933_IE_CONNECTED_NUMBER:
1963 dissect_q933_number_ie(tvb,
1964 offset + 2, info_element_len,
1965 ie_tree,
1966 hf_q933_connected_number);
1967 break;
1969 case CS0 | Q933_IE_CALLED_PARTY_NUMBER:
1970 dissect_q933_number_ie(tvb,
1971 offset + 2, info_element_len,
1972 ie_tree,
1973 hf_q933_called_party_number);
1974 break;
1976 case CS0 | Q933_IE_CALLING_PARTY_SUBADDR:
1977 case CS0 | Q933_IE_CALLED_PARTY_SUBADDR:
1978 dissect_q933_party_subaddr_ie(tvb,
1979 offset + 2, info_element_len,
1980 ie_tree);
1981 break;
1983 case CS0 | Q933_IE_HIGH_LAYER_COMPAT:
1984 dissect_q933_high_layer_compat_ie(tvb,
1985 offset + 2, info_element_len,
1986 ie_tree);
1987 break;
1989 case CS0 | Q933_IE_USER_USER:
1990 dissect_q933_user_user_ie(tvb,
1991 offset + 2, info_element_len,
1992 ie_tree);
1993 break;
1996 case CS0 | Q933_IE_REPORT_TYPE:
1997 case CS5 | Q933_IE_REPORT_TYPE:
1998 case CS5 | Q933_IE_ANSI_REPORT_TYPE:
1999 dissect_q933_report_type_ie(tvb,
2000 offset + 2, info_element_len,
2001 ie_tree);
2002 break;
2004 case CS0 | Q933_IE_LINK_INTEGRITY_VERF:
2005 case CS5 | Q933_IE_LINK_INTEGRITY_VERF:
2006 case CS5 | Q933_IE_ANSI_LINK_INTEGRITY_VERF:
2007 dissect_q933_link_integrity_verf_ie(tvb,
2008 offset + 2, info_element_len,
2009 ie_tree);
2010 break;
2012 case CS0 | Q933_IE_PVC_STATUS:
2013 case CS5 | Q933_IE_PVC_STATUS:
2014 case CS5 | Q933_IE_ANSI_PVC_STATUS:
2015 dissect_q933_pvc_status_ie(tvb,
2016 offset + 2, info_element_len,
2017 ie_tree);
2018 break;
2020 default:
2021 proto_tree_add_item(ie_tree, hf_q933_data, tvb, offset + 2, info_element_len, ENC_NA);
2022 break;
2025 offset += 1 + 1 + info_element_len;
2026 codeset = locked_codeset;
2028 return tvb_captured_length(tvb);
2031 void
2032 proto_register_q933(void)
2034 static hf_register_info hf[] = {
2035 { &hf_q933_discriminator,
2036 { "Protocol discriminator", "q933.disc", FT_UINT8, BASE_HEX, NULL, 0x0,
2037 NULL, HFILL }},
2039 { &hf_q933_call_ref_flag,
2040 { "Call reference flag", "q933.call_ref_flag", FT_BOOLEAN, BASE_NONE, TFS(&tfs_call_ref_flag), 0x0,
2041 NULL, HFILL }},
2043 { &hf_q933_call_ref,
2044 { "Call reference value", "q933.call_ref", FT_BYTES, BASE_NONE, NULL, 0x0,
2045 NULL, HFILL }},
2048 { &hf_q933_coding_standard,
2049 { "Coding standard", "q933.coding_standard", FT_UINT8, BASE_HEX,
2050 VALS(q933_coding_standard_vals), 0x60,NULL, HFILL }},
2052 { &hf_q933_information_transfer_capability,
2053 { "Information transfer capability", "q933.information_transfer_capability", FT_UINT8, BASE_HEX,
2054 VALS(q933_information_transfer_capability_vals), 0x1f,NULL, HFILL }},
2056 { &hf_q933_transfer_mode,
2057 { "Transfer mode", "q933.transfer_mode", FT_UINT8, BASE_HEX,
2058 VALS(q933_transfer_mode_vals), 0x60,NULL, HFILL }},
2060 { &hf_q933_uil1,
2061 { "User information layer 1 protocol", "q933.uil1", FT_UINT8, BASE_HEX,
2062 VALS(q933_uil1_vals), 0x1f,NULL, HFILL }},
2064 { &hf_q933_call_ref_len,
2065 { "Call reference value length", "q933.call_ref_len", FT_UINT8, BASE_DEC, NULL, 0x0,
2066 NULL, HFILL }},
2068 { &hf_q933_message_type,
2069 { "Message type", "q933.message_type", FT_UINT8, BASE_HEX, VALS(q933_message_type_vals), 0x0,
2070 NULL, HFILL }},
2072 { &hf_q933_cause_location,
2073 { "Cause location", "q933.cause_location", FT_UINT8, BASE_DEC, VALS(q933_cause_location_vals), 0x0f,
2074 NULL, HFILL }},
2076 { &hf_q933_cause_value,
2077 { "Cause value", "q933.cause_value", FT_UINT8, BASE_DEC, VALS(q933_cause_code_vals), 0x7f,
2078 NULL, HFILL }},
2080 { &hf_q933_number_type,
2081 { "Number type", "q933.number_type", FT_UINT8, BASE_HEX, VALS(q933_number_type_vals), 0x70,
2082 NULL, HFILL }},
2084 { &hf_q933_numbering_plan,
2085 { "numbering plan", "q933.numbering_plan", FT_UINT8, BASE_HEX, VALS(q933_numbering_plan_vals), 0x0f,
2086 NULL, HFILL }},
2088 { &hf_q933_screening_ind,
2089 { "Screening indicator", "q933.screening_ind", FT_UINT8, BASE_HEX, VALS(q933_screening_indicator_vals), 0x03,
2090 NULL, HFILL }},
2092 { &hf_q933_presentation_ind,
2093 { "Presentation indicator", "q933.presentation_ind", FT_UINT8, BASE_HEX, VALS(q933_presentation_indicator_vals), 0x60,
2094 NULL, HFILL }},
2096 { &hf_q933_extension_ind,
2097 { "Extension indicator", "q933.extension_ind",
2098 FT_BOOLEAN, 8, TFS(&q933_extension_ind_value), 0x80,
2099 NULL, HFILL }},
2101 { &hf_q933_calling_party_number,
2102 { "Calling party number digits", "q933.calling_party_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2103 NULL, HFILL }},
2105 { &hf_q933_called_party_number,
2106 { "Called party number digits", "q933.called_party_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2107 NULL, HFILL }},
2109 { &hf_q933_connected_number,
2110 { "Connected party number digits", "q933.connected_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2111 NULL, HFILL }},
2113 #if 0
2114 { &hf_q933_redirecting_number,
2115 { "Redirecting party number digits", "q933.redirecting_number.digits", FT_STRING, BASE_NONE, NULL, 0x0,
2116 NULL, HFILL }},
2117 #endif
2118 { &hf_q933_report_type,
2119 { "Report type", "q933.report_type", FT_UINT8, BASE_DEC, VALS(q933_report_type_vals), 0x0,
2120 NULL, HFILL }},
2121 { &hf_q933_link_verf_txseq,
2122 { "TX Sequence", "q933.link_verification.txseq", FT_UINT8, BASE_DEC, NULL, 0x0,
2123 NULL, HFILL }},
2124 { &hf_q933_link_verf_rxseq,
2125 { "RX Sequence", "q933.link_verification.rxseq", FT_UINT8, BASE_DEC, NULL, 0x0,
2126 NULL, HFILL }},
2127 { &hf_q933_data,
2128 { "Data", "q933.data", FT_BYTES, BASE_NONE, NULL, 0x0,
2129 NULL, HFILL }},
2131 /* Generated from convert_proto_tree_add_text.pl */
2132 { &hf_q933_first_segment, { "First segment", "q933.first_segment", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_segment_remaining), 0x7F, NULL, HFILL }},
2133 { &hf_q933_not_first_segment, { "Not first segment", "q933.not_first_segment", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_segment_remaining), 0x7F, NULL, HFILL }},
2134 { &hf_q933_segmented_message_type, { "Segmented message type", "q933.segmented_message_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2135 { &hf_q933_out_band_negotiation, { "Out-band negotiation", "q933.out_band_negotiation", FT_BOOLEAN, 8, TFS(&tfs_possible_not_possible), 0x40, NULL, HFILL }},
2136 { &hf_q933_layer_1, { "Layer 1", "q933.layer_1", FT_BOOLEAN, 8, TFS(&tfs_asynchronous_synchronous), 0x40, NULL, HFILL }},
2137 { &hf_q933_user_rate, { "User rate", "q933.user_rate", FT_UINT8, BASE_DEC, VALS(q933_l1_user_rate_vals), 0x1F, NULL, HFILL }},
2138 { &hf_q933_rate_adaption_header, { "Rate adaption header", "q933.rate_adaption_header", FT_BOOLEAN, 8, TFS(&tfs_included_not_included), 0x40, NULL, HFILL }},
2139 { &hf_q933_multiple_frame_establishment, { "Multiple frame establishment", "q933.multiple_frame_establishment", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20, NULL, HFILL }},
2140 { &hf_q933_mode_of_operation, { "Mode of operation", "q933.mode_of_operation", FT_BOOLEAN, 8, TFS(&tfs_protocol_sensative_bit_transparent), 0x10, NULL, HFILL }},
2141 { &hf_q933_stop_bits, { "Stop bits", "q933.stop_bits", FT_UINT8, BASE_DEC, VALS(q933_l1_stop_bits_vals), 0x60, NULL, HFILL }},
2142 { &hf_q933_data_bits, { "Data bits", "q933.data_bits", FT_UINT8, BASE_DEC, VALS(q933_l1_data_bits_vals), 0x18, NULL, HFILL }},
2143 { &hf_q933_parity, { "Parity", "q933.parity", FT_UINT8, BASE_DEC, VALS(q933_l1_parity_vals), 0x07, NULL, HFILL }},
2144 { &hf_q933_duplex, { "Duplex", "q933.duplex", FT_BOOLEAN, 8, TFS(&tfs_full_half), 0x40, NULL, HFILL }},
2145 { &hf_q933_modem_type, { "Modem type (Network-specific rules)", "q933.modem_type", FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL }},
2146 { &hf_q933_user_information_layer_2_protocol, { "User information layer 2 protocol", "q933.user_information_layer_2_protocol", FT_UINT8, BASE_HEX, VALS(q933_uil2_vals), 0x1F, NULL, HFILL }},
2147 { &hf_q933_user_specified_layer_2_protocol_information, { "User-specified layer 2 protocol information", "q933.user_specified_layer_2_protocol_information", FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL }},
2148 { &hf_q933_address_inclusion, { "Address inclusion", "q933.address_inclusion", FT_UINT8, BASE_HEX, VALS(q933_address_inclusion_vals), 0x03, NULL, HFILL }},
2149 { &hf_q933_user_information_layer_3_protocol, { "User information layer 3 protocol", "q933.user_information_layer_3_protocol", FT_UINT8, BASE_HEX, VALS(q933_uil3_vals), 0x1F, NULL, HFILL }},
2150 { &hf_q933_mode, { "Mode", "q933.mode", FT_UINT8, BASE_HEX, VALS(q933_mode_vals), 0x60, NULL, HFILL }},
2151 { &hf_q933_default_packet_size_0F, { "Default packet size", "q933.default_packet_size", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }},
2152 { &hf_q933_packet_window_size, { "Packet window size", "q933.packet_window_size", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL }},
2153 { &hf_q933_default_packet_size, { "Default packet size", "q933.default_packet_size", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0x0, NULL, HFILL }},
2154 { &hf_q933_additional_layer_3_protocol_information, { "Additional layer 3 protocol information", "q933.additional_layer_3_protocol_information", FT_UINT16, BASE_HEX, VALS(nlpid_vals), 0x0FF0, NULL, HFILL }},
2155 { &hf_q933_recommendation, { "Recommendation", "q933.recommendation", FT_UINT8, BASE_HEX, VALS(q933_cause_recommendation_vals), 0x7F, NULL, HFILL }},
2156 { &hf_q933_network_service, { "Network service", "q933.network_service", FT_BOOLEAN, 8, TFS(&tfs_user_provider), 0x80, NULL, HFILL }},
2157 { &hf_q933_condition_normal, { "Condition", "q933.condition_normal", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
2158 { &hf_q933_condition, { "Condition", "q933.condition", FT_UINT8, BASE_HEX, VALS(q933_cause_condition_vals), 0x03, NULL, HFILL }},
2159 { &hf_q933_rejection_reason, { "Rejection reason", "q933.rejection_reason", FT_UINT8, BASE_HEX, VALS(q933_rejection_reason_vals), 0x7C, NULL, HFILL }},
2160 { &hf_q933_user_specific_diagnostic, { "User specific diagnostic", "q933.user_specific_diagnostic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2161 { &hf_q933_missing_information_element, { "Missing information element", "q933.missing_information_element", FT_UINT8, BASE_HEX, VALS(q933_info_element_vals0), 0x0, NULL, HFILL }},
2162 { &hf_q933_insufficient_information_element, { "Insufficient information element", "q933.insufficient_information_element", FT_UINT8, BASE_HEX, VALS(q933_info_element_vals0), 0x0, NULL, HFILL }},
2163 { &hf_q933_diagnostic, { "Diagnostic", "q933.diagnostic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2164 { &hf_q933_information_element, { "Information element", "q933.information_element", FT_UINT8, BASE_HEX, VALS(q933_info_element_vals0), 0x0, NULL, HFILL }},
2165 { &hf_q933_timer, { "Timer", "q933.timer", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2166 { &hf_q933_call_state, { "Call state", "q933.call_state", FT_UINT8, BASE_HEX, VALS(q933_call_state_vals), 0x3F, NULL, HFILL }},
2167 { &hf_q933_dlci, { "DLCI", "q933.dlci", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2168 { &hf_q933_status, { "Status", "q933.status", FT_UINT8, BASE_DEC, VALS(q933_pvc_status_vals), 0x0E, NULL, HFILL }},
2169 { &hf_q933_interface_identified, { "Interface", "q933.interface_identified", FT_BOOLEAN, 8, TFS(&tfs_explicitly_implicitly_identified), Q933_INTERFACE_IDENTIFIED, NULL, HFILL }},
2170 { &hf_q933_interface_basic, { "Interface", "q933.interface_basic", FT_BOOLEAN, 8, TFS(&tfs_not_basic_basic), Q933_NOT_BASIC_CHANNEL, NULL, HFILL }},
2171 { &hf_q933_indicated_channel_required, { "Indicated channel", "q933.indicated_channel_required", FT_BOOLEAN, 8, TFS(&tfs_required_preferred), 0x08, NULL, HFILL }},
2172 { &hf_q933_indicated_channel_d_channel, { "Indicated channel", "q933.indicated_channel_d_channel", FT_BOOLEAN, 8, TFS(&tfs_dchannel_not_dchannel), 0x04, NULL, HFILL }},
2173 { &hf_q933_not_channel_selection, { "Channel selection", "q933.channel_selection", FT_UINT8, BASE_HEX, VALS(q933_not_basic_channel_selection_vals), 0x03, NULL, HFILL }},
2174 { &hf_q933_channel_selection, { "Channel selection", "q933.channel_selection", FT_UINT8, BASE_HEX, VALS(q933_basic_channel_selection_vals), 0x03, NULL, HFILL }},
2175 { &hf_q933_interface_identifier, { "Interface identifier", "q933.interface_identifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2176 { &hf_q933_channel_indicated_by, { "Channel indicated by", "q933.channel_indicated_by", FT_BOOLEAN, 8, TFS(&tfs_slot_map_number), Q933_IS_SLOT_MAP, NULL, HFILL }},
2177 { &hf_q933_map_element_type, { "Map element type", "q933.map_element_type", FT_UINT8, BASE_HEX, VALS(q933_element_type_vals), 0x0F, NULL, HFILL }},
2178 { &hf_q933_channel_type, { "Channel", "q933.channel_type", FT_UINT8, BASE_HEX, VALS(q933_element_type_vals), 0x0F, NULL, HFILL }},
2179 { &hf_q933_location, { "Location", "q933.location", FT_UINT8, BASE_HEX, VALS(q933_cause_location_vals), 0x0F, NULL, HFILL }},
2180 { &hf_q933_progress_description, { "Progress description", "q933.progress_description", FT_UINT8, BASE_HEX, VALS(q933_progress_description_vals), 0x7F, NULL, HFILL }},
2181 { &hf_q933_network_identification_length, { "Network identification length", "q933.network_identification_length", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL }},
2182 { &hf_q933_type_of_network_identification, { "Type of network identification", "q933.type_of_network_identification", FT_UINT8, BASE_HEX, VALS(q933_netid_type_vals), 0x70, NULL, HFILL }},
2183 { &hf_q933_network_identification_plan, { "Network identification plan", "q933.network_identification_plan", FT_UINT8, BASE_HEX, VALS(q933_netid_plan_vals), 0x0F, NULL, HFILL }},
2184 { &hf_q933_network_identification, { "Network identification", "q933.network_identification", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2185 { &hf_q933_network_specific_facility_specification, { "Network-specific facility specification", "q933.network_specific_facility_specification", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2186 { &hf_q933_confirmation, { "Confirmation", "q933.confirmation", FT_BOOLEAN, 8, TFS(&tfs_link_by_link_end_to_end), 0x02, NULL, HFILL }},
2187 { &hf_q933_reverse_charging_indication, { "Reverse charging indication", "q933.reverse_charging_indication", FT_UINT8, BASE_HEX, VALS(q933_reverse_charging_indication_vals), 0x07, NULL, HFILL }},
2188 { &hf_q933_reason_for_redirection, { "Reason for redirection", "q933.reason_for_redirection", FT_UINT8, BASE_HEX, VALS(q933_redirection_reason_vals), 0x0F, NULL, HFILL }},
2189 { &hf_q933_type_of_subaddress, { "Type of subaddress", "q933.type_of_subaddress", FT_UINT8, BASE_HEX, VALS(q933_subaddress_type_vals), 0x70, NULL, HFILL }},
2190 { &hf_q933_odd_even_indicator, { "Odd/even indicator", "q933.odd_even_indicator", FT_UINT8, BASE_HEX, VALS(q933_odd_even_indicator_vals), 0x10, NULL, HFILL }},
2191 { &hf_q933_subaddress, { "Subaddress", "q933.subaddress", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2192 { &hf_q933_high_layer_characteristics_identification, { "High layer characteristics identification", "q933.high_layer_characteristics_identification", FT_UINT8, BASE_HEX, VALS(q933_high_layer_characteristics_vals), 0x7F, NULL, HFILL }},
2193 { &hf_q933_extended_audiovisual_characteristics_id, { "Extended audiovisual characteristics identification", "q933.extended_audiovisual_characteristics_id", FT_UINT8, BASE_HEX, VALS(q933_audiovisual_characteristics_vals), 0x7F, NULL, HFILL }},
2194 { &hf_q933_extended_high_layer_characteristics_id, { "Extended high layer characteristics identification", "q933.extended_high_layer_characteristics_id", FT_UINT8, BASE_HEX, VALS(q933_high_layer_characteristics_vals), 0x7F, NULL, HFILL }},
2195 { &hf_q933_protocol_discriminator, { "Protocol discriminator", "q933.protocol_discriminator", FT_UINT8, BASE_HEX, VALS(q933_protocol_discriminator_vals), 0x0, NULL, HFILL }},
2196 { &hf_q933_user_information_str, { "User information", "q933.user_information_str", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2197 { &hf_q933_user_information_bytes, { "User information", "q933.user_information_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2198 { &hf_q933_locking_shift_to_codeset, { "Locking shift to codeset", "q933.locking_shift_to_codeset", FT_UINT8, BASE_DEC, VALS(q933_codeset_vals), Q933_IE_SHIFT_CODESET, NULL, HFILL }},
2199 { &hf_q933_non_locking_shift_to_codeset, { "Non-locking shift to codeset", "q933.non_locking_shift_to_codeset", FT_UINT8, BASE_DEC, VALS(q933_codeset_vals), Q933_IE_SHIFT_CODESET, NULL, HFILL }},
2200 { &hf_q933_repeat_indicator, { "Repeat indicator", "q933.repeat_indicator", FT_UINT8, BASE_HEX, VALS(q933_repeat_indication_vals), Q933_IE_SO_IE_MASK, NULL, HFILL }},
2201 { &hf_q933_length, { "Length", "q933.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2202 { &hf_q933_diagnostics, { "Diagnostics", "q933.diagnostics", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2203 { &hf_q933_display_information, { "Display information", "q933.display_information", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2204 { &hf_q933_cumulative_transit_delay, { "Cumulative transit delay", "q933.cumulative_transit_delay", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0, NULL, HFILL }},
2205 { &hf_q933_requested_end_to_end_transit_delay, { "Requested end-to-end transit delay", "q933.requested_end_to_end_transit_delay", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0, NULL, HFILL }},
2206 { &hf_q933_max_end_to_end_transit_delay, { "Maximum end-to-end transit delay", "q933.max_end_to_end_transit_delay", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0, NULL, HFILL }},
2207 { &hf_q933_transit_delay, { "Transit Delay", "q933.transit_delay", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0, NULL, HFILL }},
2208 { &hf_q933_request, { "Request", "q933.request", FT_BOOLEAN, 8, TFS(&tfs_no_request_request_indicated), 0x04, NULL, HFILL }},
2211 static int *ett[] = {
2212 &ett_q933,
2213 &ett_q933_ie,
2216 static ei_register_info ei[] = {
2217 { &ei_q933_invalid_length, { "q933.invalid_length", PI_MALFORMED, PI_ERROR, "Invalid length", EXPFILL }},
2218 { &ei_q933_information_element, { "q933.information_element.unknown", PI_PROTOCOL, PI_WARN, "Unknown information element", EXPFILL }},
2220 expert_module_t* expert_q933;
2222 proto_q933 = proto_register_protocol("Q.933", "Q.933", "q933");
2223 proto_register_field_array (proto_q933, hf, array_length(hf));
2224 proto_register_subtree_array(ett, array_length(ett));
2225 expert_q933 = expert_register_protocol(proto_q933);
2226 expert_register_field_array(expert_q933, ei, array_length(ei));
2228 q933_handle = register_dissector("q933", dissect_q933, proto_q933);
2231 void
2232 proto_reg_handoff_q933(void)
2234 dissector_add_uint("fr.osinl", NLPID_Q_933, q933_handle);
2235 dissector_add_uint("juniper.proto", JUNIPER_PROTO_Q933, q933_handle);
2239 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2241 * Local variables:
2242 * c-basic-offset: 8
2243 * tab-width: 8
2244 * indent-tabs-mode: t
2245 * End:
2247 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
2248 * :indentSize=8:tabSize=8:noTabs=false: