Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-q2931.c
blobbd0a9d5410cb452c293ce6bc2c884c2af65ca4c4
1 /* packet-q2931.c
2 * Routines for Q.2931 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/tfs.h>
16 #include <epan/unit_strings.h>
17 #include <epan/oui.h>
18 #include <epan/nlpid.h>
19 #include <epan/etypes.h>
20 #include <epan/expert.h>
21 #include "packet-q931.h"
22 #include "packet-arp.h"
25 * See
27 * http://web.archive.org/web/20150408122122/http://www.protocols.com/pbook/atmsig.htm
29 * for some information on Q.2931, although, alas, not the actual message
30 * type and information element values - those I got from the FreeBSD 3.2
31 * ATM code, and from Q.2931 (and Q.931) itself.
34 void proto_register_q2931(void);
36 static int proto_q2931;
37 static int hf_q2931_discriminator;
38 static int hf_q2931_call_ref_len;
39 static int hf_q2931_call_ref_flag;
40 static int hf_q2931_call_ref;
41 static int hf_q2931_message_type;
42 static int hf_q2931_message_type_ext;
43 static int hf_q2931_message_flag;
44 static int hf_q2931_message_action_indicator;
45 static int hf_q2931_message_len;
46 static int hf_q2931_ie_handling_instructions;
47 static int hf_q2931_ie_coding_standard;
48 static int hf_q2931_ie_action_indicator;
49 /* Generated from convert_proto_tree_add_text.pl */
50 static int hf_q2931_number_bytes;
51 static int hf_q2931_conn_id_vci;
52 static int hf_q2931_restart_indicator;
53 static int hf_q2931_conn_id_vpci;
54 static int hf_q2931_bband_low_layer_info_mode;
55 static int hf_q2931_cause_rejection_insufficient_information_element;
56 static int hf_q2931_bband_low_layer_info_user_info_l3_proto;
57 static int hf_q2931_number_string;
58 static int hf_q2931_aal1_backward_max_cpcs_sdu_size;
59 static int hf_q2931_user_plane_connection_configuration;
60 static int hf_q2931_party_subaddr_subaddress;
61 static int hf_q2931_aal1_mode;
62 static int hf_q2931_cause_location;
63 static int hf_q2931_bband_low_layer_info_user_specified_l2_proto;
64 static int hf_q2931_information_element;
65 static int hf_q2931_conn_id_preferred_exclusive;
66 static int hf_q2931_cause_vci;
67 static int hf_q2931_cause_information_element;
68 static int hf_q2931_oam_traffic_descriptor_backward_f5_flow_indicator;
69 static int hf_q2931_cause_rejection_reason;
70 static int hf_q2931_ethernet_type;
71 static int hf_q2931_cause_value;
72 static int hf_q2931_information_element_length;
73 static int hf_q2931_cause_rejection_user_specific_diagnostic;
74 static int hf_q2931_transit_network_sel_type;
75 static int hf_q2931_user_defined_aal_information;
76 static int hf_q2931_aal1_forward_max_cpcs_sdu_size;
77 static int hf_q2931_atm_transfer_capability;
78 static int hf_q2931_aal1_subtype;
79 static int hf_q2931_information_element_extension;
80 static int hf_q2931_party_subaddr_type_of_subaddress;
81 static int hf_q2931_number_plan;
82 static int hf_q2931_aal1_error_correction_method;
83 static int hf_q2931_call_state;
84 static int hf_q2931_bearer_class;
85 static int hf_q2931_protocol_id;
86 static int hf_q2931_information_element_data;
87 static int hf_q2931_aal1_partially_filled_cells_method;
88 static int hf_q2931_lane_protocol_id;
89 static int hf_q2931_party_subaddr_odd_even_indicator;
90 static int hf_q2931_qos_class_backward;
91 static int hf_q2931_cause_rejection_condition;
92 static int hf_q2931_aal1_source_clock_frequency_recovery_method;
93 static int hf_q2931_broadband_repeat_indicator;
94 static int hf_q2931_cause_rejection_missing_information_element;
95 static int hf_q2931_e2e_transit_delay_maximum_end_to_end;
96 static int hf_q2931_endpoint_reference_flag;
97 static int hf_q2931_endpoint_reference_identifier_value;
98 static int hf_q2931_cause_vpci;
99 static int hf_q2931_endpoint_state;
100 static int hf_q2931_high_layer_information_type;
101 static int hf_q2931_transit_network_sel_network_id;
102 static int hf_q2931_aal1_sscs_type;
103 static int hf_q2931_bband_low_layer_info_packet_window_size;
104 static int hf_q2931_aal1_structured_data_transfer_block_size;
105 static int hf_q2931_cause_timer;
106 static int hf_q2931_cause_message_type;
107 static int hf_q2931_e2e_transit_delay_cumulative;
108 static int hf_q2931_oam_traffic_descriptor_shaping_indicator;
109 static int hf_q2931_oam_end_to_end_f5_flow;
110 static int hf_q2931_oam_traffic_descriptor_forward_f5_flow_indicator;
111 static int hf_q2931_organization_code;
112 static int hf_q2931_bband_low_layer_info_additional_l3_proto;
113 static int hf_q2931_transit_network_sel_plan;
114 static int hf_q2931_bband_low_layer_info_user_info_l2_proto;
115 static int hf_q2931_aal1_multiplier;
116 static int hf_q2931_aal_type;
117 static int hf_q2931_aal1_cbr_rate;
118 static int hf_q2931_number_type;
119 static int hf_q2931_cause_rejection_diagnostic;
120 static int hf_q2931_bband_low_layer_info_default_packet_size;
121 static int hf_q2931_susceptibility_to_clipping;
122 static int hf_q2931_oam_traffic_descriptor_management_indicator;
123 static int hf_q2931_qos_class_forward;
124 static int hf_q2931_endpoint_reference_type;
125 static int hf_q2931_number_presentation_indicator;
126 static int hf_q2931_bband_low_layer_info_user_info_l1_proto;
127 static int hf_q2931_number_screening_indicator;
128 static int hf_q2931_bband_low_layer_info_window_size;
129 static int hf_q2931_conn_id_vp_associated_signalling;
130 static int hf_q2931_cause_cell_rate_subfield_identifier;
131 static int hf_q2931_frame_discard_forward_dir;
132 static int hf_q2931_frame_discard_backward_dir;
133 static int hf_q2931_tagging_backward_dir;
134 static int hf_q2931_tagging_forward_dir;
135 static int hf_q2931_midrange;
136 static int hf_q2931_cause_network_service;
137 static int hf_q2931_cause_network_behavior;
138 static int hf_q2931_nsap_address_number_short;
139 static int hf_q2931_atm_identifier;
140 static int hf_q2931_atm_identifier_value;
141 static int hf_q2931_aal_parameter_identifier;
142 static int hf_q2931_e2e_transit_delay_identifier;
143 static int hf_q2931_bband_sending_complete_id;
144 static int hf_q2931_bband_sending_complete;
145 static int hf_q2931_locking_codeset;
147 static int ett_q2931;
148 static int ett_q2931_ext;
149 static int ett_q2931_ie;
150 static int ett_q2931_ie_ext;
151 static int ett_q2931_nsap;
153 static expert_field ei_q2931_atm_identifier;
154 static expert_field ei_q2931_aal_parameter_identifier;
155 static expert_field ei_q2931_e2e_transit_delay_identifier;
156 static expert_field ei_q2931_bband_sending_complete_id;
158 static void dissect_q2931_ie(tvbuff_t *tvb, packet_info* pinfo, int offset, int len,
159 proto_tree *tree, uint8_t info_element, uint8_t info_element_ext);
162 * Q.2931 message types.
164 #define Q2931_ALERTING 0x01
165 #define Q2931_CALL_PROCEEDING 0x02
166 #define Q2931_PROGRESS 0x03
167 #define Q2931_SETUP 0x05
168 #define Q2931_CONNECT 0x07
169 #define Q2931_SETUP_ACK 0x0B
170 #define Q2931_CONNECT_ACK 0x0F
171 #define Q2931_RESTART 0x46
172 #define Q2931_RELEASE 0x4D
173 #define Q2931_RESTART_ACK 0x4E
174 #define Q2931_RELEASE_COMPLETE 0x5A
175 #define Q2931_NOTIFY 0x6E
176 #define Q2931_STATUS_ENQUIRY 0x75
177 #define Q2931_INFORMATION 0x7B
178 #define Q2931_STATUS 0x7D
179 #define Q2931_ADD_PARTY 0x80
180 #define Q2931_ADD_PARTY_ACK 0x81
181 #define Q2931_ADD_PARTY_REJ 0x82
182 #define Q2931_DROP_PARTY 0x83
183 #define Q2931_DROP_PARTY_ACK 0x84
184 #define Q2931_LEAF_SETUP_FAIL 0x90
185 #define Q2931_LEAF_SETUP_REQ 0x91
187 static const value_string q2931_message_type_vals[] = {
188 { Q2931_ALERTING, "ALERTING" },
189 { Q2931_CALL_PROCEEDING, "CALL PROCEEDING" },
190 { Q2931_PROGRESS, "PROGRESS" },
191 { Q2931_SETUP, "SETUP" },
192 { Q2931_CONNECT, "CONNECT" },
193 { Q2931_SETUP_ACK, "SETUP ACKNOWLEDGE" },
194 { Q2931_CONNECT_ACK, "CONNECT ACKNOWLEDGE" },
195 { Q2931_RESTART, "RESTART" },
196 { Q2931_RELEASE, "RELEASE" },
197 { Q2931_RESTART_ACK, "RESTART ACKNOWLEDGE" },
198 { Q2931_RELEASE_COMPLETE, "RELEASE COMPLETE" },
199 { Q2931_NOTIFY, "NOTIFY" },
200 { Q2931_STATUS_ENQUIRY, "STATUS ENQUIRY" },
201 { Q2931_INFORMATION, "INFORMATION" },
202 { Q2931_STATUS, "STATUS" },
203 { Q2931_ADD_PARTY, "ADD PARTY" },
204 { Q2931_ADD_PARTY_ACK, "ADD PARTY ACKNOWLEDGE" },
205 { Q2931_ADD_PARTY_REJ, "ADD PARTY REJECT" },
206 { Q2931_DROP_PARTY, "DROP PARTY" },
207 { Q2931_DROP_PARTY_ACK, "DROP PARTY ACKNOWLEDGE" },
208 { Q2931_LEAF_SETUP_FAIL, "LEAF SETUP FAILURE" },
209 { Q2931_LEAF_SETUP_REQ, "LEAF SETUP REQUEST" },
210 { 0, NULL }
213 static value_string_ext q2931_message_type_vals_ext = VALUE_STRING_EXT_INIT(q2931_message_type_vals);
215 static const true_false_string tfs_call_ref_flag = {
216 "Message sent to originating side",
217 "Message sent from originating side"
221 * Bits in the message type extension.
223 #define Q2931_MSG_TYPE_EXT_FOLLOW_INST 0x10 /* follow instructions in action indicator */
224 #define Q2931_MSG_TYPE_EXT_ACTION_IND 0x03 /* said instructions */
226 static const true_false_string tos_msg_flag = {
227 "Regular error handling procedures apply",
228 "Follow explicit error handling instructions"
231 static const value_string msg_action_ind_vals[] = {
232 { 0x00, "Clear call" },
233 { 0x01, "Discard and ignore" },
234 { 0x02, "Discard and report status" },
235 { 0x00, NULL }
239 * Bits in the compatibility instruction indicator octet of an
240 * information element.
242 #define Q2931_IE_COMPAT_CODING_STD 0x60 /* Coding standard */
243 #define Q2931_IE_COMPAT_FOLLOW_INST 0x10 /* follow instructions in action indicator */
244 #define Q2931_IE_COMPAT_ACTION_IND 0x07
247 * ITU-standardized coding.
249 #define Q2931_ITU_STANDARDIZED_CODING 0x00
251 static const value_string coding_std_vals[] = {
252 { 0x00, "ITU-T standardized coding" },
253 { 0x01, "ISO/IEC standard" },
254 { 0x02, "National standard" },
255 { 0x03, "Standard defined for the network" },
256 { 0, NULL }
259 static const value_string ie_action_ind_vals[] = {
260 { 0x00, "Clear call" },
261 { 0x01, "Discard information element and proceed" },
262 { 0x02, "Discard information element, proceed, and report status" },
263 { 0x05, "Discard message, and ignore" },
264 { 0x06, "Discard message, and report status" },
265 { 0x00, NULL }
269 * Information elements.
271 #define Q2931_IE_EXTENSION 0x80 /* Extension flag */
273 #define Q2931_IE_NBAND_BEARER_CAP 0x04 /* Narrowband bearer capability */
274 #define Q2931_IE_CAUSE 0x08
275 #define Q2931_IE_CALL_STATE 0x14
276 #define Q2931_IE_PROGRESS_INDICATOR 0x1E
277 #define Q2931_IE_NOTIFICATION_INDICATOR 0x27
278 #define Q2931_IE_E2E_TRANSIT_DELAY 0x42 /* End-to-end Transit Delay */
279 #define Q2931_IE_ENDPOINT_REFERENCE 0x54
280 #define Q2931_IE_ENDPOINT_STATE 0x55
281 #define Q2931_IE_AAL_PARAMETERS 0x58 /* ATM adaptation layer parameters */
282 #define Q2931_IE_ATM_USER_CELL_RATE 0x59 /* ATM traffic descriptor */
283 #define Q2931_IE_CONNECTION_IDENTIFIER 0x5A
284 #define Q2931_IE_OAM_TRAFFIC_DESCRIPTOR 0x5B
285 #define Q2931_IE_QOS_PARAMETER 0x5C /* Quality of Service parameter */
286 #define Q2931_IE_BBAND_HI_LAYER_INFO 0x5D /* Broadband high-layer information */
287 #define Q2931_IE_BBAND_BEARER_CAP 0x5E /* Broadband bearer capability */
288 #define Q2931_IE_BBAND_LOW_LAYER_INFO 0x5F /* Broadband low-layer information */
289 #define Q2931_IE_BBAND_LOCKING_SHIFT 0x60 /* Broadband locking shift */
290 #define Q2931_IE_BBAND_NLOCKING_SHIFT 0x61 /* Broadband non-locking shift */
291 #define Q2931_IE_BBAND_SENDING_COMPL 0x62 /* Broadband sending complete */
292 #define Q2931_IE_BBAND_RPT_INDICATOR 0x63 /* Broadband repeat indicator */
293 #define Q2931_IE_CALLING_PARTY_NUMBER 0x6C /* Calling Party Number */
294 #define Q2931_IE_CALLING_PARTY_SUBADDR 0x6D /* Calling Party Subaddress */
295 #define Q2931_IE_CALLED_PARTY_NUMBER 0x70 /* Called Party Number */
296 #define Q2931_IE_CALLED_PARTY_SUBADDR 0x71 /* Called Party Subaddress */
297 #define Q2931_IE_TRANSIT_NETWORK_SEL 0x78 /* Transit Network Selection */
298 #define Q2931_IE_RESTART_INDICATOR 0x79
299 #define Q2931_IE_NBAND_LOW_LAYER_COMPAT 0x7C /* Narrowband Low-Layer Compatibility */
300 #define Q2931_IE_NBAND_HIGH_LAYER_COMPAT 0x7D /* Narrowband High-Layer Compatibility */
301 #define Q2931_IE_GENERIC_IDENT_TRANSPORT 0x7F /* Generic identifier transport */
303 static const value_string q2931_info_element_vals[] = {
304 { Q2931_IE_NBAND_BEARER_CAP, "Narrowband bearer capability" },
305 { Q2931_IE_CAUSE, "Cause" },
306 { Q2931_IE_CALL_STATE, "Call state" },
307 { Q2931_IE_PROGRESS_INDICATOR, "Progress indicator" },
308 { Q2931_IE_NOTIFICATION_INDICATOR, "Notification indicator" },
309 { Q2931_IE_E2E_TRANSIT_DELAY, "End-to-end transit delay" },
310 { Q2931_IE_ENDPOINT_REFERENCE, "Endpoint reference" },
311 { Q2931_IE_ENDPOINT_STATE, "Endpoint state" },
312 { Q2931_IE_AAL_PARAMETERS, "AAL parameters" },
313 { Q2931_IE_ATM_USER_CELL_RATE, "ATM user cell rate" },
314 { Q2931_IE_CONNECTION_IDENTIFIER, "Connection identifier" },
315 { Q2931_IE_OAM_TRAFFIC_DESCRIPTOR, "OAM traffic descriptor" },
316 { Q2931_IE_QOS_PARAMETER, "Quality of service parameter" },
317 { Q2931_IE_BBAND_HI_LAYER_INFO, "Broadband high-layer information" },
318 { Q2931_IE_BBAND_BEARER_CAP, "Broadband bearer capability" },
319 { Q2931_IE_BBAND_LOW_LAYER_INFO, "Broadband low-layer information" },
320 { Q2931_IE_BBAND_LOCKING_SHIFT, "Broadband locking shift" },
321 { Q2931_IE_BBAND_NLOCKING_SHIFT, "Broadband non-locking shift" },
322 { Q2931_IE_BBAND_SENDING_COMPL, "Broadband sending complete" },
323 { Q2931_IE_BBAND_RPT_INDICATOR, "Broadband repeat indicator" },
324 { Q2931_IE_CALLING_PARTY_NUMBER, "Calling party number" },
325 { Q2931_IE_CALLING_PARTY_SUBADDR, "Calling party subaddress" },
326 { Q2931_IE_CALLED_PARTY_NUMBER, "Called party number" },
327 { Q2931_IE_CALLED_PARTY_SUBADDR, "Called party subaddress" },
328 { Q2931_IE_TRANSIT_NETWORK_SEL, "Transit network selection" },
329 { Q2931_IE_RESTART_INDICATOR, "Restart indicator" },
330 { Q2931_IE_NBAND_LOW_LAYER_COMPAT, "Narrowband low-layer compatibility" },
331 { Q2931_IE_NBAND_HIGH_LAYER_COMPAT, "Narrowband high-layer compatibility" },
332 { Q2931_IE_GENERIC_IDENT_TRANSPORT, "Generic identifier transport" },
333 { 0, NULL }
336 static value_string_ext q2931_info_element_vals_ext = VALUE_STRING_EXT_INIT(q2931_info_element_vals);
339 * Dissect a locking or non-locking shift information element.
341 static const value_string q2931_codeset_vals[] = {
342 { 0x00, "Q.2931 information elements" },
343 { 0x04, "Information elements for ISO/IEC use" },
344 { 0x05, "Information elements for national use" },
345 { 0x06, "Information elements specific to the local network" },
346 { 0x07, "User-specific information elements" },
347 { 0x00, NULL },
350 static const true_false_string tfs_q2931_handling_instructions = { "Follow explicit error handling instructions",
351 "Regular error handling procedures apply" };
353 static void
354 dissect_q2931_shift_ie(tvbuff_t *tvb, int offset, int len,
355 proto_tree *tree, uint8_t info_element)
357 bool non_locking_shift;
358 uint8_t codeset;
360 if (len == 0)
361 return;
362 non_locking_shift = (info_element == Q2931_IE_BBAND_NLOCKING_SHIFT);
363 codeset = tvb_get_uint8(tvb, offset) & 0x07;
364 proto_tree_add_uint_format(tree, hf_q2931_locking_codeset, tvb, offset, 1, codeset,
365 "%s shift to codeset %u: %s",
366 (non_locking_shift ? "Non-locking" : "Locking"),
367 codeset, val_to_str(codeset, q2931_codeset_vals, "Unknown (0x%02X)"));
371 * Dissect an ATM adaptation layer parameters information element.
373 #define Q2931_AAL_VOICE 0x00
374 #define Q2931_AAL1 0x01
375 #define Q2931_AAL2 0x02
376 #define Q2931_AAL3_4 0x03
377 #define Q2931_AAL5 0x05
378 #define Q2931_USER_DEFINED_AAL 0x10
380 static const value_string q9231_aal_type_vals[] = {
381 { 0x00, "AAL for voice" },
382 { 0x01, "AAL type 1" },
383 { 0x02, "AAL type 2" },
384 { 0x03, "AAL type 3/4" },
385 { 0x05, "AAL type 5" },
386 { 0x10, "User-defined AAL" },
387 { 0, NULL }
390 static const value_string q9231_aal1_subtype_vals[] = {
391 { 0x00, "Null" },
392 { 0x01, "64 kbit/s voice-band signal transport (G.711/G.722)" },
393 { 0x02, "Circuit transport (I.363)" },
394 { 0x03, "Circuit emulation (asynchronous)" },
395 { 0x04, "High-quality audio signal transport (I.363)" },
396 { 0x05, "Video signal transport (I.363)" },
397 { 0x00, NULL }
400 #define Q2931_AAL1_nx64_KBIT_S 0x40
401 #define Q2931_AAL1_nx8_KBIT_S 0x41
403 static const value_string q9231_aal1_cbr_rate_vals[] = {
404 { 0x01, "64 kbit/s" },
405 { 0x04, "1544 kbit/s" },
406 { 0x05, "6312 kbit/s" },
407 { 0x06, "32064 kbit/s" },
408 { 0x07, "44736 kbit/s" },
409 { 0x08, "97728 kbit/s" },
410 { 0x10, "2048 kbit/s" },
411 { 0x11, "8448 kibt/s" },
412 { 0x12, "34368 kbit/s" },
413 { 0x13, "139264 kbit/s" },
414 { Q2931_AAL1_nx64_KBIT_S, "nx64 kbit/s" },
415 { Q2931_AAL1_nx8_KBIT_S, "nx8 kbit/s" },
416 { 0x00, NULL }
419 static const value_string q2931_aal1_src_clk_rec_meth_vals[] = {
420 { 0x00, "Null (synchronous circuit transport)" },
421 { 0x01, "SRTS method (asynchronous circuit transport" },
422 { 0x02, "Adaptive clock method" },
423 { 0x00, NULL }
426 static const value_string q2931_aal1_err_correction_method_vals[] = {
427 { 0x00, "Null" },
428 { 0x01, "FEC method for less sensitive signal transport" },
429 { 0x02, "FEC method for delay-sensitive signal transport" },
430 { 0x00, NULL }
433 static const value_string q2931_aal_mode_vals[] = {
434 { 0x01, "Message" },
435 { 0x02, "Streaming" },
436 { 0x00, NULL }
439 static const value_string q2931_sscs_type_vals[] = {
440 { 0x00, "Null" },
441 { 0x01, "Data SSCS based on SSCOP (assured operation)" },
442 { 0x02, "Data SSCS based on SSCOP (non-assured operation)" },
443 { 0x04, "Frame relay SSCS" },
444 { 0x00, NULL }
447 static void
448 dissect_q2931_aal_parameters_ie(tvbuff_t *tvb, packet_info* pinfo, int offset, int len,
449 proto_tree *tree)
451 uint8_t aal_type;
452 uint8_t identifier;
453 uint32_t value;
454 uint32_t low_mid, high_mid;
455 proto_item* ti;
457 if (len == 0)
458 return;
459 aal_type = tvb_get_uint8(tvb, offset);
460 proto_tree_add_item(tree, hf_q2931_aal_type, tvb, offset, 1, ENC_BIG_ENDIAN);
461 offset += 1;
462 len -= 1;
465 * Now get the rest of the IE.
467 if (aal_type == 0x40) {
469 * User-defined AAL.
471 if (len > 4)
472 len = 4;
473 proto_tree_add_item(tree, hf_q2931_user_defined_aal_information, tvb, offset, len, ENC_NA);
474 return;
477 while (len >= 0) {
478 identifier = tvb_get_uint8(tvb, offset);
479 ti = proto_tree_add_item(tree, hf_q2931_aal_parameter_identifier, tvb, offset, 1, ENC_NA);
480 offset++;
481 len--;
482 switch (identifier) {
484 case 0x85: /* Subtype identifier for AAL1 */
485 if (len < 1)
486 return;
487 proto_tree_add_item(tree, hf_q2931_aal1_subtype, tvb, offset, 1, ENC_NA);
488 offset++;
489 len--;
490 break;
492 case 0x86: /* CBR identifier for AAL1 */
493 if (len < 1)
494 return;
495 proto_tree_add_item(tree, hf_q2931_aal1_cbr_rate, tvb, offset, 1, ENC_NA);
496 offset++;
497 len--;
498 break;
500 case 0x87: /* Multiplier identifier for AAL1 */
501 if (len < 2)
502 return;
503 proto_tree_add_item(tree, hf_q2931_aal1_multiplier, tvb, offset, 2, ENC_BIG_ENDIAN);
504 offset += 2;
505 len -= 2;
506 break;
508 case 0x88: /* Source clock frequency recovery method identifier for AAL1 */
509 if (len < 1)
510 return;
511 proto_tree_add_item(tree, hf_q2931_aal1_source_clock_frequency_recovery_method, tvb, offset, 1, ENC_NA);
512 offset++;
513 len--;
514 break;
516 case 0x89: /* Error correction method identifier for AAL1 */
517 if (len < 1)
518 return;
519 proto_tree_add_item(tree, hf_q2931_aal1_error_correction_method, tvb, offset, 1, ENC_NA);
520 offset++;
521 len--;
522 break;
524 case 0x8A: /* Structured data transfer block size identifier for AAL1 */
525 if (len < 2)
526 return;
527 proto_tree_add_item(tree, hf_q2931_aal1_structured_data_transfer_block_size, tvb, offset, 2, ENC_BIG_ENDIAN);
528 offset += 2;
529 len -= 2;
530 break;
532 case 0x8B: /* Partially filled cells identifier for AAL1 */
533 if (len < 1)
534 return;
535 value = tvb_get_uint8(tvb, offset);
536 proto_tree_add_uint_format_value(tree, hf_q2931_aal1_partially_filled_cells_method, tvb, offset, 1,
537 value, "%u octets", value);
538 offset++;
539 len--;
540 break;
542 case 0x8C: /* Forward maximum CPCS-SDU size identifier for AAL3/4 and AAL5 */
543 if (len < 2)
544 return;
545 proto_tree_add_item(tree, hf_q2931_aal1_forward_max_cpcs_sdu_size, tvb, offset, 2, ENC_BIG_ENDIAN);
546 offset += 2;
547 len -= 2;
548 break;
550 case 0x81: /* Backward maximum CPCS-SDU size identifier for AAL3/4 and AAL5 */
551 if (len < 2)
552 return;
553 proto_tree_add_item(tree, hf_q2931_aal1_backward_max_cpcs_sdu_size, tvb, offset, 2, ENC_BIG_ENDIAN);
554 offset += 2;
555 len -= 2;
556 break;
558 case 0x82: /* MID range identifier for AAL3/4 */
559 if (len < 4)
560 return;
561 low_mid = tvb_get_ntohs(tvb, offset);
562 high_mid = tvb_get_ntohs(tvb, offset + 2);
563 proto_tree_add_uint_format_value(tree, hf_q2931_midrange, tvb, offset, 4, tvb_get_ntohl(tvb, offset),
564 "%u - %u", low_mid, high_mid);
565 offset += 4;
566 len -= 4;
567 break;
569 case 0x83: /* Mode identifier for AAL3/4 and AAL5 */
570 if (len < 1)
571 return;
572 proto_tree_add_item(tree, hf_q2931_aal1_mode, tvb, offset, 1, ENC_NA);
573 offset++;
574 len--;
575 break;
577 case 0x84: /* SSCS type identifier for AAL3/4 and AAL5 */
578 if (len < 1)
579 return;
580 proto_tree_add_item(tree, hf_q2931_aal1_sscs_type, tvb, offset, 1, ENC_NA);
581 offset++;
582 len--;
583 break;
585 default: /* unknown AAL parameter */
586 expert_add_info(pinfo, ti, &ei_q2931_aal_parameter_identifier);
587 return; /* give up */
593 * Dissect an ATM traffic descriptor information element.
595 #define Q2931_ATM_CR_FW_PEAK_CLP_0 0x82 /* Forward peak cell rate (CLP = 0) */
596 #define Q2931_ATM_CR_BW_PEAK_CLP_0 0x83 /* Backward peak cell rate (CLP = 0) */
597 #define Q2931_ATM_CR_FW_PEAK_CLP_0_1 0x84 /* Forward peak cell rate (CLP = 0 + 1) */
598 #define Q2931_ATM_CR_BW_PEAK_CLP_0_1 0x85 /* Backward peak cell rate (CLP = 0 + 1) */
599 #define Q2931_ATM_CR_FW_SUST_CLP_0 0x88 /* Forward sustainable cell rate (CLP = 0) */
600 #define Q2931_ATM_CR_BW_SUST_CLP_0 0x89 /* Backward sustainable cell rate (CLP = 0) */
601 #define Q2931_ATM_CR_FW_SUST_CLP_0_1 0x90 /* Forward sustainable cell rate (CLP = 0 + 1) */
602 #define Q2931_ATM_CR_BW_SUST_CLP_0_1 0x91 /* Backward sustainable cell rate (CLP = 0 + 1) */
603 #define Q2931_ATM_CR_FW_MAXB_CLP_0 0xA0 /* Forward maximum burst size (CLP = 0) */
604 #define Q2931_ATM_CR_BW_MAXB_CLP_0 0xA1 /* Backward maximum burst size (CLP = 0) */
605 #define Q2931_ATM_CR_FW_MAXB_CLP_0_1 0xB0 /* Forward maximum burst size (CLP = 0 + 1) */
606 #define Q2931_ATM_CR_BW_MAXB_CLP_0_1 0xB1 /* Backward maximum burst size (CLP = 0 + 1) */
607 #define Q2931_ATM_CR_BEST_EFFORT_IND 0xBE /* Best effort indicator */
608 #define Q2931_ATM_CR_TRAFFIC_MGMT_OPT 0xBF /* Traffic management options */
610 static const value_string q2931_atm_td_subfield_vals[] = {
611 { Q2931_ATM_CR_FW_PEAK_CLP_0, "Forward peak cell rate (CLP = 0)" },
612 { Q2931_ATM_CR_BW_PEAK_CLP_0, "Backward peak cell rate (CLP = 0)" },
613 { Q2931_ATM_CR_FW_PEAK_CLP_0_1, "Forward peak cell rate (CLP = 0 + 1)" },
614 { Q2931_ATM_CR_BW_PEAK_CLP_0_1, "Backward peak cell rate (CLP = 0 + 1)" },
615 { Q2931_ATM_CR_FW_SUST_CLP_0, "Forward sustainable cell rate (CLP = 0)" },
616 { Q2931_ATM_CR_BW_SUST_CLP_0, "Backward sustainable cell rate (CLP = 0)" },
617 { Q2931_ATM_CR_FW_SUST_CLP_0_1, "Forward sustainable cell rate (CLP = 0 + 1)" },
618 { Q2931_ATM_CR_BW_SUST_CLP_0_1, "Backward sustainable cell rate (CLP = 0 + 1)" },
619 { Q2931_ATM_CR_FW_MAXB_CLP_0, "Forward maximum burst size (CLP = 0)" },
620 { Q2931_ATM_CR_BW_MAXB_CLP_0, "Backward maximum burst size (CLP = 0)" },
621 { Q2931_ATM_CR_FW_MAXB_CLP_0_1, "Forward maximum burst size (CLP = 0 + 1)" },
622 { Q2931_ATM_CR_BW_MAXB_CLP_0_1, "Backward maximum burst size (CLP = 0 + 1)" },
623 { Q2931_ATM_CR_BEST_EFFORT_IND, "Best effort indicator" },
624 { Q2931_ATM_CR_TRAFFIC_MGMT_OPT,"Traffic management options" },
625 { 0x0, NULL }
628 static const unit_name_string units_cells_s = { " cell/s", " cells/s" };
630 static void
631 dissect_q2931_atm_cell_rate_ie(tvbuff_t *tvb, packet_info* pinfo, int offset, int len,
632 proto_tree *tree)
634 uint8_t identifier;
635 uint32_t value;
636 proto_item* ti;
638 while (len >= 0) {
639 identifier = tvb_get_uint8(tvb, offset);
640 ti = proto_tree_add_item(tree, hf_q2931_atm_identifier, tvb, offset, 1, ENC_NA);
642 switch (identifier) {
644 case Q2931_ATM_CR_FW_PEAK_CLP_0:
645 case Q2931_ATM_CR_BW_PEAK_CLP_0:
646 case Q2931_ATM_CR_FW_PEAK_CLP_0_1:
647 case Q2931_ATM_CR_BW_PEAK_CLP_0_1:
648 case Q2931_ATM_CR_FW_SUST_CLP_0:
649 case Q2931_ATM_CR_BW_SUST_CLP_0:
650 case Q2931_ATM_CR_FW_SUST_CLP_0_1:
651 case Q2931_ATM_CR_BW_SUST_CLP_0_1:
652 case Q2931_ATM_CR_FW_MAXB_CLP_0:
653 case Q2931_ATM_CR_BW_MAXB_CLP_0:
654 case Q2931_ATM_CR_FW_MAXB_CLP_0_1:
655 case Q2931_ATM_CR_BW_MAXB_CLP_0_1:
656 if (len < 4)
657 return;
659 value = tvb_get_ntoh24(tvb, offset + 1);
660 proto_tree_add_uint(tree, hf_q2931_atm_identifier_value, tvb, offset+3, 3, value);
661 offset += 4;
662 len -= 4;
663 break;
665 case Q2931_ATM_CR_BEST_EFFORT_IND:
666 /* Yes, its value *IS* 0xBE.... */
667 offset += 1;
668 len -= 1;
669 break;
671 case Q2931_ATM_CR_TRAFFIC_MGMT_OPT:
672 if (len < 2)
673 return;
674 proto_tree_add_item(tree, hf_q2931_frame_discard_forward_dir, tvb, offset + 1, 1, ENC_NA);
675 proto_tree_add_item(tree, hf_q2931_frame_discard_backward_dir, tvb, offset + 1, 1, ENC_NA);
676 proto_tree_add_item(tree, hf_q2931_tagging_backward_dir, tvb, offset + 1, 1, ENC_NA);
677 proto_tree_add_item(tree, hf_q2931_tagging_forward_dir, tvb, offset + 1, 1, ENC_NA);
678 offset += 2;
679 len -= 2;
680 break;
682 default: /* unknown ATM traffic descriptor element */
683 expert_add_info(pinfo, ti, &ei_q2931_atm_identifier);
684 return; /* give up */
690 * Dissect a broadband bearer capability information element.
692 static const value_string q2931_bearer_class_vals[] = {
693 { 0x01, "BCOB-A" },
694 { 0x03, "BCOB-C" },
695 { 0x10, "BCOB-X" },
696 { 0x18, "Transparent VP Service" },
697 { 0x00, NULL }
700 static const value_string q2931_transfer_capability_vals[] = {
701 { 0x00, "No bit rate indication" },
702 { 0x01, "No bit rate indication, end-to-end timing required" },
703 { 0x02, "No bit rate indication, end-to-end timing not required" },
704 { 0x04, "CBR" },
705 { 0x05, "CBR, end-to-end timing required" },
706 { 0x06, "CBR, end-to-end timing not required" },
707 { 0x07, "CBR with CLR commitment on CLP=0+1" },
708 { 0x08, "VBR, no timing requirements indication" },
709 { 0x09, "Real time VBR" },
710 { 0x0A, "Non-real time VBR" },
711 { 0x0B, "Non-real time VBR with CLR commitment on CLP=0+1" },
712 { 0x0C, "ABR" },
713 { 0x00, NULL }
716 static const value_string q2931_susc_clip_vals[] = {
717 { 0, "Not susceptible to clipping" },
718 { 1, "Susceptible to clipping" },
719 { 0, NULL }
722 static const value_string q2931_up_conn_config_vals[] = {
723 { 0x00, "Point-to-point" },
724 { 0x01, "Point-to-multipoint" },
725 { 0x00, NULL }
728 static void
729 dissect_q2931_bband_bearer_cap_ie(tvbuff_t *tvb, int offset, int len,
730 proto_tree *tree)
732 uint8_t octet;
734 if (len == 0)
735 return;
736 octet = tvb_get_uint8(tvb, offset);
737 proto_tree_add_item(tree, hf_q2931_bearer_class, tvb, offset, 1, ENC_BIG_ENDIAN);
738 offset += 1;
739 len -= 1;
741 if (len == 0)
742 return;
743 if (!(octet & Q2931_IE_EXTENSION)) {
744 proto_tree_add_item(tree, hf_q2931_atm_transfer_capability, tvb, offset, 1, ENC_BIG_ENDIAN);
745 offset += 1;
746 len -= 1;
749 if (len == 0)
750 return;
751 proto_tree_add_item(tree, hf_q2931_susceptibility_to_clipping, tvb, offset, 1, ENC_BIG_ENDIAN);
752 proto_tree_add_item(tree, hf_q2931_user_plane_connection_configuration, tvb, offset, 1, ENC_BIG_ENDIAN);
756 * Dissect a broadband high layer information information element.
758 static const value_string q2931_hi_layer_info_type_vals[] = {
759 { 0x00, "ISO/IEC" },
760 { 0x01, "User-specific" },
761 { 0x03, "Vendor-specific" },
762 { 0x04, "ITU-T SG 1 B-ISDN teleservice recommendation" },
763 { 0x00, NULL }
766 static void
767 dissect_q2931_bband_hi_layer_info_ie(tvbuff_t *tvb, int offset, int len,
768 proto_tree *tree)
770 if (len == 0)
771 return;
773 proto_tree_add_item(tree, hf_q2931_high_layer_information_type, tvb, offset, 1, ENC_BIG_ENDIAN);
774 /*offset += 1; */
775 /* len -= 1; */
779 * Dissect a Bearer capability or Low-layer compatibility information element.
781 #define Q2931_UIL2_USER_SPEC 0x10
783 static const value_string q2931_uil2_vals[] = {
784 { 0x01, "Basic mode ISO 1745" },
785 { 0x02, "Q.921/I.441" }, /* LAPD */
786 { 0x06, "X.25, link layer" }, /* LAPB */
787 { 0x07, "X.25 multilink" }, /* or 0x0F? */
788 { 0x08, "T.71 Extended LAPB" },
789 { 0x09, "HDLC ARM" },
790 { 0x0A, "HDLC NRM" },
791 { 0x0B, "HDLC ABM" },
792 { 0x0C, "ISO 8802/2 LLC" },
793 { 0x0D, "X.75 Single Link Procedure" },
794 { 0x0E, "Q.922" },
795 { Q2931_UIL2_USER_SPEC, "User-specified" },
796 { 0x11, "ISO 7776 DTE-DTE operation" },
797 { 0, NULL }
800 static const value_string q2931_mode_vals[] = {
801 { 1, "Normal mode" },
802 { 2, "Extended mode" },
803 { 0, NULL }
806 #define Q2931_UIL3_X25_PL 0x06
807 #define Q2931_UIL3_ISO_8208 0x07 /* X.25-based */
808 #define Q2931_UIL3_X223 0x08 /* X.25-based */
809 #define Q2931_UIL3_TR_9577 0x0B
810 #define Q2931_UIL3_USER_SPEC 0x10
812 static const value_string q2931_uil3_vals[] = {
813 { Q2931_UIL3_X25_PL, "X.25, packet layer" },
814 { Q2931_UIL3_ISO_8208, "ISO/IEC 8208" },
815 { Q2931_UIL3_X223, "X.223/ISO 8878" },
816 { 0x09, "ISO/IEC 8473" },
817 { 0x0A, "T.70" },
818 { Q2931_UIL3_TR_9577, "ISO/IEC TR 9577" },
819 { Q2931_UIL3_USER_SPEC, "User-specified" },
820 { 0, NULL }
823 static const value_string lane_pid_vals[] = {
824 { 0x0001, "LE Configuration Direct/Control Direct/Control Distribute" },
825 { 0x0002, "Ethernet/IEEE 002.3 LE Data Direct" },
826 { 0x0003, "IEEE 802.5 LE Data Direct" },
827 { 0x0004, "Ethernet/IEEE 802.3 LE Multicast Send/Multicast Forward" },
828 { 0x0005, "IEEE 802.5 LE Multicast Send/Multicast Forward" },
829 { 0, NULL },
833 * Dissect a broadband low layer information information element.
835 static void
836 dissect_q2931_bband_low_layer_info_ie(tvbuff_t *tvb, int offset, int len,
837 proto_tree *tree)
839 uint8_t octet;
840 uint8_t uil2_protocol;
841 uint8_t uil3_protocol;
842 uint8_t add_l3_info;
843 uint32_t organization_code;
845 if (len == 0)
846 return;
847 octet = tvb_get_uint8(tvb, offset);
848 if ((octet & 0x60) == 0x20) {
850 * Layer 1 information.
852 proto_tree_add_item(tree, hf_q2931_bband_low_layer_info_user_info_l1_proto, tvb, offset, 1, ENC_BIG_ENDIAN);
853 offset += 1;
854 len -= 1;
857 if (len == 0)
858 return;
859 octet = tvb_get_uint8(tvb, offset);
860 if ((octet & 0x60) == 0x40) {
862 * Layer 2 information.
864 uil2_protocol = octet & 0x1F;
865 proto_tree_add_item(tree, hf_q2931_bband_low_layer_info_user_info_l2_proto, tvb, offset, 1, ENC_BIG_ENDIAN);
866 offset += 1;
867 len -= 1;
869 if (octet & Q2931_IE_EXTENSION)
870 goto l2_done;
871 if (len == 0)
872 return;
873 octet = tvb_get_uint8(tvb, offset);
874 if (uil2_protocol == Q2931_UIL2_USER_SPEC) {
875 proto_tree_add_item(tree, hf_q2931_bband_low_layer_info_user_specified_l2_proto, tvb, offset, 1, ENC_BIG_ENDIAN);
876 } else {
877 proto_tree_add_item(tree, hf_q2931_bband_low_layer_info_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
879 offset += 1;
880 len -= 1;
882 if (octet & Q2931_IE_EXTENSION)
883 goto l2_done;
884 if (len == 0)
885 return;
886 octet = tvb_get_uint8(tvb, offset);
887 proto_tree_add_uint_format_value(tree, hf_q2931_bband_low_layer_info_window_size, tvb, offset, 1,
888 octet & 0x7F, "%u k", octet & 0x7F);
889 offset += 1;
890 len -= 1;
892 l2_done:
895 if (len == 0)
896 return;
897 octet = tvb_get_uint8(tvb, offset);
898 if ((octet & 0x60) == 0x60) {
900 * Layer 3 information.
902 uil3_protocol = octet & 0x1F;
903 proto_tree_add_item(tree, hf_q2931_bband_low_layer_info_user_info_l3_proto, tvb, offset, 1, ENC_BIG_ENDIAN);
904 offset += 1;
905 len -= 1;
909 * XXX - only in Low-layer compatibility information element.
911 if (octet & Q2931_IE_EXTENSION)
912 goto l3_done;
913 if (len == 0)
914 return;
915 octet = tvb_get_uint8(tvb, offset);
916 switch (uil3_protocol) {
918 case Q2931_UIL3_X25_PL:
919 case Q2931_UIL3_ISO_8208:
920 case Q2931_UIL3_X223:
921 proto_tree_add_item(tree, hf_q2931_bband_low_layer_info_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
922 offset += 1;
923 len -= 1;
925 if (octet & Q2931_IE_EXTENSION)
926 goto l3_done;
927 if (len == 0)
928 return;
929 octet = tvb_get_uint8(tvb, offset);
930 proto_tree_add_item(tree, hf_q2931_bband_low_layer_info_default_packet_size, tvb, offset, 1, ENC_BIG_ENDIAN);
931 offset += 1;
932 len -= 1;
934 if (octet & Q2931_IE_EXTENSION)
935 goto l3_done;
936 if (len == 0)
937 return;
938 proto_tree_add_item(tree, hf_q2931_bband_low_layer_info_packet_window_size, tvb, offset, 1, ENC_BIG_ENDIAN);
939 /*offset += 1;*/
940 /*len -= 1;*/
941 break;
943 case Q2931_UIL3_USER_SPEC:
944 proto_tree_add_uint(tree, hf_q2931_bband_low_layer_info_default_packet_size, tvb, offset, 1, 1 << (octet & 0x0F));
945 /*offset += 1;*/
946 /*len -= 1;*/
947 break;
949 case Q2931_UIL3_TR_9577:
950 add_l3_info = (octet & 0x7F) << 1;
951 if (octet & Q2931_IE_EXTENSION)
952 goto l3_done;
953 if (len < 2)
954 return;
955 add_l3_info |= (tvb_get_uint8(tvb, offset + 1) & 0x40) >> 6;
956 proto_tree_add_uint(tree, hf_q2931_bband_low_layer_info_additional_l3_proto, tvb, offset, 2, add_l3_info);
957 offset += 2;
958 len -= 2;
959 if (add_l3_info == NLPID_SNAP) {
960 if (len < 6)
961 return;
962 offset += 1;
963 /*len -= 1;*/
964 organization_code = tvb_get_ntoh24(tvb, offset);
965 proto_tree_add_item(tree, hf_q2931_organization_code, tvb, offset, 3, ENC_BIG_ENDIAN);
966 offset += 3;
967 /*len -= 3;*/
969 switch (organization_code) {
971 case OUI_ENCAP_ETHER:
972 proto_tree_add_item(tree, hf_q2931_ethernet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
973 break;
975 case OUI_ATM_FORUM:
976 proto_tree_add_item(tree, hf_q2931_lane_protocol_id, tvb, offset, 2, ENC_BIG_ENDIAN);
977 break;
979 default:
980 proto_tree_add_item(tree, hf_q2931_protocol_id, tvb, offset, 2, ENC_BIG_ENDIAN);
981 break;
984 break;
987 l3_done:
992 * Dissect a Cause information element.
994 static const value_string q2931_cause_location_vals[] = {
995 { 0x00, "User (U)" },
996 { 0x01, "Private network serving the local user (LPN)" },
997 { 0x02, "Public network serving the local user (LN)" },
998 { 0x03, "Transit network (TN)" },
999 { 0x04, "Public network serving the remote user (RLN)" },
1000 { 0x05, "Private network serving the remote user (RPN)" },
1001 { 0x07, "International network (INTL)" },
1002 { 0x0A, "Network beyond interworking point (BI)" },
1003 { 0, NULL }
1007 * Cause codes for Cause.
1009 #define Q2931_CAUSE_UNALLOC_NUMBER 0x01
1010 #define Q2931_CAUSE_NO_ROUTE_TO_DEST 0x03
1011 #define Q2931_CAUSE_CALL_REJECTED 0x15
1012 #define Q2931_CAUSE_NUMBER_CHANGED 0x16
1013 #define Q2931_CAUSE_CELL_RATE_UNAVAIL 0x25
1014 #define Q2931_CAUSE_ACCESS_INFO_DISC 0x2B
1015 #define Q2931_CAUSE_QOS_UNAVAILABLE 0x31
1016 #define Q2931_CAUSE_CHAN_NONEXISTENT 0x52
1017 #define Q2931_CAUSE_INCOMPATIBLE_DEST 0x58
1018 #define Q2931_CAUSE_MAND_IE_MISSING 0x60
1019 #define Q2931_CAUSE_MT_NONEX_OR_UNIMPL 0x61
1020 #define Q2931_CAUSE_IE_NONEX_OR_UNIMPL 0x63
1021 #define Q2931_CAUSE_INVALID_IE_CONTENTS 0x64
1022 #define Q2931_CAUSE_MSG_INCOMPAT_W_CS 0x65
1023 #define Q2931_CAUSE_REC_TIMER_EXP 0x66
1025 static const value_string q2931_cause_code_vals[] = {
1026 { Q2931_CAUSE_UNALLOC_NUMBER, "Unallocated (unassigned) number" },
1027 { 0x02, "No route to specified transit network" },
1028 { Q2931_CAUSE_NO_ROUTE_TO_DEST, "No route to destination" },
1029 { 0x04, "Send special information tone" },
1030 { 0x05, "Misdialled trunk prefix" },
1031 { 0x06, "Channel unacceptable" },
1032 { 0x07, "Call awarded and being delivered in an established channel" },
1033 { 0x08, "Preemption" },
1034 { 0x09, "Preemption - circuit reserved for reuse" },
1035 { 0x0E, "QoR: ported number" },
1036 { 0x10, "Normal call clearing" },
1037 { 0x11, "User busy" },
1038 { 0x12, "No user responding" },
1039 { 0x13, "No answer from user (user alerted)" },
1040 { 0x14, "Subscriber absent" },
1041 { Q2931_CAUSE_CALL_REJECTED, "Call rejected" },
1042 { Q2931_CAUSE_NUMBER_CHANGED, "Number changed" },
1043 { 0x17, "Redirection to new destination" },
1044 { 0x18, "Call rejected due to feature at the destination" },
1045 { 0x19, "Exchange routing error" },
1046 { 0x1A, "Non-selected user clearing" },
1047 { 0x1B, "Destination out of order" },
1048 { 0x1C, "Invalid number format (incomplete number)" },
1049 { 0x1E, "Response to STATUS ENQUIRY" },
1050 { 0x1F, "Normal unspecified" },
1051 { 0x20, "Too many pending add party request" },
1052 { 0x23, "Requested VPCI/VCI not available" },
1053 { 0x24, "VPCI/VCI assignment failure" },
1054 { Q2931_CAUSE_CELL_RATE_UNAVAIL,"User cell rate not available" },
1055 { 0x26, "Network out of order" },
1056 { 0x27, "Permanent frame mode connection out of service" },
1057 { 0x28, "Permanent frame mode connection operational" },
1058 { 0x29, "Temporary failure" },
1059 { 0x2A, "Switching equipment congestion" },
1060 { Q2931_CAUSE_ACCESS_INFO_DISC, "Access information discarded" },
1061 { 0x2C, "Requested circuit/channel not available" },
1062 { 0x2D, "No VPCI/VCI available" },
1063 { 0x2F, "Resources unavailable, unspecified" },
1064 { Q2931_CAUSE_QOS_UNAVAILABLE, "Quality of service unavailable" },
1065 { 0x32, "Requested facility not subscribed" },
1066 { 0x35, "Outgoing calls barred within CUG" },
1067 { 0x37, "Incoming calls barred within CUG" },
1068 { 0x39, "Bearer capability not authorized" },
1069 { 0x3A, "Bearer capability not presently available" },
1070 { 0x3E, "Inconsistency in designated outgoing access information and subscriber class" },
1071 { 0x3F, "Service or option not available, unspecified" },
1072 { 0x41, "Bearer capability not implemented" },
1073 { 0x42, "Channel type not implemented" },
1074 { 0x45, "Requested facility not implemented" },
1075 { 0x46, "Only restricted digital information bearer capability is available" },
1076 { 0x49, "Unsupported combination of traffic parameters" },
1077 { 0x4E, "AAL parameters cannot be supported" },
1078 { 0x4F, "Service or option not implemented, unspecified" },
1079 { 0x51, "Invalid call reference value" },
1080 { Q2931_CAUSE_CHAN_NONEXISTENT, "Identified channel does not exist" },
1081 { 0x53, "Call identity does not exist for suspended call" },
1082 { 0x54, "Call identity in use" },
1083 { 0x55, "No call suspended" },
1084 { 0x56, "Call having the requested call identity has been cleared" },
1085 { 0x57, "Called user not member of CUG" },
1086 { Q2931_CAUSE_INCOMPATIBLE_DEST,"Incompatible destination" },
1087 { 0x59, "Invalid endpoint reference" },
1088 { 0x5A, "Non-existent CUG" },
1089 { 0x5B, "Invalid transit network selection" },
1090 { 0x5C, "Too many pending ADD PARTY requests" },
1091 { 0x5D, "AAL parameters cannot be supported" },
1092 { 0x5F, "Invalid message, unspecified" },
1093 { Q2931_CAUSE_MAND_IE_MISSING, "Mandatory information element is missing" },
1094 { Q2931_CAUSE_MT_NONEX_OR_UNIMPL,"Message type non-existent or not implemented" },
1095 { 0x62, "Message not compatible with call state or message type non-existent or not implemented" },
1096 { Q2931_CAUSE_IE_NONEX_OR_UNIMPL,"Information element non-existent or not implemented" },
1097 { Q2931_CAUSE_INVALID_IE_CONTENTS,"Invalid information element contents" },
1098 { Q2931_CAUSE_MSG_INCOMPAT_W_CS,"Message not compatible with call state" },
1099 { Q2931_CAUSE_REC_TIMER_EXP, "Recovery on timer expiry" },
1100 { 0x67, "Parameter non-existent or not implemented - passed on" },
1101 { 0x68, "Incorrect message length" },
1102 { 0x6E, "Message with unrecognized parameter discarded" },
1103 { 0x6F, "Protocol error, unspecified" },
1104 { 0x7F, "Internetworking, unspecified" },
1105 { 0, NULL }
1108 static value_string_ext q2931_cause_code_vals_ext = VALUE_STRING_EXT_INIT(q2931_cause_code_vals);
1110 static const value_string q2931_cause_condition_vals[] = {
1111 { 0x00, "Unknown" },
1112 { 0x01, "Permanent" },
1113 { 0x02, "Transient" },
1114 { 0x00, NULL }
1117 #define Q2931_REJ_USER_SPECIFIC 0x00
1118 #define Q2931_REJ_IE_MISSING 0x04
1119 #define Q2931_REJ_IE_INSUFFICIENT 0x08
1121 static const value_string q2931_rejection_reason_vals[] = {
1122 { 0x00, "User specific" },
1123 { 0x04, "Information element missing" },
1124 { 0x08, "Information element contents are not sufficient" },
1125 { 0x00, NULL }
1128 static const true_false_string tfs_abnormal_normal = { "Abnormal", "Normal" };
1130 static void
1131 // NOLINTNEXTLINE(misc-no-recursion)
1132 dissect_q2931_cause_ie(tvbuff_t *tvb, packet_info* pinfo, int offset, int len,
1133 proto_tree *tree)
1135 uint8_t octet;
1136 uint8_t cause_value;
1137 uint8_t rejection_reason;
1138 uint8_t info_element;
1139 uint8_t info_element_ext;
1140 uint16_t info_element_len;
1142 if (len == 0)
1143 return;
1144 proto_tree_add_item(tree, hf_q2931_cause_location, tvb, offset, 1, ENC_BIG_ENDIAN);
1145 offset += 1;
1146 len -= 1;
1148 if (len == 0)
1149 return;
1150 octet = tvb_get_uint8(tvb, offset);
1151 cause_value = octet & 0x7F;
1152 proto_tree_add_item(tree, hf_q2931_cause_value, tvb, offset, 1, ENC_BIG_ENDIAN);
1153 offset += 1;
1154 len -= 1;
1156 if (len == 0)
1157 return;
1158 switch (cause_value) {
1160 case Q2931_CAUSE_UNALLOC_NUMBER:
1161 case Q2931_CAUSE_NO_ROUTE_TO_DEST:
1162 case Q2931_CAUSE_QOS_UNAVAILABLE:
1163 proto_tree_add_item(tree, hf_q2931_cause_network_service, tvb, offset, 1, ENC_NA);
1164 proto_tree_add_item(tree, hf_q2931_cause_network_behavior, tvb, offset, 1, ENC_NA);
1165 proto_tree_add_item(tree, hf_q2931_cause_rejection_condition, tvb, offset, 1, ENC_NA);
1166 break;
1168 case Q2931_CAUSE_CALL_REJECTED:
1169 rejection_reason = octet & 0x7C;
1170 proto_tree_add_item(tree, hf_q2931_cause_rejection_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
1171 proto_tree_add_item(tree, hf_q2931_cause_rejection_condition, tvb, offset, 1, ENC_BIG_ENDIAN);
1172 offset += 1;
1173 len -= 1;
1175 if (len == 0)
1176 return;
1177 switch (rejection_reason) {
1179 case Q2931_REJ_USER_SPECIFIC:
1180 proto_tree_add_item(tree, hf_q2931_cause_rejection_user_specific_diagnostic, tvb, offset, len, ENC_NA);
1181 break;
1183 case Q2931_REJ_IE_MISSING:
1184 proto_tree_add_item(tree, hf_q2931_cause_rejection_missing_information_element, tvb, offset, 1, ENC_BIG_ENDIAN);
1185 break;
1187 case Q2931_REJ_IE_INSUFFICIENT:
1188 proto_tree_add_item(tree, hf_q2931_cause_rejection_insufficient_information_element, tvb, offset, 1, ENC_BIG_ENDIAN);
1189 break;
1191 default:
1192 proto_tree_add_item(tree, hf_q2931_cause_rejection_diagnostic, tvb, offset, len, ENC_NA);
1193 break;
1195 break;
1197 case Q2931_CAUSE_NUMBER_CHANGED:
1199 * UNI 3.1 claims this "is formatted as the called party
1200 * number information element, including information
1201 * element identifier.
1203 info_element = tvb_get_uint8(tvb, offset);
1204 info_element_ext = tvb_get_uint8(tvb, offset + 1);
1205 info_element_len = tvb_get_ntohs(tvb, offset + 2);
1206 // We recurse here, but we'll run out of packet before we run out of stack.
1207 dissect_q2931_ie(tvb, pinfo, offset, info_element_len, tree,
1208 info_element, info_element_ext);
1209 break;
1211 case Q2931_CAUSE_ACCESS_INFO_DISC:
1212 case Q2931_CAUSE_INCOMPATIBLE_DEST:
1213 case Q2931_CAUSE_MAND_IE_MISSING:
1214 case Q2931_CAUSE_IE_NONEX_OR_UNIMPL:
1215 case Q2931_CAUSE_INVALID_IE_CONTENTS:
1216 do {
1217 proto_tree_add_item(tree, hf_q2931_cause_information_element, tvb, offset, 1, ENC_BIG_ENDIAN);
1218 offset += 1;
1219 len -= 1;
1220 } while (len >= 0);
1221 break;
1223 case Q2931_CAUSE_CELL_RATE_UNAVAIL:
1224 do {
1225 proto_tree_add_item(tree, hf_q2931_cause_cell_rate_subfield_identifier, tvb, offset, 1, ENC_BIG_ENDIAN);
1226 offset += 1;
1227 len -= 1;
1228 } while (len >= 0);
1229 break;
1231 case Q2931_CAUSE_CHAN_NONEXISTENT:
1232 if (len < 2)
1233 return;
1234 proto_tree_add_item(tree, hf_q2931_cause_vpci, tvb, offset, 2, ENC_BIG_ENDIAN);
1235 offset += 2;
1236 len -= 2;
1238 if (len < 2)
1239 return;
1240 proto_tree_add_item(tree, hf_q2931_cause_vci, tvb, offset, 2, ENC_BIG_ENDIAN);
1241 break;
1243 case Q2931_CAUSE_MT_NONEX_OR_UNIMPL:
1244 case Q2931_CAUSE_MSG_INCOMPAT_W_CS:
1245 proto_tree_add_item(tree, hf_q2931_cause_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1246 break;
1248 case Q2931_CAUSE_REC_TIMER_EXP:
1249 if (len < 3)
1250 return;
1251 proto_tree_add_item(tree, hf_q2931_cause_timer, tvb, offset, 3, ENC_ASCII);
1252 break;
1254 default:
1255 proto_tree_add_item(tree, hf_q2931_cause_rejection_diagnostic, tvb, offset, len, ENC_NA);
1260 * Dissect a Call state information element.
1262 static const value_string q2931_call_state_vals[] = {
1263 { 0x00, "Null" },
1264 { 0x01, "Call initiated" },
1265 { 0x02, "Overlap sending" },
1266 { 0x03, "Outgoing call proceeding" },
1267 { 0x04, "Call delivered" },
1268 { 0x06, "Call present" },
1269 { 0x07, "Call received" },
1270 { 0x09, "Connect request" },
1271 { 0x0A, "Incoming call proceeding" },
1272 { 0x0B, "Active" },
1273 { 0x0C, "Disconnect request" },
1274 { 0x0F, "Disconnect indication" },
1275 { 0x11, "Suspend request" },
1276 { 0x13, "Resume request" },
1277 { 0x16, "Release request" },
1278 { 0x19, "Overlap receiving" },
1279 { 0x3D, "Restart request" },
1280 { 0x3E, "Restart" },
1281 { 0, NULL }
1284 static void
1285 dissect_q2931_call_state_ie(tvbuff_t *tvb, int offset, int len,
1286 proto_tree *tree)
1288 if (len == 0)
1289 return;
1291 proto_tree_add_item(tree, hf_q2931_call_state, tvb, offset, 1, ENC_BIG_ENDIAN);
1295 * Dissect a (phone) number information element.
1297 static const value_string q2931_number_type_vals[] = {
1298 { 0x0, "Unknown" },
1299 { 0x1, "International number" },
1300 { 0x2, "National number" },
1301 { 0x3, "Network specific number" },
1302 { 0x4, "Subscriber number" },
1303 { 0x6, "Abbreviated number" },
1304 { 0, NULL }
1307 #define Q2931_ISDN_NUMBERING 0x01
1308 #define Q2931_NSAP_ADDRESSING 0x02
1310 static const value_string q2931_numbering_plan_vals[] = {
1311 { 0x00, "Unknown" },
1312 { Q2931_ISDN_NUMBERING, "E.164 ISDN/telephony numbering" },
1313 { Q2931_NSAP_ADDRESSING, "ISO/IEC 8348 NSAP addressing" },
1314 { 0x09, "Private numbering" },
1315 { 0, NULL }
1318 static const value_string q2931_presentation_indicator_vals[] = {
1319 { 0, "Presentation allowed" },
1320 { 1, "Presentation restricted" },
1321 { 2, "Number not available" },
1322 { 0, NULL }
1325 static const value_string q2931_screening_indicator_vals[] = {
1326 { 0x00, "User-provided, not screened" },
1327 { 0x01, "User-provided, verified and passed" },
1328 { 0x02, "User-provided, verified and failed" },
1329 { 0x03, "Network-provided" },
1330 { 0, NULL }
1333 static void
1334 dissect_q2931_number_ie(tvbuff_t *tvb, packet_info* pinfo, int offset, int len,
1335 proto_tree *tree)
1337 uint8_t octet;
1338 uint8_t numbering_plan;
1339 proto_tree *nsap_tree;
1341 if (len == 0)
1342 return;
1343 octet = tvb_get_uint8(tvb, offset);
1344 proto_tree_add_item(tree, hf_q2931_number_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1345 numbering_plan = octet & 0x0F;
1346 proto_tree_add_item(tree, hf_q2931_number_plan, tvb, offset, 1, ENC_BIG_ENDIAN);
1347 offset += 1;
1348 len -= 1;
1350 if (!(octet & Q2931_IE_EXTENSION)) {
1351 if (len == 0)
1352 return;
1354 proto_tree_add_item(tree, hf_q2931_number_presentation_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1355 proto_tree_add_item(tree, hf_q2931_number_screening_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1356 offset += 1;
1357 len -= 1;
1360 if (len == 0)
1361 return;
1362 switch (numbering_plan) {
1364 case Q2931_ISDN_NUMBERING:
1365 proto_tree_add_item(tree, hf_q2931_number_string, tvb, offset, len, ENC_ASCII);
1366 break;
1368 case Q2931_NSAP_ADDRESSING:
1369 if (len < 20) {
1370 proto_tree_add_item(tree, hf_q2931_nsap_address_number_short, tvb, offset, len, ENC_NA);
1371 return;
1373 nsap_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_q2931_nsap, NULL, "Number");
1374 dissect_atm_nsap(tvb, pinfo, offset, len, nsap_tree);
1375 break;
1377 default:
1378 proto_tree_add_item(tree, hf_q2931_number_bytes, tvb, offset, len, ENC_NA);
1379 break;
1384 * Dissect a party subaddress information element.
1386 static const value_string q2931_subaddress_type_vals[] = {
1387 { 0, "X.213/ISO 8348 NSAP" },
1388 { 1, "User-specified ATM endsystem address" },
1389 { 2, "User-specified" },
1390 { 0, NULL }
1393 static const value_string q2931_odd_even_indicator_vals[] = {
1394 { 0, "Even number of address signals" },
1395 { 1, "Odd number of address signals" },
1396 { 0, NULL }
1399 static void
1400 dissect_q2931_party_subaddr_ie(tvbuff_t *tvb, int offset, int len,
1401 proto_tree *tree)
1403 if (len == 0)
1404 return;
1406 proto_tree_add_item(tree, hf_q2931_party_subaddr_type_of_subaddress, tvb, offset, 1, ENC_BIG_ENDIAN);
1407 proto_tree_add_item(tree, hf_q2931_party_subaddr_odd_even_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1408 offset += 1;
1409 len -= 1;
1411 if (len == 0)
1412 return;
1413 proto_tree_add_item(tree, hf_q2931_party_subaddr_subaddress, tvb, offset, len, ENC_NA);
1417 * Dissect a connection identifier information element.
1419 static const value_string q2931_vp_associated_signalling_vals[] = {
1420 { 0, "Yes" },
1421 { 1, "No - explicit indication of VPCI" },
1422 { 0, NULL }
1425 static const value_string q2931_preferred_exclusive_vals[] = {
1426 { 0x00, "Exclusive VPCI; exclusive VCI" },
1427 { 0x01, "Exclusive VPCI; any VCI" },
1428 { 0x04, "Exclusive VPCI; no VCI" },
1429 { 0x00, NULL }
1432 static void
1433 dissect_q2931_connection_identifier_ie(tvbuff_t *tvb, int offset, int len,
1434 proto_tree *tree)
1436 if (len == 0)
1437 return;
1439 proto_tree_add_item(tree, hf_q2931_conn_id_vp_associated_signalling, tvb, offset, 1, ENC_BIG_ENDIAN);
1440 proto_tree_add_item(tree, hf_q2931_conn_id_preferred_exclusive, tvb, offset, 1, ENC_BIG_ENDIAN);
1441 offset += 1;
1442 len -= 1;
1444 if (len < 2)
1445 return;
1446 proto_tree_add_item(tree, hf_q2931_conn_id_vpci, tvb, offset, 2, ENC_BIG_ENDIAN);
1447 offset += 2;
1448 len -= 2;
1450 if (len < 2)
1451 return;
1452 proto_tree_add_item(tree, hf_q2931_conn_id_vci, tvb, offset, 2, ENC_BIG_ENDIAN);
1456 * Dissect an End-to-end transit delay information element.
1458 static void
1459 dissect_q2931_e2e_transit_delay_ie(tvbuff_t *tvb, packet_info* pinfo, int offset, int len, proto_tree *tree)
1461 uint8_t identifier;
1462 uint16_t value;
1463 proto_item* ti;
1465 while (len >= 3) {
1466 ti = proto_tree_add_item(tree, hf_q2931_e2e_transit_delay_identifier, tvb, offset, 1, ENC_BIG_ENDIAN);
1467 identifier = tvb_get_uint8(tvb, offset);
1468 offset++;
1469 value = tvb_get_ntohs(tvb, offset);
1470 len -=3;
1471 switch (identifier) {
1473 case 0x01: /* Cumulative transit delay identifier */
1474 proto_tree_add_uint(tree, hf_q2931_e2e_transit_delay_cumulative, tvb, offset, 2, value);
1475 break;
1477 case 0x03: /* Maximum transit delay identifier */
1478 if (value == 0xFFFF) {
1479 proto_tree_add_uint_format_value(tree, hf_q2931_e2e_transit_delay_maximum_end_to_end, tvb, offset, 2,
1480 value, "Any end-to-end transit delay value acceptable");
1481 } else {
1482 proto_tree_add_uint_format_value(tree, hf_q2931_e2e_transit_delay_maximum_end_to_end, tvb, offset, 2,
1483 value, "%u ms", value);
1485 break;
1487 default: /* Unknown transit delay identifier */
1488 expert_add_info(pinfo, ti, &ei_q2931_e2e_transit_delay_identifier);
1489 return; /* give up */
1495 * Dissect a Quality of Service parameter information element.
1497 static const value_string q2931_qos_parameter_vals[] = {
1498 { 0x00, "Unspecified QOS class" },
1499 { 0x00, NULL }
1502 static void
1503 dissect_q2931_qos_parameter_ie(tvbuff_t *tvb, int offset, int len,
1504 proto_tree *tree)
1506 if (len == 0)
1507 return;
1509 proto_tree_add_item(tree, hf_q2931_qos_class_forward, tvb, offset, 1, ENC_BIG_ENDIAN);
1510 offset += 1;
1511 len -= 1;
1513 if (len == 0)
1514 return;
1515 proto_tree_add_item(tree, hf_q2931_qos_class_backward, tvb, offset, 1, ENC_BIG_ENDIAN);
1519 * Dissect a broadband repeat indicator.
1521 static const value_string q2931_bband_rpt_indicator_vals[] = {
1522 { 0x02, "Prioritized list for selecting one possibility (descending order)" },
1523 { 0x00, NULL }
1526 static void
1527 dissect_q2931_bband_rpt_indicator(tvbuff_t *tvb, int offset, int len,
1528 proto_tree *tree)
1530 if (len == 0)
1531 return;
1533 proto_tree_add_item(tree, hf_q2931_broadband_repeat_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1537 * Dissect a restart indicator.
1539 static const value_string q2931_class_vals[] = {
1540 { 0x00, "Indicated VC" },
1541 { 0x01, "All VC's in the indicated VPC controlled via this channel" },
1542 { 0x02, "All VC's controlled by the L3 entity that sent this message" },
1543 { 0x00, NULL }
1546 static void
1547 dissect_q2931_restart_indicator(tvbuff_t *tvb, int offset, int len,
1548 proto_tree *tree)
1550 if (len == 0)
1551 return;
1553 proto_tree_add_item(tree, hf_q2931_restart_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1557 * Dissect an broadband sending complete information element.
1559 static void
1560 dissect_q2931_bband_sending_compl_ie(tvbuff_t *tvb, packet_info* pinfo, int offset, int len,
1561 proto_tree *tree)
1563 uint8_t identifier;
1564 proto_item* ti;
1566 while (len >= 0) {
1567 ti = proto_tree_add_item(tree, hf_q2931_bband_sending_complete_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1568 identifier = tvb_get_uint8(tvb, offset);
1569 switch (identifier) {
1571 case 0xA1: /* Sending complete indication */
1572 proto_tree_add_item(tree, hf_q2931_bband_sending_complete, tvb, offset, 1, ENC_NA);
1573 offset += 1;
1574 len -= 1;
1575 break;
1577 default: /* unknown broadband sending complete element */
1578 expert_add_info(pinfo, ti, &ei_q2931_bband_sending_complete_id);
1579 return; /* give up */
1585 * Dissect a Transit network selection information element.
1587 static const value_string q2931_netid_type_vals[] = {
1588 { 0, "User specified" },
1589 { 2, "National network identification" },
1590 { 3, "International network identification" },
1591 { 0, NULL }
1594 static const value_string q2931_netid_plan_vals[] = {
1595 { 0x00, "Unknown" },
1596 { 0x01, "Carrier Identification Code" },
1597 { 0x03, "X.121 data network identification code" },
1598 { 0, NULL }
1601 static void
1602 dissect_q2931_transit_network_sel_ie(tvbuff_t *tvb, int offset, int len,
1603 proto_tree *tree)
1605 if (len == 0)
1606 return;
1608 proto_tree_add_item(tree, hf_q2931_transit_network_sel_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1609 proto_tree_add_item(tree, hf_q2931_transit_network_sel_plan, tvb, offset, 1, ENC_BIG_ENDIAN);
1610 offset += 1;
1611 len -= 1;
1613 if (len == 0)
1614 return;
1615 proto_tree_add_item(tree, hf_q2931_transit_network_sel_network_id, tvb, offset, len, ENC_NA|ENC_ASCII);
1619 * Dissect an OAM traffic descriptor information element.
1621 static const value_string q2931_shaping_indicator_vals[] = {
1622 { 0, "No user specified requirement" },
1623 { 1, "Aggregate shaping of user and OAM cells not allowed" },
1624 { 0, NULL }
1627 static const value_string q2931_user_net_fault_mgmt_vals[] = {
1628 { 0, "No user-originated fault management indications" },
1629 { 1, "User-originated fault management indications, cell rate 1 cell/s" },
1630 { 0, NULL }
1633 static const value_string q2931_fwd_e2e_oam_f5_flow_indicator_vals[] = {
1634 { 0x00, "0% of the forward cell rate" },
1635 { 0x10, "0.1% of the forward cell rate" },
1636 { 0x40, "1% of the forward cell rate" },
1637 { 0x0, NULL }
1640 static const value_string q2931_bwd_e2e_oam_f5_flow_indicator_vals[] = {
1641 { 0x00, "0% of the backward cell rate" },
1642 { 0x01, "0.1% of the backward cell rate" },
1643 { 0x04, "1% of the backward cell rate" },
1644 { 0x0, NULL }
1647 static const true_false_string tfs_mandatory_optional = { "Mandatory", "Optional" };
1649 static void
1650 dissect_q2931_oam_traffic_descriptor_ie(tvbuff_t *tvb, int offset, int len,
1651 proto_tree *tree)
1653 if (len == 0)
1654 return;
1656 proto_tree_add_item(tree, hf_q2931_oam_traffic_descriptor_shaping_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1657 proto_tree_add_item(tree, hf_q2931_oam_end_to_end_f5_flow, tvb, offset, 1, ENC_BIG_ENDIAN);
1658 proto_tree_add_item(tree, hf_q2931_oam_traffic_descriptor_management_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1659 offset += 1;
1660 len -= 1;
1662 if (len == 0)
1663 return;
1665 proto_tree_add_item(tree, hf_q2931_oam_traffic_descriptor_forward_f5_flow_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1666 proto_tree_add_item(tree, hf_q2931_oam_traffic_descriptor_backward_f5_flow_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1670 * Dissect an Endpoint reference information element.
1672 static const value_string q2931_endpoint_reference_type_vals[] = {
1673 { 0x00, "Locally defined integer" },
1674 { 0, NULL }
1677 static const true_false_string tfs_endpoint_reference_flag = { "Message sent to side that originates the endpoint reference",
1678 "Message sent from side that originates the endpoint reference" };
1680 static void
1681 dissect_q2931_endpoint_reference_ie(tvbuff_t *tvb, int offset, int len,
1682 proto_tree *tree)
1684 if (len == 0)
1685 return;
1687 proto_tree_add_item(tree, hf_q2931_endpoint_reference_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1688 offset += 1;
1689 len -= 1;
1691 if (len < 2)
1692 return;
1694 proto_tree_add_item(tree, hf_q2931_endpoint_reference_flag, tvb, offset, 2, ENC_BIG_ENDIAN);
1695 proto_tree_add_item(tree, hf_q2931_endpoint_reference_identifier_value, tvb, offset, 2, ENC_BIG_ENDIAN);
1699 * Dissect an Endpoint state information element.
1701 static const value_string q2931_endpoint_reference_party_state_vals[] = {
1702 { 0x00, "Null" },
1703 { 0x01, "ADD PARTY initiated" },
1704 { 0x06, "ADD PARTY received" },
1705 { 0x0B, "DROP PARTY initiated" },
1706 { 0x0C, "DROP PARTY received" },
1707 { 0x0A, "Active" },
1708 { 0, NULL }
1711 static void
1712 dissect_q2931_endpoint_state_ie(tvbuff_t *tvb, int offset, int len,
1713 proto_tree *tree)
1715 if (len == 0)
1716 return;
1718 proto_tree_add_item(tree, hf_q2931_endpoint_state, tvb, offset, 1, ENC_BIG_ENDIAN);
1721 static void
1722 // NOLINTNEXTLINE(misc-no-recursion)
1723 dissect_q2931_ie_contents(tvbuff_t *tvb, packet_info* pinfo, int offset, int len,
1724 proto_tree *tree, uint8_t info_element)
1726 switch (info_element) {
1728 case Q2931_IE_BBAND_LOCKING_SHIFT:
1729 case Q2931_IE_BBAND_NLOCKING_SHIFT:
1730 dissect_q2931_shift_ie(tvb, offset, len, tree, info_element);
1731 break;
1733 case Q2931_IE_NBAND_BEARER_CAP:
1734 case Q2931_IE_NBAND_LOW_LAYER_COMPAT:
1735 dissect_q931_bearer_capability_ie(tvb, offset, len, tree);
1736 break;
1738 case Q2931_IE_NBAND_HIGH_LAYER_COMPAT:
1739 dissect_q931_high_layer_compat_ie(tvb, offset, len, tree);
1740 break;
1742 case Q2931_IE_PROGRESS_INDICATOR:
1743 dissect_q931_progress_indicator_ie(tvb, offset, len, tree);
1744 break;
1746 case Q2931_IE_AAL_PARAMETERS:
1747 dissect_q2931_aal_parameters_ie(tvb, pinfo, offset, len, tree);
1748 break;
1750 case Q2931_IE_ATM_USER_CELL_RATE:
1751 dissect_q2931_atm_cell_rate_ie(tvb, pinfo, offset, len, tree);
1752 break;
1754 case Q2931_IE_BBAND_BEARER_CAP:
1755 dissect_q2931_bband_bearer_cap_ie(tvb, offset, len, tree);
1756 break;
1758 case Q2931_IE_BBAND_HI_LAYER_INFO:
1759 dissect_q2931_bband_hi_layer_info_ie(tvb, offset, len, tree);
1760 break;
1762 case Q2931_IE_BBAND_LOW_LAYER_INFO:
1763 dissect_q2931_bband_low_layer_info_ie(tvb, offset, len, tree);
1764 break;
1766 case Q2931_IE_CALL_STATE:
1767 dissect_q2931_call_state_ie(tvb, offset, len, tree);
1768 break;
1770 case Q2931_IE_CALLED_PARTY_NUMBER:
1771 case Q2931_IE_CALLING_PARTY_NUMBER:
1772 dissect_q2931_number_ie(tvb, pinfo, offset, len, tree);
1773 break;
1775 case Q2931_IE_CALLED_PARTY_SUBADDR:
1776 case Q2931_IE_CALLING_PARTY_SUBADDR:
1777 dissect_q2931_party_subaddr_ie(tvb, offset, len, tree);
1778 break;
1780 case Q2931_IE_CAUSE:
1781 // We recurse here, but we'll run out of packet before we run out of stack.
1782 dissect_q2931_cause_ie(tvb, pinfo, offset, len, tree);
1783 break;
1785 case Q2931_IE_CONNECTION_IDENTIFIER:
1786 dissect_q2931_connection_identifier_ie(tvb, offset, len, tree);
1787 break;
1789 case Q2931_IE_E2E_TRANSIT_DELAY:
1790 dissect_q2931_e2e_transit_delay_ie(tvb, pinfo, offset, len, tree);
1791 break;
1793 case Q2931_IE_QOS_PARAMETER:
1794 dissect_q2931_qos_parameter_ie(tvb, offset, len, tree);
1795 break;
1797 case Q2931_IE_BBAND_RPT_INDICATOR:
1798 dissect_q2931_bband_rpt_indicator(tvb, offset, len, tree);
1799 break;
1801 case Q2931_IE_RESTART_INDICATOR:
1802 dissect_q2931_restart_indicator(tvb, offset, len, tree);
1803 break;
1805 case Q2931_IE_BBAND_SENDING_COMPL:
1806 dissect_q2931_bband_sending_compl_ie(tvb, pinfo, offset, len, tree);
1807 break;
1809 case Q2931_IE_TRANSIT_NETWORK_SEL:
1810 dissect_q2931_transit_network_sel_ie(tvb, offset, len, tree);
1811 break;
1813 case Q2931_IE_OAM_TRAFFIC_DESCRIPTOR:
1814 dissect_q2931_oam_traffic_descriptor_ie(tvb, offset, len, tree);
1815 break;
1817 case Q2931_IE_ENDPOINT_REFERENCE:
1818 dissect_q2931_endpoint_reference_ie(tvb, offset, len, tree);
1819 break;
1821 case Q2931_IE_ENDPOINT_STATE:
1822 dissect_q2931_endpoint_state_ie(tvb, offset, len, tree);
1823 break;
1827 static void
1828 // NOLINTNEXTLINE(misc-no-recursion)
1829 dissect_q2931_ie(tvbuff_t *tvb, packet_info* pinfo, int offset, int len, proto_tree *tree,
1830 uint8_t info_element, uint8_t info_element_ext)
1832 proto_item *ti;
1833 proto_tree *ie_tree;
1834 proto_tree *ie_ext_tree;
1836 ie_tree = proto_tree_add_subtree(tree, tvb, offset, 1+1+2+len, ett_q2931_ie, NULL,
1837 val_to_str_ext(info_element, &q2931_info_element_vals_ext,
1838 "Unknown information element (0x%02X)"));
1839 proto_tree_add_uint(ie_tree, hf_q2931_information_element, tvb, offset, 1, info_element);
1840 ti = proto_tree_add_uint(ie_tree, hf_q2931_information_element_extension, tvb, offset + 1, 1, info_element_ext);
1841 ie_ext_tree = proto_item_add_subtree(ti, ett_q2931_ie_ext);
1842 proto_tree_add_item(ie_ext_tree, hf_q2931_ie_coding_standard, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1843 proto_tree_add_item(ie_ext_tree, hf_q2931_ie_handling_instructions, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1844 if (info_element_ext & Q2931_IE_COMPAT_FOLLOW_INST) {
1845 proto_tree_add_item(ie_ext_tree, hf_q2931_ie_action_indicator, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1847 proto_tree_add_uint(ie_tree, hf_q2931_information_element_length, tvb, offset + 2, 2, len);
1849 if ((info_element_ext & Q2931_IE_COMPAT_CODING_STD)
1850 == Q2931_ITU_STANDARDIZED_CODING) {
1851 // We recurse here, but we'll run out of packet before we run out of stack.
1852 dissect_q2931_ie_contents(tvb, pinfo, offset + 4,
1853 len, ie_tree, info_element);
1854 } else {
1856 * We don't know how it's encoded, so just
1857 * dump it as data and be done with it.
1859 proto_tree_add_item(ie_tree, hf_q2931_information_element_data, tvb, offset + 4, len, ENC_NA);
1863 static int
1864 dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1866 int offset = 0;
1867 proto_tree *q2931_tree;
1868 proto_item *ti;
1869 uint32_t call_ref_len;
1870 uint8_t call_ref[16];
1871 uint8_t message_type;
1872 uint8_t message_type_ext;
1873 uint16_t message_len;
1874 uint8_t info_element;
1875 uint8_t info_element_ext;
1876 uint16_t info_element_len;
1877 #if 0
1878 int codeset;
1879 bool non_locking_shift;
1880 #endif
1881 static int * const ext_flags[] = {
1882 &hf_q2931_message_flag,
1883 NULL
1885 static int * const ext_flags_follow_inst[] = {
1886 &hf_q2931_message_flag,
1887 &hf_q2931_message_action_indicator,
1888 NULL
1891 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Q.2931");
1893 ti = proto_tree_add_item(tree, proto_q2931, tvb, offset, -1, ENC_NA);
1894 q2931_tree = proto_item_add_subtree(ti, ett_q2931);
1896 proto_tree_add_item(q2931_tree, hf_q2931_discriminator, tvb, offset, 1, ENC_NA);
1897 offset += 1;
1899 proto_tree_add_item_ret_uint(q2931_tree, hf_q2931_call_ref_len, tvb, offset, 1, ENC_NA, &call_ref_len);
1900 offset += 1;
1901 if (call_ref_len != 0) {
1902 tvb_memcpy(tvb, call_ref, offset, call_ref_len);
1903 proto_tree_add_boolean(q2931_tree, hf_q2931_call_ref_flag,
1904 tvb, offset, 1, (call_ref[0] & 0x80) != 0);
1905 call_ref[0] &= 0x7F;
1906 proto_tree_add_bytes(q2931_tree, hf_q2931_call_ref, tvb, offset, call_ref_len, call_ref);
1907 offset += call_ref_len;
1909 message_type = tvb_get_uint8(tvb, offset);
1910 col_add_str(pinfo->cinfo, COL_INFO,
1911 val_to_str_ext(message_type, &q2931_message_type_vals_ext,
1912 "Unknown message type (0x%02X)"));
1914 proto_tree_add_uint(q2931_tree, hf_q2931_message_type, tvb, offset, 1, message_type);
1915 offset += 1;
1917 message_type_ext = tvb_get_uint8(tvb, offset);
1918 if (message_type_ext & Q2931_MSG_TYPE_EXT_FOLLOW_INST) {
1919 proto_tree_add_bitmask(q2931_tree, tvb, offset, hf_q2931_message_type_ext, ett_q2931_ext, ext_flags_follow_inst, ENC_NA);
1920 } else {
1921 proto_tree_add_bitmask(q2931_tree, tvb, offset, hf_q2931_message_type_ext, ett_q2931_ext, ext_flags, ENC_NA);
1923 offset += 1;
1925 message_len = tvb_get_ntohs(tvb, offset);
1926 if (q2931_tree != NULL)
1927 proto_tree_add_uint(q2931_tree, hf_q2931_message_len, tvb, offset, 2, message_len);
1928 offset += 2;
1931 * And now for the information elements....
1933 #if 0
1934 codeset = 0; /* start out in codeset 0 */
1935 non_locking_shift = true;
1936 #endif
1937 while (tvb_reported_length_remaining(tvb, offset) > 0) {
1938 info_element = tvb_get_uint8(tvb, offset);
1939 info_element_ext = tvb_get_uint8(tvb, offset + 1);
1940 info_element_len = tvb_get_ntohs(tvb, offset + 2);
1941 if (q2931_tree != NULL) {
1942 dissect_q2931_ie(tvb, pinfo, offset, info_element_len,
1943 q2931_tree, info_element, info_element_ext);
1945 #if 0 /* XXX: Is codeset & etc supposed to be used somehow ? */
1946 if (non_locking_shift)
1947 codeset = 0;
1949 * Handle shifts.
1951 switch (info_element) {
1953 case Q2931_IE_BBAND_LOCKING_SHIFT:
1954 if (info_element_len >= 1) {
1955 non_locking_shift = false;
1956 codeset = tvb_get_uint8(tvb, offset + 4) & 0x07;
1958 break;
1960 case Q2931_IE_BBAND_NLOCKING_SHIFT:
1961 if (info_element_len >= 1) {
1962 non_locking_shift = true;
1963 codeset = tvb_get_uint8(tvb, offset + 4) & 0x07;
1965 break;
1967 #endif
1968 offset += 1 + 1 + 2 + info_element_len;
1970 return tvb_captured_length(tvb);
1973 void
1974 proto_register_q2931(void)
1976 static hf_register_info hf[] = {
1977 { &hf_q2931_discriminator,
1978 { "Protocol discriminator", "q2931.disc",
1979 FT_UINT8, BASE_HEX, NULL, 0x0,
1980 NULL, HFILL }
1983 { &hf_q2931_call_ref_len,
1984 { "Call reference value length", "q2931.call_ref_len",
1985 FT_UINT8, BASE_DEC, NULL, 0x0F,
1986 NULL, HFILL }
1989 { &hf_q2931_call_ref_flag,
1990 { "Call reference flag", "q2931.call_ref_flag",
1991 FT_BOOLEAN, BASE_NONE, TFS(&tfs_call_ref_flag), 0x0,
1992 NULL, HFILL }
1995 { &hf_q2931_call_ref,
1996 { "Call reference value", "q2931.call_ref",
1997 FT_BYTES, BASE_NONE, NULL, 0x0,
1998 NULL, HFILL }
2001 { &hf_q2931_message_type,
2002 { "Message type", "q2931.message_type",
2003 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &q2931_message_type_vals_ext, 0x0,
2004 NULL, HFILL }
2007 { &hf_q2931_message_type_ext,
2008 { "Message type extension", "q2931.message_type_ext",
2009 FT_UINT8, BASE_HEX, NULL, 0x0,
2010 NULL, HFILL }
2013 { &hf_q2931_message_flag,
2014 { "Flag", "q2931.message_flag",
2015 FT_BOOLEAN, 8, TFS(&tos_msg_flag), Q2931_MSG_TYPE_EXT_FOLLOW_INST,
2016 NULL, HFILL }
2019 { &hf_q2931_message_action_indicator,
2020 { "Action indicator", "q2931.message_action_indicator",
2021 FT_UINT8, BASE_DEC, VALS(msg_action_ind_vals), Q2931_MSG_TYPE_EXT_ACTION_IND,
2022 NULL, HFILL }
2025 { &hf_q2931_message_len,
2026 { "Message length", "q2931.message_len",
2027 FT_UINT16, BASE_DEC, NULL, 0x0,
2028 NULL, HFILL }
2031 { &hf_q2931_ie_handling_instructions,
2032 { "Handling Instructions", "q2931.ie_handling_instructions",
2033 FT_BOOLEAN, 8, TFS(&tfs_q2931_handling_instructions), Q2931_IE_COMPAT_FOLLOW_INST,
2034 NULL, HFILL }
2037 { &hf_q2931_ie_coding_standard,
2038 { "Coding standard", "q2931.ie_coding_standard",
2039 FT_UINT8, BASE_DEC, VALS(coding_std_vals), Q2931_IE_COMPAT_CODING_STD,
2040 NULL, HFILL }
2043 { &hf_q2931_ie_action_indicator,
2044 { "Action indicator", "q2931.ie_action_indicator",
2045 FT_UINT8, BASE_DEC, VALS(ie_action_ind_vals), Q2931_IE_COMPAT_ACTION_IND,
2046 NULL, HFILL }
2049 /* Generated from convert_proto_tree_add_text.pl */
2050 { &hf_q2931_aal_type,
2051 { "AAL type", "q2931.aal_type",
2052 FT_UINT8, BASE_HEX, VALS(q9231_aal_type_vals), 0x0,
2053 NULL, HFILL }
2055 { &hf_q2931_user_defined_aal_information,
2056 { "User defined AAL information", "q2931.user_defined_aal_information",
2057 FT_BYTES, BASE_NONE, NULL, 0x0,
2058 NULL, HFILL }
2060 { &hf_q2931_aal1_subtype,
2061 { "Subtype", "q2931.aal1.subtype",
2062 FT_UINT8, BASE_HEX, VALS(q9231_aal1_subtype_vals), 0x0,
2063 NULL, HFILL }
2065 { &hf_q2931_aal1_cbr_rate,
2066 { "CBR rate", "q2931.aal1.cbr_rate",
2067 FT_UINT8, BASE_HEX, VALS(q9231_aal1_cbr_rate_vals), 0x0,
2068 NULL, HFILL }
2070 { &hf_q2931_aal1_multiplier,
2071 { "Multiplier", "q2931.aal1.multiplier",
2072 FT_UINT16, BASE_DEC, NULL, 0x0,
2073 NULL, HFILL }
2075 { &hf_q2931_aal1_source_clock_frequency_recovery_method,
2076 { "Source clock frequency recovery method", "q2931.aal1.source_clock_frequency_recovery_method",
2077 FT_UINT8, BASE_HEX, VALS(q2931_aal1_src_clk_rec_meth_vals), 0x0,
2078 NULL, HFILL }
2080 { &hf_q2931_aal1_error_correction_method,
2081 { "Error correction method", "q2931.aal1.error_correction_method",
2082 FT_UINT8, BASE_HEX, VALS(q2931_aal1_err_correction_method_vals), 0x0,
2083 NULL, HFILL }
2085 { &hf_q2931_aal1_structured_data_transfer_block_size,
2086 { "Structured data transfer block size", "q2931.aal1.structured_data_transfer_block_size",
2087 FT_UINT16, BASE_DEC, NULL, 0x0,
2088 NULL, HFILL }
2090 { &hf_q2931_aal1_partially_filled_cells_method,
2091 { "Partially filled cells method", "q2931.aal1.partially_filled_cells_method",
2092 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0x0,
2093 NULL, HFILL }
2095 { &hf_q2931_aal1_forward_max_cpcs_sdu_size,
2096 { "Forward maximum CPCS-SDU size", "q2931.aal1.forward_max_cpcs_sdu_size",
2097 FT_UINT16, BASE_DEC, NULL, 0x0,
2098 NULL, HFILL }
2100 { &hf_q2931_aal1_backward_max_cpcs_sdu_size,
2101 { "Backward maximum CPCS-SDU size", "q2931.aal1.backward_max_cpcs_sdu_size",
2102 FT_UINT16, BASE_DEC, NULL, 0x0,
2103 NULL, HFILL }
2105 { &hf_q2931_aal1_mode,
2106 { "Mode", "q2931.aal1.mode",
2107 FT_UINT8, BASE_HEX, VALS(q2931_aal_mode_vals), 0x0,
2108 NULL, HFILL }
2110 { &hf_q2931_aal1_sscs_type,
2111 { "SSCS type", "q2931.aal1.sscs_type",
2112 FT_UINT8, BASE_HEX, VALS(q2931_sscs_type_vals), 0x0,
2113 NULL, HFILL }
2115 { &hf_q2931_bearer_class,
2116 { "Bearer class", "q2931.bearer_class",
2117 FT_UINT8, BASE_HEX, VALS(q2931_bearer_class_vals), 0x1F,
2118 NULL, HFILL }
2120 { &hf_q2931_atm_transfer_capability,
2121 { "ATM Transfer Capability", "q2931.atm_transfer_capability",
2122 FT_UINT8, BASE_HEX, VALS(q2931_transfer_capability_vals), 0x1F,
2123 NULL, HFILL }
2125 { &hf_q2931_susceptibility_to_clipping,
2126 { "Susceptibility to clipping", "q2931.susceptibility_to_clipping",
2127 FT_UINT8, BASE_HEX, VALS(q2931_susc_clip_vals), 0x60,
2128 NULL, HFILL }
2130 { &hf_q2931_user_plane_connection_configuration,
2131 { "User-plane connection configuration", "q2931.user_plane_connection_configuration",
2132 FT_UINT8, BASE_HEX, VALS(q2931_up_conn_config_vals), 0x03,
2133 NULL, HFILL }
2135 { &hf_q2931_high_layer_information_type,
2136 { "High layer information type", "q2931.high_layer_information_type",
2137 FT_UINT8, BASE_HEX, VALS(q2931_hi_layer_info_type_vals), 0x7F,
2138 NULL, HFILL }
2140 { &hf_q2931_bband_low_layer_info_user_info_l1_proto,
2141 { "User information layer 1 protocol", "q2931.bband_low_layer_info.user_info_l1_proto",
2142 FT_UINT8, BASE_HEX, NULL, 0x1F,
2143 NULL, HFILL }
2145 { &hf_q2931_bband_low_layer_info_user_info_l2_proto,
2146 { "User information layer 2 protocol", "q2931.bband_low_layer_info.user_info_l2_proto",
2147 FT_UINT8, BASE_HEX, VALS(q2931_uil2_vals), 0x1F,
2148 NULL, HFILL }
2150 { &hf_q2931_bband_low_layer_info_user_specified_l2_proto,
2151 { "User-specified layer 2 protocol information", "q2931.bband_low_layer_info.user_specified_l2_proto",
2152 FT_UINT8, BASE_HEX, NULL, 0x7F,
2153 NULL, HFILL }
2155 { &hf_q2931_bband_low_layer_info_mode,
2156 { "Mode", "q2931.bband_low_layer_info.mode",
2157 FT_UINT8, BASE_HEX, VALS(q2931_mode_vals), 0x60,
2158 NULL, HFILL }
2160 { &hf_q2931_bband_low_layer_info_window_size,
2161 { "Window size", "q2931.bband_low_layer_info.window_size",
2162 FT_UINT8, BASE_DEC, NULL, 0x7F,
2163 NULL, HFILL }
2165 { &hf_q2931_bband_low_layer_info_user_info_l3_proto,
2166 { "User information layer 3 protocol", "q2931.bband_low_layer_info.user_info_l3_proto",
2167 FT_UINT8, BASE_HEX, VALS(q2931_uil3_vals), 0x1F,
2168 NULL, HFILL }
2170 { &hf_q2931_bband_low_layer_info_default_packet_size,
2171 { "Default packet size", "q2931.bband_low_layer_info.default_packet_size",
2172 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0x0F,
2173 NULL, HFILL }
2175 { &hf_q2931_bband_low_layer_info_packet_window_size,
2176 { "Packet window size", "q2931.bband_low_layer_info.packet_window_size",
2177 FT_UINT8, BASE_DEC, NULL, 0x7F,
2178 NULL, HFILL }
2180 { &hf_q2931_bband_low_layer_info_additional_l3_proto,
2181 { "Additional layer 3 protocol information", "q2931.bband_low_layer_info.additional_l3_proto",
2182 FT_UINT8, BASE_HEX, VALS(nlpid_vals), 0x0,
2183 NULL, HFILL }
2185 { &hf_q2931_organization_code,
2186 { "Organization Code", "q2931.bband_low_layer_info.organization_code",
2187 FT_UINT24, BASE_OUI, NULL, 0x0,
2188 NULL, HFILL }
2190 { &hf_q2931_ethernet_type,
2191 { "Ethernet type", "q2931.bband_low_layer_info.ethernet_type",
2192 FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
2193 NULL, HFILL }
2195 { &hf_q2931_lane_protocol_id,
2196 { "LANE Protocol ID", "q2931.bband_low_layer_info.lane_protocol_id",
2197 FT_UINT16, BASE_HEX, VALS(lane_pid_vals), 0x0,
2198 NULL, HFILL }
2200 { &hf_q2931_protocol_id,
2201 { "Protocol ID", "q2931.bband_low_layer_info.protocol_id",
2202 FT_UINT16, BASE_HEX, NULL, 0x0,
2203 NULL, HFILL }
2205 { &hf_q2931_cause_location,
2206 { "Location", "q2931.cause.location",
2207 FT_UINT8, BASE_HEX, VALS(q2931_cause_location_vals), 0x0F,
2208 NULL, HFILL }
2210 { &hf_q2931_cause_value,
2211 { "Cause value", "q2931.cause.value",
2212 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &q2931_cause_code_vals_ext, 0x7F,
2213 NULL, HFILL }
2215 { &hf_q2931_cause_rejection_reason,
2216 { "Rejection reason", "q2931.cause.rejection.reason",
2217 FT_UINT8, BASE_HEX, VALS(q2931_rejection_reason_vals), 0x7C,
2218 NULL, HFILL }
2220 { &hf_q2931_cause_rejection_condition,
2221 { "Condition", "q2931.cause.rejection.condition",
2222 FT_UINT8, BASE_HEX, VALS(q2931_cause_condition_vals), 0x03,
2223 NULL, HFILL }
2225 { &hf_q2931_cause_rejection_user_specific_diagnostic,
2226 { "User specific diagnostic", "q2931.cause.rejection.user_specific_diagnostic",
2227 FT_BYTES, BASE_NONE, NULL, 0x0,
2228 NULL, HFILL }
2230 { &hf_q2931_cause_rejection_missing_information_element,
2231 { "Missing information element", "q2931.cause.rejection.missing_information_element",
2232 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &q2931_info_element_vals_ext, 0x0,
2233 NULL, HFILL }
2235 { &hf_q2931_cause_rejection_insufficient_information_element,
2236 { "Insufficient information element", "q2931.cause.rejection.insufficient_information_element",
2237 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &q2931_info_element_vals_ext, 0x0,
2238 NULL, HFILL }
2240 { &hf_q2931_cause_rejection_diagnostic,
2241 { "Diagnostic", "q2931.cause.rejection.diagnostic",
2242 FT_BYTES, BASE_NONE, NULL, 0x0,
2243 NULL, HFILL }
2245 { &hf_q2931_cause_information_element,
2246 { "Information element", "q2931.cause.information_element",
2247 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &q2931_info_element_vals_ext, 0x0,
2248 NULL, HFILL }
2250 { &hf_q2931_cause_cell_rate_subfield_identifier,
2251 { "Cell rate subfield identifier", "q2931.cause.cell_rate_subfield_identifier",
2252 FT_UINT8, BASE_HEX, VALS(q2931_atm_td_subfield_vals), 0x0,
2253 NULL, HFILL }
2255 { &hf_q2931_cause_vpci,
2256 { "VPCI", "q2931.cause.vpci",
2257 FT_UINT16, BASE_DEC, NULL, 0x0,
2258 NULL, HFILL }
2260 { &hf_q2931_cause_vci,
2261 { "VCI", "q2931.cause.vci",
2262 FT_UINT16, BASE_DEC, NULL, 0x0,
2263 NULL, HFILL }
2265 { &hf_q2931_cause_message_type,
2266 { "Message type", "q2931.cause.message_type",
2267 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &q2931_message_type_vals_ext, 0x0,
2268 NULL, HFILL }
2270 { &hf_q2931_cause_timer,
2271 { "Timer", "q2931.cause.timer",
2272 FT_STRING, BASE_NONE, NULL, 0x0,
2273 NULL, HFILL }
2275 { &hf_q2931_call_state,
2276 { "Call state", "q2931.call_state",
2277 FT_UINT8, BASE_HEX, VALS(q2931_call_state_vals), 0x3F,
2278 NULL, HFILL }
2280 { &hf_q2931_number_type,
2281 { "Type of number", "q2931.number.type",
2282 FT_UINT8, BASE_HEX, VALS(q2931_number_type_vals), 0x70,
2283 NULL, HFILL }
2285 { &hf_q2931_number_plan,
2286 { "Numbering plan", "q2931.number.plan",
2287 FT_UINT8, BASE_HEX, VALS(q2931_numbering_plan_vals), 0x0F,
2288 NULL, HFILL }
2290 { &hf_q2931_number_presentation_indicator,
2291 { "Presentation indicator", "q2931.number.presentation_indicator",
2292 FT_UINT8, BASE_HEX, VALS(q2931_presentation_indicator_vals), 0x60,
2293 NULL, HFILL }
2295 { &hf_q2931_number_screening_indicator,
2296 { "Screening indicator", "q2931.number.screening_indicator",
2297 FT_UINT8, BASE_HEX, VALS(q2931_screening_indicator_vals), 0x03,
2298 NULL, HFILL }
2300 { &hf_q2931_number_string,
2301 { "Number", "q2931.number.string",
2302 FT_STRING, BASE_NONE, NULL, 0x0,
2303 NULL, HFILL }
2305 { &hf_q2931_number_bytes,
2306 { "Number", "q2931.number.bytes",
2307 FT_BYTES, BASE_NONE, NULL, 0x0,
2308 NULL, HFILL }
2310 { &hf_q2931_party_subaddr_type_of_subaddress,
2311 { "Type of subaddress", "q2931.party_subaddr.type_of_subaddress",
2312 FT_UINT8, BASE_HEX, VALS(q2931_subaddress_type_vals), 0x70,
2313 NULL, HFILL }
2315 { &hf_q2931_party_subaddr_odd_even_indicator,
2316 { "Odd/even indicator", "q2931.party_subaddr.odd_even_indicator",
2317 FT_UINT8, BASE_HEX, VALS(q2931_odd_even_indicator_vals), 0x10,
2318 NULL, HFILL }
2320 { &hf_q2931_party_subaddr_subaddress,
2321 { "Subaddress", "q2931.party_subaddr.subaddress",
2322 FT_BYTES, BASE_NONE, NULL, 0x0,
2323 NULL, HFILL }
2325 { &hf_q2931_conn_id_vp_associated_signalling,
2326 { "VP-associated signalling", "q2931.conn_id.vp_associated_signalling",
2327 FT_UINT8, BASE_HEX, VALS(q2931_vp_associated_signalling_vals), 0x18,
2328 NULL, HFILL }
2330 { &hf_q2931_conn_id_preferred_exclusive,
2331 { "Preferred/exclusive", "q2931.conn_id.preferred_exclusive",
2332 FT_UINT8, BASE_HEX, VALS(q2931_preferred_exclusive_vals), 0x07,
2333 NULL, HFILL }
2335 { &hf_q2931_conn_id_vpci,
2336 { "VPCI", "q2931.conn_id.vpci",
2337 FT_UINT16, BASE_DEC, NULL, 0x0,
2338 NULL, HFILL }
2340 { &hf_q2931_conn_id_vci,
2341 { "VCI", "q2931.conn_id.vci",
2342 FT_UINT16, BASE_DEC, NULL, 0x0,
2343 NULL, HFILL }
2345 { &hf_q2931_e2e_transit_delay_cumulative,
2346 { "Cumulative transit delay", "q2931.e2e_transit_delay.cumulative",
2347 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0,
2348 NULL, HFILL }
2350 { &hf_q2931_e2e_transit_delay_maximum_end_to_end,
2351 { "Maximum end-to-end transit delay", "q2931.e2e_transit_delay.maximum_end_to_end",
2352 FT_UINT16, BASE_DEC, NULL, 0x0,
2353 NULL, HFILL }
2355 { &hf_q2931_qos_class_forward,
2356 { "QOS class forward", "q2931.qos_class_forward",
2357 FT_UINT8, BASE_HEX, VALS(q2931_qos_parameter_vals), 0x0,
2358 NULL, HFILL }
2360 { &hf_q2931_qos_class_backward,
2361 { "QOS class backward", "q2931.qos_class_backward",
2362 FT_UINT8, BASE_HEX, VALS(q2931_qos_parameter_vals), 0x0,
2363 NULL, HFILL }
2365 { &hf_q2931_broadband_repeat_indicator,
2366 { "Broadband repeat indicator", "q2931.broadband_repeat_indicator",
2367 FT_UINT8, BASE_HEX, VALS(q2931_bband_rpt_indicator_vals), 0x0F,
2368 NULL, HFILL }
2370 { &hf_q2931_restart_indicator,
2371 { "Restart indicator", "q2931.restart_indicator",
2372 FT_UINT8, BASE_HEX, VALS(q2931_class_vals), 0x07,
2373 NULL, HFILL }
2375 { &hf_q2931_transit_network_sel_type,
2376 { "Type of network identification", "q2931.transit_network_sel.type",
2377 FT_UINT8, BASE_HEX, VALS(q2931_netid_type_vals), 0x70,
2378 NULL, HFILL }
2380 { &hf_q2931_transit_network_sel_plan,
2381 { "Network identification plan", "q2931.transit_network_sel.plan",
2382 FT_UINT8, BASE_HEX, VALS(q2931_netid_plan_vals), 0x0F,
2383 NULL, HFILL }
2385 { &hf_q2931_transit_network_sel_network_id,
2386 { "Network identification", "q2931.transit_network_sel.network_identification",
2387 FT_STRING, BASE_NONE, NULL, 0x0,
2388 NULL, HFILL }
2390 { &hf_q2931_oam_traffic_descriptor_shaping_indicator,
2391 { "Shaping indicator", "q2931.oam_traffic_descriptor.shaping_indicator",
2392 FT_UINT8, BASE_HEX, VALS(q2931_shaping_indicator_vals), 0x60,
2393 NULL, HFILL }
2395 { &hf_q2931_oam_end_to_end_f5_flow,
2396 { "Use of end-to-end OAM F5 flow", "q2931.oam_end_to_end_f5_flow",
2397 FT_BOOLEAN, 8, TFS(&tfs_mandatory_optional), 0x10,
2398 NULL, HFILL }
2400 { &hf_q2931_oam_traffic_descriptor_management_indicator,
2401 { "User-Network fault management indicator", "q2931.oam_traffic_descriptor.management_indicator",
2402 FT_UINT8, BASE_HEX, VALS(q2931_user_net_fault_mgmt_vals), 0x07,
2403 NULL, HFILL }
2405 { &hf_q2931_oam_traffic_descriptor_forward_f5_flow_indicator,
2406 { "Forward end-to-end OAM F5 flow indicator", "q2931.oam_traffic_descriptor.forward_f5_flow_indicator",
2407 FT_UINT8, BASE_HEX, VALS(q2931_fwd_e2e_oam_f5_flow_indicator_vals), 0x70,
2408 NULL, HFILL }
2410 { &hf_q2931_oam_traffic_descriptor_backward_f5_flow_indicator,
2411 { "Backward end-to-end OAM F5 flow indicator", "q2931.oam_traffic_descriptor.backward_f5_flow_indicator",
2412 FT_UINT8, BASE_HEX, VALS(q2931_bwd_e2e_oam_f5_flow_indicator_vals), 0x07,
2413 NULL, HFILL }
2415 { &hf_q2931_endpoint_reference_type,
2416 { "Endpoint reference type", "q2931.endpoint_reference.type",
2417 FT_UINT8, BASE_HEX, VALS(q2931_endpoint_reference_type_vals), 0x0,
2418 NULL, HFILL }
2420 { &hf_q2931_endpoint_reference_flag,
2421 { "Endpoint reference identifier value", "q2931.endpoint_reference.flag",
2422 FT_BOOLEAN, 16, TFS(&tfs_endpoint_reference_flag), 0x8000,
2423 NULL, HFILL }
2425 { &hf_q2931_endpoint_reference_identifier_value,
2426 { "Endpoint reference identifier value", "q2931.endpoint_reference.identifier_value",
2427 FT_UINT16, BASE_DEC, NULL, 0x7FFF,
2428 NULL, HFILL }
2430 { &hf_q2931_endpoint_state,
2431 { "Endpoint reference party-state", "q2931.endpoint_state",
2432 FT_UINT8, BASE_HEX, VALS(q2931_endpoint_reference_party_state_vals), 0x3F,
2433 NULL, HFILL }
2435 { &hf_q2931_information_element,
2436 { "Information element", "q2931.information_element",
2437 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &q2931_info_element_vals_ext, 0x0,
2438 NULL, HFILL }
2440 { &hf_q2931_information_element_extension,
2441 { "Information element extension", "q2931.information_element.extension",
2442 FT_UINT8, BASE_HEX, NULL, 0x0,
2443 NULL, HFILL }
2445 { &hf_q2931_information_element_length,
2446 { "Length", "q2931.information_element.length",
2447 FT_UINT16, BASE_DEC, NULL, 0x0,
2448 NULL, HFILL }
2450 { &hf_q2931_information_element_data,
2451 { "Data", "q2931.information_element.data",
2452 FT_BYTES, BASE_NONE, NULL, 0x0,
2453 NULL, HFILL }
2455 { &hf_q2931_frame_discard_forward_dir,
2456 { "Frame discard in forward direction", "q2931.frame_discard_forward_dir",
2457 FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x80,
2458 NULL, HFILL }
2460 { &hf_q2931_frame_discard_backward_dir,
2461 { "Frame discard in backward direction", "q2931.frame_discard_backward_dir",
2462 FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x40,
2463 NULL, HFILL }
2465 { &hf_q2931_tagging_backward_dir,
2466 { "Tagging in backward direction", "q2931.tagging_backward_dir",
2467 FT_BOOLEAN, 8, TFS(&tfs_requested_not_requested), 0x02,
2468 NULL, HFILL }
2470 { &hf_q2931_tagging_forward_dir,
2471 { "Tagging in forward direction", "q2931.tagging_forward_dir",
2472 FT_BOOLEAN, 8, TFS(&tfs_requested_not_requested), 0x01,
2473 NULL, HFILL }
2475 { &hf_q2931_midrange,
2476 { "MID range", "q2931.midrange",
2477 FT_UINT32, BASE_HEX, NULL, 0x0,
2478 NULL, HFILL }
2480 { &hf_q2931_cause_network_service,
2481 { "Network service", "q2931.cause.network_service",
2482 FT_BOOLEAN, 8, TFS(&tfs_user_provider), 0x80,
2483 NULL, HFILL }
2485 { &hf_q2931_cause_network_behavior,
2486 { "Network behavior", "q2931.cause.network_behavior",
2487 FT_BOOLEAN, 8, TFS(&tfs_abnormal_normal), 0x40,
2488 NULL, HFILL }
2490 { &hf_q2931_nsap_address_number_short,
2491 { "Number (too short)", "q2931.nsap_address.number_short",
2492 FT_BYTES, BASE_NONE, NULL, 0x0,
2493 NULL, HFILL }
2495 { &hf_q2931_atm_identifier,
2496 { "Identifier", "q2931.atm_identifier",
2497 FT_UINT8, BASE_HEX, VALS(q2931_atm_td_subfield_vals), 0x0,
2498 NULL, HFILL }
2500 { &hf_q2931_atm_identifier_value,
2501 { "Value", "q2931.atm_identifier_value",
2502 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_cells_s), 0x0,
2503 NULL, HFILL }
2505 { &hf_q2931_aal_parameter_identifier,
2506 { "Identifier", "q2931.aal.parameter_identifier",
2507 FT_UINT8, BASE_HEX, NULL, 0x0,
2508 NULL, HFILL }
2510 { &hf_q2931_e2e_transit_delay_identifier,
2511 { "Identifier", "q2931.transit_delay.identifier",
2512 FT_UINT8, BASE_HEX, NULL, 0x0,
2513 NULL, HFILL }
2515 { &hf_q2931_bband_sending_complete_id,
2516 { "Identifier", "q2931.bband_sending_complete.id",
2517 FT_UINT8, BASE_HEX, NULL, 0x0,
2518 NULL, HFILL }
2520 { &hf_q2931_bband_sending_complete,
2521 { "Broadband sending complete indication", "q2931.bband_sending_complete",
2522 FT_NONE, BASE_NONE, NULL, 0x0,
2523 NULL, HFILL }
2525 { &hf_q2931_locking_codeset,
2526 { "Locking codeset", "q2931.locking_codeset",
2527 FT_UINT8, BASE_DEC, NULL, 0x0,
2528 NULL, HFILL }
2532 static int *ett[] = {
2533 &ett_q2931,
2534 &ett_q2931_ext,
2535 &ett_q2931_ie,
2536 &ett_q2931_ie_ext,
2537 &ett_q2931_nsap,
2540 static ei_register_info ei[] = {
2541 { &ei_q2931_atm_identifier, { "q2931.atm_identifier.unknown", PI_PROTOCOL, PI_WARN, "Unknown ATM traffic descriptor element", EXPFILL }},
2542 { &ei_q2931_aal_parameter_identifier, { "q2931.aal.parameter_identifier.unknown", PI_PROTOCOL, PI_WARN, "Unknown AAL parameter", EXPFILL }},
2543 { &ei_q2931_e2e_transit_delay_identifier, { "q2931.transit_delay.parameter_identifier.unknown", PI_PROTOCOL, PI_WARN, "Unknown transit delay identifier", EXPFILL }},
2544 { &ei_q2931_bband_sending_complete_id, { "q2931.bband_sending_complete.id.unknown", PI_PROTOCOL, PI_WARN, "Unknown broadband sending complete element", EXPFILL }},
2547 expert_module_t* expert_q2931;
2549 proto_q2931 = proto_register_protocol("Q.2931", "Q.2931", "q2931");
2550 proto_register_field_array (proto_q2931, hf, array_length(hf));
2551 proto_register_subtree_array(ett, array_length(ett));
2552 expert_q2931 = expert_register_protocol(proto_q2931);
2553 expert_register_field_array(expert_q2931, ei, array_length(ei));
2555 register_dissector("q2931", dissect_q2931, proto_q2931);
2559 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2561 * Local variables:
2562 * c-basic-offset: 8
2563 * tab-width: 8
2564 * indent-tabs-mode: t
2565 * End:
2567 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
2568 * :indentSize=8:tabSize=8:noTabs=false: