epan/dissectors/pidl/samr/samr.cnf cnf_dissect_lsa_BinaryString => lsarpc_dissect_str...
[wireshark-sm.git] / epan / dissectors / packet-v52.c
blob12f5209033899373831d582b714c83307ee2e81e
1 /* packet-v52.c
2 * Implementation for V5.2 Interface dissection
3 * References:
4 * ETSI EN 300 324-1 V2.1.1 (2000-04)
5 * ETSI EN 300 347-1 V2.2.2 (1999-12)
7 * Copyright 2009
9 * ISKRATEL d.o.o. | 4S d.o.o.
10 * http://www.iskratel.si/ | http://www.4es.si/
11 * <info@iskratel.si> | <projects@4es.si>
12 * Vladimir Smrekar <vladimir.smrekar@gmail.com>
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1998
18 * SPDX-License-Identifier: GPL-2.0-or-later
21 #include "config.h"
23 #include <epan/packet.h>
24 #include <epan/tfs.h>
25 #include <wsutil/array.h>
27 void proto_register_v52(void);
29 static int proto_v52;
30 static int hf_v52_discriminator;
32 static int ett_v52;
33 static int ett_v52_info;
35 /* static int hf_v52_address; */
36 /* static int hf_v52_low_address; */
38 static int hf_v52_msg_type;
39 static int hf_v52_info_element;
41 static int hf_v52_isdn_address;
42 static int hf_v52_isdn_low_address;
43 static int hf_v52_pstn_address;
44 static int hf_v52_pstn_low_address;
45 static int hf_v52_link_address;
46 static int hf_v52_link_low_address;
47 static int hf_v52_bcc_address;
48 static int hf_v52_bcc_low_address;
49 static int hf_v52_prot_address;
50 static int hf_v52_prot_low_address;
51 /* static int hf_v52_ctrl_address; */
52 /* static int hf_v52_ctrl_low_address; */
53 static int hf_v52_cadenced_ring;
54 static int hf_v52_pulse_notification;
55 static int hf_v52_info_length;
57 /*PSTN Message*/
58 static int hf_v52_line_info;
59 static int hf_v52_pulse_type;
60 static int hf_v52_suppression_indicator;
61 static int hf_v52_pulse_duration;
62 static int hf_v52_ack_request_indicator;
63 static int hf_v52_number_of_pulses;
64 static int hf_v52_steady_signal;
65 static int hf_v52_auto_signalling_sequence;
66 static int hf_v52_sequence_response;
67 static int hf_v52_digit_ack;
68 static int hf_v52_digit_spare;
69 static int hf_v52_digit_info;
70 static int hf_v52_res_unavailable;
71 static int hf_v52_state;
72 static int hf_v52_cause_type;
73 static int hf_v52_pstn_sequence_number;
74 static int hf_v52_duration_type;
75 /*Link control*/
76 static int hf_v52_link_control_function;
77 /*Protection protocol*/
78 static int hf_v52_rejection_cause;
79 static int hf_v52_error_cause;
80 static int hf_v52_diagnostic_msg;
81 static int hf_v52_diagnostic_element;
82 /*BCC protocol*/
83 static int hf_v52_pstn_user_port_id;
84 static int hf_v52_pstn_user_port_id_lower;
86 static int hf_v52_isdn_user_port_id;
87 static int hf_v52_isdn_user_port_id_lower;
89 static int hf_v52_isdn_user_port_ts_num;
90 static int hf_v52_override;
91 static int hf_v52_reject_cause_type;
92 static int hf_v52_bcc_protocol_error_cause;
93 static int hf_v52_connection_incomplete_reason;
95 static int hf_v52_diagnostic_message;
96 static int hf_v52_diagnostic_information;
98 /*Control protocol*/
99 static int hf_v52_control_function_element;
100 static int hf_v52_control_function_id;
101 static int hf_v52_variant;
102 static int hf_v52_if_up_id;
103 static int hf_v52_if_id;
104 static int hf_v52_if_low_id;
105 static int hf_v52_if_all_id;
106 static int hf_v52_performance_grading;
107 static int hf_v52_cp_rejection_cause;
109 static int hf_v52_v5_link_id;
110 static int hf_v52_v5_time_slot;
111 static int hf_v52_sequence_number;
113 static int hf_v52_v5_multi_slot_elements;
115 static int message_type_tmp = -1;
117 static void
118 dissect_v52_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree)
120 unsigned int discriminator = tvb_get_uint8(tvb, offset);
123 if (discriminator == 0x48) {
124 proto_tree_add_uint_format_value(tree, hf_v52_discriminator, tvb, offset, 1, discriminator,
125 "V5.2 (0x%02X)",
126 discriminator);
127 } else {
128 proto_tree_add_uint_format_value(tree, hf_v52_discriminator,
129 tvb, offset, 1, discriminator,
130 "Reserved (0x%02X)",
131 discriminator);
135 /*============================*/
136 /* V52 MESSAGE TYPE START */
137 /*============================*/
139 /* message types of PSTN */
140 #define ESTABLISH 0x00
141 #define ESTABLISH_ACK 0x01
142 #define SIGNAL 0x02
143 #define SIGNAL_ACK 0x03
144 #define DISCONNECT 0x08
145 #define DISCONNECT_COMPLETE 0x09
146 #define STATUS_ENQUIRY 0x0c
147 #define STATUS 0x0d
148 #define PROTOCOL_PARAMETER 0x0e
149 /* message types of Control protocol */
150 #define PORT_CONTROL 0x10
151 #define PORT_CONTROL_ACK 0x11
152 #define COMMON_CONTROL 0x12
153 #define COMMON_CONTROL_ACK 0x13
154 /* message types of PROT protocol */
155 #define SWITCH_OVER_REQ 0x18
156 #define SWITCH_OVER_COM 0x19
157 #define OS_SWITCH_OVER_COM 0x1a
158 #define SWITCH_OVER_ACK 0x1b
159 #define SWITCH_OVER_REJECT 0x1c
160 #define PROT_PROTOCOL_ERROR 0x1d
161 #define RESET_SN_COM 0x1e
162 #define RESET_SN_ACK 0x1f
163 /* message types of BCC */
164 #define ALLOCATION 0x20
165 #define ALLOCATION_COMPLETE 0x21
166 #define ALLOCATION_REJECT 0x22
167 #define DE_ALLOCATION 0x23
168 #define DE_ALLOCATION_COMPLETE 0x24
169 #define DE_ALLOCATION_REJECT 0x25
170 #define AUDIT 0x26
171 #define AUDIT_COMPLETE 0x27
172 #define AN_FAULT 0x28
173 #define AN_FAULT_ACKNOWLEDGE 0x29
174 #define BCC_PROTOCOL_ERROR 0x2a
175 /* message types of Link Control protocol */
176 #define LINK_CONTROL 0x30
177 #define LINK_CONTROL_ACK 0x31
179 static const value_string msg_type_values [] = {
180 { ESTABLISH, "Establish" },
181 { ESTABLISH_ACK, "Establish Ack" },
182 { SIGNAL, "Signal" },
183 { SIGNAL_ACK, "Signal Ack" },
184 { DISCONNECT, "Disconnect" },
185 { DISCONNECT_COMPLETE, "Disconnect Complete" },
186 { STATUS_ENQUIRY, "Status Enquiry" },
187 { STATUS, "Status" },
188 { PROTOCOL_PARAMETER, "Protocol Parameter" },
189 { PORT_CONTROL, "Port Control" },
190 { PORT_CONTROL_ACK, "Port Control Ack" },
191 { COMMON_CONTROL, "Common Control" },
192 { COMMON_CONTROL_ACK, "Common Control Ack" },
193 { SWITCH_OVER_REQ, "Switch-Over Request" },
194 { SWITCH_OVER_COM, "Switch-Over Com" },
195 { OS_SWITCH_OVER_COM, "OS-Switch-Over Com" },
196 { SWITCH_OVER_ACK, "Switch-Over Ack" },
197 { SWITCH_OVER_REJECT, "Switch-Over Reject" },
198 { PROT_PROTOCOL_ERROR, "Protocol Error" },
199 { RESET_SN_COM, "Reset SN Com" },
200 { RESET_SN_ACK, "Reset SN Ack" },
201 { ALLOCATION, "Allocation" },
202 { ALLOCATION_COMPLETE, "Allocation Complete" },
203 { ALLOCATION_REJECT, "Allocation Reject" },
204 { DE_ALLOCATION, "DE Allocation" },
205 { DE_ALLOCATION_COMPLETE, "DE Allocation Complete" },
206 { DE_ALLOCATION_REJECT, "DE Allocation Reject" },
207 { AUDIT, "Audit" },
208 { AUDIT_COMPLETE, "Audit Complete" },
209 { AN_FAULT, "AN Fault" },
210 { AN_FAULT_ACKNOWLEDGE, "AN Fault Ack" },
211 { BCC_PROTOCOL_ERROR, "Protocol Error" },
212 { LINK_CONTROL, "Link Control" },
213 { LINK_CONTROL_ACK, "Link Control Ack" },
214 { 0, NULL } };
215 static value_string_ext msg_type_values_ext = VALUE_STRING_EXT_INIT(msg_type_values);
217 /* SHORT */
218 static const value_string msg_type_values_short [] = {
219 { ESTABLISH, "Establish" },
220 { ESTABLISH_ACK, "Establish Ack" },
221 { SIGNAL, "Signal" },
222 { SIGNAL_ACK, "Signal Ack" },
223 { DISCONNECT, "Disconnect" },
224 { DISCONNECT_COMPLETE, "Disconnect Com" },
225 { STATUS_ENQUIRY, "Status Enq" },
226 { STATUS, "Status" },
227 { PROTOCOL_PARAMETER, "Prot Para" },
228 { PORT_CONTROL, "PortCtrl" },
229 { PORT_CONTROL_ACK, "PortCtrl Ack" },
230 { COMMON_CONTROL, "CCtrl" },
231 { COMMON_CONTROL_ACK, "CCtrl Ack" },
232 { SWITCH_OVER_REQ, "SO Req" },
233 { SWITCH_OVER_COM, "SO Com" },
234 { OS_SWITCH_OVER_COM, "OS SO Com" },
235 { SWITCH_OVER_ACK, "SO Ack" },
236 { SWITCH_OVER_REJECT, "SO Rej" },
237 { PROT_PROTOCOL_ERROR, "Prot Err" },
238 { RESET_SN_COM, "Res SN Com" },
239 { RESET_SN_ACK, "Res SN Ack" },
240 { ALLOCATION, "BCC Alloc" },
241 { ALLOCATION_COMPLETE, "BCC Alloc Comp" },
242 { ALLOCATION_REJECT, "BCC Allo Rej" },
243 { DE_ALLOCATION, "BCC DE-Alloc" },
244 { DE_ALLOCATION_COMPLETE, "BCC DE-Alloc Comp" },
245 { DE_ALLOCATION_REJECT, "BCC DE-Alloc Rej" },
246 { AUDIT, "BCC Audit" },
247 { AUDIT_COMPLETE, "BCC Audit Comp" },
248 { AN_FAULT, "BCC AN Fault" },
249 { AN_FAULT_ACKNOWLEDGE, "BCC AN Fault Ack" },
250 { BCC_PROTOCOL_ERROR, "BCC Prot Error" },
251 { LINK_CONTROL, "LinkCtrl" },
252 { LINK_CONTROL_ACK, "LinkCtrl Ack" },
253 { 0, NULL } };
254 static value_string_ext msg_type_values_short_ext = VALUE_STRING_EXT_INIT(msg_type_values_short);
256 static const value_string pulse_type_values [] = {
257 { 0xeb, "Pulsed b-wire disconnected" },
258 { 0xec, "Pulsed a-wire disconnected" },
259 { 0xed, "Pulsed normal battery" },
260 { 0xee, "Pulsed c-wire disconnected" },
261 { 0xef, "Pulsed c-wire connected to earth" },
262 { 0xf0, "Pulsed a-wire connected to battery" },
263 { 0xf1, "Pulsed a-wire connected to earth" },
264 { 0xf2, "Pulsed b-wire connected to battery" },
265 { 0xf3, "Earth loop pulse" },
266 { 0xf4, "Pulsed b-wire connected to earth" },
267 { 0xf5, "Pulsed off hook (pulsed loop closed)" },
268 { 0xf6, "Register recall (timed loop open)" },
269 { 0xf7, "50 Hz pulse" },
270 { 0xf8, "Meter pulse" },
271 { 0xf9, "Initial ring" },
272 { 0xfa, "Pulsed no battery" },
273 { 0xfb, "Pulsed reduced battery" },
274 { 0xfc, "Pulsed on hook" },
275 { 0xfd, "Pulsed battery on c-wire" },
276 { 0xfe, "Pulsed reversed polarity" },
277 { 0xff, "Pulsed normal polarity" },
278 { 0, NULL } };
279 static value_string_ext pulse_type_values_ext = VALUE_STRING_EXT_INIT(pulse_type_values);
281 static const value_string suppression_indication_values [] = {
282 { 0x0, "No suppression" },
283 { 0x1, "Suppression allowed by pre-defined V5.1 SIGNAL msg from LE" },
284 { 0x2, "Suppression allowed by pre-defined line signal from TE" },
285 { 0x3, "Suppression allowed by pre-defined V5.1 SIGNAL msg from LE or line signal from TE" },
286 { 0, NULL } };
288 static const value_string ack_request_indication_values [] = {
289 { 0x0, "No acknowledgement requested" },
290 { 0x1, "Ending acknowledgement requested when finished each pulses" },
291 { 0x2, "Ending acknowledgement requested when finished all pulses" },
292 { 0x3, "Start of pulse acknowledgement requested" },
293 { 0, NULL } };
295 static const value_string steady_signal_values [] = {
296 { 0x00, "Normal polarity" },
297 { 0x01, "Reversed polarity" },
298 { 0x02, "Battery on c-wire" },
299 { 0x03, "No battery on c-wire" },
300 { 0x04, "Off hook (loop closed)" },
301 { 0x05, "On hook (loop open)" },
302 { 0x06, "Battery on a-wire" },
303 { 0x07, "A-wire on earth" },
304 { 0x08, "No battery on a-wire" },
305 { 0x09, "No battery on b-wire" },
306 { 0x0a, "Reduced battery" },
307 { 0x0b, "No battery" },
308 { 0x0c, "Alternate reduced power / no power" },
309 { 0x0d, "Normal battery" },
310 { 0x0e, "Stop ringing" },
311 { 0x0f, "Start pilot frequency" },
312 { 0x10, "Stop pilot frequency" },
313 { 0x11, "Low impedance on b-wire" },
314 { 0x12, "B-wire connected to earth" },
315 { 0x13, "B-wire disconnected from earth" },
316 { 0x14, "Battery on b-wire" },
317 { 0x15, "Low loop impedance" },
318 { 0x16, "High loop impedance" },
319 { 0x17, "Anomalous loop impedance" },
320 { 0x18, "A-wire disconnected from earth" },
321 { 0x19, "C-wire on earth" },
322 { 0x1a, "C-wire disconnected from earth" },
323 { 0x1d, "Ramp to reverse polarity" },
324 { 0x1e, "Ramp to normal polarity" },
325 { 0, NULL } };
326 static value_string_ext steady_signal_values_ext = VALUE_STRING_EXT_INIT(steady_signal_values);
328 static const true_false_string tfs_digit_ack_values = {
329 "Ending acknowledgement requested when digit transmission is finished",
330 "No ending acknowledgement requested" };
332 static const value_string line_info_values [] = {
333 { 0x00, "Impedance marker reset" },
334 { 0x01, "Impedance marker set" },
335 { 0x02, "Low loop impedance" },
336 { 0x03, "Anomalous loop impedance" },
337 { 0x04, "Anomalous line condition received"},
338 { 0, NULL } };
340 static const value_string state_values [] = {
341 { 0x00, "AN0" },
342 { 0x01, "AN1" },
343 { 0x02, "AN2" },
344 { 0x03, "AN3" },
345 { 0x04, "AN4" },
346 { 0x05, "AN5" },
347 { 0x06, "AN6" },
348 { 0x07, "AN7" },
349 { 0x0f, "Not applicable" },
350 { 0, NULL } };
352 static const value_string control_function_element_values [] = {
353 { 0x01, "FE101 (activate access)" },
354 { 0x02, "FE102 (activation initiated by user)" },
355 { 0x03, "FE103 (DS activated)" },
356 { 0x04, "FE104 (access activated)" },
357 { 0x05, "FE105 (deactivate access)" },
358 { 0x06, "FE106 (access deactivated)" },
359 { 0x11, "FE201/202 (unblock)" },
360 { 0x13, "FE203/204 (block)" },
361 { 0x15, "FE205 (block request)" },
362 { 0x16, "FE206 (performance grading)" },
363 { 0x17, "FE207 (D-channel block)" },
364 { 0x18, "FE208 (D-channel unblock)" },
365 { 0x19, "FE209 (TE out of service)" },
366 { 0x1A, "FE210 (failure inside network)" },
367 { 0, NULL } };
369 static const value_string control_function_id_values [] = {
370 { 0x00, "Verify re-provisioning" },
371 { 0x01, "Ready for re-provisioning" },
372 { 0x02, "Not ready for re-provisioning" },
373 { 0x03, "Switch-over to new variant" },
374 { 0x04, "Re-provisioning started" },
375 { 0x05, "Cannot re-provision" },
376 { 0x06, "Request variant and interface ID" },
377 { 0x07, "Variant and interface ID" },
378 { 0x08, "Blocking started" },
379 { 0x10, "Restart request" },
380 { 0x11, "Restart complete" },
381 { 0x12, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REQUEST" },
382 { 0x13, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS ACCEPTED" },
383 { 0x14, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REJECTED" },
384 { 0x15, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS COMPLETED" },
385 { 0x16, "UNBLOCK ALL RELEVANT PSTN PORTS REQUEST" },
386 { 0x17, "UNBLOCK ALL RELEVANT PSTN PORTS ACCEPTED" },
387 { 0x18, "UNBLOCK ALL RELEVANT PSTN PORTS REJECTED" },
388 { 0x19, "UNBLOCK ALL RELEVANT PSTN PORTS COMPLETED" },
389 { 0x1a, "UNBLOCK ALL RELEVANT ISDN PORTS REQUEST" },
390 { 0x1b, "UNBLOCK ALL RELEVANT ISDN PORTS ACCEPTED" },
391 { 0x1c, "UNBLOCK ALL RELEVANT ISDN PORTS REJECTED" },
392 { 0x1d, "UNBLOCK ALL RELEVANT ISDN PORTS COMPLETED" },
393 { 0x1e, "BLOCK ALL PSTN PORTS REQUEST" },
394 { 0x1f, "BLOCK ALL PSTN PORTS ACCEPTED" },
395 { 0x20, "BLOCK ALL PSTN PORTS REJECTED" },
396 { 0x21, "BLOCK ALL PSTN PORTS COMPLETED" },
397 { 0x22, "BLOCK ALL ISDN PORTS REQUEST" },
398 { 0x23, "BLOCK ALL ISDN PORTS ACCEPTED" },
399 { 0x24, "BLOCK ALL ISDN PORTS REJECTED" },
400 { 0x25, "BLOCK ALL ISDN PORTS COMPLETED" },
401 { 0, NULL } };
402 static value_string_ext control_function_id_values_ext = VALUE_STRING_EXT_INIT(control_function_id_values);
404 static const value_string control_function_id_values_short [] = {
405 { 0x00, "VerifyRe-pro" },
406 { 0x01, "ReadyForRe-pro" },
407 { 0x02, "NotReadyForRe-pro" },
408 { 0x03, "SO ToNewVar" },
409 { 0x04, "Re-pro Started" },
410 { 0x05, "CannotRe-pro" },
411 { 0x06, "ReqVar & intf ID" },
412 { 0x07, "Var & intf ID" },
413 { 0x08, "BlockStarted" },
414 { 0x10, "RestartReq" },
415 { 0x11, "RestartCompl" },
416 { 0x12, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REQUEST" },
417 { 0x13, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS ACCEPTED" },
418 { 0x14, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REJECTED" },
419 { 0x15, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS COMPLETED" },
420 { 0x16, "UNBLOCK ALL RELEVANT PSTN PORTS REQUEST" },
421 { 0x17, "UNBLOCK ALL RELEVANT PSTN PORTS ACCEPTED" },
422 { 0x18, "UNBLOCK ALL RELEVANT PSTN PORTS REJECTED" },
423 { 0x19, "UNBLOCK ALL RELEVANT PSTN PORTS COMPLETED" },
424 { 0x1a, "UNBLOCK ALL RELEVANT ISDN PORTS REQUEST" },
425 { 0x1b, "UNBLOCK ALL RELEVANT ISDN PORTS ACCEPTED" },
426 { 0x1c, "UNBLOCK ALL RELEVANT ISDN PORTS REJECTED" },
427 { 0x1d, "UNBLOCK ALL RELEVANT ISDN PORTS COMPLETED" },
428 { 0x1e, "BLOCK ALL PSTN PORTS REQUEST" },
429 { 0x1f, "BLOCK ALL PSTN PORTS ACCEPTED" },
430 { 0x20, "BLOCK ALL PSTN PORTS REJECTED" },
431 { 0x21, "BLOCK ALL PSTN PORTS COMPLETED" },
432 { 0x22, "BLOCK ALL ISDN PORTS REQUEST" },
433 { 0x23, "BLOCK ALL ISDN PORTS ACCEPTED" },
434 { 0x24, "BLOCK ALL ISDN PORTS REJECTED" },
435 { 0x25, "BLOCK ALL ISDN PORTS COMPLETED" },
436 { 0, NULL } };
437 static value_string_ext control_function_id_values_short_ext = VALUE_STRING_EXT_INIT(control_function_id_values_short);
439 static const value_string rejection_cause_values [] = {
440 { 0x00, "No standby C-channel available" },
441 { 0x01, "Target physical C-channel not operational" },
442 { 0x02, "Target physical C-channel not provisioned" },
443 { 0x03, "Protection switching impossible (AN/LE failure)" },
444 { 0x04, "Protection group mismatch" },
445 { 0x05, "Requested allocation exists already" },
446 { 0x06, "Target physical C-channel already has logical C-channel" },
447 { 0, NULL } };
449 static const value_string error_cause_values [] = {
450 { 0x01, "Protocol discriminator error" },
451 { 0x04, "Message type unrecognized" },
452 { 0x07, "Mandatory information element missing" },
453 { 0x08, "Unrecognized information element" },
454 { 0x09, "Mandatory information element content error" },
455 { 0x0b, "Message not compatible with protection protocol state" },
456 { 0x0c, "Repeated mandatory information element" },
457 { 0x0d, "Too many information elements" },
458 { 0x0f, "Logical C-Channel identification error" },
459 { 0, NULL } };
461 static const value_string performance_grading_values [] = {
462 { 0x00, "normal grade" },
463 { 0x01, "degraded" },
464 { 0, NULL } };
466 static const value_string cp_rejection_cause_values [] = {
467 { 0x00, "variant unknown" },
468 { 0x01, "variant known, not ready" },
469 { 0x02, "re-provisioning in progress (re-pro)" },
470 { 0, NULL } };
472 static const value_string reject_cause_type_values [] = {
473 { 0x00, "Unspecified" },
474 { 0x01, "Access network fault" },
475 { 0x02, "Access network blocked (internally)" },
476 { 0x03, "Connection already present at the PSTN user port to a different V5 time slot" },
477 { 0x04, "Connection already present at the V5 time slot(s) to a different port or ISDN user port time slot(s)" },
478 { 0x05, "Connection already present at the ISDN user port time slot(s) to a different V5 time slot(s)" },
479 { 0x06, "User port unavailable (blocked)" },
480 { 0x07, "De-allocation cannot be completed due to incompatible data content" },
481 { 0x08, "De-allocation cannot be completed due to V5 time slot(s) data incompatibility" },
482 { 0x09, "De-allocation cannot be completed due to port data incompatibility" },
483 { 0x0a, "De-allocation cannot be completed due to user port time slot(s) data incompatibility" },
484 { 0x0b, "User port not provisioned" },
485 { 0x0c, "Invalid V5 time slot(s) indication(s)" },
486 { 0x0d, "Invalid V5 2048 kbit/s link indication" },
487 { 0x0e, "Invalid user time slot(s) indication(s)" },
488 { 0x0f, "V5 time slot(s) being used as physical C-channel(s)" },
489 { 0x10, "V5 link unavailable (blocked)" },
490 { 0, NULL } };
492 static const value_string bcc_protocol_error_cause_type_values [] = {
493 { 0x01, "Protocol discriminator error" },
494 { 0x04, "Message type unrecognized" },
495 { 0x05, "Out of sequence information element" },
496 { 0x06, "Repeated optional information element" },
497 { 0x07, "Mandatory information element missing" },
498 { 0x08, "Unrecognized information element" },
499 { 0x09, "Mandatory information element content error" },
500 { 0x0a, "Optional information element content error" },
501 { 0x0b, "Message not compatible with the BCC protocol state" },
502 { 0x0c, "Repeated mandatory information element" },
503 { 0x0d, "Too many information element" },
504 { 0x0f, "BCC Reference Number coding error" },
505 { 0, NULL } };
507 static const value_string connection_incomplete_reason_values [] = {
508 { 0x00, "Incomplete normal" },
509 { 0x01, "Access network fault" },
510 { 0x02, "User port not provisioned" },
511 { 0x03, "Invalid V5 time slot identification" },
512 { 0x04, "Invalid V5 2048 kbit/s link identification" },
513 { 0x05, "Time slot being used as physical C-channel" },
514 { 0, NULL } };
516 static const value_string link_control_function_values [] = {
517 { 0x00, "FE-IDReq" },
518 { 0x01, "FE-IDAck" },
519 { 0x02, "FE-IDRel" },
520 { 0x03, "FE-IDRej" },
521 { 0x04, "FE301/302 (link unblock)" },
522 { 0x05, "FE303/304 (link block)" },
523 { 0x06, "FE305 (deferred link block request" },
524 { 0x07, "FE306 (non-deferred link block request)" },
525 { 0, NULL } };
527 static const value_string cause_type_values [] = {
528 { 0x00, "Response to STATUS ENQUIRY" },
529 { 0x01, "Not used" },
530 { 0x03, "L3 address error" },
531 { 0x04, "Message type unrecognized" },
532 { 0x05, "Out of sequence information element" },
533 { 0x06, "Repeated optional information element" },
534 { 0x07, "Mandatory information element missing" },
535 { 0x08, "Unrecognized information element" },
536 { 0x09, "Mandatory information element content error" },
537 { 0x0a, "Optional information element content error" },
538 { 0x0b, "Message not compatible with path state" },
539 { 0x0c, "Repeated mandatory information element" },
540 { 0x0d, "Too many information elements" },
541 { 0, NULL } };
543 /* protocol message info elements */
544 #define PSTN_SEQUENCE_NUMBER 0x00 /* PSTN */
545 #define CADENCED_RINGING 0x01 /* PSTN */
546 #define PULSED_SIGNAL 0x02 /* PSTN */
547 #define STEADY_SIGNAL 0x03 /* PSTN */
548 #define DIGIT_SIGNAL 0x04 /* PSTN */
549 #define RECOGNITION_TIME 0x10 /* PSTN */
550 #define ENABLE_AUTO_ACK 0x11 /* PSTN */
551 #define DISABLE_AUTO_ACK 0x12 /* PSTN */
552 #define CAUSE 0x13 /* PSTN */
553 #define RESOURCE_UNAVAILABLE 0x14 /* PSTN */
554 #define CONTROL_FUNCTION_ELEMENT 0x20 /* Control */
555 #define CONTROL_FUNCTION_ID 0x21 /* Control */
556 #define ENABLE_METERING 0x22 /* PSTN */
557 #define VARIANT 0x22 /* Control */
558 #define METERING_REPORT 0x23 /* PSTN */
559 #define INTERFACE_ID 0x23 /* Control */
560 #define ATTENUATION 0x24 /* PSTN */
561 #define LINK_CONTROL_FUNCTION 0x30 /* Link Control */
562 #define USER_PORT_ID 0x40 /* BCC */
563 #define ISDN_PORT_TS_ID 0x41 /* BCC */
564 #define V5_TIME_SLOT_ID 0x42 /* BCC */
565 #define MULTI_SLOT_MAP 0x43 /* BCC */
566 #define BCC_REJECT_CAUSE 0x44 /* BCC */
567 #define BCC_PROTOCOL_ERROR_CAUSE 0x45 /* BCC */
568 #define CONNECTION_INCOMPLETE 0x46 /* BCC */
569 #define SEQUENCE_NUMBER 0x50 /* Protection */
570 #define C_CHANNEL_ID 0x51 /* Protection */
571 #define PP_REJECTION_CAUSE 0x52 /* Protection */
572 #define PROTOCOL_ERROR 0x53 /* Protection */
573 #define LINE_INFORMATION 0x80 /* PSTN */
574 #define STATE 0x90 /* PSTN */
575 #define AUTO_SIG_SEQUENCE 0xa0 /* PSTN */
576 #define SEQUENCE_RESPONSE 0xb0 /* PSTN */
577 #define PULSE_NOTIFICATION 0xc0 /* PSTN */
578 #define PERFORMANCE_GRADING 0xe0 /* Control */
579 #define CP_REJECTION_CAUSE 0xf0 /* Control */
581 static const value_string info_element_values [] = {
582 { PSTN_SEQUENCE_NUMBER, "Sequence number" },
583 { CADENCED_RINGING, "Cadenced ringing" },
584 { PULSED_SIGNAL, "Pulsed signal" },
585 { STEADY_SIGNAL, "Steady signal" },
586 { DIGIT_SIGNAL, "Digit signal" },
587 { RECOGNITION_TIME, "Recognition time" },
588 { ENABLE_AUTO_ACK, "Enable autonomous acknowledge" },
589 { DISABLE_AUTO_ACK, "Disable autonomous acknowledge" },
590 { CAUSE, "Cause" },
591 { RESOURCE_UNAVAILABLE, "Resource unavailable" },
592 { CONTROL_FUNCTION_ELEMENT, "Control function element" },
593 { CONTROL_FUNCTION_ID, "Control function ID" },
594 { ENABLE_METERING, "Enable metering" },
595 /* { VARIANT, "Variant" }, XXX - Duplicate value of ENABLE_METERING */
596 { METERING_REPORT, "Metering report" },
597 /* { INTERFACE_ID, "Interface ID" }, XXX - Duplicate value of METERING_REPORT */
598 { ATTENUATION, "Attenuation" },
599 { LINK_CONTROL_FUNCTION, "Link control function" },
600 { USER_PORT_ID, "User port ID" },
601 { ISDN_PORT_TS_ID, "ISDN port TS ID" },
602 { V5_TIME_SLOT_ID, "V5 TS ID" },
603 { MULTI_SLOT_MAP, "Multi-Slot map" },
604 { BCC_REJECT_CAUSE, "Reject cause" },
605 { BCC_PROTOCOL_ERROR_CAUSE, "Protocol error cause" },
606 { CONNECTION_INCOMPLETE, "Connection incomplete" },
607 { SEQUENCE_NUMBER, "Sequence number" },
608 { C_CHANNEL_ID, "Physical C-Channel ID" },
609 { PP_REJECTION_CAUSE, "Rejection cause" },
610 { PROTOCOL_ERROR, "Protocol error cause" },
611 { LINE_INFORMATION, "Line information" },
612 { STATE, "State" },
613 { AUTO_SIG_SEQUENCE, "Autonomous signal sequence" },
614 { SEQUENCE_RESPONSE, "Sequence response" },
615 { PULSE_NOTIFICATION, "Pulse notification" },
616 { PERFORMANCE_GRADING, "Performance grading" },
617 { CP_REJECTION_CAUSE, "Rejection cause" },
618 { 0, NULL } };
619 static value_string_ext info_element_values_ext = VALUE_STRING_EXT_INIT(info_element_values);
622 static const value_string info_element_values_short [] = {
623 { PSTN_SEQUENCE_NUMBER, "SN" },
624 { CADENCED_RINGING, "CR" },
625 { PULSED_SIGNAL, "PS" },
626 { STEADY_SIGNAL, "SS" },
627 { DIGIT_SIGNAL, "DS" },
628 { RECOGNITION_TIME, "RT" },
629 { ENABLE_AUTO_ACK, "EAA" },
630 { DISABLE_AUTO_ACK, "DAA" },
631 { CAUSE, "CA" },
632 { RESOURCE_UNAVAILABLE, "RU" },
633 { CONTROL_FUNCTION_ELEMENT, "CF element" },
634 { CONTROL_FUNCTION_ID, "CF ID" },
635 { ENABLE_METERING, "EM" },
636 { VARIANT, "Var" },
637 { METERING_REPORT, "MR" },
638 { INTERFACE_ID, "Interface ID" },
639 { ATTENUATION, "ATT" },
640 { LINK_CONTROL_FUNCTION, "LC F" },
641 { USER_PORT_ID, "UP ID" },
642 { ISDN_PORT_TS_ID, "ISDNP TS ID" },
643 { V5_TIME_SLOT_ID, "V5 TS ID" },
644 { MULTI_SLOT_MAP, "MS map" },
645 { BCC_REJECT_CAUSE, "RC" },
646 { BCC_PROTOCOL_ERROR_CAUSE, "PEC" },
647 { CONNECTION_INCOMPLETE, "CI" },
648 { SEQUENCE_NUMBER, "SN" },
649 { C_CHANNEL_ID, "Phy CChannel ID" },
650 { PP_REJECTION_CAUSE, "RC" },
651 { PROTOCOL_ERROR, "PEC" },
652 { LINE_INFORMATION, "LI" },
653 { STATE, "ST" },
654 { AUTO_SIG_SEQUENCE, "ASS" },
655 { SEQUENCE_RESPONSE, "SR" },
656 { PULSE_NOTIFICATION, "PN" },
657 { PERFORMANCE_GRADING, "PG" },
658 { CP_REJECTION_CAUSE, "RC" },
659 { 0, NULL } };
660 static value_string_ext info_element_values_short_ext = VALUE_STRING_EXT_INIT(info_element_values_short);
663 #define ADDRESS_OFFSET 1
664 #define ADDRESS_LENGTH 1
665 #define LOW_ADDRESS_OFFSET 2
666 #define LOW_ADDRESS_LENGTH 1
667 #define MSG_TYPE_OFFSET 3
668 #define MSG_TYPE_LENGTH 1
669 #define INFO_ELEMENT_OFFSET 4
670 #define INFO_ELEMENT_LENGTH 1
673 static void
674 dissect_pstn_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
676 proto_tree *info_tree;
677 proto_item *ti_info;
678 const uint8_t info_element_length = 1;
679 uint8_t info_element;
680 uint8_t pstn_sequence_number_tmp;
682 uint16_t data_length;
683 tvbuff_t *info_tvb;
684 const int info_offset = 0;
686 info_element = tvb_get_uint8(tvb, offset);
688 data_length = tvb_get_uint8(tvb, offset+1)+2;
689 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
691 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
693 pstn_sequence_number_tmp = tvb_get_uint8(info_tvb, info_offset+2)-0x80;
694 col_append_fstr(pinfo->cinfo, COL_INFO, " | SN: %u", pstn_sequence_number_tmp);
696 if (info_tree != NULL) {
697 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
698 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
699 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
700 proto_tree_add_item(info_tree, hf_v52_pstn_sequence_number, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
704 static void
705 dissect_cadenced_ring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
707 proto_tree *info_tree;
708 proto_item *ti_info;
709 const uint8_t info_element_length = 1;
710 uint8_t info_element;
711 uint8_t cadenced_ring_tmp;
712 uint16_t data_length;
713 tvbuff_t *info_tvb;
714 const int info_offset = 0;
716 info_element = tvb_get_uint8(tvb, offset);
718 data_length = tvb_get_uint8(tvb, offset+1)+2;
719 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
721 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
723 cadenced_ring_tmp = tvb_get_uint8(info_tvb, info_offset+2)-0x80;
724 col_append_str(pinfo->cinfo, COL_INFO, " | ");
725 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
727 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", cadenced_ring_tmp);
729 if (info_tree != NULL) {
730 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
731 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
732 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
733 proto_tree_add_item(info_tree, hf_v52_cadenced_ring, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
739 static void
740 dissect_pulsed_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
742 proto_tree *info_tree;
743 proto_item *ti_info;
744 const uint8_t info_element_length = 1;
745 uint8_t info_element;
747 uint16_t data_length;
748 tvbuff_t *info_tvb;
749 const int info_offset = 0;
751 info_element = tvb_get_uint8(tvb, offset);
753 data_length = tvb_get_uint8(tvb, offset+1)+2;
754 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
756 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
758 col_append_str(pinfo->cinfo, COL_INFO, " | ");
759 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
761 col_append_str(pinfo->cinfo, COL_INFO, ": ");
762 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset+2), &pulse_type_values_ext, "Unknown element"));
764 if (info_tree != NULL) {
765 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
766 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
767 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
768 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
770 if (data_length > 3) {
771 proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
772 proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
775 if (data_length > 4) {
776 proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN);
777 proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN);
782 static void
783 dissect_steady_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
785 proto_tree *info_tree;
786 proto_item *ti_info;
787 const uint8_t info_element_length = 1;
788 uint8_t info_element;
790 uint16_t data_length;
791 tvbuff_t *info_tvb;
792 const int info_offset = 0;
794 info_element = tvb_get_uint8(tvb, offset);
796 data_length = tvb_get_uint8(tvb, offset+1)+2;
797 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
799 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
801 col_append_str(pinfo->cinfo, COL_INFO, " | ");
802 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
804 col_append_str(pinfo->cinfo, COL_INFO, ": ");
805 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset+2)-0x80, &steady_signal_values_ext, "Unknown element"));
807 if (info_tree != NULL) {
808 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
809 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
810 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
811 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
815 static void
816 dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
818 proto_tree *info_tree;
819 proto_item *ti_info;
820 const uint8_t info_element_length = 1;
821 uint8_t buffer;
822 uint8_t info_element;
824 uint16_t data_length;
825 tvbuff_t *info_tvb;
826 const int info_offset = 0;
828 info_element = tvb_get_uint8(tvb, offset);
830 data_length = tvb_get_uint8(tvb, offset+1)+2;
831 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
833 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
835 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
836 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
837 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
839 proto_tree_add_item(info_tree, hf_v52_digit_ack, info_tvb, info_offset+2, 1, ENC_NA);
841 buffer = tvb_get_uint8(info_tvb, info_offset+2)>>4;
842 buffer = buffer&0x03;
844 proto_tree_add_item(info_tree, hf_v52_digit_spare, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
845 proto_tree_add_item(info_tree, hf_v52_digit_info, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
847 col_append_str(pinfo->cinfo, COL_INFO, " | ");
848 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
850 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", buffer);
853 static void
854 dissect_recognition_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
856 proto_tree *info_tree;
857 proto_item *ti_info;
858 const uint8_t info_element_length = 1;
859 uint8_t info_element;
861 uint16_t data_length;
862 tvbuff_t *info_tvb;
863 const int info_offset = 0;
865 info_element = tvb_get_uint8(tvb, offset);
867 data_length = tvb_get_uint8(tvb, offset+1)+2;
868 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
870 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
872 col_append_str(pinfo->cinfo, COL_INFO, " | ");
873 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
875 if (info_tree != NULL) {
876 uint8_t buffer;
877 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
878 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
879 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
881 buffer = tvb_get_uint8(info_tvb, info_offset+2)&0x7f;
882 /*Signal = Coding of pulse type*/
883 if (buffer >= 0x6b)
884 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
885 /*Signal = Coding of steady signal type*/
886 else if (buffer <= 0x1a)
887 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
889 proto_tree_add_item(info_tree, hf_v52_duration_type, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
893 static void
894 dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
896 proto_tree *info_tree;
897 proto_item *ti_info;
898 const uint8_t info_element_length = 1;
899 uint8_t info_element;
901 uint16_t data_length;
902 tvbuff_t *info_tvb;
903 const int info_offset = 0;
905 info_element = tvb_get_uint8(tvb, offset);
907 data_length = tvb_get_uint8(tvb, offset+1)+2;
908 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
910 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
912 col_append_str(pinfo->cinfo, COL_INFO, " | ");
913 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
915 if (info_tree != NULL) {
916 uint8_t buffer;
917 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
918 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
919 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
921 buffer = tvb_get_uint8(info_tvb, info_offset+2)&0x7f;
922 /*Signal*/
923 if (buffer >= 0x6b)
924 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
925 else if (buffer <= 0x1a)
926 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
928 buffer = tvb_get_uint8(info_tvb, info_offset+3)&0x7f;
929 /*Response*/
930 if (buffer >= 0x6b)
931 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
932 else if (buffer <= 0x1a)
933 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
935 if (tvb_reported_length_remaining(info_tvb, info_offset+4)) {
936 proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN);
937 proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN);
939 if (tvb_reported_length_remaining(info_tvb, info_offset+5)) {
940 proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+5, 1, ENC_BIG_ENDIAN);
941 proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+5, 1, ENC_BIG_ENDIAN);
946 static void
947 dissect_disable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
949 proto_tree *info_tree;
950 proto_item *ti_info;
951 const uint8_t info_element_length = 1;
952 uint8_t info_element;
954 uint16_t data_length;
955 tvbuff_t *info_tvb;
956 const int info_offset = 0;
958 info_element = tvb_get_uint8(tvb, offset);
960 data_length = tvb_get_uint8(tvb, offset+1)+2;
961 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
963 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
965 col_append_str(pinfo->cinfo, COL_INFO, " | ");
966 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
968 if (info_tree != NULL) {
969 uint8_t buffer;
970 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
971 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
972 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
974 buffer = tvb_get_uint8(info_tvb, info_offset+2)&0x7f;
976 if (buffer >= 0x6b)
977 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
978 else if (buffer <= 0x1a)
979 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
983 static void
984 dissect_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
986 proto_tree *info_tree;
987 proto_item *ti_info;
988 const uint8_t info_element_length = 1;
989 uint8_t info_element;
991 uint16_t data_length;
992 tvbuff_t *info_tvb;
993 const int info_offset = 0;
995 info_element = tvb_get_uint8(tvb, offset);
997 data_length = tvb_get_uint8(tvb, offset+1)+2;
998 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1000 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1002 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1003 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
1005 col_append_str(pinfo->cinfo, COL_INFO, ": ");
1006 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_uint8(info_tvb, info_offset+2)-0x80, cause_type_values, "Unknown element"));
1008 if (info_tree != NULL) {
1009 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1010 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1011 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1012 proto_tree_add_item(info_tree, hf_v52_cause_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
1014 if (tvb_reported_length_remaining(info_tvb, info_offset+3))
1015 proto_tree_add_uint_format(info_tree, hf_v52_msg_type, info_tvb, info_offset+3, 1, tvb_get_uint8(info_tvb, info_offset+3),
1016 "Diagnostic: %s", val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset+3), &msg_type_values_ext, "unknown"));
1020 static void
1021 dissect_resource_unavailable(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1023 proto_tree *info_tree;
1024 proto_item *ti_info;
1025 const uint8_t info_element_length = 1;
1026 uint8_t info_element;
1028 uint16_t data_length;
1029 tvbuff_t *info_tvb;
1030 const int info_offset = 0;
1032 info_element = tvb_get_uint8(tvb, offset);
1034 data_length = tvb_get_uint8(tvb, offset+1)+2;
1035 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1037 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1039 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1040 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
1042 if (info_tree != NULL) {
1043 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1044 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1045 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1046 proto_tree_add_item(info_tree, hf_v52_res_unavailable, info_tvb, info_offset+2, info_element_length, ENC_ASCII);
1050 static void
1051 dissect_pulse_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1053 proto_tree *info_tree;
1054 proto_item *ti_info;
1055 const uint8_t info_element_length = 1;
1056 uint8_t info_element;
1058 uint16_t data_length;
1059 tvbuff_t *info_tvb;
1060 const int info_offset = 0;
1062 info_element = tvb_get_uint8(tvb, offset);
1064 data_length = 1;
1065 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1067 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1069 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1070 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
1072 if (info_tree != NULL) {
1073 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1074 proto_tree_add_item(info_tree, hf_v52_pulse_notification, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1078 static void
1079 dissect_line_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1081 proto_tree *info_tree;
1082 proto_item *ti_info;
1083 const uint8_t info_element_length = 1;
1084 uint8_t info_element;
1086 uint16_t data_length;
1087 tvbuff_t *info_tvb;
1088 const int info_offset = 0;
1090 info_element = tvb_get_uint8(tvb, offset);
1092 data_length = 1;
1093 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1095 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1097 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1098 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
1100 if (info_tree != NULL) {
1101 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1102 proto_tree_add_item(info_tree, hf_v52_line_info, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1106 static void
1107 dissect_state(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1109 proto_tree *info_tree;
1110 proto_item *ti_info;
1111 const uint8_t info_element_length = 1;
1112 uint8_t info_element;
1114 uint16_t data_length;
1115 tvbuff_t *info_tvb;
1116 const int info_offset = 0;
1118 info_element = tvb_get_uint8(tvb, offset);
1120 data_length = 1;
1121 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1123 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1125 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1126 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
1128 if (info_tree != NULL) {
1129 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1130 proto_tree_add_item(info_tree, hf_v52_state, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1134 static void
1135 dissect_auto_sig_sequence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1137 proto_tree *info_tree;
1138 proto_item *ti_info;
1139 const uint8_t info_element_length = 1;
1140 uint8_t info_element;
1142 uint16_t data_length;
1143 tvbuff_t *info_tvb;
1144 const int info_offset = 0;
1146 info_element = tvb_get_uint8(tvb, offset);
1148 data_length = 1;
1149 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1151 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1153 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1154 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
1156 if (info_tree != NULL) {
1157 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1158 proto_tree_add_item(info_tree, hf_v52_auto_signalling_sequence, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1162 static void
1163 dissect_sequence_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1165 proto_tree *info_tree;
1166 proto_item *ti_info;
1167 const uint8_t info_element_length = 1;
1168 uint8_t info_element;
1170 uint16_t data_length;
1171 tvbuff_t *info_tvb;
1172 const int info_offset = 0;
1174 info_element = tvb_get_uint8(tvb, offset);
1176 data_length = 1;
1177 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1179 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1181 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1182 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
1184 if (info_tree != NULL) {
1185 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1186 proto_tree_add_item(info_tree, hf_v52_sequence_response, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1190 static void
1191 dissect_control_function_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1193 proto_tree *info_tree;
1194 proto_item *ti_info;
1195 const uint8_t info_element_length = 1;
1196 uint8_t info_element;
1198 uint16_t data_length;
1199 tvbuff_t *info_tvb;
1200 const int info_offset = 0;
1202 info_element = tvb_get_uint8(tvb, offset);
1204 data_length = tvb_get_uint8(tvb, offset+1)+2;
1205 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1207 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1209 if (message_type_tmp != 0x11) {
1210 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1211 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_uint8(info_tvb, info_offset+2)-0x80, control_function_element_values, "Unknown element"));
1214 if (info_tree != NULL) {
1215 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1216 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1217 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1218 proto_tree_add_item(info_tree, hf_v52_control_function_element, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1222 static void
1223 dissect_control_function_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1225 proto_tree *info_tree;
1226 proto_item *ti_info;
1227 const uint8_t info_element_length = 1;
1228 uint8_t info_element;
1230 uint16_t data_length;
1231 tvbuff_t *info_tvb;
1232 const int info_offset = 0;
1234 info_element = tvb_get_uint8(tvb, offset);
1236 data_length = tvb_get_uint8(tvb, offset+1)+2;
1237 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1239 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1241 if (message_type_tmp != 0x13) {
1242 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1243 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset+2)-0x80, &control_function_id_values_short_ext, "Unknown layer3 element"));
1246 if (info_tree != NULL) {
1247 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1248 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1249 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1250 proto_tree_add_item(info_tree, hf_v52_control_function_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1254 static void
1255 dissect_variant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1257 proto_tree *info_tree;
1258 proto_item *ti_info;
1259 const uint8_t info_element_length = 1;
1260 uint8_t info_element;
1261 uint8_t variantValue;
1263 uint16_t data_length;
1264 tvbuff_t *info_tvb;
1265 const int info_offset = 0;
1267 info_element = tvb_get_uint8(tvb, offset);
1269 data_length = tvb_get_uint8(tvb, offset+1)+2;
1270 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1272 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1274 variantValue = tvb_get_uint8(info_tvb, info_offset+2)-0x80;
1275 col_append_fstr(pinfo->cinfo, COL_INFO, " | Var: %u", variantValue);
1277 if (info_tree != NULL) {
1278 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1279 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1280 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1281 proto_tree_add_item(info_tree, hf_v52_variant, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1285 static void
1286 dissect_interface_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1288 proto_tree *info_tree;
1289 proto_item *ti_info;
1290 const uint8_t info_element_length = 1;
1291 uint8_t info_element;
1292 uint8_t interfaceAllIdValue;
1294 uint16_t data_length;
1295 tvbuff_t *info_tvb;
1296 const int info_offset = 0;
1298 info_element = tvb_get_uint8(tvb, offset);
1300 data_length = tvb_get_uint8(tvb, offset+1)+2;
1301 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1303 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1305 interfaceAllIdValue = (tvb_get_uint8(info_tvb, info_offset+2)<<16)+(tvb_get_uint8(info_tvb, info_offset+3)<<8)+(tvb_get_uint8(info_tvb, info_offset+4));
1306 col_append_fstr(pinfo->cinfo, COL_INFO, " | Intf. ID: %u", interfaceAllIdValue);
1308 if (info_tree != NULL) {
1309 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1310 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1311 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1312 proto_tree_add_item(info_tree, hf_v52_if_up_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1313 proto_tree_add_item(info_tree, hf_v52_if_id, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1314 proto_tree_add_item(info_tree, hf_v52_if_low_id, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
1315 proto_tree_add_item(info_tree, hf_v52_if_all_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1319 static void
1320 dissect_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1322 proto_tree *info_tree;
1323 proto_item *ti_info;
1324 const uint8_t info_element_length = 1;
1325 uint8_t info_element;
1326 uint8_t hf_v52_sequence_number_tmp;
1327 uint16_t data_length;
1328 tvbuff_t *info_tvb;
1329 const int info_offset = 0;
1331 info_element = tvb_get_uint8(tvb, offset);
1333 data_length = tvb_get_uint8(tvb, offset+1)+2;
1334 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1336 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1338 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1339 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element"));
1341 hf_v52_sequence_number_tmp = tvb_get_uint8(info_tvb, info_offset+2)-0x80;
1342 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", hf_v52_sequence_number_tmp);
1344 if (info_tree != NULL) {
1345 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1346 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1347 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1348 proto_tree_add_item(info_tree, hf_v52_sequence_number, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1352 static void
1353 dissect_physical_c_channel_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1355 proto_tree *info_tree;
1356 proto_item *ti_info;
1357 const uint8_t info_element_length = 1;
1358 uint8_t info_element;
1360 uint16_t data_length;
1361 tvbuff_t *info_tvb;
1362 const int info_offset = 0;
1364 info_element = tvb_get_uint8(tvb, offset);
1366 data_length = tvb_get_uint8(tvb, offset+1)+2;
1367 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1369 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1371 col_append_fstr(pinfo->cinfo, COL_INFO, " | Phy C-ch: %u, %u", tvb_get_uint8(info_tvb, info_offset+2), tvb_get_uint8(info_tvb, info_offset+3));
1373 if (info_tree != NULL) {
1374 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1375 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1376 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1377 proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1378 proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1382 static void
1383 dissect_pp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1385 proto_tree *info_tree;
1386 proto_item *ti_info;
1387 const uint8_t info_element_length = 1;
1388 uint8_t info_element;
1390 uint16_t data_length;
1391 tvbuff_t *info_tvb;
1392 const int info_offset = 0;
1394 info_element = tvb_get_uint8(tvb, offset);
1396 data_length = tvb_get_uint8(tvb, offset+1)+2;
1397 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1399 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1401 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1402 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_uint8(info_tvb, info_offset+2)-0x80, rejection_cause_values, "Unknown element"));
1404 if (info_tree != NULL) {
1405 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1406 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1407 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1408 proto_tree_add_item(info_tree, hf_v52_rejection_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1412 static void
1413 dissect_protocol_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1415 proto_tree *info_tree;
1416 proto_item *ti_info;
1417 const uint8_t info_element_length = 1;
1418 uint8_t info_element;
1420 uint16_t data_length;
1421 tvbuff_t *info_tvb;
1422 const int info_offset = 0;
1424 info_element = tvb_get_uint8(tvb, offset);
1426 data_length = tvb_get_uint8(tvb, offset+1)+2;
1427 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1429 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1431 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1432 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_uint8(info_tvb, info_offset+2)-0x80, error_cause_values, "Unknown element"));
1434 if (info_tree != NULL) {
1435 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1436 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1437 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1438 proto_tree_add_item(info_tree, hf_v52_error_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1439 proto_tree_add_item(info_tree, hf_v52_diagnostic_msg, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1440 proto_tree_add_item(info_tree, hf_v52_diagnostic_element, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
1444 static void
1445 dissect_performance_grading(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1447 proto_tree *info_tree;
1448 proto_item *ti_info;
1449 const uint8_t info_element_length = 1;
1450 uint8_t info_element;
1452 uint16_t data_length;
1453 tvbuff_t *info_tvb;
1454 const int info_offset = 0;
1456 info_element = tvb_get_uint8(tvb, offset);
1458 data_length = 1;
1459 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1461 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1463 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1464 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_uint8(info_tvb, info_offset)-0xe0, performance_grading_values, "Unknown element"));
1466 if (info_tree != NULL) {
1467 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1468 proto_tree_add_item(info_tree, hf_v52_performance_grading, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1472 static void
1473 dissect_cp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1475 proto_tree *info_tree;
1476 proto_item *ti_info;
1477 const uint8_t info_element_length = 1;
1478 uint8_t info_element;
1480 uint16_t data_length;
1481 tvbuff_t *info_tvb;
1482 const int info_offset = 0;
1484 info_element = tvb_get_uint8(tvb, offset);
1486 data_length = 1;
1487 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1489 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1491 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1492 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_uint8(info_tvb, info_offset)-0xe0, cp_rejection_cause_values, "Unknown element"));
1494 if (info_tree != NULL) {
1495 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1496 proto_tree_add_item(info_tree, hf_v52_cp_rejection_cause, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1500 static void
1501 dissect_user_port_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1503 proto_tree *info_tree;
1504 proto_item *ti_info;
1505 const uint8_t info_element_length = 1;
1506 uint8_t buffer;
1507 uint8_t info_element;
1509 uint16_t data_length;
1510 tvbuff_t *info_tvb;
1511 const int info_offset = 0;
1513 info_element = tvb_get_uint8(tvb, offset);
1515 data_length = tvb_get_uint8(tvb, offset+1)+2;
1516 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1518 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1520 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1521 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1522 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1524 buffer = tvb_get_uint8(info_tvb, info_offset+2)&0x01;
1526 if (buffer == 0x01) {
1527 proto_tree_add_item(info_tree, hf_v52_pstn_user_port_id, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
1528 proto_tree_add_item(info_tree, hf_v52_pstn_user_port_id_lower, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
1530 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN port: %u", (((tvb_get_uint8(info_tvb, info_offset+2)>>1)<<8)+(tvb_get_uint8(info_tvb, info_offset+3))));
1532 else if (buffer == 0x00) {
1533 proto_tree_add_item(info_tree, hf_v52_isdn_user_port_id, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
1534 proto_tree_add_item(info_tree, hf_v52_isdn_user_port_id_lower, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
1536 col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", (((tvb_get_uint8(info_tvb, info_offset+2)>>2)<<7)+((tvb_get_uint8( info_tvb, info_offset+3)>>1))));
1540 static void
1541 dissect_isdn_port_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1543 proto_tree *info_tree;
1544 proto_item *ti_info;
1545 const uint8_t info_element_length = 1;
1546 uint8_t info_element;
1547 uint8_t isdn_user_port_ts_num_tmp;
1549 uint16_t data_length;
1550 tvbuff_t *info_tvb;
1551 const int info_offset = 0;
1553 info_element = tvb_get_uint8(tvb, offset);
1555 data_length = tvb_get_uint8(tvb, offset+1)+2;
1556 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1558 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1560 isdn_user_port_ts_num_tmp = (tvb_get_uint8(info_tvb, info_offset+2)) - 128;
1561 col_append_str(pinfo->cinfo, COL_INFO, ", ");
1562 col_append_fstr(pinfo->cinfo, COL_INFO, "%x", isdn_user_port_ts_num_tmp);
1564 if (info_tree != NULL) {
1565 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1566 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1567 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1568 proto_tree_add_item(info_tree, hf_v52_isdn_user_port_ts_num, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1572 static void
1573 dissect_v5_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1575 proto_tree *info_tree;
1576 proto_item *ti_info;
1577 const uint8_t info_element_length = 1;
1578 uint8_t info_element;
1579 uint8_t v5_link_id_tmp;
1580 uint8_t v5_time_slot_tmp;
1582 uint16_t data_length;
1583 tvbuff_t *info_tvb;
1584 const int info_offset = 0;
1586 info_element = tvb_get_uint8(tvb, offset);
1588 data_length = tvb_get_uint8(tvb, offset+1)+2;
1589 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1591 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1593 v5_link_id_tmp = tvb_get_uint8(info_tvb, info_offset+2);
1594 v5_time_slot_tmp = tvb_get_uint8(info_tvb, info_offset+3);
1596 if (v5_time_slot_tmp >= 64) {
1597 v5_time_slot_tmp = v5_time_slot_tmp - 64;
1600 if (v5_time_slot_tmp >= 32) {
1601 v5_time_slot_tmp = v5_time_slot_tmp - 32;
1604 col_append_fstr(pinfo->cinfo, COL_INFO, " | V5 Link: %u, %u ", v5_link_id_tmp, v5_time_slot_tmp);
1606 if (info_tree != NULL) {
1607 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1608 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1609 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1610 proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1611 proto_tree_add_item(info_tree, hf_v52_override, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1612 proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1616 static void
1617 dissect_multi_slot_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1619 proto_tree *info_tree;
1620 proto_item *ti_info;
1621 const uint8_t info_element_length = 1;
1622 uint8_t info_element;
1624 uint16_t data_length;
1625 tvbuff_t *info_tvb;
1626 const int info_offset = 0;
1628 info_element = tvb_get_uint8(tvb, offset);
1630 data_length = tvb_get_uint8(tvb, offset+1)+2;
1631 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1633 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1635 col_append_fstr(pinfo->cinfo, COL_INFO, " | V5MSlink ID:%u", tvb_get_uint8(info_tvb, info_offset+2));
1637 if (info_tree != NULL) {
1638 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1639 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1640 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1641 proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1643 if (tvb_reported_length_remaining(info_tvb, info_offset+3))
1644 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1645 if (tvb_reported_length_remaining(info_tvb, info_offset+4))
1646 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
1647 if (tvb_reported_length_remaining(info_tvb, info_offset+5))
1648 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+5, info_element_length, ENC_BIG_ENDIAN);
1649 if (tvb_reported_length_remaining(info_tvb, info_offset+6))
1650 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+6, info_element_length, ENC_BIG_ENDIAN);
1651 if (tvb_reported_length_remaining(info_tvb, info_offset+7))
1652 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+7, info_element_length, ENC_BIG_ENDIAN);
1653 if (tvb_reported_length_remaining(info_tvb, info_offset+8))
1654 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+8, info_element_length, ENC_BIG_ENDIAN);
1655 if (tvb_reported_length_remaining(info_tvb, info_offset+9))
1656 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+9, info_element_length, ENC_BIG_ENDIAN);
1657 if (tvb_reported_length_remaining(info_tvb, info_offset+10))
1658 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+10, info_element_length, ENC_BIG_ENDIAN);
1662 static void
1663 dissect_bcc_rejct_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1665 proto_tree *info_tree;
1666 proto_item *ti_info;
1667 const uint8_t info_element_length = 1;
1668 uint8_t info_element;
1670 uint16_t data_length;
1671 tvbuff_t *info_tvb;
1672 const int info_offset = 0;
1674 info_element = tvb_get_uint8(tvb, offset);
1676 data_length = tvb_get_uint8(tvb, offset+1)+2;
1677 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1679 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1681 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1682 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_uint8(info_tvb, info_offset+2)-0x80, reject_cause_type_values, "Unknown element"));
1684 if (info_tree != NULL) {
1685 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1686 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1687 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1688 proto_tree_add_item(info_tree, hf_v52_reject_cause_type, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1692 static void
1693 dissect_bcc_protocol_error_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1695 proto_tree *info_tree;
1696 proto_item *ti_info;
1697 const uint8_t info_element_length = 1;
1698 uint8_t info_element;
1700 uint16_t data_length;
1701 tvbuff_t *info_tvb;
1702 const int info_offset = 0;
1704 info_element = tvb_get_uint8(tvb, offset);
1706 data_length = tvb_get_uint8(tvb, offset+1)+2;
1707 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1709 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1711 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1712 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_uint8(info_tvb, info_offset+2)-0x80, bcc_protocol_error_cause_type_values, "Unknown element"));
1714 if (info_tree != NULL) {
1715 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1716 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1717 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1718 proto_tree_add_item(info_tree, hf_v52_bcc_protocol_error_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1720 if (tvb_reported_length_remaining(info_tvb, info_offset+3))
1721 proto_tree_add_item(info_tree, hf_v52_diagnostic_message, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1722 if (tvb_reported_length_remaining(info_tvb, info_offset+4))
1723 proto_tree_add_item(info_tree, hf_v52_diagnostic_information, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
1727 static void
1728 dissect_connection_incomplete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1730 proto_tree *info_tree;
1731 proto_item *ti_info;
1732 const uint8_t info_element_length = 1;
1733 uint8_t info_element;
1735 uint16_t data_length;
1736 tvbuff_t *info_tvb;
1737 const int info_offset = 0;
1739 info_element = tvb_get_uint8(tvb, offset);
1741 data_length = tvb_get_uint8(tvb, offset+1)+2;
1742 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1744 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1746 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1747 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_uint8(info_tvb, info_offset+2) & 0x80, connection_incomplete_reason_values, "Unknown element"));
1749 if (info_tree != NULL) {
1750 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1751 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1752 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1753 proto_tree_add_item(info_tree, hf_v52_connection_incomplete_reason, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1757 static void
1758 dissect_link_control_function(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1760 proto_tree *info_tree;
1761 proto_item *ti_info;
1762 const uint8_t info_element_length = 1;
1763 uint8_t info_element;
1765 uint16_t data_length;
1766 tvbuff_t *info_tvb;
1767 const int info_offset = 0;
1769 info_element = tvb_get_uint8(tvb, offset);
1771 data_length = tvb_get_uint8(tvb, offset+1) + 2;
1772 info_tvb = tvb_new_subset_length(tvb, offset, data_length);
1774 info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:");
1776 if (message_type_tmp != 0x31) {
1777 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1778 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_uint8(info_tvb, info_offset+2)-0x80, link_control_function_values, "Unknown element"));
1781 if (info_tree != NULL) {
1782 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1783 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1784 proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element);
1785 proto_tree_add_item(info_tree, hf_v52_link_control_function, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1791 static void
1792 dissect_v52_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1794 int offset = 4;
1795 uint8_t info_element, info_element_length;
1796 /*int old_offset;*/
1797 int singleoctet;
1799 while (tvb_reported_length_remaining(tvb, offset) > 0) {
1800 singleoctet = 0;
1801 /* old_offset = offset; */
1802 info_element = tvb_get_uint8(tvb, offset);
1803 switch (info_element) {
1804 case PSTN_SEQUENCE_NUMBER:
1805 info_element_length = tvb_get_uint8(tvb, offset+1);
1806 dissect_pstn_sequence_number(tvb, pinfo, tree, offset);
1807 offset += info_element_length+2;
1808 break;
1809 case CADENCED_RINGING:
1810 info_element_length = tvb_get_uint8(tvb, offset+1);
1811 dissect_cadenced_ring(tvb, pinfo, tree, offset);
1812 offset += info_element_length+2;
1813 break;
1814 case PULSED_SIGNAL:
1815 info_element_length = tvb_get_uint8(tvb, offset+1);
1816 dissect_pulsed_signal(tvb, pinfo, tree, offset);
1817 offset += info_element_length+2;
1818 break;
1819 case STEADY_SIGNAL:
1820 info_element_length = tvb_get_uint8(tvb, offset+1);
1821 dissect_steady_signal(tvb, pinfo, tree, offset);
1822 offset += info_element_length+2;
1823 break;
1824 case DIGIT_SIGNAL:
1825 info_element_length = tvb_get_uint8(tvb, offset+1);
1826 dissect_digit_signal(tvb, pinfo, tree, offset);
1827 offset += info_element_length+2;
1828 break;
1829 case RECOGNITION_TIME:
1830 info_element_length = tvb_get_uint8(tvb, offset+1);
1831 dissect_recognition_time(tvb, pinfo, tree, offset);
1832 offset += info_element_length+2;
1833 break;
1834 case ENABLE_AUTO_ACK:
1835 info_element_length = tvb_get_uint8(tvb, offset+1);
1836 dissect_enable_auto_ack(tvb, pinfo, tree, offset);
1837 offset += info_element_length+2;
1838 break;
1839 case DISABLE_AUTO_ACK:
1840 info_element_length = tvb_get_uint8(tvb, offset+1);
1841 dissect_disable_auto_ack(tvb, pinfo, tree, offset);
1842 offset += info_element_length+2;
1843 break;
1844 case CAUSE:
1845 info_element_length = tvb_get_uint8(tvb, offset+1);
1846 dissect_cause(tvb, pinfo, tree, offset);
1847 offset += info_element_length+2;
1848 break;
1849 case RESOURCE_UNAVAILABLE:
1850 info_element_length = tvb_get_uint8(tvb, offset+1);
1851 dissect_resource_unavailable(tvb, pinfo, tree, offset);
1852 offset += info_element_length+2;
1853 break;
1854 case PULSE_NOTIFICATION:
1855 dissect_pulse_notification(tvb, pinfo, tree, offset);
1856 singleoctet = 1;
1857 break;
1858 case LINE_INFORMATION:
1859 dissect_line_information(tvb, pinfo, tree, offset);
1860 singleoctet = 1;
1861 break;
1862 case STATE:
1863 dissect_state(tvb, pinfo, tree, offset);
1864 singleoctet = 1;
1865 break;
1866 case AUTO_SIG_SEQUENCE:
1867 dissect_auto_sig_sequence(tvb, pinfo, tree, offset);
1868 singleoctet = 1;
1869 break;
1870 case SEQUENCE_RESPONSE:
1871 dissect_sequence_response(tvb, pinfo, tree, offset);
1872 singleoctet = 1;
1873 break;
1875 case CONTROL_FUNCTION_ELEMENT:
1876 info_element_length = tvb_get_uint8(tvb, offset+1);
1877 dissect_control_function_element(tvb, pinfo, tree, offset);
1878 offset += info_element_length+2;
1879 break;
1880 case CONTROL_FUNCTION_ID:
1881 info_element_length = tvb_get_uint8(tvb, offset+1);
1882 dissect_control_function_id(tvb, pinfo, tree, offset);
1883 offset += info_element_length+2;
1884 break;
1885 case VARIANT:
1886 info_element_length = tvb_get_uint8(tvb, offset+1);
1887 dissect_variant(tvb, pinfo, tree, offset);
1888 offset += info_element_length+2;
1889 break;
1890 case INTERFACE_ID:
1891 info_element_length = tvb_get_uint8(tvb, offset+1);
1892 dissect_interface_id(tvb, pinfo, tree, offset);
1893 offset += info_element_length+2;
1894 break;
1895 case SEQUENCE_NUMBER:
1896 info_element_length = tvb_get_uint8(tvb, offset+1);
1897 dissect_sequence_number(tvb, pinfo, tree, offset);
1898 offset += info_element_length+2;
1899 break;
1900 case C_CHANNEL_ID:
1901 info_element_length = tvb_get_uint8(tvb, offset+1);
1902 dissect_physical_c_channel_id(tvb, pinfo, tree, offset);
1903 offset += info_element_length+2;
1904 break;
1905 case PP_REJECTION_CAUSE:
1906 info_element_length = tvb_get_uint8(tvb, offset+1);
1907 dissect_pp_rejection_cause(tvb, pinfo, tree, offset);
1908 offset += info_element_length+2;
1909 break;
1910 case PROTOCOL_ERROR:
1911 info_element_length = tvb_get_uint8(tvb, offset+1);
1912 dissect_protocol_error(tvb, pinfo, tree, offset);
1913 offset += info_element_length+2;
1914 break;
1915 case PERFORMANCE_GRADING:
1916 dissect_performance_grading(tvb, pinfo, tree, offset);
1917 singleoctet = 1;
1918 break;
1919 case CP_REJECTION_CAUSE:
1920 dissect_cp_rejection_cause(tvb, pinfo, tree, offset);
1921 singleoctet = 1;
1922 break;
1923 case USER_PORT_ID:
1924 info_element_length = tvb_get_uint8(tvb, offset+1);
1925 dissect_user_port_identification(tvb, pinfo, tree, offset);
1926 offset += info_element_length+2;
1927 break;
1928 case ISDN_PORT_TS_ID:
1929 info_element_length = tvb_get_uint8(tvb, offset+1);
1930 dissect_isdn_port_time_slot_identification(tvb, pinfo, tree, offset);
1931 offset += info_element_length+2;
1932 break;
1933 case V5_TIME_SLOT_ID:
1934 info_element_length = tvb_get_uint8(tvb, offset+1);
1935 dissect_v5_time_slot_identification(tvb, pinfo, tree, offset);
1936 offset += info_element_length+2;
1937 break;
1938 case MULTI_SLOT_MAP:
1939 info_element_length = tvb_get_uint8(tvb, offset+1);
1940 dissect_multi_slot_map(tvb, pinfo, tree, offset);
1941 offset += info_element_length+2;
1942 break;
1943 case BCC_REJECT_CAUSE:
1944 info_element_length = tvb_get_uint8(tvb, offset+1);
1945 dissect_bcc_rejct_cause(tvb, pinfo, tree, offset);
1946 offset += info_element_length+2;
1947 break;
1948 case BCC_PROTOCOL_ERROR_CAUSE:
1949 info_element_length = tvb_get_uint8(tvb, offset+1);
1950 dissect_bcc_protocol_error_cause(tvb, pinfo, tree, offset);
1951 offset += info_element_length+2;
1952 break;
1953 case CONNECTION_INCOMPLETE:
1954 info_element_length = tvb_get_uint8(tvb, offset+1);
1955 dissect_connection_incomplete(tvb, pinfo, tree, offset);
1956 offset += info_element_length+2;
1957 break;
1958 case LINK_CONTROL_FUNCTION:
1959 info_element_length = tvb_get_uint8(tvb, offset+1);
1960 dissect_link_control_function(tvb, pinfo, tree, offset);
1961 offset += info_element_length+2;
1962 break;
1963 default:
1964 offset += 1;
1965 break;
1967 if (singleoctet == 1) {
1968 offset += 1;
1970 #if 0
1971 if (old_offset <= offset) {
1972 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_WARN, "Zero-length information element");
1973 return;
1975 #endif
1980 static void
1981 dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1983 int offset = 0;
1984 proto_tree *v52_tree = NULL;
1985 bool addr = false;
1986 uint8_t bcc_all_address_tmp_up = -1;
1987 uint16_t pstn_all_address_tmp, isdn_all_address_tmp, bcc_all_address_tmp;
1988 uint16_t prot_all_address_tmp, link_all_address_tmp;
1990 col_set_str(pinfo->cinfo, COL_PROTOCOL, "V52");
1992 if (tree) {
1993 proto_item *ti;
1994 ti = proto_tree_add_item(tree, proto_v52, tvb, offset, -1, ENC_NA);
1995 v52_tree = proto_item_add_subtree(ti, ett_v52);
1997 dissect_v52_protocol_discriminator(tvb, offset, v52_tree);
2001 /* if (v52_tree != NULL) */ {
2003 message_type_tmp = tvb_get_uint8(tvb, MSG_TYPE_OFFSET);
2005 if ((message_type_tmp >= 0x00) && (message_type_tmp <= 0x0e)) {
2006 addr = true;
2007 proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2008 proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2010 pstn_all_address_tmp = (((tvb_get_uint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_uint8(tvb, LOW_ADDRESS_OFFSET)));
2013 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp);
2016 if ((message_type_tmp >= 0x10) && (message_type_tmp <= 0x13)) {
2017 addr = true;
2018 if ((tvb_get_uint8(tvb, ADDRESS_OFFSET)&0x01) == 0x1) {
2019 pstn_all_address_tmp = (((tvb_get_uint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_uint8(tvb, LOW_ADDRESS_OFFSET)));
2020 proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2021 proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2023 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp);
2025 else {
2026 isdn_all_address_tmp = (((tvb_get_uint8(tvb, ADDRESS_OFFSET)>>2)<<7)+((tvb_get_uint8(tvb, LOW_ADDRESS_OFFSET)>>1)));
2027 proto_tree_add_item(v52_tree, hf_v52_isdn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2028 proto_tree_add_item(v52_tree, hf_v52_isdn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2030 col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", isdn_all_address_tmp);
2034 if ((message_type_tmp == 0x30) || (message_type_tmp == 0x31)) {
2035 addr = true;
2036 link_all_address_tmp = tvb_get_uint8(tvb, LOW_ADDRESS_OFFSET);
2037 proto_tree_add_item(v52_tree, hf_v52_link_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2038 proto_tree_add_item(v52_tree, hf_v52_link_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2040 col_append_fstr(pinfo->cinfo, COL_INFO, " | LinkId: %u", link_all_address_tmp);
2043 if ((message_type_tmp >= 0x20) && (message_type_tmp <= 0x2a)) {
2044 addr = true;
2045 proto_tree_add_item(v52_tree, hf_v52_bcc_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2046 proto_tree_add_item(v52_tree, hf_v52_bcc_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2048 bcc_all_address_tmp_up = tvb_get_uint8(tvb, ADDRESS_OFFSET);
2049 if (bcc_all_address_tmp_up >= 128) {
2050 bcc_all_address_tmp_up = bcc_all_address_tmp_up - 128;
2052 bcc_all_address_tmp = (bcc_all_address_tmp_up<<6) + tvb_get_uint8(tvb, LOW_ADDRESS_OFFSET);
2054 col_append_fstr(pinfo->cinfo, COL_INFO, " | ref: %u", bcc_all_address_tmp);
2057 if ((message_type_tmp >= 0x18) && (message_type_tmp <= 0x1f)) {
2058 addr = true;
2059 prot_all_address_tmp = (tvb_get_uint8(tvb, ADDRESS_OFFSET)<<8) + (tvb_get_uint8(tvb, LOW_ADDRESS_OFFSET));
2060 proto_tree_add_item(v52_tree, hf_v52_prot_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2061 proto_tree_add_item(v52_tree, hf_v52_prot_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2063 if ((message_type_tmp == 0x1e) || (message_type_tmp == 0x1f)) {}
2064 else {
2065 col_append_fstr(pinfo->cinfo, COL_INFO, " | Log C-ch: %u", prot_all_address_tmp);
2069 if (addr == false) {
2070 if ((tvb_get_uint8(tvb, ADDRESS_OFFSET)&0x01) == 0x1) {
2071 pstn_all_address_tmp = (((tvb_get_uint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_uint8(tvb, LOW_ADDRESS_OFFSET)));
2072 proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2073 proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2075 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp);
2078 else {
2079 isdn_all_address_tmp = (((tvb_get_uint8(tvb, ADDRESS_OFFSET)>>2)<<7)+((tvb_get_uint8(tvb, LOW_ADDRESS_OFFSET)>>1)));
2080 proto_tree_add_item(v52_tree, hf_v52_isdn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2081 proto_tree_add_item(v52_tree, hf_v52_isdn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2083 col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", isdn_all_address_tmp);
2088 proto_tree_add_item(v52_tree, hf_v52_msg_type, tvb, MSG_TYPE_OFFSET, MSG_TYPE_LENGTH, ENC_BIG_ENDIAN);
2091 col_append_str(pinfo->cinfo, COL_INFO, " | ");
2092 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_uint8(tvb, MSG_TYPE_OFFSET), &msg_type_values_short_ext, "Unknown msg type"));
2094 dissect_v52_info(tvb, pinfo, v52_tree);
2098 static int
2099 dissect_v52(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2101 dissect_v52_message(tvb, pinfo, tree);
2102 return tvb_captured_length(tvb);
2105 void
2106 proto_register_v52(void)
2108 static hf_register_info hf[] = {
2109 { &hf_v52_discriminator,
2110 { "Protocol discriminator", "v52.disc", FT_UINT8, BASE_HEX, NULL, 0x0,
2111 NULL, HFILL }},
2112 #if 0
2113 { &hf_v52_address,
2114 { "Address", "v52.address",
2115 FT_UINT8, BASE_HEX, NULL, 0x0,
2116 NULL, HFILL } },
2117 #endif
2118 #if 0
2119 { &hf_v52_low_address,
2120 { "Address Low", "v52.low_address",
2121 FT_UINT8, BASE_HEX, NULL, 0x0,
2122 NULL, HFILL } },
2123 #endif
2124 /* ISDN */
2125 { &hf_v52_isdn_address,
2126 { "Address isdn", "v52.isdn_address",
2127 FT_UINT8, BASE_HEX, NULL, 0xfc,
2128 NULL, HFILL } },
2129 { &hf_v52_isdn_low_address,
2130 { "Address isdn Low", "v52.isdn_low_address",
2131 FT_UINT8, BASE_HEX, NULL, 0xfe,
2132 NULL, HFILL } },
2133 /* PSTN */
2134 { &hf_v52_pstn_address,
2135 { "Address pstn", "v52.pstn_address",
2136 FT_UINT8, BASE_HEX, NULL, 0xfe,
2137 NULL, HFILL } },
2138 { &hf_v52_pstn_low_address,
2139 { "Address pstn Low", "v52.pstn_low_address",
2140 FT_UINT8, BASE_HEX, NULL, 0x0,
2141 NULL, HFILL } },
2142 /* LINK */
2143 { &hf_v52_link_address,
2144 { "Address link", "v52.link_address",
2145 FT_UINT8, BASE_HEX, NULL, 0x0,
2146 NULL, HFILL } },
2147 { &hf_v52_link_low_address,
2148 { "Address link Low", "v52.link_low_address",
2149 FT_UINT8, BASE_HEX, NULL, 0x0,
2150 NULL, HFILL } },
2151 /* BCC */
2152 { &hf_v52_bcc_address,
2153 { "Address bcc", "v52.bcc_address",
2154 FT_UINT8, BASE_HEX, NULL, 0x7f,
2155 NULL, HFILL } },
2156 { &hf_v52_bcc_low_address,
2157 { "Address bcc Low", "v52.bcc_low_address",
2158 FT_UINT8, BASE_HEX, NULL, 0x3f,
2159 NULL, HFILL } },
2160 /* PROTECTION */
2161 { &hf_v52_prot_address,
2162 { "Address prot", "v52.prot_address",
2163 FT_UINT8, BASE_HEX, NULL, 0x0,
2164 NULL, HFILL } },
2165 { &hf_v52_prot_low_address,
2166 { "Address prot Low", "v52.prot_low_address",
2167 FT_UINT8, BASE_HEX, NULL, 0x0,
2168 NULL, HFILL } },
2169 /* CONTROL */
2170 #if 0
2171 { &hf_v52_ctrl_address,
2172 { "Address ctrl", "v52.ctrl_address",
2173 FT_UINT8, BASE_HEX, NULL, 0x0,
2174 NULL, HFILL } },
2175 #endif
2176 #if 0
2177 { &hf_v52_ctrl_low_address,
2178 { "Address ctrl Low", "v52.ctrl_low_address",
2179 FT_UINT8, BASE_HEX, NULL, 0x0,
2180 NULL, HFILL } },
2181 #endif
2182 /* OTHER */
2183 {&hf_v52_msg_type,
2184 { "Message type", "v52.msg_type",
2185 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &msg_type_values_ext, 0x0,
2186 NULL, HFILL } },
2187 {&hf_v52_info_element,
2188 { "Information element", "v52.info_element",
2189 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &info_element_values_ext, 0x0,
2190 NULL, HFILL } },
2191 {&hf_v52_info_length,
2192 { "Information length", "v52.info_length",
2193 FT_UINT8, BASE_DEC, NULL, 0x0,
2194 NULL, HFILL } },
2195 {&hf_v52_pulse_notification,
2196 { "Pulse notification", "v52.pulse_notification",
2197 FT_UINT8, BASE_HEX, NULL, 0x0,
2198 NULL, HFILL } },
2199 {&hf_v52_pstn_sequence_number,
2200 { "Sequence number", "v52.pstn_sequence_number",
2201 FT_UINT8, BASE_HEX, NULL, 0x7f,
2202 NULL, HFILL } },
2203 {&hf_v52_cadenced_ring,
2204 { "Cadenced ring", "v52.cadenced_ring",
2205 FT_UINT8, BASE_HEX, NULL, 0x7f,
2206 NULL, HFILL } },
2207 {&hf_v52_pulse_type,
2208 { "Pulse Type", "v52.pulse_type",
2209 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &pulse_type_values_ext, 0x0,
2210 NULL, HFILL } },
2211 {&hf_v52_suppression_indicator,
2212 { "Suppression indicator", "v52.suppression_indicator",
2213 FT_UINT8, BASE_HEX, VALS(suppression_indication_values), 0x60,
2214 NULL, HFILL } },
2215 {&hf_v52_pulse_duration,
2216 { "Pulse duration type", "v52.pulse_duration",
2217 FT_UINT8, BASE_HEX, NULL, 0x1f,
2218 NULL, HFILL } },
2219 {&hf_v52_ack_request_indicator,
2220 { "Ack request indicator", "v52.ack_request_indicator",
2221 FT_UINT8, BASE_HEX, VALS(ack_request_indication_values), 0x60,
2222 NULL, HFILL } },
2223 {&hf_v52_number_of_pulses,
2224 { "Number of pulses", "v52.number_of_pulses",
2225 FT_UINT8, BASE_DEC, NULL, 0x1f,
2226 NULL, HFILL } },
2227 {&hf_v52_steady_signal,
2228 { "Steady Signal", "v52.steady_signal",
2229 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &steady_signal_values_ext, 0x7f,
2230 NULL, HFILL } },
2231 {&hf_v52_digit_ack,
2232 { "Digit ack request indication", "v52.digit_ack",
2233 FT_BOOLEAN, 8, TFS(&tfs_digit_ack_values), 0x40,
2234 NULL, HFILL } },
2235 {&hf_v52_digit_spare,
2236 { "Digit spare", "v52.digit_spare",
2237 FT_UINT8, BASE_HEX, NULL, 0x30,
2238 NULL, HFILL } },
2239 {&hf_v52_digit_info,
2240 { "Digit information", "v52.digit_info",
2241 FT_UINT8, BASE_HEX, NULL, 0x0f,
2242 NULL, HFILL } },
2243 {&hf_v52_duration_type,
2244 { "Duration Type", "v52.duration_type",
2245 FT_UINT8, BASE_HEX, NULL, 0x3f,
2246 NULL, HFILL } },
2247 {&hf_v52_res_unavailable,
2248 { "Resource unavailable", "v52.res_unavailable",
2249 FT_STRING, BASE_NONE, NULL, 0x0,
2250 NULL, HFILL } },
2251 {&hf_v52_line_info,
2252 { "Line_Information", "v52.line_info",
2253 FT_UINT8, BASE_HEX, VALS(line_info_values), 0x0f,
2254 NULL, HFILL } },
2255 {&hf_v52_state,
2256 { "PSTN FSM state", "v52.state",
2257 FT_UINT8, BASE_HEX, VALS(state_values), 0x0f,
2258 NULL, HFILL } },
2259 {&hf_v52_auto_signalling_sequence,
2260 { "Autonomous signalling sequence", "v52.auto_signalling_sequence",
2261 FT_UINT8, BASE_HEX, NULL, 0x0f,
2262 NULL, HFILL } },
2263 {&hf_v52_sequence_response,
2264 { "Sequence response", "v52.sequence_response",
2265 FT_UINT8, BASE_HEX, NULL, 0x0f,
2266 NULL, HFILL } },
2267 {&hf_v52_control_function_element,
2268 { "Control function element", "v52.control_function_element",
2269 FT_UINT8, BASE_HEX, VALS(control_function_element_values), 0x7f,
2270 NULL, HFILL } },
2271 {&hf_v52_control_function_id,
2272 { "Control function ID", "v52.control_function",
2273 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &control_function_id_values_ext, 0x7f,
2274 NULL, HFILL } },
2275 {&hf_v52_variant,
2276 { "Variant", "v52.variant",
2277 FT_UINT8, BASE_DEC, NULL, 0x7f,
2278 NULL, HFILL } },
2279 {&hf_v52_if_up_id,
2280 { "Interface up ID", "v52.interface_up_id",
2281 FT_UINT8, BASE_HEX, NULL, 0x0,
2282 NULL, HFILL } },
2283 {&hf_v52_if_id,
2284 { "Interface ID", "v52.interface_id",
2285 FT_UINT8, BASE_HEX, NULL, 0x0,
2286 NULL, HFILL } },
2287 {&hf_v52_if_low_id,
2288 { "Interface down ID", "v52.interface_low_id",
2289 FT_UINT8, BASE_HEX, NULL, 0x0,
2290 NULL, HFILL } },
2291 {&hf_v52_if_all_id,
2292 { "Interface all ID", "v52.interface_all_id",
2293 FT_UINT24, BASE_DEC, NULL, 0x0,
2294 NULL, HFILL } },
2295 {&hf_v52_sequence_number,
2296 { "Sequence number", "v52.sequence_number",
2297 FT_UINT8, BASE_HEX, NULL, 0x7f,
2298 NULL, HFILL } },
2299 {&hf_v52_v5_link_id,
2300 { "V5 2048 kbit/s Link Identifier", "v52.V5_ln_id",
2301 FT_UINT8, BASE_HEX, NULL, 0x0,
2302 NULL, HFILL } },
2303 {&hf_v52_v5_multi_slot_elements,
2304 { "Additional MS ID", "v52.add_ms_id",
2305 FT_UINT8, BASE_HEX, NULL, 0x0,
2306 NULL, HFILL } },
2307 {&hf_v52_v5_time_slot,
2308 { "V5 Time Slot Number", "v52.v5_time_slot",
2309 FT_UINT8, BASE_DEC, NULL, 0x1f,
2310 NULL, HFILL } },
2311 {&hf_v52_rejection_cause,
2312 { "Rejection cause", "v52.rejection_cause",
2313 FT_UINT8, BASE_HEX, VALS(rejection_cause_values), 0x7f,
2314 NULL, HFILL } },
2315 {&hf_v52_error_cause,
2316 { "Protocol Error Cause type", "v52.error_cause",
2317 FT_UINT8, BASE_HEX, VALS(error_cause_values), 0x7f,
2318 NULL, HFILL } },
2319 {&hf_v52_diagnostic_msg,
2320 { "Diagnostic message", "v52.diagnostic_message",
2321 FT_UINT8, BASE_HEX, NULL, 0x7f,
2322 NULL, HFILL } },
2323 {&hf_v52_diagnostic_element,
2324 { "Diagnostic element", "v52.diagnostic_element",
2325 FT_UINT8, BASE_HEX, NULL, 0x0,
2326 NULL, HFILL } },
2327 {&hf_v52_performance_grading,
2328 { "Performance grading", "v52.performance_grading",
2329 FT_UINT8, BASE_HEX, VALS(performance_grading_values), 0x0f,
2330 NULL, HFILL } },
2331 {&hf_v52_cp_rejection_cause,
2332 { "Rejection cp cause", "v52.cp_rejection_cause",
2333 FT_UINT8, BASE_HEX, VALS(cp_rejection_cause_values), 0x0f,
2334 NULL, HFILL } },
2335 {&hf_v52_pstn_user_port_id,
2336 { "PSTN User Port identification Value", "v52.pstn_user_port_id",
2337 FT_UINT8, BASE_HEX, NULL, 0xfe,
2338 NULL, HFILL } },
2339 {&hf_v52_pstn_user_port_id_lower,
2340 { "PSTN User Port Identification Value (lower)", "v52.pstn_user_port_id_lower",
2341 FT_UINT8, BASE_HEX, NULL, 0x0,
2342 NULL, HFILL } },
2343 {&hf_v52_isdn_user_port_id,
2344 { "ISDN User Port Identification Value", "v52.isdn_user_port_id",
2345 FT_UINT8, BASE_HEX, NULL, 0xfc,
2346 NULL, HFILL } },
2347 {&hf_v52_isdn_user_port_id_lower,
2348 { "ISDN User Port Identification Value (lower)", "v52.user_port_id_lower",
2349 FT_UINT8, BASE_HEX, NULL, 0xfe,
2350 NULL, HFILL } },
2351 {&hf_v52_isdn_user_port_ts_num,
2352 { "ISDN user port time slot number", "v52.isdn_user_port_ts_num",
2353 FT_UINT8, BASE_HEX, NULL, 0x1f,
2354 NULL, HFILL } },
2355 {&hf_v52_override,
2356 { "Override", "v52.override",
2357 FT_BOOLEAN, 8, NULL, 0x20,
2358 NULL, HFILL } },
2359 {&hf_v52_reject_cause_type,
2360 { "Reject cause type", "v52.reject_cause_type",
2361 FT_UINT8, BASE_HEX, VALS(reject_cause_type_values), 0x7f,
2362 NULL, HFILL } },
2363 {&hf_v52_bcc_protocol_error_cause,
2364 { "Protocol error cause type", "v52.bcc_protocol_cause",
2365 FT_UINT8, BASE_HEX, VALS(bcc_protocol_error_cause_type_values), 0x7f,
2366 NULL, HFILL } },
2367 {&hf_v52_diagnostic_message,
2368 { "Diagnostic message", "v52.diagnostic_message",
2369 FT_UINT8, BASE_HEX, NULL, 0x7f,
2370 NULL, HFILL } },
2371 {&hf_v52_diagnostic_information,
2372 { "Diagnostic information", "v52.diagnostic_information",
2373 FT_UINT8, BASE_HEX, NULL, 0x0,
2374 NULL, HFILL } },
2375 {&hf_v52_connection_incomplete_reason,
2376 { "Reason", "v52.connection_incomplete_reason",
2377 FT_UINT8, BASE_HEX, VALS(connection_incomplete_reason_values), 0x0,
2378 NULL, HFILL } },
2379 {&hf_v52_link_control_function,
2380 { "Link control function", "v52.link_control_function",
2381 FT_UINT8, BASE_HEX, VALS(link_control_function_values), 0x7f,
2382 NULL, HFILL } },
2383 {&hf_v52_cause_type,
2384 { "Cause type", "v52.cause_type",
2385 FT_UINT8, BASE_HEX, VALS(cause_type_values), 0x7f,
2386 NULL, HFILL } }
2388 static int *ett[] = {
2389 &ett_v52,
2390 &ett_v52_info,
2393 proto_v52 = proto_register_protocol("V5.2", "V5.2", "v52");
2394 proto_register_field_array (proto_v52, hf, array_length(hf));
2395 proto_register_subtree_array(ett, array_length(ett));
2397 register_dissector("v52", dissect_v52, proto_v52);
2401 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2403 * Local variables:
2404 * c-basic-offset: 4
2405 * tab-width: 8
2406 * indent-tabs-mode: nil
2407 * End:
2409 * vi: set shiftwidth=4 tabstop=8 expandtab:
2410 * :indentSize=4:tabSize=8:noTabs=true: