3 * Implementation for V5.2 Interface dissection
5 * ETSI EN 300 324-1 V2.1.1 (2000-04)
6 * ETSI EN 300 347-1 V2.2.2 (1999-12)
10 * ISKRATEL d.o.o. | 4S d.o.o.
11 * http://www.iskratel.si/ | http://www.4es.si/
12 * <info@iskratel.si> | <projects@4es.si>
13 * Vladimir Smrekar <vladimir.smrekar@gmail.com>
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39 #include <epan/packet.h>
40 #include <epan/expert.h>
42 static int proto_v52 = -1;
43 static int hf_v52_discriminator = -1;
45 static gint ett_v52 = -1;
46 static gint ett_v52_info = -1;
48 static int hf_v52_address = -1;
49 static int hf_v52_low_address = -1;
51 static int hf_v52_msg_type = -1;
52 static int hf_v52_info_element = -1;
54 static int hf_v52_isdn_address = -1;
55 static int hf_v52_isdn_low_address = -1;
56 static int hf_v52_pstn_address = -1;
57 static int hf_v52_pstn_low_address = -1;
58 static int hf_v52_link_address = -1;
59 static int hf_v52_link_low_address = -1;
60 static int hf_v52_bcc_address = -1;
61 static int hf_v52_bcc_low_address = -1;
62 static int hf_v52_prot_address = -1;
63 static int hf_v52_prot_low_address = -1;
64 static int hf_v52_ctrl_address = -1;
65 static int hf_v52_ctrl_low_address = -1;
66 static int hf_v52_cadenced_ring = -1;
67 static int hf_v52_pulse_notification = -1;
68 static int hf_v52_info_length = -1;
71 static int hf_v52_line_info = -1;
72 static int hf_v52_pulse_type = -1;
73 static int hf_v52_suppression_indicator = -1;
74 static int hf_v52_pulse_duration = -1;
75 static int hf_v52_ack_request_indicator = -1;
76 static int hf_v52_number_of_pulses = -1;
77 static int hf_v52_steady_signal = -1;
78 static int hf_v52_auto_signalling_sequence = -1;
79 static int hf_v52_sequence_response = -1;
80 static int hf_v52_digit_ack = -1;
81 static int hf_v52_digit_spare = -1;
82 static int hf_v52_digit_info = -1;
83 static int hf_v52_res_unavailable = -1;
84 static int hf_v52_state = -1;
85 static int hf_v52_cause_type = -1;
86 static int hf_v52_pstn_sequence_number = -1;
87 static int hf_v52_duration_type = -1;
89 static int hf_v52_link_control_function = -1;
90 /*Protection protocol*/
91 static int hf_v52_rejection_cause = -1;
92 static int hf_v52_error_cause = -1;
93 static int hf_v52_diagnostic_msg = -1;
94 static int hf_v52_diagnostic_element = -1;
96 static int hf_v52_pstn_user_port_id = -1;
97 static int hf_v52_pstn_user_port_id_lower = -1;
99 static int hf_v52_isdn_user_port_id = -1;
100 static int hf_v52_isdn_user_port_id_lower = -1;
102 static int hf_v52_isdn_user_port_ts_num = -1;
103 static int hf_v52_override = -1;
104 static int hf_v52_reject_cause_type = -1;
105 static int hf_v52_bcc_protocol_error_cause = -1;
106 static int hf_v52_connection_incomplete_reason = -1;
108 static int hf_v52_diagnostic_message = -1;
109 static int hf_v52_diagnostic_information = -1;
112 static int hf_v52_control_function_element = -1;
113 static int hf_v52_control_function_id = -1;
114 static int hf_v52_variant = -1;
115 static int hf_v52_if_up_id = -1;
116 static int hf_v52_if_id = -1;
117 static int hf_v52_if_low_id = -1;
118 static int hf_v52_if_all_id = -1;
119 static int hf_v52_performance_grading = -1;
120 static int hf_v52_cp_rejection_cause = -1;
122 static int hf_v52_v5_link_id = -1;
123 static int hf_v52_v5_time_slot = -1;
124 static int hf_v52_sequence_number = -1;
126 static int hf_v52_v5_multi_slot_elements = -1;
128 static int message_type_tmp = -1;
131 dissect_v52_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree)
133 unsigned int discriminator = tvb_get_guint8(tvb, offset);
136 if (discriminator == 0x48) {
137 proto_tree_add_uint_format(tree, hf_v52_discriminator, tvb, offset, 1, discriminator,
138 "Protocol discriminator: V5.2 (0x%02X)",
141 proto_tree_add_uint_format(tree, hf_v52_discriminator,
142 tvb, offset, 1, discriminator,
143 "Protocol discriminator: Reserved (0x%02X)",
148 /*============================*/
149 /* V52 MESSAGE TYPE START */
150 /*============================*/
152 /* message types of PSTN */
153 #define ESTABLISH 0x00
154 #define ESTABLISH_ACK 0x01
156 #define SIGNAL_ACK 0x03
157 #define DISCONNECT 0x08
158 #define DISCONNECT_COMPLETE 0x09
159 #define STATUS_ENQUIRY 0x0c
161 #define PROTOCOL_PARAMETER 0x0e
162 /* message types of Control protocol */
163 #define PORT_CONTROL 0x10
164 #define PORT_CONTROL_ACK 0x11
165 #define COMMON_CONTROL 0x12
166 #define COMMON_CONTROL_ACK 0x13
167 /* message types of PROT protocol */
168 #define SWITCH_OVER_REQ 0x18
169 #define SWITCH_OVER_COM 0x19
170 #define OS_SWITCH_OVER_COM 0x1a
171 #define SWITCH_OVER_ACK 0x1b
172 #define SWITCH_OVER_REJECT 0x1c
173 #define PROT_PROTOCOL_ERROR 0x1d
174 #define RESET_SN_COM 0x1e
175 #define RESET_SN_ACK 0x1f
176 /* message types of BCC */
177 #define ALLOCATION 0x20
178 #define ALLOCATION_COMPLETE 0x21
179 #define ALLOCATION_REJECT 0x22
180 #define DE_ALLOCATION 0x23
181 #define DE_ALLOCATION_COMPLETE 0x24
182 #define DE_ALLOCATION_REJECT 0x25
184 #define AUDIT_COMPLETE 0x27
185 #define AN_FAULT 0x28
186 #define AN_FAULT_ACKNOWLEDGE 0x29
187 #define BCC_PROTOCOL_ERROR 0x2a
188 /* message types of Link Control protocol */
189 #define LINK_CONTROL 0x30
190 #define LINK_CONTROL_ACK 0x31
192 static const value_string msg_type_values [] = {
193 { ESTABLISH, "Establish" },
194 { ESTABLISH_ACK, "Establish Ack" },
195 { SIGNAL, "Signal" },
196 { SIGNAL_ACK, "Signal Ack" },
197 { DISCONNECT, "Disconnect" },
198 { DISCONNECT_COMPLETE, "Disconnect Complete" },
199 { STATUS_ENQUIRY, "Status Enqury" },
200 { STATUS, "Status" },
201 { PROTOCOL_PARAMETER, "Protocol Parameter" },
202 { PORT_CONTROL, "Port Control" },
203 { PORT_CONTROL_ACK, "Port Control Ack" },
204 { COMMON_CONTROL, "Common Control" },
205 { COMMON_CONTROL_ACK, "Common Control Ack" },
206 { SWITCH_OVER_REQ, "Switch-Over Request" },
207 { SWITCH_OVER_COM, "Switch-Over Com" },
208 { OS_SWITCH_OVER_COM, "OS-Switch-Over Com" },
209 { SWITCH_OVER_ACK, "Switch-Over Ack" },
210 { SWITCH_OVER_REJECT, "Switch-Over Reject" },
211 { PROT_PROTOCOL_ERROR, "Protocol Error" },
212 { RESET_SN_COM, "Reset SN Com" },
213 { RESET_SN_ACK, "Reset SN Ack" },
214 { ALLOCATION, "Allocation" },
215 { ALLOCATION_COMPLETE, "Allocation Complete" },
216 { ALLOCATION_REJECT, "Allocation Reject" },
217 { DE_ALLOCATION, "DE Allocation" },
218 { DE_ALLOCATION_COMPLETE,"DE Allocation Complete" },
219 { DE_ALLOCATION_REJECT, "DE Allocation Reject" },
221 { AUDIT_COMPLETE, "Audit Complete" },
222 { AN_FAULT, "AN Fault" },
223 { AN_FAULT_ACKNOWLEDGE, "AN Fault Ack" },
224 { BCC_PROTOCOL_ERROR, "Protocol Error" },
225 { LINK_CONTROL, "Link Control" },
226 { LINK_CONTROL_ACK, "Link Control Ack" },
230 static const value_string msg_type_values_short [] = {
231 { ESTABLISH, "Establish" },
232 { ESTABLISH_ACK, "Establish Ack" },
233 { SIGNAL, "Signal" },
234 { SIGNAL_ACK, "Signal Ack" },
235 { DISCONNECT, "Disconnect" },
236 { DISCONNECT_COMPLETE, "Disconnect Com" },
237 { STATUS_ENQUIRY, "Status Enq" },
238 { STATUS, "Status" },
239 { PROTOCOL_PARAMETER, "Prot Para" },
240 { PORT_CONTROL, "PortCtrl" },
241 { PORT_CONTROL_ACK, "PortCtrl Ack" },
242 { COMMON_CONTROL, "CCtrl" },
243 { COMMON_CONTROL_ACK, "CCtrl Ack" },
244 { SWITCH_OVER_REQ, "SO Req" },
245 { SWITCH_OVER_COM, "SO Com" },
246 { OS_SWITCH_OVER_COM, "OS SO Com" },
247 { SWITCH_OVER_ACK, "SO Ack" },
248 { SWITCH_OVER_REJECT, "SO Rej" },
249 { PROT_PROTOCOL_ERROR, "Prot Err" },
250 { RESET_SN_COM, "Res SN Com" },
251 { RESET_SN_ACK, "Res SN Ack" },
252 { ALLOCATION, "BCC Alloc" },
253 { ALLOCATION_COMPLETE, "BCC Alloc Comp" },
254 { ALLOCATION_REJECT, "BCC Allo Rej" },
255 { DE_ALLOCATION, "BCC DE-Alloc" },
256 { DE_ALLOCATION_COMPLETE,"BCC DE-Alloc Comp" },
257 { DE_ALLOCATION_REJECT, "BCC DE-Alloc Rej" },
258 { AUDIT, "BCC Audit" },
259 { AUDIT_COMPLETE, "BCC Audit Comp" },
260 { AN_FAULT, "BCC AN Fault" },
261 { AN_FAULT_ACKNOWLEDGE, "BCC AN Fault Ack" },
262 { BCC_PROTOCOL_ERROR, "BCC Prot Error" },
263 { LINK_CONTROL, "LinkCtrl" },
264 { LINK_CONTROL_ACK, "LinkCtrl Ack" },
267 static const value_string pulse_type_values [] = {
268 { 0xff, "Pulsed normal polarity" },
269 { 0xfe, "Pulsed reversed polarity" },
270 { 0xfd, "Pulsed battery on c-wire" },
271 { 0xfc, "Pulsed on hook" },
272 { 0xfb, "Pulsed reduced battery" },
273 { 0xfa, "Pulsed no battery" },
274 { 0xf9, "Initial ring" },
275 { 0xf8, "Meter pulse" },
276 { 0xf7, "50 Hz pulse" },
277 { 0xf6, "Register recall (timed loop open)" },
278 { 0xf5, "Pulsed off hook (pulsed loop closed)" },
279 { 0xf4, "Pulsed b-wire connected to earth" },
280 { 0xf3, "Earth loop pulse" },
281 { 0xf2, "Pulsed b-wire connected to battery" },
282 { 0xf1, "Pulsed a-wire connected to earth" },
283 { 0xf0, "Pulsed a-wire connected to battery" },
284 { 0xef, "Pulsed c-wire connected to earth" },
285 { 0xee, "Pulsed c-wire disconnected" },
286 { 0xed, "Pulsed normal battery" },
287 { 0xec, "Pulsed a-wire disconnected" },
288 { 0xeb, "Pulsed b-wire disconnected" },
291 static const value_string suppression_indication_values [] = {
292 { 0x0, "No suppression" },
293 { 0x1, "Suppression allowed by pre-defined V5.1 SIGNAL msg from LE" },
294 { 0x2, "Suppression allowed by pre-defined line signal from TE" },
295 { 0x3, "Suppression allowed by pre-defined V5.1 SIGNAL msg from LE or line signal from TE" },
298 static const value_string ack_request_indication_values [] = {
299 { 0x0, "No acknowledgement requested" },
300 { 0x1, "Ending acknowledgement requested when finished each pulses" },
301 { 0x2, "Ending acknowledgement requested when finished all pulses" },
302 { 0x3, "Start of pulse acknowledgement requested" },
305 static const value_string steady_signal_values [] = {
306 { 0x00, "Normal polarity" },
307 { 0x01, "Reversed polarity" },
308 { 0x02, "Battery on c-wire" },
309 { 0x03, "No battery on c-wire" },
310 { 0x04, "Off hook (loop closed)" },
311 { 0x05, "On hook (loop open)" },
312 { 0x06, "Battery on a-wire" },
313 { 0x07, "A-wire on earth" },
314 { 0x08, "No battery on a-wire" },
315 { 0x09, "No batery on b-wire" },
316 { 0x0a, "Reduced battery" },
317 { 0x0b, "No battery" },
318 { 0x0c, "Alternate reduced power / no power" },
319 { 0x0d, "Normal battery" },
320 { 0x0e, "Stop ringing" },
321 { 0x0f, "Start pilot frequency" },
322 { 0x10, "Stop pilot frequency" },
323 { 0x11, "Low impedance on b-wire" },
324 { 0x12, "B-wire connected to earth" },
325 { 0x13, "B-wire disconnected from earth" },
326 { 0x14, "Battery on b-wire" },
327 { 0x15, "Low loop impedance" },
328 { 0x16, "High loop impedance" },
329 { 0x17, "Anomalous loop impedance" },
330 { 0x18, "A-wire disconnected from earth" },
331 { 0x19, "C-wire on earth" },
332 { 0x1a, "C-wire disconnected from earth" },
333 { 0x1d, "Ramp to reverse polarity" },
334 { 0x1e, "Ramp to normal polarity" },
337 static const value_string digit_ack_values [] = {
338 { 0x0, "No ending acknowledgement requested" },
339 { 0x1, "Ending acknowledgement requested when digit transmission is finished" },
342 static const value_string line_info_values [] = {
343 { 0x00, "Impedance marker reset" },
344 { 0x01, "Impedance marker set" },
345 { 0x02, "Low loop impedance" },
346 { 0x03, "Anomalous loop impedance" },
347 { 0x04, "Anomalous line condition received"},
350 static const value_string state_values [] = {
359 { 0x0f, "Not applicable" },
362 static const value_string control_function_element_values [] = {
363 { 0x01, "FE101 (activate access)" },
364 { 0x02, "FE102 (activation initiated by user)" },
365 { 0x03, "FE103 (DS activated)" },
366 { 0x04, "FE104 (access activated)" },
367 { 0x05, "FE105 (deactivate access)" },
368 { 0x06, "FE106 (access deactivated)" },
369 { 0x11, "FE201/202 (unblock)" },
370 { 0x13, "FE203/204 (block)" },
371 { 0x15, "FE205 (block request)" },
372 { 0x16, "FE206 (performance grading)" },
373 { 0x17, "FE207 (D-channel block)" },
374 { 0x18, "FE208 (D-channel unblock)" },
375 { 0x19, "FE209 (TE out of service)" },
376 { 0x1A, "FE210 (failure inside network)" },
379 static const value_string control_function_id_values [] = {
380 { 0x00, "Verify re-provisioning" },
381 { 0x01, "Ready for re-provisioning" },
382 { 0x02, "Not ready for re-provisioning" },
383 { 0x03, "Switch-over to new variant" },
384 { 0x04, "Re-provisioning started" },
385 { 0x05, "Cannot re-provision" },
386 { 0x06, "Request variant and interface ID" },
387 { 0x07, "Variant and interface ID" },
388 { 0x08, "Blocking started" },
389 { 0x10, "Restart request" },
390 { 0x11, "Restart complete" },
391 { 0x12, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REQUEST" },
392 { 0x13, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS ACCEPTED" },
393 { 0x14, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REJECTED" },
394 { 0x15, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS COMPLETED" },
395 { 0x16, "UNBLOCK ALL RELEVANT PSTN PORTS REQUEST" },
396 { 0x17, "UNBLOCK ALL RELEVANT PSTN PORTS ACCEPTED" },
397 { 0x18, "UNBLOCK ALL RELEVANT PSTN PORTS REJECTED" },
398 { 0x19, "UNBLOCK ALL RELEVANT PSTN PORTS COMPLETED" },
399 { 0x1a, "UNBLOCK ALL RELEVANT ISDN PORTS REQUEST" },
400 { 0x1b, "UNBLOCK ALL RELEVANT ISDN PORTS ACCEPTED" },
401 { 0x1c, "UNBLOCK ALL RELEVANT ISDN PORTS REJECTED" },
402 { 0x1d, "UNBLOCK ALL RELEVANT ISDN PORTS COMPLETED" },
403 { 0x1e, "BLOCK ALL PSTN PORTS REQUEST" },
404 { 0x1f, "BLOCK ALL PSTN PORTS ACCEPTED" },
405 { 0x20, "BLOCK ALL PSTN PORTS REJECTED" },
406 { 0x21, "BLOCK ALL PSTN PORTS COMPLETED" },
407 { 0x22, "BLOCK ALL ISDN PORTS REQUEST" },
408 { 0x23, "BLOCK ALL ISDN PORTS ACCEPTED" },
409 { 0x24, "BLOCK ALL ISDN PORTS REJECTED" },
410 { 0x25, "BLOCK ALL ISDN PORTS COMPLETED" },
413 static const value_string control_function_id_values_short [] = {
414 { 0x00, "VerifyRe-pro" },
415 { 0x01, "ReadyForRe-pro" },
416 { 0x02, "NotReadyForRe-pro" },
417 { 0x03, "SO ToNewVar" },
418 { 0x04, "Re-pro Started" },
419 { 0x05, "CannotRe-pro" },
420 { 0x06, "ReqVar & intf ID" },
421 { 0x07, "Var & intf ID" },
422 { 0x08, "BlockStarted" },
423 { 0x10, "RestartReq" },
424 { 0x11, "RestartCompl" },
425 { 0x12, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REQUEST" },
426 { 0x13, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS ACCEPTED" },
427 { 0x14, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REJECTED" },
428 { 0x15, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS COMPLETED" },
429 { 0x16, "UNBLOCK ALL RELEVANT PSTN PORTS REQUEST" },
430 { 0x17, "UNBLOCK ALL RELEVANT PSTN PORTS ACCEPTED" },
431 { 0x18, "UNBLOCK ALL RELEVANT PSTN PORTS REJECTED" },
432 { 0x19, "UNBLOCK ALL RELEVANT PSTN PORTS COMPLETED" },
433 { 0x1a, "UNBLOCK ALL RELEVANT ISDN PORTS REQUEST" },
434 { 0x1b, "UNBLOCK ALL RELEVANT ISDN PORTS ACCEPTED" },
435 { 0x1c, "UNBLOCK ALL RELEVANT ISDN PORTS REJECTED" },
436 { 0x1d, "UNBLOCK ALL RELEVANT ISDN PORTS COMPLETED" },
437 { 0x1e, "BLOCK ALL PSTN PORTS REQUEST" },
438 { 0x1f, "BLOCK ALL PSTN PORTS ACCEPTED" },
439 { 0x20, "BLOCK ALL PSTN PORTS REJECTED" },
440 { 0x21, "BLOCK ALL PSTN PORTS COMPLETED" },
441 { 0x22, "BLOCK ALL ISDN PORTS REQUEST" },
442 { 0x23, "BLOCK ALL ISDN PORTS ACCEPTED" },
443 { 0x24, "BLOCK ALL ISDN PORTS REJECTED" },
444 { 0x25, "BLOCK ALL ISDN PORTS COMPLETED" },
447 static const value_string rejection_cause_values [] = {
448 { 0x00, "No standby C-channel available" },
449 { 0x01, "Target physical C-channel not operational" },
450 { 0x02, "Target physical C-channel not provisioned" },
451 { 0x03, "Protection switching impossible (AN/LE failure)" },
452 { 0x04, "Protection group mismatch" },
453 { 0x05, "Requested allocation exists already" },
454 { 0x06, "Target physical C-channel already has logical C-channel" },
457 static const value_string error_cause_values [] = {
458 { 0x01, "Protocol discriminator error" },
459 { 0x04, "Message type unrecognized" },
460 { 0x07, "Mandatory information element missing" },
461 { 0x08, "Unrecognized information element" },
462 { 0x09, "Mandatory information element content error" },
463 { 0x0b, "Message not compatible with protection protocol state" },
464 { 0x0c, "Repeated mandatory information element" },
465 { 0x0d, "Too many information elements" },
466 { 0x0f, "Logical C-Channel identification error" },
469 static const value_string performance_grading_values [] = {
470 { 0x00, "normal grade" },
471 { 0x01, "degraded" },
474 static const value_string cp_rejection_cause_values [] = {
475 { 0x00, "variant unknown" },
476 { 0x01, "variant known, not ready" },
477 { 0x02, "re-provisioning in progress (re-pro)" },
480 static const value_string reject_cause_type_values [] = {
481 { 0x00, "Unspecified" },
482 { 0x01, "Access network fault" },
483 { 0x02, "Access network blocked (internally)" },
484 { 0x03, "Connection already present at the PSTN user port to a different V5 time slot" },
485 { 0x04, "Connection already present at the V5 time slot(s) to a different port or ISDN user port time slot(s)" },
486 { 0x05, "Connection already present at the ISDN user port time slot(s) to a different V5 time slot(s)" },
487 { 0x06, "User port unavailable (blocked)" },
488 { 0x07, "De-allocation cannot completeddue to incompatible data content" },
489 { 0x08, "De-allocation cannot completeddue to V5 time slot(s) data incompatibility" },
490 { 0x09, "De-allocation cannot completeddue to port data incompatibility" },
491 { 0x0a, "De-allocation cannot completeddue to user port time slot(s) data incompatibility" },
492 { 0x0b, "User port not provisioned" },
493 { 0x0c, "Invalid V5 time slot(s) indication(s)" },
494 { 0x0d, "Invalid V5 2048 kbit/s link indication" },
495 { 0x0e, "Invalid user time slot(s) indication(s)" },
496 { 0x0f, "V5 time slot(s) being used as physikal C-channel(s)" },
497 { 0x10, "V5 link unavailable (blocked)" },
500 static const value_string bcc_protocol_error_cause_type_values [] = {
501 { 0x01, "Protocol discriminator error" },
502 { 0x04, "Message type unrecognized" },
503 { 0x05, "Out of sequence information element" },
504 { 0x06, "Repeated optional information element" },
505 { 0x07, "Mandatory information element missing" },
506 { 0x08, "Unrecognized information element" },
507 { 0x09, "Mandatory information element content error" },
508 { 0x0a, "Optional infromation element content error" },
509 { 0x0b, "Message not compatible with the BCC protocol state" },
510 { 0x0c, "Repeated mandatory information element" },
511 { 0x0d, "Too many information element" },
512 { 0x0f, "BCC Reference Number coding error" },
515 static const value_string connection_incomplete_reason_values [] = {
516 { 0x00, "Incomplete normal" },
517 { 0x01, "Access network fault" },
518 { 0x02, "User port not provisioned" },
519 { 0x03, "Invalid V5 time slot identification" },
520 { 0x04, "Invalid V5 2048 kbit/s link identification" },
521 { 0x05, "Time slot being used as physical C-channel" },
524 static const value_string link_control_function_values [] = {
525 { 0x00, "FE-IDReq" },
526 { 0x01, "FE-IDAck" },
527 { 0x02, "FE-IDRel" },
528 { 0x03, "FE-IDRej" },
529 { 0x04, "FE301/302 (link unblock)" },
530 { 0x05, "FE303/304 (link block)" },
531 { 0x06, "FE305 (deferred link block request" },
532 { 0x07, "FE306 (non-deferred link block request)" },
535 static const value_string cause_type_values [] = {
536 { 0x00, "Response to STATUS ENQUIRY" },
537 { 0x01, "Not used" },
538 { 0x03, "L3 address error" },
539 { 0x04, "Message type unrecognized" },
540 { 0x05, "Out of sequence information element" },
541 { 0x06, "Repeated optional information element" },
542 { 0x07, "Mandatory information element missing" },
543 { 0x08, "Unrecognized information element" },
544 { 0x09, "Mandatory information element content error" },
545 { 0x0a, "Optional information element content error" },
546 { 0x0b, "Message not compatible with path state" },
547 { 0x0c, "Repeated mandatory information element" },
548 { 0x0d, "Too many information elements" },
551 /* PSTN protocol message info elements */
552 #define PULSE_NOTIFICATION 0xc0
553 #define LINE_INFORMATION 0x80
555 #define AUTO_SIG_SEQUENCE 0xa0
556 #define SEQUENCE_RESPONSE 0xb0
557 #define PSTN_SEQUENCE_NUMBER 0x00
558 #define CADENCED_RINGING 0x01
559 #define PULSED_SIGNAL 0x02
560 #define STEADY_SIGNAL 0x03
561 #define DIGIT_SIGNAL 0x04
562 #define RECOGNITION_TIME 0x10
563 #define ENABLE_AUTO_ACK 0x11
564 #define DISABLE_AUTO_ACK 0x12
566 #define RESOURCE_UNAVAILABLE 0x14
567 #define ENABLE_METERING 0x22
568 #define METERING_REPORT 0x23
569 #define ATTENUATION 0x24
570 /* Control protocol message info elements */
571 #define PERFORMANCE_GRADING 0xe0
572 #define CP_REJECTION_CAUSE 0xf0
573 #define CONTROL_FUNCTION_ELEMENT 0x20
574 #define CONTROL_FUNCTION_ID 0x21
576 #define INTERFACE_ID 0x23
577 /* Link control protocol message info elements */
578 #define LINK_CONTROL_FUNCTION 0x30
579 /* BCC protocol message info elements */
580 #define USER_PORT_ID 0x40
581 #define ISDN_PORT_TS_ID 0x41
582 #define V5_TIME_SLOT_ID 0x42
583 #define MULTI_SLOT_MAP 0x43
584 #define BCC_REJECT_CAUSE 0x44
585 #define BCC_PROTOCOL_ERROR_CAUSE 0x45
586 #define CONNECTION_INCOMPLETE 0x46
587 /* Protection protocol message info elements */
588 #define SEQUENCE_NUMBER 0x50
589 #define C_CHANNEL_ID 0x51
590 #define PP_REJECTION_CAUSE 0x52
591 #define PROTOCOL_ERROR 0x53
593 static const value_string info_element_values [] = {
594 { PULSE_NOTIFICATION, "Pulse notification" },
595 { LINE_INFORMATION, "Line information" },
597 { AUTO_SIG_SEQUENCE, "Autonomous signal sequence" },
598 { SEQUENCE_RESPONSE, "Sequence response" },
599 { PSTN_SEQUENCE_NUMBER, "Sequence number" },
600 { CADENCED_RINGING, "Cadenced ringing" },
601 { PULSED_SIGNAL, "Pulsed signal" },
602 { STEADY_SIGNAL, "Steady signal" },
603 { DIGIT_SIGNAL, "Digit signal" },
604 { RECOGNITION_TIME, "Recognition time" },
605 { ENABLE_AUTO_ACK, "Enable autonomous acknowledge" },
606 { DISABLE_AUTO_ACK, "Disable autonomous acknowledge" },
608 { RESOURCE_UNAVAILABLE, "Resource unavailable" },
609 { ENABLE_METERING, "Enable metering" },
610 { METERING_REPORT, "Metering report" },
611 { ATTENUATION, "Attenuation" },
612 { PERFORMANCE_GRADING, "Performance grading" },
613 { CP_REJECTION_CAUSE, "Rejection cause" },
614 { CONTROL_FUNCTION_ELEMENT,"Control function element" },
615 { CONTROL_FUNCTION_ID, "Control function ID" },
616 { VARIANT, "Variant" },
617 { INTERFACE_ID, "Interface ID" },
618 { LINK_CONTROL_FUNCTION, "Link control funktion" },
619 { USER_PORT_ID, "User port ID" },
620 { ISDN_PORT_TS_ID, "ISDN port TS ID" },
621 { V5_TIME_SLOT_ID, "V5 TS ID" },
622 { MULTI_SLOT_MAP, "Multi-Slot map" },
623 { BCC_REJECT_CAUSE, "Reject cause" },
624 { BCC_PROTOCOL_ERROR_CAUSE,"Protocol error cause" },
625 { CONNECTION_INCOMPLETE, "Connection incomplete" },
626 { SEQUENCE_NUMBER, "Sequence number" },
627 { C_CHANNEL_ID, "Physical C-Channel ID" },
628 { PP_REJECTION_CAUSE, "Rejection cause" },
629 { PROTOCOL_ERROR, "Protocol error cause" },
632 static const value_string info_element_values_short [] = {
633 { PULSE_NOTIFICATION, "PN" },
634 { LINE_INFORMATION, "LI" },
636 { AUTO_SIG_SEQUENCE, "ASS" },
637 { SEQUENCE_RESPONSE, "SR" },
638 { PSTN_SEQUENCE_NUMBER, "SN" },
639 { CADENCED_RINGING, "CR" },
640 { PULSED_SIGNAL, "PS" },
641 { STEADY_SIGNAL, "SS" },
642 { DIGIT_SIGNAL, "DS" },
643 { RECOGNITION_TIME, "RT" },
644 { ENABLE_AUTO_ACK, "EAA" },
645 { DISABLE_AUTO_ACK, "DAA" },
647 { RESOURCE_UNAVAILABLE, "RU" },
648 { ENABLE_METERING, "EM" },
649 { METERING_REPORT, "MR" },
650 { ATTENUATION, "ATT" },
651 { PERFORMANCE_GRADING, "PG" },
652 { CP_REJECTION_CAUSE, "RC" },
653 { CONTROL_FUNCTION_ELEMENT,"CF element" },
654 { CONTROL_FUNCTION_ID, "CF ID" },
656 { INTERFACE_ID, "Interface ID" },
657 { LINK_CONTROL_FUNCTION, "LC F" },
658 { USER_PORT_ID, "UP ID" },
659 { ISDN_PORT_TS_ID, "ISDNP TS ID" },
660 { V5_TIME_SLOT_ID, "V5 TS ID" },
661 { MULTI_SLOT_MAP, "MS map" },
662 { BCC_REJECT_CAUSE, "RC" },
663 { BCC_PROTOCOL_ERROR_CAUSE,"PEC" },
664 { CONNECTION_INCOMPLETE, "CI" },
665 { SEQUENCE_NUMBER, "SN" },
666 { C_CHANNEL_ID, "Phy CChannel ID" },
667 { PP_REJECTION_CAUSE, "RC" },
668 { PROTOCOL_ERROR, "PEC" },
672 #define ADDRESS_OFFSET 1
673 #define ADDRESS_LENGTH 1
674 #define LOW_ADDRESS_OFFSET 2
675 #define LOW_ADDRESS_LENGTH 1
676 #define MSG_TYPE_OFFSET 3
677 #define MSG_TYPE_LENGTH 1
678 #define INFO_ELEMENT_OFFSET 4
679 #define INFO_ELEMENT_LENGTH 1
683 dissect_pstn_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
685 proto_tree *info_tree = NULL;
687 guint8 info_element_length = 1;
688 guint8 info_element = 0;
689 guint8 pstn_sequence_number_tmp = 0;
695 info_element = tvb_get_guint8(tvb, offset);
697 data_length = tvb_get_guint8(tvb, offset+1)+2;
698 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
701 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
702 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
705 if (info_tree != NULL) {
706 pstn_sequence_number_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
708 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
709 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
710 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
711 proto_tree_add_item(info_tree, hf_v52_pstn_sequence_number, info_tvb, info_offset+2, info_element_length, FALSE);
713 col_append_fstr(pinfo->cinfo, COL_INFO, " | SN: %u", pstn_sequence_number_tmp);
718 dissect_cadenced_ring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
720 proto_tree *info_tree = NULL;
722 guint8 info_element_length = 1;
723 guint8 info_element = 0;
724 guint8 cadenced_ring_tmp = 0;
729 info_element = tvb_get_guint8(tvb, offset);
731 data_length = tvb_get_guint8(tvb, offset+1)+2;
732 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
735 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
736 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
739 if (info_tree != NULL) {
740 cadenced_ring_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
741 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
742 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
743 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
744 proto_tree_add_item(info_tree, hf_v52_cadenced_ring, info_tvb, info_offset+2, info_element_length, FALSE);
746 col_append_str(pinfo->cinfo, COL_INFO, " | ");
747 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
749 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", cadenced_ring_tmp);
755 dissect_pulsed_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
757 proto_tree *info_tree = NULL;
759 guint8 info_element_length = 1;
760 guint8 info_element = 0;
766 info_element = tvb_get_guint8(tvb, offset);
768 data_length = tvb_get_guint8(tvb, offset+1)+2;
769 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
772 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
773 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
776 if (info_tree != NULL) {
777 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
778 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
779 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
780 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, FALSE);
782 if (data_length > 3) {
783 proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+3, 1, FALSE);
784 proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+3, 1, FALSE);
787 if (data_length > 4) {
788 proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+4, 1, FALSE);
789 proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+4, 1, FALSE);
792 col_append_str(pinfo->cinfo, COL_INFO, " | ");
793 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
795 col_append_str(pinfo->cinfo, COL_INFO, ": ");
796 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2), pulse_type_values, "Unknown element"));
802 dissect_steady_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
804 proto_tree *info_tree = NULL;
806 guint8 info_element_length = 1;
808 guint8 info_element = 0;
814 info_element = tvb_get_guint8(tvb, offset);
816 data_length = tvb_get_guint8(tvb, offset+1)+2;
817 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
820 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
821 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
824 if (info_tree != NULL) {
825 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
826 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
827 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
828 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, FALSE);
830 col_append_str(pinfo->cinfo, COL_INFO, " | ");
831 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
833 col_append_str(pinfo->cinfo, COL_INFO, ": ");
834 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, steady_signal_values, "Unknown element"));
839 dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
841 proto_tree *info_tree = NULL;
843 guint8 info_element_length = 1;
845 guint8 info_element = 0;
851 info_element = tvb_get_guint8(tvb, offset);
853 data_length = tvb_get_guint8(tvb, offset+1)+2;
854 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
857 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
858 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
861 if (info_tree != NULL) {
862 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
863 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
864 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
866 buffer = tvb_get_guint8(info_tvb, info_offset+2)>>6;
867 buffer = buffer&0x01;
869 proto_tree_add_uint_format(info_tree, hf_v52_digit_ack, info_tvb, info_offset+2, 1, buffer,
870 "Digit ack request indication: %s",val_to_str(buffer,digit_ack_values,"unknown"));
872 buffer = tvb_get_guint8(info_tvb, info_offset+2)>>4;
873 buffer = buffer&0x03;
875 proto_tree_add_item(info_tree, hf_v52_digit_spare, info_tvb, info_offset+2, info_element_length, FALSE);
876 proto_tree_add_item(info_tree, hf_v52_digit_info, info_tvb, info_offset+2, info_element_length, FALSE);
878 col_append_str(pinfo->cinfo, COL_INFO, " | ");
879 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
881 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", buffer);
888 dissect_recognition_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
890 proto_tree *info_tree = NULL;
892 guint8 info_element_length = 1;
894 guint8 info_element = 0;
900 info_element = tvb_get_guint8(tvb, offset);
902 data_length = tvb_get_guint8(tvb, offset+1)+2;
903 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
906 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
907 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
910 if (info_tree != NULL) {
911 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
912 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
913 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
915 buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f;
916 /*Signal = Coding of pulse type*/
918 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, FALSE);
919 /*Signal = Coding of steady signal type*/
920 else if(buffer<=0x1a)
921 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, FALSE);
923 proto_tree_add_item(info_tree, hf_v52_duration_type, info_tvb, info_offset+3, 1, FALSE);
925 col_append_str(pinfo->cinfo, COL_INFO, " | ");
926 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
931 dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
933 proto_tree *info_tree = NULL;
935 guint8 info_element_length = 1;
937 guint8 info_element = 0;
943 info_element = tvb_get_guint8(tvb, offset);
945 data_length = tvb_get_guint8(tvb, offset+1)+2;
946 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
949 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
950 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
953 if (info_tree != NULL) {
954 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
955 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
956 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
958 buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f;
961 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, FALSE);
962 else if(buffer<=0x1a)
963 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, FALSE);
965 buffer = tvb_get_guint8(info_tvb, info_offset+3)&0x7f;
968 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+3, 1, FALSE);
969 else if(buffer<=0x1a)
970 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+3,1,FALSE);
972 if(tvb_length_remaining(info_tvb, info_offset+4)){
973 proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+4,1,FALSE);
974 proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+4,1,FALSE);
976 if(tvb_length_remaining(info_tvb, info_offset+5)){
977 proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+5,1,FALSE);
978 proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+5,1,FALSE);
981 col_append_str(pinfo->cinfo, COL_INFO, " | ");
982 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
987 dissect_disable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
989 proto_tree *info_tree = NULL;
991 guint8 info_element_length = 1;
993 guint8 info_element = 0;
999 info_element = tvb_get_guint8(tvb, offset);
1001 data_length = tvb_get_guint8(tvb, offset+1)+2;
1002 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1005 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1006 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1009 if (info_tree != NULL) {
1010 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1011 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1012 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1014 buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f;
1017 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, FALSE);
1018 else if(buffer<=0x1a)
1019 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, FALSE);
1021 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1022 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1027 dissect_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1029 proto_tree *info_tree = NULL;
1030 proto_item *ti_info;
1031 guint8 info_element_length = 1;
1032 guint8 info_element = 0;
1034 guint16 data_length;
1036 int info_offset = 0;
1038 info_element = tvb_get_guint8(tvb, offset);
1040 data_length = tvb_get_guint8(tvb, offset+1)+2;
1041 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1044 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1045 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1048 if (info_tree != NULL) {
1049 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1050 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1051 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"), info_element);
1052 proto_tree_add_item(info_tree, hf_v52_cause_type, info_tvb, info_offset+2, 1, FALSE);
1054 if(tvb_length_remaining(info_tvb, info_offset+3))
1055 proto_tree_add_uint_format(info_tree, hf_v52_msg_type, info_tvb, info_offset+3, 1, tvb_get_guint8(info_tvb, info_offset+3),
1056 "Diagnostic: %s",val_to_str(tvb_get_guint8(info_tvb, info_offset+3), msg_type_values,"unknown"));
1058 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1059 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1061 col_append_str(pinfo->cinfo, COL_INFO, ": ");
1062 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, cause_type_values, "Unknown element"));
1067 dissect_resource_unavailable(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1069 proto_tree *info_tree = NULL;
1070 proto_item *ti_info;
1071 guint8 info_element_length = 1;
1072 guint8 info_element = 0;
1074 guint16 data_length;
1076 int info_offset = 0;
1078 info_element = tvb_get_guint8(tvb, offset);
1080 data_length = tvb_get_guint8(tvb, offset+1)+2;
1081 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1084 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1085 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1088 if (info_tree != NULL) {
1089 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1090 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1091 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1092 proto_tree_add_item(info_tree, hf_v52_res_unavailable, info_tvb, info_offset+2, info_element_length, FALSE);
1094 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1095 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1100 dissect_pulse_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1102 proto_tree *info_tree = NULL;
1103 proto_item *ti_info;
1104 guint8 info_element_length = 1;
1105 guint8 info_element = 0;
1107 guint16 data_length;
1109 int info_offset = 0;
1111 info_element = tvb_get_guint8(tvb, offset);
1114 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1117 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1118 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1121 if (info_tree != NULL) {
1122 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1123 proto_tree_add_item(info_tree, hf_v52_pulse_notification, info_tvb, info_offset, info_element_length, FALSE);
1125 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1126 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1131 dissect_line_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1133 proto_tree *info_tree = NULL;
1134 proto_item *ti_info;
1135 guint8 info_element_length = 1;
1136 guint8 info_element = 0;
1138 guint16 data_length;
1140 int info_offset = 0;
1142 info_element = tvb_get_guint8(tvb, offset);
1145 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1148 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1149 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1152 if (info_tree != NULL) {
1153 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1154 proto_tree_add_item(info_tree, hf_v52_line_info, info_tvb, info_offset, info_element_length, FALSE);
1156 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1157 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1162 dissect_state(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1164 proto_tree *info_tree = NULL;
1165 proto_item *ti_info;
1166 guint8 info_element_length = 1;
1167 guint8 info_element = 0;
1169 guint16 data_length;
1171 int info_offset = 0;
1173 info_element = tvb_get_guint8(tvb, offset);
1176 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1179 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1180 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1183 if (info_tree != NULL) {
1184 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1185 proto_tree_add_item(info_tree, hf_v52_state, info_tvb, info_offset, info_element_length, FALSE);
1187 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1188 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1193 dissect_auto_sig_sequence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1195 proto_tree *info_tree = NULL;
1196 proto_item *ti_info;
1197 guint8 info_element_length = 1;
1198 guint8 info_element = 0;
1200 guint16 data_length;
1202 int info_offset = 0;
1204 info_element = tvb_get_guint8(tvb, offset);
1207 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1210 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1211 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1214 if (info_tree != NULL) {
1215 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1216 proto_tree_add_item(info_tree, hf_v52_auto_signalling_sequence, info_tvb, info_offset, info_element_length, FALSE);
1218 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1219 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1224 dissect_sequence_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1226 proto_tree *info_tree = NULL;
1227 proto_item *ti_info;
1228 guint8 info_element_length = 1;
1229 guint8 info_element = 0;
1231 guint16 data_length;
1233 int info_offset = 0;
1235 info_element = tvb_get_guint8(tvb, offset);
1238 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1241 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1242 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1245 if (info_tree != NULL) {
1246 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1247 proto_tree_add_item(info_tree, hf_v52_sequence_response, info_tvb, info_offset, info_element_length, FALSE);
1249 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1250 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1255 dissect_control_function_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1257 proto_tree *info_tree = NULL;
1258 proto_item *ti_info;
1259 guint8 info_element_length = 1;
1260 guint8 info_element = 0;
1262 guint16 data_length;
1264 int info_offset = 0;
1266 info_element = tvb_get_guint8(tvb, offset);
1268 data_length = tvb_get_guint8(tvb, offset+1)+2;
1269 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1272 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1273 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1276 if (info_tree != NULL) {
1277 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1278 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1279 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1280 proto_tree_add_item(info_tree, hf_v52_control_function_element, info_tvb, info_offset+2, info_element_length, FALSE);
1282 if (message_type_tmp == 0x11) {}
1284 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1285 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, control_function_element_values, "Unknown element"));
1291 dissect_control_function_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1293 proto_tree *info_tree = NULL;
1294 proto_item *ti_info;
1295 guint8 info_element_length = 1;
1296 guint8 info_element = 0;
1298 guint16 data_length;
1300 int info_offset = 0;
1302 info_element = tvb_get_guint8(tvb, offset);
1304 data_length = tvb_get_guint8(tvb, offset+1)+2;
1305 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1308 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1309 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1312 if (info_tree != NULL) {
1313 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1314 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1315 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1316 proto_tree_add_item(info_tree, hf_v52_control_function_id, info_tvb, info_offset+2, info_element_length, FALSE);
1318 if (message_type_tmp == 0x13) {}
1320 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1321 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, control_function_id_values_short, "Unknown layer3 element"));
1327 dissect_variant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1329 proto_tree *info_tree = NULL;
1330 proto_item *ti_info;
1331 guint8 info_element_length = 1;
1332 guint8 info_element = 0;
1333 guint8 variantValue = 0;
1335 guint16 data_length;
1337 int info_offset = 0;
1339 info_element = tvb_get_guint8(tvb, offset);
1341 data_length = tvb_get_guint8(tvb, offset+1)+2;
1342 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1345 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1346 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1349 if (info_tree != NULL) {
1350 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1351 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1352 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1353 proto_tree_add_item(info_tree, hf_v52_variant, info_tvb, info_offset+2, info_element_length, FALSE);
1355 variantValue = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
1356 col_append_fstr(pinfo->cinfo, COL_INFO, " | Var: %u", variantValue);
1361 dissect_interface_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1363 proto_tree *info_tree = NULL;
1364 proto_item *ti_info;
1365 guint8 info_element_length = 1;
1366 guint8 info_element = 0;
1367 guint8 interfaceAllIdValue = 0;
1369 guint16 data_length;
1371 int info_offset = 0;
1373 info_element = tvb_get_guint8(tvb, offset);
1375 data_length = tvb_get_guint8(tvb, offset+1)+2;
1376 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1379 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1380 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1383 if (info_tree != NULL) {
1384 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1385 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1386 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1387 proto_tree_add_item(info_tree, hf_v52_if_up_id, info_tvb, info_offset+2, info_element_length, FALSE);
1388 proto_tree_add_item(info_tree, hf_v52_if_id, info_tvb, info_offset+3, info_element_length, FALSE);
1389 proto_tree_add_item(info_tree, hf_v52_if_low_id, info_tvb, info_offset+4, info_element_length, FALSE);
1390 proto_tree_add_item(info_tree, hf_v52_if_all_id, info_tvb, info_offset+2, info_element_length, FALSE);
1392 interfaceAllIdValue = (tvb_get_guint8(info_tvb, info_offset+2)<<16)+(tvb_get_guint8(info_tvb, info_offset+3)<<8)+(tvb_get_guint8(info_tvb, info_offset+4));
1394 col_append_fstr(pinfo->cinfo, COL_INFO, " | Intf. ID: %u", interfaceAllIdValue);
1399 dissect_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1401 proto_tree *info_tree = NULL;
1402 proto_item *ti_info;
1403 guint8 info_element_length = 1;
1404 guint8 info_element = 0;
1405 guint8 hf_v52_sequence_number_tmp = 0;
1406 guint16 data_length;
1408 int info_offset = 0;
1410 info_element = tvb_get_guint8(tvb, offset);
1412 data_length = tvb_get_guint8(tvb, offset+1)+2;
1413 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1416 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1417 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1420 if (info_tree != NULL) {
1421 hf_v52_sequence_number_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
1422 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1423 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1424 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1425 proto_tree_add_item(info_tree, hf_v52_sequence_number, info_tvb, info_offset+2, info_element_length, FALSE);
1427 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1428 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1430 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", hf_v52_sequence_number_tmp);
1437 dissect_physical_c_channel_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1439 proto_tree *info_tree = NULL;
1440 proto_item *ti_info;
1441 guint8 info_element_length = 1;
1442 guint8 info_element = 0;
1443 guint8 hf_v52_v5_link_id_cc_tmp = 0;
1444 guint8 hf_v52_v5_time_slot_cc_tmp = 0;
1446 guint16 data_length;
1448 int info_offset = 0;
1450 info_element = tvb_get_guint8(tvb, offset);
1452 data_length = tvb_get_guint8(tvb, offset+1)+2;
1453 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1456 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1457 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1460 if (info_tree != NULL) {
1461 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1462 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1463 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1464 proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, FALSE);
1465 proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, FALSE);
1467 hf_v52_v5_link_id_cc_tmp = tvb_get_guint8(info_tvb, info_offset+2);
1468 hf_v52_v5_time_slot_cc_tmp =tvb_get_guint8(info_tvb, info_offset+3);
1470 col_append_fstr(pinfo->cinfo, COL_INFO, " | Phy C-ch: %u, %u", hf_v52_v5_link_id_cc_tmp, hf_v52_v5_time_slot_cc_tmp);
1475 dissect_pp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1477 proto_tree *info_tree = NULL;
1478 proto_item *ti_info;
1479 guint8 info_element_length = 1;
1480 guint8 info_element = 0;
1482 guint16 data_length;
1484 int info_offset = 0;
1486 info_element = tvb_get_guint8(tvb, offset);
1488 data_length = tvb_get_guint8(tvb, offset+1)+2;
1489 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1492 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1493 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1496 if (info_tree != NULL) {
1497 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1498 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1499 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1500 proto_tree_add_item(info_tree, hf_v52_rejection_cause, info_tvb, info_offset+2, info_element_length, FALSE);
1502 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1503 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, rejection_cause_values, "Unknown element"));
1508 dissect_protocol_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1510 proto_tree *info_tree = NULL;
1511 proto_item *ti_info;
1512 guint8 info_element_length = 1;
1513 guint8 info_element = 0;
1515 guint16 data_length;
1517 int info_offset = 0;
1519 info_element = tvb_get_guint8(tvb, offset);
1521 data_length = tvb_get_guint8(tvb, offset+1)+2;
1522 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1525 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1526 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1529 if (info_tree != NULL) {
1530 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1531 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1532 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1533 proto_tree_add_item(info_tree, hf_v52_error_cause, info_tvb, info_offset+2, info_element_length, FALSE);
1534 proto_tree_add_item(info_tree, hf_v52_diagnostic_msg, info_tvb, info_offset+3, info_element_length, FALSE);
1535 proto_tree_add_item(info_tree, hf_v52_diagnostic_element, info_tvb, info_offset+4, info_element_length, FALSE);
1537 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1538 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, error_cause_values, "Unknown element"));
1544 dissect_performance_grading(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1546 proto_tree *info_tree = NULL;
1547 proto_item *ti_info;
1548 guint8 info_element_length = 1;
1549 guint8 info_element = 0;
1551 guint16 data_length;
1553 int info_offset = 0;
1555 info_element = tvb_get_guint8(tvb, offset);
1558 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1561 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1562 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1565 if (info_tree != NULL) {
1566 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1567 proto_tree_add_item(info_tree, hf_v52_performance_grading, info_tvb, info_offset, info_element_length, FALSE);
1569 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1570 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset)-0xe0, performance_grading_values, "Unknown element"));
1576 dissect_cp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1578 proto_tree *info_tree = NULL;
1579 proto_item *ti_info;
1580 guint8 info_element_length = 1;
1581 guint8 info_element = 0;
1583 guint16 data_length;
1585 int info_offset = 0;
1587 info_element = tvb_get_guint8(tvb, offset);
1590 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1593 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1594 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1597 if (info_tree != NULL) {
1598 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1599 proto_tree_add_item(info_tree, hf_v52_cp_rejection_cause, info_tvb, info_offset, info_element_length, FALSE);
1601 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1602 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset)-0xe0, cp_rejection_cause_values, "Unknown element"));
1607 dissect_user_port_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1609 proto_tree *info_tree = NULL;
1610 proto_item *ti_info;
1611 int hf_v52_pstn_user_port_tmp = 0;
1612 int hf_v52_isdn_user_port_tmp = 0;
1613 guint8 info_element_length = 1;
1615 guint8 info_element = 0;
1617 guint16 data_length;
1619 int info_offset = 0;
1621 info_element = tvb_get_guint8(tvb, offset);
1623 data_length = tvb_get_guint8(tvb, offset+1)+2;
1624 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1627 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1628 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1631 if (info_tree != NULL) {
1632 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1633 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1634 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1636 buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x01;
1639 proto_tree_add_item(info_tree, hf_v52_pstn_user_port_id, info_tvb, info_offset+2, 1, FALSE);
1640 proto_tree_add_item(info_tree, hf_v52_pstn_user_port_id_lower, info_tvb, info_offset+3, 1, FALSE);
1642 hf_v52_pstn_user_port_tmp = (((tvb_get_guint8(info_tvb, info_offset+2)>>1)<<8)+(tvb_get_guint8(info_tvb, info_offset+3)));
1644 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN port: %u", hf_v52_pstn_user_port_tmp);
1646 else if(buffer == 0x00){
1647 proto_tree_add_item(info_tree, hf_v52_isdn_user_port_id, info_tvb, info_offset+2, 1, FALSE);
1648 proto_tree_add_item(info_tree, hf_v52_isdn_user_port_id_lower, info_tvb, info_offset+3, 1, FALSE);
1650 hf_v52_isdn_user_port_tmp = (((tvb_get_guint8(info_tvb, info_offset+2)>>2)<<7)+((tvb_get_guint8( info_tvb, info_offset+3)>>1)));
1652 col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", hf_v52_isdn_user_port_tmp);
1658 dissect_isdn_port_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1660 proto_tree *info_tree = NULL;
1661 proto_item *ti_info;
1662 guint8 info_element_length = 1;
1663 guint8 info_element = 0;
1664 guint8 isdn_user_port_ts_num_tmp = 0;
1666 guint16 data_length;
1668 int info_offset = 0;
1670 info_element = tvb_get_guint8(tvb, offset);
1672 data_length = tvb_get_guint8(tvb, offset+1)+2;
1673 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1676 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1677 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1680 if (info_tree != NULL) {
1681 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1682 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1683 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1684 proto_tree_add_item(info_tree, hf_v52_isdn_user_port_ts_num, info_tvb, info_offset+2, info_element_length, FALSE);
1686 isdn_user_port_ts_num_tmp = (tvb_get_guint8(info_tvb, info_offset+2)) - 128;
1687 col_append_str(pinfo->cinfo, COL_INFO, ", ");
1688 col_append_fstr(pinfo->cinfo, COL_INFO, "%x", isdn_user_port_ts_num_tmp);
1693 dissect_v5_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1695 proto_tree *info_tree = NULL;
1696 proto_item *ti_info;
1697 guint8 info_element_length = 1;
1698 guint8 info_element = 0;
1699 guint8 v5_link_id_tmp = 0;
1700 guint8 v5_time_slot_tmp = 0;
1702 guint16 data_length;
1704 int info_offset = 0;
1706 info_element = tvb_get_guint8(tvb, offset);
1708 data_length = tvb_get_guint8(tvb, offset+1)+2;
1709 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1712 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1713 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1716 if (info_tree != NULL) {
1717 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1718 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1719 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1720 proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, FALSE);
1721 proto_tree_add_item(info_tree, hf_v52_override, info_tvb, info_offset+3, info_element_length, FALSE);
1722 proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, FALSE);
1724 v5_link_id_tmp = tvb_get_guint8(info_tvb, info_offset+2);
1725 v5_time_slot_tmp = tvb_get_guint8(info_tvb, info_offset+3);
1727 if (v5_time_slot_tmp >= 64) {
1728 v5_time_slot_tmp = v5_time_slot_tmp - 64;
1731 if (v5_time_slot_tmp >= 32) {
1732 v5_time_slot_tmp = v5_time_slot_tmp - 32;
1735 col_append_fstr(pinfo->cinfo, COL_INFO, " | V5 Link: %u, %u ", v5_link_id_tmp, v5_time_slot_tmp);
1740 dissect_multi_slot_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1742 proto_tree *info_tree = NULL;
1743 proto_item *ti_info;
1744 guint8 info_element_length = 1;
1745 guint8 info_element = 0;
1747 guint16 data_length;
1749 int info_offset = 0;
1751 info_element = tvb_get_guint8(tvb, offset);
1753 data_length = tvb_get_guint8(tvb, offset+1)+2;
1754 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1757 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1758 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1761 if (info_tree != NULL) {
1762 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1763 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1764 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1765 proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, FALSE);
1767 col_append_fstr(pinfo->cinfo, COL_INFO, " | V5MSlink ID:%u",tvb_get_guint8(info_tvb, info_offset+2));
1769 if(tvb_length_remaining(info_tvb, info_offset+3))
1770 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+3, info_element_length, FALSE);
1771 if(tvb_length_remaining(info_tvb, info_offset+4))
1772 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+4, info_element_length, FALSE);
1773 if(tvb_length_remaining(info_tvb, info_offset+5))
1774 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+5, info_element_length, FALSE);
1775 if(tvb_length_remaining(info_tvb, info_offset+6))
1776 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+6, info_element_length, FALSE);
1777 if(tvb_length_remaining(info_tvb, info_offset+7))
1778 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+7, info_element_length, FALSE);
1779 if(tvb_length_remaining(info_tvb, info_offset+8))
1780 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+8, info_element_length, FALSE);
1781 if(tvb_length_remaining(info_tvb, info_offset+9))
1782 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+9, info_element_length, FALSE);
1783 if(tvb_length_remaining(info_tvb, info_offset+10))
1784 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+10, info_element_length, FALSE);
1789 dissect_bcc_rejct_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1791 proto_tree *info_tree = NULL;
1792 proto_item *ti_info;
1793 guint8 info_element_length = 1;
1794 guint8 info_element = 0;
1796 guint16 data_length;
1798 int info_offset = 0;
1800 info_element = tvb_get_guint8(tvb, offset);
1802 data_length = tvb_get_guint8(tvb, offset+1)+2;
1803 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1806 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1807 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1810 if (info_tree != NULL) {
1811 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1812 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1813 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1814 proto_tree_add_item(info_tree, hf_v52_reject_cause_type, info_tvb, info_offset+2, info_element_length, FALSE);
1816 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1817 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, reject_cause_type_values, "Unknown element"));
1822 dissect_bcc_protocol_error_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1824 proto_tree *info_tree = NULL;
1825 proto_item *ti_info;
1826 guint8 info_element_length = 1;
1827 guint8 info_element = 0;
1829 guint16 data_length;
1831 int info_offset = 0;
1833 info_element = tvb_get_guint8(tvb, offset);
1835 data_length = tvb_get_guint8(tvb, offset+1)+2;
1836 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1839 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1840 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1843 if (info_tree != NULL) {
1844 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1845 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1846 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1847 proto_tree_add_item(info_tree, hf_v52_bcc_protocol_error_cause, info_tvb, info_offset+2, info_element_length, FALSE);
1849 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1850 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, bcc_protocol_error_cause_type_values, "Unknown element"));
1852 if(tvb_length_remaining(info_tvb, info_offset+3))
1853 proto_tree_add_item(info_tree, hf_v52_diagnostic_message, info_tvb, info_offset+3, info_element_length, FALSE);
1854 if(tvb_length_remaining(info_tvb, info_offset+4))
1855 proto_tree_add_item(info_tree, hf_v52_diagnostic_information, info_tvb, info_offset+4, info_element_length, FALSE);
1860 dissect_connection_incomplete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1862 proto_tree *info_tree = NULL;
1863 proto_item *ti_info;
1864 guint8 info_element_length = 1;
1865 guint8 info_element = 0;
1867 guint16 data_length;
1869 int info_offset = 0;
1871 info_element = tvb_get_guint8(tvb, offset);
1873 data_length = tvb_get_guint8(tvb, offset+1)+2;
1874 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1877 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1878 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1881 if (info_tree != NULL) {
1882 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1883 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1884 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1885 proto_tree_add_item(info_tree, hf_v52_connection_incomplete_reason, info_tvb, info_offset+2, info_element_length, FALSE);
1888 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1889 if ((tvb_get_guint8(info_tvb, info_offset+2) < 0x80)) {
1890 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2), connection_incomplete_reason_values, "Unknown element"));
1893 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, connection_incomplete_reason_values, "Unknown element"));
1900 dissect_link_control_function(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1902 proto_tree *info_tree = NULL;
1903 proto_item *ti_info;
1904 guint8 info_element_length = 1;
1905 guint8 info_element = 0;
1907 guint16 data_length;
1909 int info_offset = 0;
1911 info_element = tvb_get_guint8(tvb, offset);
1913 data_length = tvb_get_guint8(tvb, offset+1)+2;
1914 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1917 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1918 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1921 if (info_tree != NULL) {
1922 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, FALSE);
1923 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, FALSE);
1924 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
1925 proto_tree_add_item(info_tree, hf_v52_link_control_function, info_tvb, info_offset+2, info_element_length, FALSE);
1927 if (message_type_tmp == 0x31) {}
1929 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1930 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, link_control_function_values, "Unknown element"));
1938 dissect_v52_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1941 guint8 info_element, info_element_length;
1945 while(tvb_length_remaining(tvb,offset)){
1947 old_offset = offset;
1948 info_element = tvb_get_guint8(tvb, offset);
1949 switch(info_element){
1950 case PSTN_SEQUENCE_NUMBER:
1951 info_element_length = tvb_get_guint8(tvb,offset+1);
1952 dissect_pstn_sequence_number(tvb, pinfo, tree, offset);
1953 offset +=info_element_length+2;
1955 case CADENCED_RINGING:
1956 info_element_length = tvb_get_guint8(tvb,offset+1);
1957 dissect_cadenced_ring(tvb, pinfo, tree, offset);
1958 offset +=info_element_length+2;
1961 info_element_length = tvb_get_guint8(tvb,offset+1);
1962 dissect_pulsed_signal(tvb, pinfo, tree, offset);
1963 offset +=info_element_length+2;
1966 info_element_length = tvb_get_guint8(tvb,offset+1);
1967 dissect_steady_signal(tvb, pinfo, tree, offset);
1968 offset +=info_element_length+2;
1971 info_element_length = tvb_get_guint8(tvb,offset+1);
1972 dissect_digit_signal(tvb, pinfo, tree, offset);
1973 offset +=info_element_length+2;
1975 case RECOGNITION_TIME:
1976 info_element_length = tvb_get_guint8(tvb,offset+1);
1977 dissect_recognition_time(tvb, pinfo, tree, offset);
1978 offset +=info_element_length+2;
1980 case ENABLE_AUTO_ACK:
1981 info_element_length = tvb_get_guint8(tvb,offset+1);
1982 dissect_enable_auto_ack(tvb, pinfo, tree, offset);
1983 offset +=info_element_length+2;
1985 case DISABLE_AUTO_ACK:
1986 info_element_length = tvb_get_guint8(tvb,offset+1);
1987 dissect_disable_auto_ack(tvb, pinfo, tree, offset);
1988 offset +=info_element_length+2;
1991 info_element_length = tvb_get_guint8(tvb,offset+1);
1992 dissect_cause(tvb, pinfo, tree, offset);
1993 offset +=info_element_length+2;
1995 case RESOURCE_UNAVAILABLE:
1996 info_element_length = tvb_get_guint8(tvb,offset+1);
1997 dissect_resource_unavailable(tvb, pinfo, tree, offset);
1998 offset +=info_element_length+2;
2000 case PULSE_NOTIFICATION:
2001 dissect_pulse_notification(tvb, pinfo, tree, offset);
2004 case LINE_INFORMATION:
2005 dissect_line_information(tvb, pinfo, tree, offset);
2009 dissect_state(tvb, pinfo, tree, offset);
2012 case AUTO_SIG_SEQUENCE:
2013 dissect_auto_sig_sequence(tvb, pinfo, tree, offset);
2016 case SEQUENCE_RESPONSE:
2017 dissect_sequence_response(tvb, pinfo, tree, offset);
2021 case CONTROL_FUNCTION_ELEMENT:
2022 info_element_length = tvb_get_guint8(tvb,offset+1);
2023 dissect_control_function_element(tvb, pinfo, tree, offset);
2024 offset +=info_element_length+2;
2026 case CONTROL_FUNCTION_ID:
2027 info_element_length = tvb_get_guint8(tvb,offset+1);
2028 dissect_control_function_id(tvb, pinfo, tree, offset);
2029 offset +=info_element_length+2;
2032 info_element_length = tvb_get_guint8(tvb,offset+1);
2033 dissect_variant(tvb, pinfo, tree, offset);
2034 offset +=info_element_length+2;
2037 info_element_length = tvb_get_guint8(tvb,offset+1);
2038 dissect_interface_id(tvb, pinfo, tree, offset);
2039 offset +=info_element_length+2;
2041 case SEQUENCE_NUMBER:
2042 info_element_length = tvb_get_guint8(tvb,offset+1);
2043 dissect_sequence_number(tvb, pinfo, tree, offset);
2044 offset +=info_element_length+2;
2047 info_element_length = tvb_get_guint8(tvb,offset+1);
2048 dissect_physical_c_channel_id(tvb, pinfo, tree, offset);
2049 offset +=info_element_length+2;
2051 case PP_REJECTION_CAUSE:
2052 info_element_length = tvb_get_guint8(tvb,offset+1);
2053 dissect_pp_rejection_cause(tvb, pinfo, tree, offset);
2054 offset +=info_element_length+2;
2056 case PROTOCOL_ERROR:
2057 info_element_length = tvb_get_guint8(tvb,offset+1);
2058 dissect_protocol_error(tvb, pinfo, tree, offset);
2059 offset +=info_element_length+2;
2061 case PERFORMANCE_GRADING:
2062 dissect_performance_grading(tvb, pinfo, tree, offset);
2065 case CP_REJECTION_CAUSE:
2066 dissect_cp_rejection_cause(tvb, pinfo, tree, offset);
2070 info_element_length = tvb_get_guint8(tvb,offset+1);
2071 dissect_user_port_identification(tvb, pinfo, tree, offset);
2072 offset +=info_element_length+2;
2074 case ISDN_PORT_TS_ID:
2075 info_element_length = tvb_get_guint8(tvb,offset+1);
2076 dissect_isdn_port_time_slot_identification(tvb, pinfo, tree, offset);
2077 offset +=info_element_length+2;
2079 case V5_TIME_SLOT_ID:
2080 info_element_length = tvb_get_guint8(tvb,offset+1);
2081 dissect_v5_time_slot_identification(tvb, pinfo, tree, offset);
2082 offset +=info_element_length+2;
2084 case MULTI_SLOT_MAP:
2085 info_element_length = tvb_get_guint8(tvb,offset+1);
2086 dissect_multi_slot_map(tvb, pinfo, tree, offset);
2087 offset +=info_element_length+2;
2089 case BCC_REJECT_CAUSE:
2090 info_element_length = tvb_get_guint8(tvb,offset+1);
2091 dissect_bcc_rejct_cause(tvb, pinfo, tree, offset);
2092 offset +=info_element_length+2;
2094 case BCC_PROTOCOL_ERROR_CAUSE:
2095 info_element_length = tvb_get_guint8(tvb,offset+1);
2096 dissect_bcc_protocol_error_cause(tvb, pinfo, tree, offset);
2097 offset +=info_element_length+2;
2099 case CONNECTION_INCOMPLETE:
2100 info_element_length = tvb_get_guint8(tvb,offset+1);
2101 dissect_connection_incomplete(tvb, pinfo, tree, offset);
2102 offset +=info_element_length+2;
2104 case LINK_CONTROL_FUNCTION:
2105 info_element_length = tvb_get_guint8(tvb,offset+1);
2106 dissect_link_control_function(tvb, pinfo, tree, offset);
2107 offset +=info_element_length+2;
2113 if (singleoctet == 1) {
2117 if (old_offset <= offset) {
2118 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_WARN, "Zero-length information element");
2127 dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2130 proto_tree *v52_tree = NULL;
2132 gboolean addr = FALSE;
2133 guint8 bcc_all_address_tmp_up = -1;
2134 guint16 pstn_all_address_tmp, isdn_all_address_tmp, bcc_all_address_tmp, prot_all_address_tmp, link_all_address_tmp;
2136 col_set_str(pinfo->cinfo, COL_PROTOCOL, "V52");
2139 ti = proto_tree_add_item(tree, proto_v52, tvb, offset, -1, FALSE);
2140 v52_tree = proto_item_add_subtree(ti, ett_v52);
2142 dissect_v52_protocol_discriminator(tvb, offset, v52_tree);
2146 if (v52_tree != NULL) {
2149 message_type_tmp = tvb_get_guint8(tvb, MSG_TYPE_OFFSET);
2151 if ((message_type_tmp >= 0x00) && (message_type_tmp <= 0x0e)) {
2153 proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, FALSE);
2154 proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, FALSE);
2156 pstn_all_address_tmp = (((tvb_get_guint8(tvb,ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb,LOW_ADDRESS_OFFSET)));
2159 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp);
2162 if ((message_type_tmp >= 0x10) && (message_type_tmp <= 0x13)) {
2164 if ((tvb_get_guint8(tvb, ADDRESS_OFFSET)&0x01) == 0x1) {
2165 pstn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)));
2166 proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, FALSE);
2167 proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, FALSE);
2169 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp);
2172 isdn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>2)<<7)+((tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)>>1)));
2173 proto_tree_add_item(v52_tree, hf_v52_isdn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, FALSE);
2174 proto_tree_add_item(v52_tree, hf_v52_isdn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, FALSE);
2176 col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", isdn_all_address_tmp);
2180 if ((message_type_tmp == 0x30) || (message_type_tmp == 0x31)) {
2182 link_all_address_tmp = tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET);
2183 proto_tree_add_item(v52_tree, hf_v52_link_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, FALSE);
2184 proto_tree_add_item(v52_tree, hf_v52_link_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, FALSE);
2186 col_append_fstr(pinfo->cinfo, COL_INFO, " | LinkId: %u", link_all_address_tmp);
2189 if ((message_type_tmp >= 0x20) && (message_type_tmp <= 0x2a)) {
2191 proto_tree_add_item(v52_tree, hf_v52_bcc_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, FALSE);
2192 proto_tree_add_item(v52_tree, hf_v52_bcc_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, FALSE);
2194 bcc_all_address_tmp_up = tvb_get_guint8(tvb, ADDRESS_OFFSET);
2195 if (bcc_all_address_tmp_up >= 128) {
2196 bcc_all_address_tmp_up = bcc_all_address_tmp_up - 128;
2198 bcc_all_address_tmp = (bcc_all_address_tmp_up<<6) + tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET);
2200 col_append_fstr(pinfo->cinfo, COL_INFO, " | ref: %u", bcc_all_address_tmp);
2203 if ((message_type_tmp >= 0x18) && (message_type_tmp <= 0x1f)) {
2205 prot_all_address_tmp = (tvb_get_guint8(tvb, ADDRESS_OFFSET)<<8) + (tvb_get_guint8(tvb,LOW_ADDRESS_OFFSET));
2206 proto_tree_add_item(v52_tree, hf_v52_prot_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, FALSE);
2207 proto_tree_add_item(v52_tree, hf_v52_prot_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, FALSE);
2209 if ((message_type_tmp == 0x1e) || (message_type_tmp == 0x1f)) {}
2211 col_append_fstr(pinfo->cinfo, COL_INFO, " | Log C-ch: %u", prot_all_address_tmp);
2215 if (addr == FALSE) {
2216 if ((tvb_get_guint8(tvb, ADDRESS_OFFSET)&0x01) == 0x1) {
2217 pstn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)));
2218 proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, FALSE);
2219 proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, FALSE);
2221 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp);
2225 isdn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>2)<<7)+((tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)>>1)));
2226 proto_tree_add_item(v52_tree, hf_v52_isdn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, FALSE);
2227 proto_tree_add_item(v52_tree, hf_v52_isdn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, FALSE);
2229 col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", isdn_all_address_tmp);
2234 proto_tree_add_item(v52_tree, hf_v52_msg_type, tvb, MSG_TYPE_OFFSET, MSG_TYPE_LENGTH, FALSE);
2237 col_append_str(pinfo->cinfo, COL_INFO, " | ");
2238 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(tvb, MSG_TYPE_OFFSET), msg_type_values_short, "Unknown msg type"));
2240 dissect_v52_info(tvb, pinfo, v52_tree);
2245 dissect_v52(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2247 dissect_v52_message(tvb, pinfo, tree);
2251 proto_register_v52(void)
2253 static hf_register_info hf[] = {
2254 { &hf_v52_discriminator,
2255 { "Protocol discriminator", "v52.disc", FT_UINT8, BASE_HEX, NULL, 0x0,
2258 { "Address", "v52.address",
2259 FT_UINT8, BASE_HEX, NULL, 0xff,
2261 { &hf_v52_low_address,
2262 { "Address Low", "v52.low_address",
2263 FT_UINT8, BASE_HEX, NULL, 0xff,
2266 { &hf_v52_isdn_address,
2267 { "Address isdn", "v52.isdn_address",
2268 FT_UINT8, BASE_HEX, NULL, 0xfc,
2270 { &hf_v52_isdn_low_address,
2271 { "Address isdn Low", "v52.isdn_low_address",
2272 FT_UINT8, BASE_HEX, NULL, 0xfe,
2275 { &hf_v52_pstn_address,
2276 { "Address pstn", "v52.pstn_address",
2277 FT_UINT8, BASE_HEX, NULL, 0xfe,
2279 { &hf_v52_pstn_low_address,
2280 { "Address pstn Low", "v52.pstn_low_address",
2281 FT_UINT8, BASE_HEX, NULL, 0xff,
2284 { &hf_v52_link_address,
2285 { "Address link", "v52.link_address",
2286 FT_UINT8, BASE_HEX, NULL, 0xff,
2288 { &hf_v52_link_low_address,
2289 { "Address link Low", "v52.link_low_address",
2290 FT_UINT8, BASE_HEX, NULL, 0xff,
2293 { &hf_v52_bcc_address,
2294 { "Address bcc", "v52.bcc_address",
2295 FT_UINT8, BASE_HEX, NULL, 0x7f,
2297 { &hf_v52_bcc_low_address,
2298 { "Address bcc Low", "v52.bcc_low_address",
2299 FT_UINT8, BASE_HEX, NULL, 0x3f,
2302 { &hf_v52_prot_address,
2303 { "Address prot", "v52.prot_address",
2304 FT_UINT8, BASE_HEX, NULL, 0xff,
2306 { &hf_v52_prot_low_address,
2307 { "Address prot Low", "v52.prot_low_address",
2308 FT_UINT8, BASE_HEX, NULL, 0xff,
2311 { &hf_v52_ctrl_address,
2312 { "Address ctrl", "v52.ctrl_address",
2313 FT_UINT8, BASE_HEX, NULL, 0xff,
2315 { &hf_v52_ctrl_low_address,
2316 { "Address ctrl Low", "v52.ctrl_low_address",
2317 FT_UINT8, BASE_HEX, NULL, 0xff,
2321 { "Message type", "v52.msg_type",
2322 FT_UINT8, BASE_HEX, VALS(msg_type_values), 0x0,
2324 {&hf_v52_info_element,
2325 { "Information element", "v52.info_element",
2326 FT_UINT8, BASE_HEX, VALS(info_element_values), 0x0,
2328 {&hf_v52_info_length,
2329 { "Information length", "v52.info_length",
2330 FT_UINT8, BASE_DEC, NULL, 0x0,
2332 {&hf_v52_pulse_notification,
2333 { "Pulse notification", "v52.pulse_notification",
2334 FT_UINT8, BASE_HEX, NULL, 0x0,
2336 {&hf_v52_pstn_sequence_number,
2337 { "Sequence number", "v52.pstn_sequence_number",
2338 FT_UINT8, BASE_HEX, NULL, 0x7f,
2340 {&hf_v52_cadenced_ring,
2341 { "Cadenced ring", "v52.cadenced_ring",
2342 FT_UINT8, BASE_HEX, NULL, 0x7f,
2344 {&hf_v52_pulse_type,
2345 { "Pulse Type", "v52.pulse_type",
2346 FT_UINT8, BASE_HEX, VALS(pulse_type_values), 0x0,
2348 {&hf_v52_suppression_indicator,
2349 { "Suppression indicator", "v52.suppression_indicator",
2350 FT_UINT8, BASE_HEX, VALS(suppression_indication_values), 0x60,
2352 {&hf_v52_pulse_duration,
2353 { "Pulse duration type", "v52.pulse_duration",
2354 FT_UINT8, BASE_HEX, NULL, 0x1f,
2356 {&hf_v52_ack_request_indicator,
2357 { "Ack request indicator", "v52.ack_request_indicator",
2358 FT_UINT8, BASE_HEX, VALS(ack_request_indication_values), 0x60,
2360 {&hf_v52_number_of_pulses,
2361 { "Number of pulses", "v52.number_of_pulses",
2362 FT_UINT8, BASE_DEC, NULL, 0x1f,
2364 {&hf_v52_steady_signal,
2365 { "Steady Signal", "v52.steady_signal",
2366 FT_UINT8, BASE_HEX, VALS(steady_signal_values), 0x7f,
2369 { "Digit ack request indication","v2.digit_ack",
2370 FT_UINT8, BASE_HEX, VALS(digit_ack_values), 0x40,
2372 {&hf_v52_digit_spare,
2373 { "Digit spare","v52.digit_spare",
2374 FT_UINT8, BASE_HEX, NULL, 0x30,
2376 {&hf_v52_digit_info,
2377 { "Digit information", "v52.digit_info",
2378 FT_UINT8, BASE_HEX, NULL, 0x0f,
2380 {&hf_v52_duration_type,
2381 { "Duration Type", "v52.duration_type",
2382 FT_UINT8, BASE_HEX, NULL, 0x3f,
2384 {&hf_v52_res_unavailable,
2385 { "Resource unavailable", "v52.res_unavailable",
2386 FT_STRING, BASE_NONE,NULL, 0x0,
2389 { "Line_Information", "v52.line_info",
2390 FT_UINT8, BASE_HEX, VALS(line_info_values), 0x0f,
2393 { "PSTN FSM state", "v52.state",
2394 FT_UINT8, BASE_HEX, VALS(state_values), 0x0f,
2396 {&hf_v52_auto_signalling_sequence,
2397 { "Autonomous signalling sequence","v52.auto_signalling_sequence",
2398 FT_UINT8, BASE_HEX, NULL, 0x0f,
2400 {&hf_v52_sequence_response,
2401 { "Sequence response", "v52.sequence_response",
2402 FT_UINT8, BASE_HEX, NULL, 0x0f,
2404 {&hf_v52_control_function_element,
2405 { "Control function element", "v52.control_function_element",
2406 FT_UINT8, BASE_HEX, VALS(control_function_element_values), 0x7f,
2408 {&hf_v52_control_function_id,
2409 { "Control function ID", "v52.control_function",
2410 FT_UINT8, BASE_HEX, VALS(control_function_id_values), 0x7f,
2413 { "Variant", "v52.variant",
2414 FT_UINT8, BASE_DEC, NULL, 0x7f,
2417 { "Interface up ID", "v52.interface_up_id",
2418 FT_UINT8, BASE_HEX, NULL, 0xff,
2421 { "Interface ID", "v52.interface_id",
2422 FT_UINT8, BASE_HEX, NULL, 0xff,
2425 { "Interface down ID", "v52.interface_low_id",
2426 FT_UINT8, BASE_HEX, NULL, 0xff,
2429 { "Interface all ID", "v52.interface_all_id",
2430 FT_UINT24, BASE_DEC, NULL, 0xffffff,
2432 {&hf_v52_sequence_number,
2433 { "Sequence number", "v52.sequence_number",
2434 FT_UINT8, BASE_HEX, NULL, 0x7f,
2436 {&hf_v52_v5_link_id,
2437 { "V5 2048 kbit/s Link Identifier", "v52.V5_ln_id",
2438 FT_UINT8, BASE_HEX, NULL, 0x0,
2440 {&hf_v52_v5_multi_slot_elements,
2441 { "Additional MS ID", "v52.add_ms_id",
2442 FT_UINT8, BASE_HEX, NULL, 0xff,
2444 {&hf_v52_v5_time_slot,
2445 { "V5 Time Slot Number", "v52.v5_time_slot",
2446 FT_UINT8, BASE_DEC, NULL, 0x1f,
2448 {&hf_v52_rejection_cause,
2449 { "Rejection cause", "v52.rejection_cause",
2450 FT_UINT8, BASE_HEX, VALS(rejection_cause_values), 0x7f,
2452 {&hf_v52_error_cause,
2453 { "Protocol Error Cause type", "v52.error_cause",
2454 FT_UINT8, BASE_HEX, VALS(error_cause_values), 0x7f,
2456 {&hf_v52_diagnostic_msg,
2457 { "Diagnostic message", "v52.diagnostic_message",
2458 FT_UINT8, BASE_HEX, NULL, 0x7f,
2460 {&hf_v52_diagnostic_element,
2461 { "Diagnostic element", "v52.diagnostic_element",
2462 FT_UINT8, BASE_HEX, NULL, 0x0,
2464 {&hf_v52_performance_grading,
2465 { "Performance grading", "v52.performance_grading",
2466 FT_UINT8, BASE_HEX, VALS(performance_grading_values), 0x0f,
2468 {&hf_v52_cp_rejection_cause,
2469 { "Rejection cp cause", "v52.cp_rejection_cause",
2470 FT_UINT8, BASE_HEX, VALS(cp_rejection_cause_values), 0x0f,
2472 {&hf_v52_pstn_user_port_id,
2473 { "PSTN User Port identification Value","v52.pstn_user_port_id",
2474 FT_UINT8, BASE_HEX, NULL, 0xfe,
2476 {&hf_v52_pstn_user_port_id_lower,
2477 { "PSTN User Port Identification Value (lower)","v52.pstn_user_port_id_lower",
2478 FT_UINT8, BASE_HEX, NULL, 0xff,
2480 {&hf_v52_isdn_user_port_id,
2481 { "ISDN User Port Identification Value","v52.isdn_user_port_id",
2482 FT_UINT8, BASE_HEX, NULL, 0xfc,
2484 {&hf_v52_isdn_user_port_id_lower,
2485 { "ISDN User Port Identification Value (lower)","v52.user_port_id_lower",
2486 FT_UINT8, BASE_HEX, NULL, 0xfe,
2488 {&hf_v52_isdn_user_port_ts_num,
2489 { "ISDN user port time slot number","v52.isdn_user_port_ts_num",
2490 FT_UINT8, BASE_HEX, NULL, 0x1f,
2493 { "Override", "v52.override",
2494 FT_BOOLEAN, 8, NULL, 0x20,
2496 {&hf_v52_reject_cause_type,
2497 { "Reject cause type", "v52.reject_cause_type",
2498 FT_UINT8, BASE_HEX, VALS(reject_cause_type_values), 0x7f,
2500 {&hf_v52_bcc_protocol_error_cause,
2501 { "Protocol error cause type", "v52.bcc_protocol_cause",
2502 FT_UINT8, BASE_HEX, VALS(bcc_protocol_error_cause_type_values),0x7f,
2504 {&hf_v52_diagnostic_message,
2505 { "Diagnostic message", "v52.diagnoatic_message",
2506 FT_UINT8, BASE_HEX, NULL, 0x7f,
2508 {&hf_v52_diagnostic_information,
2509 { "Diagnostic information", "v52.diagnostic_inforation",
2510 FT_UINT8, BASE_HEX, NULL, 0xff,
2512 {&hf_v52_connection_incomplete_reason,
2513 { "Reason", "v52.connection_incomplete_reason",
2514 FT_UINT8, BASE_HEX, VALS(connection_incomplete_reason_values), 0x0,
2516 {&hf_v52_link_control_function,
2517 { "Link control function","v52.link_control_function",
2518 FT_UINT8, BASE_HEX, VALS(link_control_function_values),0x7f,
2520 {&hf_v52_cause_type,
2521 { "Cause type", "v52.cause_type",
2522 FT_UINT8, BASE_HEX, VALS(cause_type_values), 0x7f,
2525 static gint *ett[] = {
2530 proto_v52 = proto_register_protocol("V5.2", "V5.2", "v52");
2531 proto_register_field_array (proto_v52, hf, array_length(hf));
2532 proto_register_subtree_array(ett, array_length(ett));
2534 register_dissector("v52", dissect_v52, proto_v52);
2539 proto_reg_handoff_v52(void)
2544 * Editor modelines - http://www.wireshark.org/tools/modelines.html
2549 * indent-tabs-mode: nil
2552 * vi: set shiftwidth=4 tabstop=8 expandtab
2553 * :indentSize=4:tabSize=8:noTabs=true: