MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-v52.c
blob4cb4561f77bed4672b280283d41f87dce502de31
1 /* packet-v52.c
2 * $Id$
3 * Implementation for V5.2 Interface dissection
4 * References:
5 * ETSI EN 300 324-1 V2.1.1 (2000-04)
6 * ETSI EN 300 347-1 V2.2.2 (1999-12)
8 * Copyright 2009
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>
17 * Copyright 1998
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
34 #include "config.h"
36 #include <glib.h>
37 #include <epan/packet.h>
38 #include <epan/expert.h>
40 static int proto_v52 = -1;
41 static int hf_v52_discriminator = -1;
43 static gint ett_v52 = -1;
44 static gint ett_v52_info = -1;
46 /* static int hf_v52_address = -1; */
47 /* static int hf_v52_low_address = -1; */
49 static int hf_v52_msg_type = -1;
50 static int hf_v52_info_element = -1;
52 static int hf_v52_isdn_address = -1;
53 static int hf_v52_isdn_low_address = -1;
54 static int hf_v52_pstn_address = -1;
55 static int hf_v52_pstn_low_address = -1;
56 static int hf_v52_link_address = -1;
57 static int hf_v52_link_low_address = -1;
58 static int hf_v52_bcc_address = -1;
59 static int hf_v52_bcc_low_address = -1;
60 static int hf_v52_prot_address = -1;
61 static int hf_v52_prot_low_address = -1;
62 /* static int hf_v52_ctrl_address = -1; */
63 /* static int hf_v52_ctrl_low_address = -1; */
64 static int hf_v52_cadenced_ring = -1;
65 static int hf_v52_pulse_notification = -1;
66 static int hf_v52_info_length = -1;
68 /*PSTN Message*/
69 static int hf_v52_line_info = -1;
70 static int hf_v52_pulse_type = -1;
71 static int hf_v52_suppression_indicator = -1;
72 static int hf_v52_pulse_duration = -1;
73 static int hf_v52_ack_request_indicator = -1;
74 static int hf_v52_number_of_pulses = -1;
75 static int hf_v52_steady_signal = -1;
76 static int hf_v52_auto_signalling_sequence = -1;
77 static int hf_v52_sequence_response = -1;
78 static int hf_v52_digit_ack = -1;
79 static int hf_v52_digit_spare = -1;
80 static int hf_v52_digit_info = -1;
81 static int hf_v52_res_unavailable = -1;
82 static int hf_v52_state = -1;
83 static int hf_v52_cause_type = -1;
84 static int hf_v52_pstn_sequence_number = -1;
85 static int hf_v52_duration_type = -1;
86 /*Link control*/
87 static int hf_v52_link_control_function = -1;
88 /*Protection protocol*/
89 static int hf_v52_rejection_cause = -1;
90 static int hf_v52_error_cause = -1;
91 static int hf_v52_diagnostic_msg = -1;
92 static int hf_v52_diagnostic_element = -1;
93 /*BCC protocol*/
94 static int hf_v52_pstn_user_port_id = -1;
95 static int hf_v52_pstn_user_port_id_lower = -1;
97 static int hf_v52_isdn_user_port_id = -1;
98 static int hf_v52_isdn_user_port_id_lower = -1;
100 static int hf_v52_isdn_user_port_ts_num = -1;
101 static int hf_v52_override = -1;
102 static int hf_v52_reject_cause_type = -1;
103 static int hf_v52_bcc_protocol_error_cause = -1;
104 static int hf_v52_connection_incomplete_reason = -1;
106 static int hf_v52_diagnostic_message = -1;
107 static int hf_v52_diagnostic_information = -1;
109 /*Control protocol*/
110 static int hf_v52_control_function_element = -1;
111 static int hf_v52_control_function_id = -1;
112 static int hf_v52_variant = -1;
113 static int hf_v52_if_up_id = -1;
114 static int hf_v52_if_id = -1;
115 static int hf_v52_if_low_id = -1;
116 static int hf_v52_if_all_id = -1;
117 static int hf_v52_performance_grading = -1;
118 static int hf_v52_cp_rejection_cause = -1;
120 static int hf_v52_v5_link_id = -1;
121 static int hf_v52_v5_time_slot = -1;
122 static int hf_v52_sequence_number = -1;
124 static int hf_v52_v5_multi_slot_elements = -1;
126 static int message_type_tmp = -1;
128 static void
129 dissect_v52_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree)
131 unsigned int discriminator = tvb_get_guint8(tvb, offset);
134 if (discriminator == 0x48) {
135 proto_tree_add_uint_format_value(tree, hf_v52_discriminator, tvb, offset, 1, discriminator,
136 "V5.2 (0x%02X)",
137 discriminator);
138 } else {
139 proto_tree_add_uint_format_value(tree, hf_v52_discriminator,
140 tvb, offset, 1, discriminator,
141 "Reserved (0x%02X)",
142 discriminator);
146 /*============================*/
147 /* V52 MESSAGE TYPE START */
148 /*============================*/
150 /* message types of PSTN */
151 #define ESTABLISH 0x00
152 #define ESTABLISH_ACK 0x01
153 #define SIGNAL 0x02
154 #define SIGNAL_ACK 0x03
155 #define DISCONNECT 0x08
156 #define DISCONNECT_COMPLETE 0x09
157 #define STATUS_ENQUIRY 0x0c
158 #define STATUS 0x0d
159 #define PROTOCOL_PARAMETER 0x0e
160 /* message types of Control protocol */
161 #define PORT_CONTROL 0x10
162 #define PORT_CONTROL_ACK 0x11
163 #define COMMON_CONTROL 0x12
164 #define COMMON_CONTROL_ACK 0x13
165 /* message types of PROT protocol */
166 #define SWITCH_OVER_REQ 0x18
167 #define SWITCH_OVER_COM 0x19
168 #define OS_SWITCH_OVER_COM 0x1a
169 #define SWITCH_OVER_ACK 0x1b
170 #define SWITCH_OVER_REJECT 0x1c
171 #define PROT_PROTOCOL_ERROR 0x1d
172 #define RESET_SN_COM 0x1e
173 #define RESET_SN_ACK 0x1f
174 /* message types of BCC */
175 #define ALLOCATION 0x20
176 #define ALLOCATION_COMPLETE 0x21
177 #define ALLOCATION_REJECT 0x22
178 #define DE_ALLOCATION 0x23
179 #define DE_ALLOCATION_COMPLETE 0x24
180 #define DE_ALLOCATION_REJECT 0x25
181 #define AUDIT 0x26
182 #define AUDIT_COMPLETE 0x27
183 #define AN_FAULT 0x28
184 #define AN_FAULT_ACKNOWLEDGE 0x29
185 #define BCC_PROTOCOL_ERROR 0x2a
186 /* message types of Link Control protocol */
187 #define LINK_CONTROL 0x30
188 #define LINK_CONTROL_ACK 0x31
190 static const value_string msg_type_values [] = {
191 { ESTABLISH, "Establish" },
192 { ESTABLISH_ACK, "Establish Ack" },
193 { SIGNAL, "Signal" },
194 { SIGNAL_ACK, "Signal Ack" },
195 { DISCONNECT, "Disconnect" },
196 { DISCONNECT_COMPLETE, "Disconnect Complete" },
197 { STATUS_ENQUIRY, "Status Enqury" },
198 { STATUS, "Status" },
199 { PROTOCOL_PARAMETER, "Protocol Parameter" },
200 { PORT_CONTROL, "Port Control" },
201 { PORT_CONTROL_ACK, "Port Control Ack" },
202 { COMMON_CONTROL, "Common Control" },
203 { COMMON_CONTROL_ACK, "Common Control Ack" },
204 { SWITCH_OVER_REQ, "Switch-Over Request" },
205 { SWITCH_OVER_COM, "Switch-Over Com" },
206 { OS_SWITCH_OVER_COM, "OS-Switch-Over Com" },
207 { SWITCH_OVER_ACK, "Switch-Over Ack" },
208 { SWITCH_OVER_REJECT, "Switch-Over Reject" },
209 { PROT_PROTOCOL_ERROR, "Protocol Error" },
210 { RESET_SN_COM, "Reset SN Com" },
211 { RESET_SN_ACK, "Reset SN Ack" },
212 { ALLOCATION, "Allocation" },
213 { ALLOCATION_COMPLETE, "Allocation Complete" },
214 { ALLOCATION_REJECT, "Allocation Reject" },
215 { DE_ALLOCATION, "DE Allocation" },
216 { DE_ALLOCATION_COMPLETE, "DE Allocation Complete" },
217 { DE_ALLOCATION_REJECT, "DE Allocation Reject" },
218 { AUDIT, "Audit" },
219 { AUDIT_COMPLETE, "Audit Complete" },
220 { AN_FAULT, "AN Fault" },
221 { AN_FAULT_ACKNOWLEDGE, "AN Fault Ack" },
222 { BCC_PROTOCOL_ERROR, "Protocol Error" },
223 { LINK_CONTROL, "Link Control" },
224 { LINK_CONTROL_ACK, "Link Control Ack" },
225 { 0, NULL } };
227 /* SHORT */
228 static const value_string msg_type_values_short [] = {
229 { ESTABLISH, "Establish" },
230 { ESTABLISH_ACK, "Establish Ack" },
231 { SIGNAL, "Signal" },
232 { SIGNAL_ACK, "Signal Ack" },
233 { DISCONNECT, "Disconnect" },
234 { DISCONNECT_COMPLETE, "Disconnect Com" },
235 { STATUS_ENQUIRY, "Status Enq" },
236 { STATUS, "Status" },
237 { PROTOCOL_PARAMETER, "Prot Para" },
238 { PORT_CONTROL, "PortCtrl" },
239 { PORT_CONTROL_ACK, "PortCtrl Ack" },
240 { COMMON_CONTROL, "CCtrl" },
241 { COMMON_CONTROL_ACK, "CCtrl Ack" },
242 { SWITCH_OVER_REQ, "SO Req" },
243 { SWITCH_OVER_COM, "SO Com" },
244 { OS_SWITCH_OVER_COM, "OS SO Com" },
245 { SWITCH_OVER_ACK, "SO Ack" },
246 { SWITCH_OVER_REJECT, "SO Rej" },
247 { PROT_PROTOCOL_ERROR, "Prot Err" },
248 { RESET_SN_COM, "Res SN Com" },
249 { RESET_SN_ACK, "Res SN Ack" },
250 { ALLOCATION, "BCC Alloc" },
251 { ALLOCATION_COMPLETE, "BCC Alloc Comp" },
252 { ALLOCATION_REJECT, "BCC Allo Rej" },
253 { DE_ALLOCATION, "BCC DE-Alloc" },
254 { DE_ALLOCATION_COMPLETE, "BCC DE-Alloc Comp" },
255 { DE_ALLOCATION_REJECT, "BCC DE-Alloc Rej" },
256 { AUDIT, "BCC Audit" },
257 { AUDIT_COMPLETE, "BCC Audit Comp" },
258 { AN_FAULT, "BCC AN Fault" },
259 { AN_FAULT_ACKNOWLEDGE, "BCC AN Fault Ack" },
260 { BCC_PROTOCOL_ERROR, "BCC Prot Error" },
261 { LINK_CONTROL, "LinkCtrl" },
262 { LINK_CONTROL_ACK, "LinkCtrl Ack" },
263 { 0, NULL } };
265 static const value_string pulse_type_values [] = {
266 { 0xff, "Pulsed normal polarity" },
267 { 0xfe, "Pulsed reversed polarity" },
268 { 0xfd, "Pulsed battery on c-wire" },
269 { 0xfc, "Pulsed on hook" },
270 { 0xfb, "Pulsed reduced battery" },
271 { 0xfa, "Pulsed no battery" },
272 { 0xf9, "Initial ring" },
273 { 0xf8, "Meter pulse" },
274 { 0xf7, "50 Hz pulse" },
275 { 0xf6, "Register recall (timed loop open)" },
276 { 0xf5, "Pulsed off hook (pulsed loop closed)" },
277 { 0xf4, "Pulsed b-wire connected to earth" },
278 { 0xf3, "Earth loop pulse" },
279 { 0xf2, "Pulsed b-wire connected to battery" },
280 { 0xf1, "Pulsed a-wire connected to earth" },
281 { 0xf0, "Pulsed a-wire connected to battery" },
282 { 0xef, "Pulsed c-wire connected to earth" },
283 { 0xee, "Pulsed c-wire disconnected" },
284 { 0xed, "Pulsed normal battery" },
285 { 0xec, "Pulsed a-wire disconnected" },
286 { 0xeb, "Pulsed b-wire disconnected" },
287 { 0, NULL } };
289 static const value_string suppression_indication_values [] = {
290 { 0x0, "No suppression" },
291 { 0x1, "Suppression allowed by pre-defined V5.1 SIGNAL msg from LE" },
292 { 0x2, "Suppression allowed by pre-defined line signal from TE" },
293 { 0x3, "Suppression allowed by pre-defined V5.1 SIGNAL msg from LE or line signal from TE" },
294 { 0, NULL } };
296 static const value_string ack_request_indication_values [] = {
297 { 0x0, "No acknowledgement requested" },
298 { 0x1, "Ending acknowledgement requested when finished each pulses" },
299 { 0x2, "Ending acknowledgement requested when finished all pulses" },
300 { 0x3, "Start of pulse acknowledgement requested" },
301 { 0, NULL } };
303 static const value_string steady_signal_values [] = {
304 { 0x00, "Normal polarity" },
305 { 0x01, "Reversed polarity" },
306 { 0x02, "Battery on c-wire" },
307 { 0x03, "No battery on c-wire" },
308 { 0x04, "Off hook (loop closed)" },
309 { 0x05, "On hook (loop open)" },
310 { 0x06, "Battery on a-wire" },
311 { 0x07, "A-wire on earth" },
312 { 0x08, "No battery on a-wire" },
313 { 0x09, "No battery on b-wire" },
314 { 0x0a, "Reduced battery" },
315 { 0x0b, "No battery" },
316 { 0x0c, "Alternate reduced power / no power" },
317 { 0x0d, "Normal battery" },
318 { 0x0e, "Stop ringing" },
319 { 0x0f, "Start pilot frequency" },
320 { 0x10, "Stop pilot frequency" },
321 { 0x11, "Low impedance on b-wire" },
322 { 0x12, "B-wire connected to earth" },
323 { 0x13, "B-wire disconnected from earth" },
324 { 0x14, "Battery on b-wire" },
325 { 0x15, "Low loop impedance" },
326 { 0x16, "High loop impedance" },
327 { 0x17, "Anomalous loop impedance" },
328 { 0x18, "A-wire disconnected from earth" },
329 { 0x19, "C-wire on earth" },
330 { 0x1a, "C-wire disconnected from earth" },
331 { 0x1d, "Ramp to reverse polarity" },
332 { 0x1e, "Ramp to normal polarity" },
333 { 0, NULL } };
335 const true_false_string tfs_digit_ack_values = {
336 "Ending acknowledgement requested when digit transmission is finished",
337 "No ending acknowledgement requested" };
339 static const value_string line_info_values [] = {
340 { 0x00, "Impedance marker reset" },
341 { 0x01, "Impedance marker set" },
342 { 0x02, "Low loop impedance" },
343 { 0x03, "Anomalous loop impedance" },
344 { 0x04, "Anomalous line condition received"},
345 { 0, NULL } };
347 static const value_string state_values [] = {
348 { 0x00, "AN0" },
349 { 0x01, "AN1" },
350 { 0x02, "AN2" },
351 { 0x03, "AN3" },
352 { 0x04, "AN4" },
353 { 0x05, "AN5" },
354 { 0x06, "AN6" },
355 { 0x07, "AN7" },
356 { 0x0f, "Not applicable" },
357 { 0, NULL } };
359 static const value_string control_function_element_values [] = {
360 { 0x01, "FE101 (activate access)" },
361 { 0x02, "FE102 (activation initiated by user)" },
362 { 0x03, "FE103 (DS activated)" },
363 { 0x04, "FE104 (access activated)" },
364 { 0x05, "FE105 (deactivate access)" },
365 { 0x06, "FE106 (access deactivated)" },
366 { 0x11, "FE201/202 (unblock)" },
367 { 0x13, "FE203/204 (block)" },
368 { 0x15, "FE205 (block request)" },
369 { 0x16, "FE206 (performance grading)" },
370 { 0x17, "FE207 (D-channel block)" },
371 { 0x18, "FE208 (D-channel unblock)" },
372 { 0x19, "FE209 (TE out of service)" },
373 { 0x1A, "FE210 (failure inside network)" },
374 { 0, NULL } };
376 static const value_string control_function_id_values [] = {
377 { 0x00, "Verify re-provisioning" },
378 { 0x01, "Ready for re-provisioning" },
379 { 0x02, "Not ready for re-provisioning" },
380 { 0x03, "Switch-over to new variant" },
381 { 0x04, "Re-provisioning started" },
382 { 0x05, "Cannot re-provision" },
383 { 0x06, "Request variant and interface ID" },
384 { 0x07, "Variant and interface ID" },
385 { 0x08, "Blocking started" },
386 { 0x10, "Restart request" },
387 { 0x11, "Restart complete" },
388 { 0x12, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REQUEST" },
389 { 0x13, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS ACCEPTED" },
390 { 0x14, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REJECTED" },
391 { 0x15, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS COMPLETED" },
392 { 0x16, "UNBLOCK ALL RELEVANT PSTN PORTS REQUEST" },
393 { 0x17, "UNBLOCK ALL RELEVANT PSTN PORTS ACCEPTED" },
394 { 0x18, "UNBLOCK ALL RELEVANT PSTN PORTS REJECTED" },
395 { 0x19, "UNBLOCK ALL RELEVANT PSTN PORTS COMPLETED" },
396 { 0x1a, "UNBLOCK ALL RELEVANT ISDN PORTS REQUEST" },
397 { 0x1b, "UNBLOCK ALL RELEVANT ISDN PORTS ACCEPTED" },
398 { 0x1c, "UNBLOCK ALL RELEVANT ISDN PORTS REJECTED" },
399 { 0x1d, "UNBLOCK ALL RELEVANT ISDN PORTS COMPLETED" },
400 { 0x1e, "BLOCK ALL PSTN PORTS REQUEST" },
401 { 0x1f, "BLOCK ALL PSTN PORTS ACCEPTED" },
402 { 0x20, "BLOCK ALL PSTN PORTS REJECTED" },
403 { 0x21, "BLOCK ALL PSTN PORTS COMPLETED" },
404 { 0x22, "BLOCK ALL ISDN PORTS REQUEST" },
405 { 0x23, "BLOCK ALL ISDN PORTS ACCEPTED" },
406 { 0x24, "BLOCK ALL ISDN PORTS REJECTED" },
407 { 0x25, "BLOCK ALL ISDN PORTS COMPLETED" },
408 { 0, NULL } };
410 static const value_string control_function_id_values_short [] = {
411 { 0x00, "VerifyRe-pro" },
412 { 0x01, "ReadyForRe-pro" },
413 { 0x02, "NotReadyForRe-pro" },
414 { 0x03, "SO ToNewVar" },
415 { 0x04, "Re-pro Started" },
416 { 0x05, "CannotRe-pro" },
417 { 0x06, "ReqVar & intf ID" },
418 { 0x07, "Var & intf ID" },
419 { 0x08, "BlockStarted" },
420 { 0x10, "RestartReq" },
421 { 0x11, "RestartCompl" },
422 { 0x12, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REQUEST" },
423 { 0x13, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS ACCEPTED" },
424 { 0x14, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REJECTED" },
425 { 0x15, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS COMPLETED" },
426 { 0x16, "UNBLOCK ALL RELEVANT PSTN PORTS REQUEST" },
427 { 0x17, "UNBLOCK ALL RELEVANT PSTN PORTS ACCEPTED" },
428 { 0x18, "UNBLOCK ALL RELEVANT PSTN PORTS REJECTED" },
429 { 0x19, "UNBLOCK ALL RELEVANT PSTN PORTS COMPLETED" },
430 { 0x1a, "UNBLOCK ALL RELEVANT ISDN PORTS REQUEST" },
431 { 0x1b, "UNBLOCK ALL RELEVANT ISDN PORTS ACCEPTED" },
432 { 0x1c, "UNBLOCK ALL RELEVANT ISDN PORTS REJECTED" },
433 { 0x1d, "UNBLOCK ALL RELEVANT ISDN PORTS COMPLETED" },
434 { 0x1e, "BLOCK ALL PSTN PORTS REQUEST" },
435 { 0x1f, "BLOCK ALL PSTN PORTS ACCEPTED" },
436 { 0x20, "BLOCK ALL PSTN PORTS REJECTED" },
437 { 0x21, "BLOCK ALL PSTN PORTS COMPLETED" },
438 { 0x22, "BLOCK ALL ISDN PORTS REQUEST" },
439 { 0x23, "BLOCK ALL ISDN PORTS ACCEPTED" },
440 { 0x24, "BLOCK ALL ISDN PORTS REJECTED" },
441 { 0x25, "BLOCK ALL ISDN PORTS COMPLETED" },
442 { 0, NULL } };
444 static const value_string rejection_cause_values [] = {
445 { 0x00, "No standby C-channel available" },
446 { 0x01, "Target physical C-channel not operational" },
447 { 0x02, "Target physical C-channel not provisioned" },
448 { 0x03, "Protection switching impossible (AN/LE failure)" },
449 { 0x04, "Protection group mismatch" },
450 { 0x05, "Requested allocation exists already" },
451 { 0x06, "Target physical C-channel already has logical C-channel" },
452 { 0, NULL } };
454 static const value_string error_cause_values [] = {
455 { 0x01, "Protocol discriminator error" },
456 { 0x04, "Message type unrecognized" },
457 { 0x07, "Mandatory information element missing" },
458 { 0x08, "Unrecognized information element" },
459 { 0x09, "Mandatory information element content error" },
460 { 0x0b, "Message not compatible with protection protocol state" },
461 { 0x0c, "Repeated mandatory information element" },
462 { 0x0d, "Too many information elements" },
463 { 0x0f, "Logical C-Channel identification error" },
464 { 0, NULL } };
466 static const value_string performance_grading_values [] = {
467 { 0x00, "normal grade" },
468 { 0x01, "degraded" },
469 { 0, NULL } };
471 static const value_string cp_rejection_cause_values [] = {
472 { 0x00, "variant unknown" },
473 { 0x01, "variant known, not ready" },
474 { 0x02, "re-provisioning in progress (re-pro)" },
475 { 0, NULL } };
477 static const value_string reject_cause_type_values [] = {
478 { 0x00, "Unspecified" },
479 { 0x01, "Access network fault" },
480 { 0x02, "Access network blocked (internally)" },
481 { 0x03, "Connection already present at the PSTN user port to a different V5 time slot" },
482 { 0x04, "Connection already present at the V5 time slot(s) to a different port or ISDN user port time slot(s)" },
483 { 0x05, "Connection already present at the ISDN user port time slot(s) to a different V5 time slot(s)" },
484 { 0x06, "User port unavailable (blocked)" },
485 { 0x07, "De-allocation cannot completeddue to incompatible data content" },
486 { 0x08, "De-allocation cannot completeddue to V5 time slot(s) data incompatibility" },
487 { 0x09, "De-allocation cannot completeddue to port data incompatibility" },
488 { 0x0a, "De-allocation cannot completeddue to user port time slot(s) data incompatibility" },
489 { 0x0b, "User port not provisioned" },
490 { 0x0c, "Invalid V5 time slot(s) indication(s)" },
491 { 0x0d, "Invalid V5 2048 kbit/s link indication" },
492 { 0x0e, "Invalid user time slot(s) indication(s)" },
493 { 0x0f, "V5 time slot(s) being used as physikal C-channel(s)" },
494 { 0x10, "V5 link unavailable (blocked)" },
495 { 0, NULL } };
497 static const value_string bcc_protocol_error_cause_type_values [] = {
498 { 0x01, "Protocol discriminator error" },
499 { 0x04, "Message type unrecognized" },
500 { 0x05, "Out of sequence information element" },
501 { 0x06, "Repeated optional information element" },
502 { 0x07, "Mandatory information element missing" },
503 { 0x08, "Unrecognized information element" },
504 { 0x09, "Mandatory information element content error" },
505 { 0x0a, "Optional information element content error" },
506 { 0x0b, "Message not compatible with the BCC protocol state" },
507 { 0x0c, "Repeated mandatory information element" },
508 { 0x0d, "Too many information element" },
509 { 0x0f, "BCC Reference Number coding error" },
510 { 0, NULL } };
512 static const value_string connection_incomplete_reason_values [] = {
513 { 0x00, "Incomplete normal" },
514 { 0x01, "Access network fault" },
515 { 0x02, "User port not provisioned" },
516 { 0x03, "Invalid V5 time slot identification" },
517 { 0x04, "Invalid V5 2048 kbit/s link identification" },
518 { 0x05, "Time slot being used as physical C-channel" },
519 { 0, NULL } };
521 static const value_string link_control_function_values [] = {
522 { 0x00, "FE-IDReq" },
523 { 0x01, "FE-IDAck" },
524 { 0x02, "FE-IDRel" },
525 { 0x03, "FE-IDRej" },
526 { 0x04, "FE301/302 (link unblock)" },
527 { 0x05, "FE303/304 (link block)" },
528 { 0x06, "FE305 (deferred link block request" },
529 { 0x07, "FE306 (non-deferred link block request)" },
530 { 0, NULL } };
532 static const value_string cause_type_values [] = {
533 { 0x00, "Response to STATUS ENQUIRY" },
534 { 0x01, "Not used" },
535 { 0x03, "L3 address error" },
536 { 0x04, "Message type unrecognized" },
537 { 0x05, "Out of sequence information element" },
538 { 0x06, "Repeated optional information element" },
539 { 0x07, "Mandatory information element missing" },
540 { 0x08, "Unrecognized information element" },
541 { 0x09, "Mandatory information element content error" },
542 { 0x0a, "Optional information element content error" },
543 { 0x0b, "Message not compatible with path state" },
544 { 0x0c, "Repeated mandatory information element" },
545 { 0x0d, "Too many information elements" },
546 { 0, NULL } };
548 /* PSTN protocol message info elements */
549 #define PULSE_NOTIFICATION 0xc0
550 #define LINE_INFORMATION 0x80
551 #define STATE 0x90
552 #define AUTO_SIG_SEQUENCE 0xa0
553 #define SEQUENCE_RESPONSE 0xb0
554 #define PSTN_SEQUENCE_NUMBER 0x00
555 #define CADENCED_RINGING 0x01
556 #define PULSED_SIGNAL 0x02
557 #define STEADY_SIGNAL 0x03
558 #define DIGIT_SIGNAL 0x04
559 #define RECOGNITION_TIME 0x10
560 #define ENABLE_AUTO_ACK 0x11
561 #define DISABLE_AUTO_ACK 0x12
562 #define CAUSE 0x13
563 #define RESOURCE_UNAVAILABLE 0x14
564 #define ENABLE_METERING 0x22
565 #define METERING_REPORT 0x23
566 #define ATTENUATION 0x24
567 /* Control protocol message info elements */
568 #define PERFORMANCE_GRADING 0xe0
569 #define CP_REJECTION_CAUSE 0xf0
570 #define CONTROL_FUNCTION_ELEMENT 0x20
571 #define CONTROL_FUNCTION_ID 0x21
572 #define VARIANT 0x22
573 #define INTERFACE_ID 0x23
574 /* Link control protocol message info elements */
575 #define LINK_CONTROL_FUNCTION 0x30
576 /* BCC protocol message info elements */
577 #define USER_PORT_ID 0x40
578 #define ISDN_PORT_TS_ID 0x41
579 #define V5_TIME_SLOT_ID 0x42
580 #define MULTI_SLOT_MAP 0x43
581 #define BCC_REJECT_CAUSE 0x44
582 #define BCC_PROTOCOL_ERROR_CAUSE 0x45
583 #define CONNECTION_INCOMPLETE 0x46
584 /* Protection protocol message info elements */
585 #define SEQUENCE_NUMBER 0x50
586 #define C_CHANNEL_ID 0x51
587 #define PP_REJECTION_CAUSE 0x52
588 #define PROTOCOL_ERROR 0x53
590 static const value_string info_element_values [] = {
591 { PULSE_NOTIFICATION, "Pulse notification" },
592 { LINE_INFORMATION, "Line information" },
593 { STATE, "State" },
594 { AUTO_SIG_SEQUENCE, "Autonomous signal sequence" },
595 { SEQUENCE_RESPONSE, "Sequence response" },
596 { PSTN_SEQUENCE_NUMBER, "Sequence number" },
597 { CADENCED_RINGING, "Cadenced ringing" },
598 { PULSED_SIGNAL, "Pulsed signal" },
599 { STEADY_SIGNAL, "Steady signal" },
600 { DIGIT_SIGNAL, "Digit signal" },
601 { RECOGNITION_TIME, "Recognition time" },
602 { ENABLE_AUTO_ACK, "Enable autonomous acknowledge" },
603 { DISABLE_AUTO_ACK, "Disable autonomous acknowledge" },
604 { CAUSE, "Cause" },
605 { RESOURCE_UNAVAILABLE, "Resource unavailable" },
606 { ENABLE_METERING, "Enable metering" },
607 { METERING_REPORT, "Metering report" },
608 { ATTENUATION, "Attenuation" },
609 { PERFORMANCE_GRADING, "Performance grading" },
610 { CP_REJECTION_CAUSE, "Rejection cause" },
611 { CONTROL_FUNCTION_ELEMENT, "Control function element" },
612 { CONTROL_FUNCTION_ID, "Control function ID" },
613 { VARIANT, "Variant" },
614 { INTERFACE_ID, "Interface ID" },
615 { LINK_CONTROL_FUNCTION, "Link control function" },
616 { USER_PORT_ID, "User port ID" },
617 { ISDN_PORT_TS_ID, "ISDN port TS ID" },
618 { V5_TIME_SLOT_ID, "V5 TS ID" },
619 { MULTI_SLOT_MAP, "Multi-Slot map" },
620 { BCC_REJECT_CAUSE, "Reject cause" },
621 { BCC_PROTOCOL_ERROR_CAUSE, "Protocol error cause" },
622 { CONNECTION_INCOMPLETE, "Connection incomplete" },
623 { SEQUENCE_NUMBER, "Sequence number" },
624 { C_CHANNEL_ID, "Physical C-Channel ID" },
625 { PP_REJECTION_CAUSE, "Rejection cause" },
626 { PROTOCOL_ERROR, "Protocol error cause" },
627 { 0, NULL } };
629 static const value_string info_element_values_short [] = {
630 { PULSE_NOTIFICATION, "PN" },
631 { LINE_INFORMATION, "LI" },
632 { STATE, "ST" },
633 { AUTO_SIG_SEQUENCE, "ASS" },
634 { SEQUENCE_RESPONSE, "SR" },
635 { PSTN_SEQUENCE_NUMBER, "SN" },
636 { CADENCED_RINGING, "CR" },
637 { PULSED_SIGNAL, "PS" },
638 { STEADY_SIGNAL, "SS" },
639 { DIGIT_SIGNAL, "DS" },
640 { RECOGNITION_TIME, "RT" },
641 { ENABLE_AUTO_ACK, "EAA" },
642 { DISABLE_AUTO_ACK, "DAA" },
643 { CAUSE, "CA" },
644 { RESOURCE_UNAVAILABLE, "RU" },
645 { ENABLE_METERING, "EM" },
646 { METERING_REPORT, "MR" },
647 { ATTENUATION, "ATT" },
648 { PERFORMANCE_GRADING, "PG" },
649 { CP_REJECTION_CAUSE, "RC" },
650 { CONTROL_FUNCTION_ELEMENT, "CF element" },
651 { CONTROL_FUNCTION_ID, "CF ID" },
652 { VARIANT, "Var" },
653 { INTERFACE_ID, "Interface ID" },
654 { LINK_CONTROL_FUNCTION, "LC F" },
655 { USER_PORT_ID, "UP ID" },
656 { ISDN_PORT_TS_ID, "ISDNP TS ID" },
657 { V5_TIME_SLOT_ID, "V5 TS ID" },
658 { MULTI_SLOT_MAP, "MS map" },
659 { BCC_REJECT_CAUSE, "RC" },
660 { BCC_PROTOCOL_ERROR_CAUSE, "PEC" },
661 { CONNECTION_INCOMPLETE, "CI" },
662 { SEQUENCE_NUMBER, "SN" },
663 { C_CHANNEL_ID, "Phy CChannel ID" },
664 { PP_REJECTION_CAUSE, "RC" },
665 { PROTOCOL_ERROR, "PEC" },
666 { 0, NULL } };
669 #define ADDRESS_OFFSET 1
670 #define ADDRESS_LENGTH 1
671 #define LOW_ADDRESS_OFFSET 2
672 #define LOW_ADDRESS_LENGTH 1
673 #define MSG_TYPE_OFFSET 3
674 #define MSG_TYPE_LENGTH 1
675 #define INFO_ELEMENT_OFFSET 4
676 #define INFO_ELEMENT_LENGTH 1
679 static void
680 dissect_pstn_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
682 proto_tree *info_tree = NULL;
683 proto_item *ti_info;
684 guint8 info_element_length = 1;
685 guint8 info_element = 0;
686 guint8 pstn_sequence_number_tmp = 0;
688 guint16 data_length;
689 tvbuff_t *info_tvb;
690 int info_offset = 0;
692 info_element = tvb_get_guint8(tvb, offset);
694 data_length = tvb_get_guint8(tvb, offset+1)+2;
695 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
697 if (tree) {
698 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
699 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
702 if (info_tree != NULL) {
703 pstn_sequence_number_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
705 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
706 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
707 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
708 proto_tree_add_item(info_tree, hf_v52_pstn_sequence_number, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
710 col_append_fstr(pinfo->cinfo, COL_INFO, " | SN: %u", pstn_sequence_number_tmp);
714 static void
715 dissect_cadenced_ring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
717 proto_tree *info_tree = NULL;
718 proto_item *ti_info;
719 guint8 info_element_length = 1;
720 guint8 info_element = 0;
721 guint8 cadenced_ring_tmp = 0;
722 guint16 data_length;
723 tvbuff_t *info_tvb;
724 int info_offset = 0;
726 info_element = tvb_get_guint8(tvb, offset);
728 data_length = tvb_get_guint8(tvb, offset+1)+2;
729 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
731 if (tree) {
732 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
733 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
736 if (info_tree != NULL) {
737 cadenced_ring_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
738 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
739 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
740 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
741 proto_tree_add_item(info_tree, hf_v52_cadenced_ring, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
743 col_append_str(pinfo->cinfo, COL_INFO, " | ");
744 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
746 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", cadenced_ring_tmp);
751 static void
752 dissect_pulsed_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
754 proto_tree *info_tree = NULL;
755 proto_item *ti_info;
756 guint8 info_element_length = 1;
757 guint8 info_element = 0;
759 guint16 data_length;
760 tvbuff_t *info_tvb;
761 int info_offset = 0;
763 info_element = tvb_get_guint8(tvb, offset);
765 data_length = tvb_get_guint8(tvb, offset+1)+2;
766 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
768 if (tree) {
769 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
770 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
773 if (info_tree != NULL) {
774 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
775 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
776 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
777 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
779 if (data_length > 3) {
780 proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
781 proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
784 if (data_length > 4) {
785 proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN);
786 proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN);
789 col_append_str(pinfo->cinfo, COL_INFO, " | ");
790 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
792 col_append_str(pinfo->cinfo, COL_INFO, ": ");
793 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2), pulse_type_values, "Unknown element"));
798 static void
799 dissect_steady_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
801 proto_tree *info_tree = NULL;
802 proto_item *ti_info;
803 guint8 info_element_length = 1;
804 guint8 info_element = 0;
806 guint16 data_length;
807 tvbuff_t *info_tvb;
808 int info_offset = 0;
810 info_element = tvb_get_guint8(tvb, offset);
812 data_length = tvb_get_guint8(tvb, offset+1)+2;
813 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
815 if (tree) {
816 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
817 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
820 if (info_tree != NULL) {
821 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
822 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
823 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
824 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
826 col_append_str(pinfo->cinfo, COL_INFO, " | ");
827 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
829 col_append_str(pinfo->cinfo, COL_INFO, ": ");
830 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, steady_signal_values, "Unknown element"));
834 static void
835 dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
837 proto_tree *info_tree = NULL;
838 proto_item *ti_info;
839 guint8 info_element_length = 1;
840 guint8 buffer = 0;
841 guint8 info_element = 0;
843 guint16 data_length;
844 tvbuff_t *info_tvb;
845 int info_offset = 0;
847 info_element = tvb_get_guint8(tvb, offset);
849 data_length = tvb_get_guint8(tvb, offset+1)+2;
850 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
852 if (tree) {
853 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
854 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
857 if (info_tree != NULL) {
858 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
859 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
860 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
862 proto_tree_add_item(info_tree, hf_v52_digit_ack, info_tvb, info_offset+2, 1, ENC_NA);
864 buffer = tvb_get_guint8(info_tvb, info_offset+2)>>4;
865 buffer = buffer&0x03;
867 proto_tree_add_item(info_tree, hf_v52_digit_spare, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
868 proto_tree_add_item(info_tree, hf_v52_digit_info, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
870 col_append_str(pinfo->cinfo, COL_INFO, " | ");
871 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
873 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", buffer);
879 static void
880 dissect_recognition_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
882 proto_tree *info_tree = NULL;
883 proto_item *ti_info;
884 guint8 info_element_length = 1;
885 guint8 buffer = 0;
886 guint8 info_element = 0;
888 guint16 data_length;
889 tvbuff_t *info_tvb;
890 int info_offset = 0;
892 info_element = tvb_get_guint8(tvb, offset);
894 data_length = tvb_get_guint8(tvb, offset+1)+2;
895 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
897 if (tree) {
898 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
899 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
902 if (info_tree != NULL) {
903 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
904 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
905 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
907 buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f;
908 /*Signal = Coding of pulse type*/
909 if(buffer>=0x6b)
910 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
911 /*Signal = Coding of steady signal type*/
912 else if(buffer<=0x1a)
913 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
915 proto_tree_add_item(info_tree, hf_v52_duration_type, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
917 col_append_str(pinfo->cinfo, COL_INFO, " | ");
918 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
922 static void
923 dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
925 proto_tree *info_tree = NULL;
926 proto_item *ti_info;
927 guint8 info_element_length = 1;
928 guint8 buffer = 0;
929 guint8 info_element = 0;
931 guint16 data_length;
932 tvbuff_t *info_tvb;
933 int info_offset = 0;
935 info_element = tvb_get_guint8(tvb, offset);
937 data_length = tvb_get_guint8(tvb, offset+1)+2;
938 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
940 if (tree) {
941 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
942 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
945 if (info_tree != NULL) {
946 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
947 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
948 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
950 buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f;
951 /*Signal*/
952 if(buffer>=0x6b)
953 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
954 else if(buffer<=0x1a)
955 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
957 buffer = tvb_get_guint8(info_tvb, info_offset+3)&0x7f;
958 /*Response*/
959 if(buffer>=0x6b)
960 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
961 else if(buffer<=0x1a)
962 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+3,1,ENC_BIG_ENDIAN);
964 if(tvb_length_remaining(info_tvb, info_offset+4)){
965 proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+4,1,ENC_BIG_ENDIAN);
966 proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+4,1,ENC_BIG_ENDIAN);
968 if(tvb_length_remaining(info_tvb, info_offset+5)){
969 proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+5,1,ENC_BIG_ENDIAN);
970 proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+5,1,ENC_BIG_ENDIAN);
973 col_append_str(pinfo->cinfo, COL_INFO, " | ");
974 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
978 static void
979 dissect_disable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
981 proto_tree *info_tree = NULL;
982 proto_item *ti_info;
983 guint8 info_element_length = 1;
984 guint8 buffer = 0;
985 guint8 info_element = 0;
987 guint16 data_length;
988 tvbuff_t *info_tvb;
989 int info_offset = 0;
991 info_element = tvb_get_guint8(tvb, offset);
993 data_length = tvb_get_guint8(tvb, offset+1)+2;
994 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
996 if (tree) {
997 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
998 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1001 if (info_tree != NULL) {
1002 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1003 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1004 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1006 buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f;
1008 if(buffer>=0x6b)
1009 proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
1010 else if(buffer<=0x1a)
1011 proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
1013 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1014 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1018 static void
1019 dissect_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1021 proto_tree *info_tree = NULL;
1022 proto_item *ti_info;
1023 guint8 info_element_length = 1;
1024 guint8 info_element = 0;
1026 guint16 data_length;
1027 tvbuff_t *info_tvb;
1028 int info_offset = 0;
1030 info_element = tvb_get_guint8(tvb, offset);
1032 data_length = tvb_get_guint8(tvb, offset+1)+2;
1033 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1035 if (tree) {
1036 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1037 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1040 if (info_tree != NULL) {
1041 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1042 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1043 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"), info_element);
1044 proto_tree_add_item(info_tree, hf_v52_cause_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
1046 if(tvb_length_remaining(info_tvb, info_offset+3))
1047 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),
1048 "Diagnostic: %s",val_to_str_const(tvb_get_guint8(info_tvb, info_offset+3), msg_type_values,"unknown"));
1050 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1051 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1053 col_append_str(pinfo->cinfo, COL_INFO, ": ");
1054 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, cause_type_values, "Unknown element"));
1058 static void
1059 dissect_resource_unavailable(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1061 proto_tree *info_tree = NULL;
1062 proto_item *ti_info;
1063 guint8 info_element_length = 1;
1064 guint8 info_element = 0;
1066 guint16 data_length;
1067 tvbuff_t *info_tvb;
1068 int info_offset = 0;
1070 info_element = tvb_get_guint8(tvb, offset);
1072 data_length = tvb_get_guint8(tvb, offset+1)+2;
1073 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1075 if (tree) {
1076 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1077 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1080 if (info_tree != NULL) {
1081 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1082 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1083 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1084 proto_tree_add_item(info_tree, hf_v52_res_unavailable, info_tvb, info_offset+2, info_element_length, ENC_ASCII|ENC_NA);
1086 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1087 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1091 static void
1092 dissect_pulse_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1094 proto_tree *info_tree = NULL;
1095 proto_item *ti_info;
1096 guint8 info_element_length = 1;
1097 guint8 info_element = 0;
1099 guint16 data_length;
1100 tvbuff_t *info_tvb;
1101 int info_offset = 0;
1103 info_element = tvb_get_guint8(tvb, offset);
1105 data_length = 1;
1106 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1108 if (tree) {
1109 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1110 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1113 if (info_tree != NULL) {
1114 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1115 proto_tree_add_item(info_tree, hf_v52_pulse_notification, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1117 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1118 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1122 static void
1123 dissect_line_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1125 proto_tree *info_tree = NULL;
1126 proto_item *ti_info;
1127 guint8 info_element_length = 1;
1128 guint8 info_element = 0;
1130 guint16 data_length;
1131 tvbuff_t *info_tvb;
1132 int info_offset = 0;
1134 info_element = tvb_get_guint8(tvb, offset);
1136 data_length = 1;
1137 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1139 if (tree) {
1140 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1141 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1144 if (info_tree != NULL) {
1145 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1146 proto_tree_add_item(info_tree, hf_v52_line_info, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1148 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1149 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1153 static void
1154 dissect_state(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1156 proto_tree *info_tree = NULL;
1157 proto_item *ti_info;
1158 guint8 info_element_length = 1;
1159 guint8 info_element = 0;
1161 guint16 data_length;
1162 tvbuff_t *info_tvb;
1163 int info_offset = 0;
1165 info_element = tvb_get_guint8(tvb, offset);
1167 data_length = 1;
1168 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1170 if (tree) {
1171 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1172 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1175 if (info_tree != NULL) {
1176 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1177 proto_tree_add_item(info_tree, hf_v52_state, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1179 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1180 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1184 static void
1185 dissect_auto_sig_sequence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1187 proto_tree *info_tree = NULL;
1188 proto_item *ti_info;
1189 guint8 info_element_length = 1;
1190 guint8 info_element = 0;
1192 guint16 data_length;
1193 tvbuff_t *info_tvb;
1194 int info_offset = 0;
1196 info_element = tvb_get_guint8(tvb, offset);
1198 data_length = 1;
1199 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1201 if (tree) {
1202 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1203 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1206 if (info_tree != NULL) {
1207 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1208 proto_tree_add_item(info_tree, hf_v52_auto_signalling_sequence, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1210 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1211 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1215 static void
1216 dissect_sequence_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1218 proto_tree *info_tree = NULL;
1219 proto_item *ti_info;
1220 guint8 info_element_length = 1;
1221 guint8 info_element = 0;
1223 guint16 data_length;
1224 tvbuff_t *info_tvb;
1225 int info_offset = 0;
1227 info_element = tvb_get_guint8(tvb, offset);
1229 data_length = 1;
1230 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1232 if (tree) {
1233 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1234 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1237 if (info_tree != NULL) {
1238 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1239 proto_tree_add_item(info_tree, hf_v52_sequence_response, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1241 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1242 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1246 static void
1247 dissect_control_function_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1249 proto_tree *info_tree = NULL;
1250 proto_item *ti_info;
1251 guint8 info_element_length = 1;
1252 guint8 info_element = 0;
1254 guint16 data_length;
1255 tvbuff_t *info_tvb;
1256 int info_offset = 0;
1258 info_element = tvb_get_guint8(tvb, offset);
1260 data_length = tvb_get_guint8(tvb, offset+1)+2;
1261 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1263 if (tree) {
1264 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1265 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1268 if (info_tree != NULL) {
1269 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1270 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1271 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1272 proto_tree_add_item(info_tree, hf_v52_control_function_element, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1274 if (message_type_tmp == 0x11) {}
1275 else {
1276 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1277 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, control_function_element_values, "Unknown element"));
1282 static void
1283 dissect_control_function_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1285 proto_tree *info_tree = NULL;
1286 proto_item *ti_info;
1287 guint8 info_element_length = 1;
1288 guint8 info_element = 0;
1290 guint16 data_length;
1291 tvbuff_t *info_tvb;
1292 int info_offset = 0;
1294 info_element = tvb_get_guint8(tvb, offset);
1296 data_length = tvb_get_guint8(tvb, offset+1)+2;
1297 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1299 if (tree) {
1300 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1301 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1304 if (info_tree != NULL) {
1305 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1306 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1307 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1308 proto_tree_add_item(info_tree, hf_v52_control_function_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1310 if (message_type_tmp == 0x13) {}
1311 else {
1312 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1313 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, control_function_id_values_short, "Unknown layer3 element"));
1318 static void
1319 dissect_variant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1321 proto_tree *info_tree = NULL;
1322 proto_item *ti_info;
1323 guint8 info_element_length = 1;
1324 guint8 info_element = 0;
1325 guint8 variantValue = 0;
1327 guint16 data_length;
1328 tvbuff_t *info_tvb;
1329 int info_offset = 0;
1331 info_element = tvb_get_guint8(tvb, offset);
1333 data_length = tvb_get_guint8(tvb, offset+1)+2;
1334 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1336 if (tree) {
1337 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1338 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1341 if (info_tree != NULL) {
1342 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1343 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1344 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1345 proto_tree_add_item(info_tree, hf_v52_variant, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1347 variantValue = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
1348 col_append_fstr(pinfo->cinfo, COL_INFO, " | Var: %u", variantValue);
1352 static void
1353 dissect_interface_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1355 proto_tree *info_tree = NULL;
1356 proto_item *ti_info;
1357 guint8 info_element_length = 1;
1358 guint8 info_element = 0;
1359 guint8 interfaceAllIdValue = 0;
1361 guint16 data_length;
1362 tvbuff_t *info_tvb;
1363 int info_offset = 0;
1365 info_element = tvb_get_guint8(tvb, offset);
1367 data_length = tvb_get_guint8(tvb, offset+1)+2;
1368 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1370 if (tree) {
1371 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1372 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1375 if (info_tree != NULL) {
1376 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1377 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1378 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1379 proto_tree_add_item(info_tree, hf_v52_if_up_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1380 proto_tree_add_item(info_tree, hf_v52_if_id, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1381 proto_tree_add_item(info_tree, hf_v52_if_low_id, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
1382 proto_tree_add_item(info_tree, hf_v52_if_all_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1384 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));
1386 col_append_fstr(pinfo->cinfo, COL_INFO, " | Intf. ID: %u", interfaceAllIdValue);
1390 static void
1391 dissect_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1393 proto_tree *info_tree = NULL;
1394 proto_item *ti_info;
1395 guint8 info_element_length = 1;
1396 guint8 info_element = 0;
1397 guint8 hf_v52_sequence_number_tmp = 0;
1398 guint16 data_length;
1399 tvbuff_t *info_tvb;
1400 int info_offset = 0;
1402 info_element = tvb_get_guint8(tvb, offset);
1404 data_length = tvb_get_guint8(tvb, offset+1)+2;
1405 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1407 if (tree) {
1408 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1409 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1412 if (info_tree != NULL) {
1413 hf_v52_sequence_number_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
1414 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1415 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1416 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1417 proto_tree_add_item(info_tree, hf_v52_sequence_number, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1419 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1420 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
1422 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", hf_v52_sequence_number_tmp);
1428 static void
1429 dissect_physical_c_channel_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1431 proto_tree *info_tree = NULL;
1432 proto_item *ti_info;
1433 guint8 info_element_length = 1;
1434 guint8 info_element = 0;
1435 guint8 hf_v52_v5_link_id_cc_tmp = 0;
1436 guint8 hf_v52_v5_time_slot_cc_tmp = 0;
1438 guint16 data_length;
1439 tvbuff_t *info_tvb;
1440 int info_offset = 0;
1442 info_element = tvb_get_guint8(tvb, offset);
1444 data_length = tvb_get_guint8(tvb, offset+1)+2;
1445 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1447 if (tree) {
1448 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1449 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1452 if (info_tree != NULL) {
1453 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1454 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1455 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1456 proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1457 proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1459 hf_v52_v5_link_id_cc_tmp = tvb_get_guint8(info_tvb, info_offset+2);
1460 hf_v52_v5_time_slot_cc_tmp =tvb_get_guint8(info_tvb, info_offset+3);
1462 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);
1466 static void
1467 dissect_pp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1469 proto_tree *info_tree = NULL;
1470 proto_item *ti_info;
1471 guint8 info_element_length = 1;
1472 guint8 info_element = 0;
1474 guint16 data_length;
1475 tvbuff_t *info_tvb;
1476 int info_offset = 0;
1478 info_element = tvb_get_guint8(tvb, offset);
1480 data_length = tvb_get_guint8(tvb, offset+1)+2;
1481 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1483 if (tree) {
1484 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1485 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1488 if (info_tree != NULL) {
1489 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1490 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1491 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1492 proto_tree_add_item(info_tree, hf_v52_rejection_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1494 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1495 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, rejection_cause_values, "Unknown element"));
1499 static void
1500 dissect_protocol_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1502 proto_tree *info_tree = NULL;
1503 proto_item *ti_info;
1504 guint8 info_element_length = 1;
1505 guint8 info_element = 0;
1507 guint16 data_length;
1508 tvbuff_t *info_tvb;
1509 int info_offset = 0;
1511 info_element = tvb_get_guint8(tvb, offset);
1513 data_length = tvb_get_guint8(tvb, offset+1)+2;
1514 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1516 if (tree) {
1517 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1518 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1521 if (info_tree != NULL) {
1522 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1523 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1524 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1525 proto_tree_add_item(info_tree, hf_v52_error_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1526 proto_tree_add_item(info_tree, hf_v52_diagnostic_msg, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1527 proto_tree_add_item(info_tree, hf_v52_diagnostic_element, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
1529 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1530 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, error_cause_values, "Unknown element"));
1535 static void
1536 dissect_performance_grading(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1538 proto_tree *info_tree = NULL;
1539 proto_item *ti_info;
1540 guint8 info_element_length = 1;
1541 guint8 info_element = 0;
1543 guint16 data_length;
1544 tvbuff_t *info_tvb;
1545 int info_offset = 0;
1547 info_element = tvb_get_guint8(tvb, offset);
1549 data_length = 1;
1550 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1552 if (tree) {
1553 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1554 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1557 if (info_tree != NULL) {
1558 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1559 proto_tree_add_item(info_tree, hf_v52_performance_grading, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1561 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1562 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset)-0xe0, performance_grading_values, "Unknown element"));
1567 static void
1568 dissect_cp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1570 proto_tree *info_tree = NULL;
1571 proto_item *ti_info;
1572 guint8 info_element_length = 1;
1573 guint8 info_element = 0;
1575 guint16 data_length;
1576 tvbuff_t *info_tvb;
1577 int info_offset = 0;
1579 info_element = tvb_get_guint8(tvb, offset);
1581 data_length = 1;
1582 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1584 if (tree) {
1585 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1586 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1589 if (info_tree != NULL) {
1590 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1591 proto_tree_add_item(info_tree, hf_v52_cp_rejection_cause, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1593 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1594 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset)-0xe0, cp_rejection_cause_values, "Unknown element"));
1598 static void
1599 dissect_user_port_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1601 proto_tree *info_tree = NULL;
1602 proto_item *ti_info;
1603 int hf_v52_pstn_user_port_tmp = 0;
1604 int hf_v52_isdn_user_port_tmp = 0;
1605 guint8 info_element_length = 1;
1606 guint8 buffer = 0;
1607 guint8 info_element = 0;
1609 guint16 data_length;
1610 tvbuff_t *info_tvb;
1611 int info_offset = 0;
1613 info_element = tvb_get_guint8(tvb, offset);
1615 data_length = tvb_get_guint8(tvb, offset+1)+2;
1616 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1618 if (tree) {
1619 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1620 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1623 if (info_tree != NULL) {
1624 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1625 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1626 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1628 buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x01;
1630 if(buffer==0x01){
1631 proto_tree_add_item(info_tree, hf_v52_pstn_user_port_id, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
1632 proto_tree_add_item(info_tree, hf_v52_pstn_user_port_id_lower, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
1634 hf_v52_pstn_user_port_tmp = (((tvb_get_guint8(info_tvb, info_offset+2)>>1)<<8)+(tvb_get_guint8(info_tvb, info_offset+3)));
1636 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN port: %u", hf_v52_pstn_user_port_tmp);
1638 else if(buffer == 0x00){
1639 proto_tree_add_item(info_tree, hf_v52_isdn_user_port_id, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
1640 proto_tree_add_item(info_tree, hf_v52_isdn_user_port_id_lower, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
1642 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)));
1644 col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", hf_v52_isdn_user_port_tmp);
1649 static void
1650 dissect_isdn_port_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1652 proto_tree *info_tree = NULL;
1653 proto_item *ti_info;
1654 guint8 info_element_length = 1;
1655 guint8 info_element = 0;
1656 guint8 isdn_user_port_ts_num_tmp = 0;
1658 guint16 data_length;
1659 tvbuff_t *info_tvb;
1660 int info_offset = 0;
1662 info_element = tvb_get_guint8(tvb, offset);
1664 data_length = tvb_get_guint8(tvb, offset+1)+2;
1665 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1667 if (tree) {
1668 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1669 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1672 if (info_tree != NULL) {
1673 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1674 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1675 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1676 proto_tree_add_item(info_tree, hf_v52_isdn_user_port_ts_num, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1678 isdn_user_port_ts_num_tmp = (tvb_get_guint8(info_tvb, info_offset+2)) - 128;
1679 col_append_str(pinfo->cinfo, COL_INFO, ", ");
1680 col_append_fstr(pinfo->cinfo, COL_INFO, "%x", isdn_user_port_ts_num_tmp);
1684 static void
1685 dissect_v5_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1687 proto_tree *info_tree = NULL;
1688 proto_item *ti_info;
1689 guint8 info_element_length = 1;
1690 guint8 info_element = 0;
1691 guint8 v5_link_id_tmp = 0;
1692 guint8 v5_time_slot_tmp = 0;
1694 guint16 data_length;
1695 tvbuff_t *info_tvb;
1696 int info_offset = 0;
1698 info_element = tvb_get_guint8(tvb, offset);
1700 data_length = tvb_get_guint8(tvb, offset+1)+2;
1701 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1703 if (tree) {
1704 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1705 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1708 if (info_tree != NULL) {
1709 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1710 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1711 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1712 proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1713 proto_tree_add_item(info_tree, hf_v52_override, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1714 proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1716 v5_link_id_tmp = tvb_get_guint8(info_tvb, info_offset+2);
1717 v5_time_slot_tmp = tvb_get_guint8(info_tvb, info_offset+3);
1719 if (v5_time_slot_tmp >= 64) {
1720 v5_time_slot_tmp = v5_time_slot_tmp - 64;
1721 } else {};
1723 if (v5_time_slot_tmp >= 32) {
1724 v5_time_slot_tmp = v5_time_slot_tmp - 32;
1725 } else {};
1727 col_append_fstr(pinfo->cinfo, COL_INFO, " | V5 Link: %u, %u ", v5_link_id_tmp, v5_time_slot_tmp);
1731 static void
1732 dissect_multi_slot_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1734 proto_tree *info_tree = NULL;
1735 proto_item *ti_info;
1736 guint8 info_element_length = 1;
1737 guint8 info_element = 0;
1739 guint16 data_length;
1740 tvbuff_t *info_tvb;
1741 int info_offset = 0;
1743 info_element = tvb_get_guint8(tvb, offset);
1745 data_length = tvb_get_guint8(tvb, offset+1)+2;
1746 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1748 if (tree) {
1749 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1750 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1753 if (info_tree != NULL) {
1754 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1755 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1756 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1757 proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1759 col_append_fstr(pinfo->cinfo, COL_INFO, " | V5MSlink ID:%u",tvb_get_guint8(info_tvb, info_offset+2));
1761 if(tvb_length_remaining(info_tvb, info_offset+3))
1762 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1763 if(tvb_length_remaining(info_tvb, info_offset+4))
1764 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
1765 if(tvb_length_remaining(info_tvb, info_offset+5))
1766 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+5, info_element_length, ENC_BIG_ENDIAN);
1767 if(tvb_length_remaining(info_tvb, info_offset+6))
1768 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+6, info_element_length, ENC_BIG_ENDIAN);
1769 if(tvb_length_remaining(info_tvb, info_offset+7))
1770 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+7, info_element_length, ENC_BIG_ENDIAN);
1771 if(tvb_length_remaining(info_tvb, info_offset+8))
1772 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+8, info_element_length, ENC_BIG_ENDIAN);
1773 if(tvb_length_remaining(info_tvb, info_offset+9))
1774 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+9, info_element_length, ENC_BIG_ENDIAN);
1775 if(tvb_length_remaining(info_tvb, info_offset+10))
1776 proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+10, info_element_length, ENC_BIG_ENDIAN);
1780 static void
1781 dissect_bcc_rejct_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1783 proto_tree *info_tree = NULL;
1784 proto_item *ti_info;
1785 guint8 info_element_length = 1;
1786 guint8 info_element = 0;
1788 guint16 data_length;
1789 tvbuff_t *info_tvb;
1790 int info_offset = 0;
1792 info_element = tvb_get_guint8(tvb, offset);
1794 data_length = tvb_get_guint8(tvb, offset+1)+2;
1795 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1797 if (tree) {
1798 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1799 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1802 if (info_tree != NULL) {
1803 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1804 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1805 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1806 proto_tree_add_item(info_tree, hf_v52_reject_cause_type, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1808 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1809 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, reject_cause_type_values, "Unknown element"));
1813 static void
1814 dissect_bcc_protocol_error_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1816 proto_tree *info_tree = NULL;
1817 proto_item *ti_info;
1818 guint8 info_element_length = 1;
1819 guint8 info_element = 0;
1821 guint16 data_length;
1822 tvbuff_t *info_tvb;
1823 int info_offset = 0;
1825 info_element = tvb_get_guint8(tvb, offset);
1827 data_length = tvb_get_guint8(tvb, offset+1)+2;
1828 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1830 if (tree) {
1831 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1832 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1835 if (info_tree != NULL) {
1836 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1837 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1838 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1839 proto_tree_add_item(info_tree, hf_v52_bcc_protocol_error_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1841 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1842 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, bcc_protocol_error_cause_type_values, "Unknown element"));
1844 if(tvb_length_remaining(info_tvb, info_offset+3))
1845 proto_tree_add_item(info_tree, hf_v52_diagnostic_message, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
1846 if(tvb_length_remaining(info_tvb, info_offset+4))
1847 proto_tree_add_item(info_tree, hf_v52_diagnostic_information, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
1851 static void
1852 dissect_connection_incomplete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1854 proto_tree *info_tree = NULL;
1855 proto_item *ti_info;
1856 guint8 info_element_length = 1;
1857 guint8 info_element = 0;
1859 guint16 data_length;
1860 tvbuff_t *info_tvb;
1861 int info_offset = 0;
1863 info_element = tvb_get_guint8(tvb, offset);
1865 data_length = tvb_get_guint8(tvb, offset+1)+2;
1866 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1868 if (tree) {
1869 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1870 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1873 if (info_tree != NULL) {
1874 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1875 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1876 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1877 proto_tree_add_item(info_tree, hf_v52_connection_incomplete_reason, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1880 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1881 if ((tvb_get_guint8(info_tvb, info_offset+2) < 0x80)) {
1882 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2), connection_incomplete_reason_values, "Unknown element"));
1884 else {
1885 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, connection_incomplete_reason_values, "Unknown element"));
1891 static void
1892 dissect_link_control_function(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
1894 proto_tree *info_tree = NULL;
1895 proto_item *ti_info;
1896 guint8 info_element_length = 1;
1897 guint8 info_element = 0;
1899 guint16 data_length;
1900 tvbuff_t *info_tvb;
1901 int info_offset = 0;
1903 info_element = tvb_get_guint8(tvb, offset);
1905 data_length = tvb_get_guint8(tvb, offset+1)+2;
1906 info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
1908 if (tree) {
1909 ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
1910 info_tree = proto_item_add_subtree(ti_info, ett_v52_info);
1913 if (info_tree != NULL) {
1914 proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
1915 proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
1916 proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
1917 proto_tree_add_item(info_tree, hf_v52_link_control_function, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
1919 if (message_type_tmp == 0x31) {}
1920 else {
1921 col_append_str(pinfo->cinfo, COL_INFO, " | ");
1922 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, link_control_function_values, "Unknown element"));
1929 static void
1930 dissect_v52_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1932 int offset = 4;
1933 guint8 info_element, info_element_length;
1934 /*int old_offset;*/
1935 int singleoctet;
1937 while(tvb_length_remaining(tvb,offset) > 0){
1938 singleoctet = 0;
1939 /* old_offset = offset; */
1940 info_element = tvb_get_guint8(tvb, offset);
1941 switch(info_element){
1942 case PSTN_SEQUENCE_NUMBER:
1943 info_element_length = tvb_get_guint8(tvb,offset+1);
1944 dissect_pstn_sequence_number(tvb, pinfo, tree, offset);
1945 offset +=info_element_length+2;
1946 break;
1947 case CADENCED_RINGING:
1948 info_element_length = tvb_get_guint8(tvb,offset+1);
1949 dissect_cadenced_ring(tvb, pinfo, tree, offset);
1950 offset +=info_element_length+2;
1951 break;
1952 case PULSED_SIGNAL:
1953 info_element_length = tvb_get_guint8(tvb,offset+1);
1954 dissect_pulsed_signal(tvb, pinfo, tree, offset);
1955 offset +=info_element_length+2;
1956 break;
1957 case STEADY_SIGNAL:
1958 info_element_length = tvb_get_guint8(tvb,offset+1);
1959 dissect_steady_signal(tvb, pinfo, tree, offset);
1960 offset +=info_element_length+2;
1961 break;
1962 case DIGIT_SIGNAL:
1963 info_element_length = tvb_get_guint8(tvb,offset+1);
1964 dissect_digit_signal(tvb, pinfo, tree, offset);
1965 offset +=info_element_length+2;
1966 break;
1967 case RECOGNITION_TIME:
1968 info_element_length = tvb_get_guint8(tvb,offset+1);
1969 dissect_recognition_time(tvb, pinfo, tree, offset);
1970 offset +=info_element_length+2;
1971 break;
1972 case ENABLE_AUTO_ACK:
1973 info_element_length = tvb_get_guint8(tvb,offset+1);
1974 dissect_enable_auto_ack(tvb, pinfo, tree, offset);
1975 offset +=info_element_length+2;
1976 break;
1977 case DISABLE_AUTO_ACK:
1978 info_element_length = tvb_get_guint8(tvb,offset+1);
1979 dissect_disable_auto_ack(tvb, pinfo, tree, offset);
1980 offset +=info_element_length+2;
1981 break;
1982 case CAUSE:
1983 info_element_length = tvb_get_guint8(tvb,offset+1);
1984 dissect_cause(tvb, pinfo, tree, offset);
1985 offset +=info_element_length+2;
1986 break;
1987 case RESOURCE_UNAVAILABLE:
1988 info_element_length = tvb_get_guint8(tvb,offset+1);
1989 dissect_resource_unavailable(tvb, pinfo, tree, offset);
1990 offset +=info_element_length+2;
1991 break;
1992 case PULSE_NOTIFICATION:
1993 dissect_pulse_notification(tvb, pinfo, tree, offset);
1994 singleoctet = 1;
1995 break;
1996 case LINE_INFORMATION:
1997 dissect_line_information(tvb, pinfo, tree, offset);
1998 singleoctet = 1;
1999 break;
2000 case STATE:
2001 dissect_state(tvb, pinfo, tree, offset);
2002 singleoctet = 1;
2003 break;
2004 case AUTO_SIG_SEQUENCE:
2005 dissect_auto_sig_sequence(tvb, pinfo, tree, offset);
2006 singleoctet = 1;
2007 break;
2008 case SEQUENCE_RESPONSE:
2009 dissect_sequence_response(tvb, pinfo, tree, offset);
2010 singleoctet = 1;
2011 break;
2013 case CONTROL_FUNCTION_ELEMENT:
2014 info_element_length = tvb_get_guint8(tvb,offset+1);
2015 dissect_control_function_element(tvb, pinfo, tree, offset);
2016 offset +=info_element_length+2;
2017 break;
2018 case CONTROL_FUNCTION_ID:
2019 info_element_length = tvb_get_guint8(tvb,offset+1);
2020 dissect_control_function_id(tvb, pinfo, tree, offset);
2021 offset +=info_element_length+2;
2022 break;
2023 case VARIANT:
2024 info_element_length = tvb_get_guint8(tvb,offset+1);
2025 dissect_variant(tvb, pinfo, tree, offset);
2026 offset +=info_element_length+2;
2027 break;
2028 case INTERFACE_ID:
2029 info_element_length = tvb_get_guint8(tvb,offset+1);
2030 dissect_interface_id(tvb, pinfo, tree, offset);
2031 offset +=info_element_length+2;
2032 break;
2033 case SEQUENCE_NUMBER:
2034 info_element_length = tvb_get_guint8(tvb,offset+1);
2035 dissect_sequence_number(tvb, pinfo, tree, offset);
2036 offset +=info_element_length+2;
2037 break;
2038 case C_CHANNEL_ID:
2039 info_element_length = tvb_get_guint8(tvb,offset+1);
2040 dissect_physical_c_channel_id(tvb, pinfo, tree, offset);
2041 offset +=info_element_length+2;
2042 break;
2043 case PP_REJECTION_CAUSE:
2044 info_element_length = tvb_get_guint8(tvb,offset+1);
2045 dissect_pp_rejection_cause(tvb, pinfo, tree, offset);
2046 offset +=info_element_length+2;
2047 break;
2048 case PROTOCOL_ERROR:
2049 info_element_length = tvb_get_guint8(tvb,offset+1);
2050 dissect_protocol_error(tvb, pinfo, tree, offset);
2051 offset +=info_element_length+2;
2052 break;
2053 case PERFORMANCE_GRADING:
2054 dissect_performance_grading(tvb, pinfo, tree, offset);
2055 singleoctet = 1;
2056 break;
2057 case CP_REJECTION_CAUSE:
2058 dissect_cp_rejection_cause(tvb, pinfo, tree, offset);
2059 singleoctet = 1;
2060 break;
2061 case USER_PORT_ID:
2062 info_element_length = tvb_get_guint8(tvb,offset+1);
2063 dissect_user_port_identification(tvb, pinfo, tree, offset);
2064 offset +=info_element_length+2;
2065 break;
2066 case ISDN_PORT_TS_ID:
2067 info_element_length = tvb_get_guint8(tvb,offset+1);
2068 dissect_isdn_port_time_slot_identification(tvb, pinfo, tree, offset);
2069 offset +=info_element_length+2;
2070 break;
2071 case V5_TIME_SLOT_ID:
2072 info_element_length = tvb_get_guint8(tvb,offset+1);
2073 dissect_v5_time_slot_identification(tvb, pinfo, tree, offset);
2074 offset +=info_element_length+2;
2075 break;
2076 case MULTI_SLOT_MAP:
2077 info_element_length = tvb_get_guint8(tvb,offset+1);
2078 dissect_multi_slot_map(tvb, pinfo, tree, offset);
2079 offset +=info_element_length+2;
2080 break;
2081 case BCC_REJECT_CAUSE:
2082 info_element_length = tvb_get_guint8(tvb,offset+1);
2083 dissect_bcc_rejct_cause(tvb, pinfo, tree, offset);
2084 offset +=info_element_length+2;
2085 break;
2086 case BCC_PROTOCOL_ERROR_CAUSE:
2087 info_element_length = tvb_get_guint8(tvb,offset+1);
2088 dissect_bcc_protocol_error_cause(tvb, pinfo, tree, offset);
2089 offset +=info_element_length+2;
2090 break;
2091 case CONNECTION_INCOMPLETE:
2092 info_element_length = tvb_get_guint8(tvb,offset+1);
2093 dissect_connection_incomplete(tvb, pinfo, tree, offset);
2094 offset +=info_element_length+2;
2095 break;
2096 case LINK_CONTROL_FUNCTION:
2097 info_element_length = tvb_get_guint8(tvb,offset+1);
2098 dissect_link_control_function(tvb, pinfo, tree, offset);
2099 offset +=info_element_length+2;
2100 break;
2101 default:
2102 offset += 1;
2103 break;
2105 if (singleoctet == 1) {
2106 offset += 1;
2108 #if 0
2109 if (old_offset <= offset) {
2110 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_WARN, "Zero-length information element");
2111 return;
2113 #endif
2118 static void
2119 dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2121 int offset = 0;
2122 proto_tree *v52_tree = NULL;
2123 proto_item *ti;
2124 gboolean addr = FALSE;
2125 guint8 bcc_all_address_tmp_up = -1;
2126 guint16 pstn_all_address_tmp, isdn_all_address_tmp, bcc_all_address_tmp;
2127 guint16 prot_all_address_tmp, link_all_address_tmp;
2129 col_set_str(pinfo->cinfo, COL_PROTOCOL, "V52");
2131 if (tree) {
2132 ti = proto_tree_add_item(tree, proto_v52, tvb, offset, -1, ENC_NA);
2133 v52_tree = proto_item_add_subtree(ti, ett_v52);
2135 dissect_v52_protocol_discriminator(tvb, offset, v52_tree);
2139 if (v52_tree != NULL) {
2142 message_type_tmp = tvb_get_guint8(tvb, MSG_TYPE_OFFSET);
2144 if ((message_type_tmp >= 0x00) && (message_type_tmp <= 0x0e)) {
2145 addr = TRUE;
2146 proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2147 proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2149 pstn_all_address_tmp = (((tvb_get_guint8(tvb,ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb,LOW_ADDRESS_OFFSET)));
2152 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp);
2155 if ((message_type_tmp >= 0x10) && (message_type_tmp <= 0x13)) {
2156 addr = TRUE;
2157 if ((tvb_get_guint8(tvb, ADDRESS_OFFSET)&0x01) == 0x1) {
2158 pstn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)));
2159 proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2160 proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2162 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp);
2164 else {
2165 isdn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>2)<<7)+((tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)>>1)));
2166 proto_tree_add_item(v52_tree, hf_v52_isdn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2167 proto_tree_add_item(v52_tree, hf_v52_isdn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2169 col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", isdn_all_address_tmp);
2173 if ((message_type_tmp == 0x30) || (message_type_tmp == 0x31)) {
2174 addr = TRUE;
2175 link_all_address_tmp = tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET);
2176 proto_tree_add_item(v52_tree, hf_v52_link_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2177 proto_tree_add_item(v52_tree, hf_v52_link_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2179 col_append_fstr(pinfo->cinfo, COL_INFO, " | LinkId: %u", link_all_address_tmp);
2182 if ((message_type_tmp >= 0x20) && (message_type_tmp <= 0x2a)) {
2183 addr = TRUE;
2184 proto_tree_add_item(v52_tree, hf_v52_bcc_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2185 proto_tree_add_item(v52_tree, hf_v52_bcc_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2187 bcc_all_address_tmp_up = tvb_get_guint8(tvb, ADDRESS_OFFSET);
2188 if (bcc_all_address_tmp_up >= 128) {
2189 bcc_all_address_tmp_up = bcc_all_address_tmp_up - 128;
2191 bcc_all_address_tmp = (bcc_all_address_tmp_up<<6) + tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET);
2193 col_append_fstr(pinfo->cinfo, COL_INFO, " | ref: %u", bcc_all_address_tmp);
2196 if ((message_type_tmp >= 0x18) && (message_type_tmp <= 0x1f)) {
2197 addr = TRUE;
2198 prot_all_address_tmp = (tvb_get_guint8(tvb, ADDRESS_OFFSET)<<8) + (tvb_get_guint8(tvb,LOW_ADDRESS_OFFSET));
2199 proto_tree_add_item(v52_tree, hf_v52_prot_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2200 proto_tree_add_item(v52_tree, hf_v52_prot_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2202 if ((message_type_tmp == 0x1e) || (message_type_tmp == 0x1f)) {}
2203 else {
2204 col_append_fstr(pinfo->cinfo, COL_INFO, " | Log C-ch: %u", prot_all_address_tmp);
2208 if (addr == FALSE) {
2209 if ((tvb_get_guint8(tvb, ADDRESS_OFFSET)&0x01) == 0x1) {
2210 pstn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)));
2211 proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2212 proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2214 col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp);
2217 else {
2218 isdn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>2)<<7)+((tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)>>1)));
2219 proto_tree_add_item(v52_tree, hf_v52_isdn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2220 proto_tree_add_item(v52_tree, hf_v52_isdn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN);
2222 col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", isdn_all_address_tmp);
2227 proto_tree_add_item(v52_tree, hf_v52_msg_type, tvb, MSG_TYPE_OFFSET, MSG_TYPE_LENGTH, ENC_BIG_ENDIAN);
2230 col_append_str(pinfo->cinfo, COL_INFO, " | ");
2231 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(tvb, MSG_TYPE_OFFSET), msg_type_values_short, "Unknown msg type"));
2233 dissect_v52_info(tvb, pinfo, v52_tree);
2237 static void
2238 dissect_v52(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2240 dissect_v52_message(tvb, pinfo, tree);
2243 void
2244 proto_register_v52(void)
2246 static hf_register_info hf[] = {
2247 { &hf_v52_discriminator,
2248 { "Protocol discriminator", "v52.disc", FT_UINT8, BASE_HEX, NULL, 0x0,
2249 NULL, HFILL }},
2250 #if 0
2251 { &hf_v52_address,
2252 { "Address", "v52.address",
2253 FT_UINT8, BASE_HEX, NULL, 0xff,
2254 NULL, HFILL } },
2255 #endif
2256 #if 0
2257 { &hf_v52_low_address,
2258 { "Address Low", "v52.low_address",
2259 FT_UINT8, BASE_HEX, NULL, 0xff,
2260 NULL, HFILL } },
2261 #endif
2262 /* ISDN */
2263 { &hf_v52_isdn_address,
2264 { "Address isdn", "v52.isdn_address",
2265 FT_UINT8, BASE_HEX, NULL, 0xfc,
2266 NULL, HFILL } },
2267 { &hf_v52_isdn_low_address,
2268 { "Address isdn Low", "v52.isdn_low_address",
2269 FT_UINT8, BASE_HEX, NULL, 0xfe,
2270 NULL, HFILL } },
2271 /* PSTN */
2272 { &hf_v52_pstn_address,
2273 { "Address pstn", "v52.pstn_address",
2274 FT_UINT8, BASE_HEX, NULL, 0xfe,
2275 NULL, HFILL } },
2276 { &hf_v52_pstn_low_address,
2277 { "Address pstn Low", "v52.pstn_low_address",
2278 FT_UINT8, BASE_HEX, NULL, 0xff,
2279 NULL, HFILL } },
2280 /* LINK */
2281 { &hf_v52_link_address,
2282 { "Address link", "v52.link_address",
2283 FT_UINT8, BASE_HEX, NULL, 0xff,
2284 NULL, HFILL } },
2285 { &hf_v52_link_low_address,
2286 { "Address link Low", "v52.link_low_address",
2287 FT_UINT8, BASE_HEX, NULL, 0xff,
2288 NULL, HFILL } },
2289 /* BCC */
2290 { &hf_v52_bcc_address,
2291 { "Address bcc", "v52.bcc_address",
2292 FT_UINT8, BASE_HEX, NULL, 0x7f,
2293 NULL, HFILL } },
2294 { &hf_v52_bcc_low_address,
2295 { "Address bcc Low", "v52.bcc_low_address",
2296 FT_UINT8, BASE_HEX, NULL, 0x3f,
2297 NULL, HFILL } },
2298 /* PROTECTION */
2299 { &hf_v52_prot_address,
2300 { "Address prot", "v52.prot_address",
2301 FT_UINT8, BASE_HEX, NULL, 0xff,
2302 NULL, HFILL } },
2303 { &hf_v52_prot_low_address,
2304 { "Address prot Low", "v52.prot_low_address",
2305 FT_UINT8, BASE_HEX, NULL, 0xff,
2306 NULL, HFILL } },
2307 /* CONTROL */
2308 #if 0
2309 { &hf_v52_ctrl_address,
2310 { "Address ctrl", "v52.ctrl_address",
2311 FT_UINT8, BASE_HEX, NULL, 0xff,
2312 NULL, HFILL } },
2313 #endif
2314 #if 0
2315 { &hf_v52_ctrl_low_address,
2316 { "Address ctrl Low", "v52.ctrl_low_address",
2317 FT_UINT8, BASE_HEX, NULL, 0xff,
2318 NULL, HFILL } },
2319 #endif
2320 /* OTHER */
2321 {&hf_v52_msg_type,
2322 { "Message type", "v52.msg_type",
2323 FT_UINT8, BASE_HEX, VALS(msg_type_values), 0x0,
2324 NULL, HFILL } },
2325 {&hf_v52_info_element,
2326 { "Information element", "v52.info_element",
2327 FT_UINT8, BASE_HEX, VALS(info_element_values), 0x0,
2328 NULL, HFILL } },
2329 {&hf_v52_info_length,
2330 { "Information length", "v52.info_length",
2331 FT_UINT8, BASE_DEC, NULL, 0x0,
2332 NULL, HFILL } },
2333 {&hf_v52_pulse_notification,
2334 { "Pulse notification", "v52.pulse_notification",
2335 FT_UINT8, BASE_HEX, NULL, 0x0,
2336 NULL, HFILL } },
2337 {&hf_v52_pstn_sequence_number,
2338 { "Sequence number", "v52.pstn_sequence_number",
2339 FT_UINT8, BASE_HEX, NULL, 0x7f,
2340 NULL, HFILL } },
2341 {&hf_v52_cadenced_ring,
2342 { "Cadenced ring", "v52.cadenced_ring",
2343 FT_UINT8, BASE_HEX, NULL, 0x7f,
2344 NULL, HFILL } },
2345 {&hf_v52_pulse_type,
2346 { "Pulse Type", "v52.pulse_type",
2347 FT_UINT8, BASE_HEX, VALS(pulse_type_values), 0x0,
2348 NULL, HFILL } },
2349 {&hf_v52_suppression_indicator,
2350 { "Suppression indicator", "v52.suppression_indicator",
2351 FT_UINT8, BASE_HEX, VALS(suppression_indication_values), 0x60,
2352 NULL, HFILL } },
2353 {&hf_v52_pulse_duration,
2354 { "Pulse duration type", "v52.pulse_duration",
2355 FT_UINT8, BASE_HEX, NULL, 0x1f,
2356 NULL, HFILL } },
2357 {&hf_v52_ack_request_indicator,
2358 { "Ack request indicator", "v52.ack_request_indicator",
2359 FT_UINT8, BASE_HEX, VALS(ack_request_indication_values), 0x60,
2360 NULL, HFILL } },
2361 {&hf_v52_number_of_pulses,
2362 { "Number of pulses", "v52.number_of_pulses",
2363 FT_UINT8, BASE_DEC, NULL, 0x1f,
2364 NULL, HFILL } },
2365 {&hf_v52_steady_signal,
2366 { "Steady Signal", "v52.steady_signal",
2367 FT_UINT8, BASE_HEX, VALS(steady_signal_values), 0x7f,
2368 NULL, HFILL } },
2369 {&hf_v52_digit_ack,
2370 { "Digit ack request indication","v52.digit_ack",
2371 FT_BOOLEAN, 8, TFS(&tfs_digit_ack_values), 0x40,
2372 NULL, HFILL } },
2373 {&hf_v52_digit_spare,
2374 { "Digit spare","v52.digit_spare",
2375 FT_UINT8, BASE_HEX, NULL, 0x30,
2376 NULL, HFILL } },
2377 {&hf_v52_digit_info,
2378 { "Digit information", "v52.digit_info",
2379 FT_UINT8, BASE_HEX, NULL, 0x0f,
2380 NULL, HFILL } },
2381 {&hf_v52_duration_type,
2382 { "Duration Type", "v52.duration_type",
2383 FT_UINT8, BASE_HEX, NULL, 0x3f,
2384 NULL, HFILL } },
2385 {&hf_v52_res_unavailable,
2386 { "Resource unavailable", "v52.res_unavailable",
2387 FT_STRING, BASE_NONE,NULL, 0x0,
2388 NULL, HFILL } },
2389 {&hf_v52_line_info,
2390 { "Line_Information", "v52.line_info",
2391 FT_UINT8, BASE_HEX, VALS(line_info_values), 0x0f,
2392 NULL, HFILL } },
2393 {&hf_v52_state,
2394 { "PSTN FSM state", "v52.state",
2395 FT_UINT8, BASE_HEX, VALS(state_values), 0x0f,
2396 NULL, HFILL } },
2397 {&hf_v52_auto_signalling_sequence,
2398 { "Autonomous signalling sequence","v52.auto_signalling_sequence",
2399 FT_UINT8, BASE_HEX, NULL, 0x0f,
2400 NULL, HFILL } },
2401 {&hf_v52_sequence_response,
2402 { "Sequence response", "v52.sequence_response",
2403 FT_UINT8, BASE_HEX, NULL, 0x0f,
2404 NULL, HFILL } },
2405 {&hf_v52_control_function_element,
2406 { "Control function element", "v52.control_function_element",
2407 FT_UINT8, BASE_HEX, VALS(control_function_element_values), 0x7f,
2408 NULL, HFILL } },
2409 {&hf_v52_control_function_id,
2410 { "Control function ID", "v52.control_function",
2411 FT_UINT8, BASE_HEX, VALS(control_function_id_values), 0x7f,
2412 NULL, HFILL } },
2413 {&hf_v52_variant,
2414 { "Variant", "v52.variant",
2415 FT_UINT8, BASE_DEC, NULL, 0x7f,
2416 NULL, HFILL } },
2417 {&hf_v52_if_up_id,
2418 { "Interface up ID", "v52.interface_up_id",
2419 FT_UINT8, BASE_HEX, NULL, 0xff,
2420 NULL, HFILL } },
2421 {&hf_v52_if_id,
2422 { "Interface ID", "v52.interface_id",
2423 FT_UINT8, BASE_HEX, NULL, 0xff,
2424 NULL, HFILL } },
2425 {&hf_v52_if_low_id,
2426 { "Interface down ID", "v52.interface_low_id",
2427 FT_UINT8, BASE_HEX, NULL, 0xff,
2428 NULL, HFILL } },
2429 {&hf_v52_if_all_id,
2430 { "Interface all ID", "v52.interface_all_id",
2431 FT_UINT24, BASE_DEC, NULL, 0xffffff,
2432 NULL, HFILL } },
2433 {&hf_v52_sequence_number,
2434 { "Sequence number", "v52.sequence_number",
2435 FT_UINT8, BASE_HEX, NULL, 0x7f,
2436 NULL, HFILL } },
2437 {&hf_v52_v5_link_id,
2438 { "V5 2048 kbit/s Link Identifier", "v52.V5_ln_id",
2439 FT_UINT8, BASE_HEX, NULL, 0x0,
2440 NULL, HFILL } },
2441 {&hf_v52_v5_multi_slot_elements,
2442 { "Additional MS ID", "v52.add_ms_id",
2443 FT_UINT8, BASE_HEX, NULL, 0xff,
2444 NULL, HFILL } },
2445 {&hf_v52_v5_time_slot,
2446 { "V5 Time Slot Number", "v52.v5_time_slot",
2447 FT_UINT8, BASE_DEC, NULL, 0x1f,
2448 NULL, HFILL } },
2449 {&hf_v52_rejection_cause,
2450 { "Rejection cause", "v52.rejection_cause",
2451 FT_UINT8, BASE_HEX, VALS(rejection_cause_values), 0x7f,
2452 NULL, HFILL } },
2453 {&hf_v52_error_cause,
2454 { "Protocol Error Cause type", "v52.error_cause",
2455 FT_UINT8, BASE_HEX, VALS(error_cause_values), 0x7f,
2456 NULL, HFILL } },
2457 {&hf_v52_diagnostic_msg,
2458 { "Diagnostic message", "v52.diagnostic_message",
2459 FT_UINT8, BASE_HEX, NULL, 0x7f,
2460 NULL, HFILL } },
2461 {&hf_v52_diagnostic_element,
2462 { "Diagnostic element", "v52.diagnostic_element",
2463 FT_UINT8, BASE_HEX, NULL, 0x0,
2464 NULL, HFILL } },
2465 {&hf_v52_performance_grading,
2466 { "Performance grading", "v52.performance_grading",
2467 FT_UINT8, BASE_HEX, VALS(performance_grading_values), 0x0f,
2468 NULL, HFILL } },
2469 {&hf_v52_cp_rejection_cause,
2470 { "Rejection cp cause", "v52.cp_rejection_cause",
2471 FT_UINT8, BASE_HEX, VALS(cp_rejection_cause_values), 0x0f,
2472 NULL, HFILL } },
2473 {&hf_v52_pstn_user_port_id,
2474 { "PSTN User Port identification Value","v52.pstn_user_port_id",
2475 FT_UINT8, BASE_HEX, NULL, 0xfe,
2476 NULL, HFILL } },
2477 {&hf_v52_pstn_user_port_id_lower,
2478 { "PSTN User Port Identification Value (lower)","v52.pstn_user_port_id_lower",
2479 FT_UINT8, BASE_HEX, NULL, 0xff,
2480 NULL, HFILL } },
2481 {&hf_v52_isdn_user_port_id,
2482 { "ISDN User Port Identification Value","v52.isdn_user_port_id",
2483 FT_UINT8, BASE_HEX, NULL, 0xfc,
2484 NULL, HFILL } },
2485 {&hf_v52_isdn_user_port_id_lower,
2486 { "ISDN User Port Identification Value (lower)","v52.user_port_id_lower",
2487 FT_UINT8, BASE_HEX, NULL, 0xfe,
2488 NULL, HFILL } },
2489 {&hf_v52_isdn_user_port_ts_num,
2490 { "ISDN user port time slot number","v52.isdn_user_port_ts_num",
2491 FT_UINT8, BASE_HEX, NULL, 0x1f,
2492 NULL, HFILL } },
2493 {&hf_v52_override,
2494 { "Override", "v52.override",
2495 FT_BOOLEAN, 8, NULL, 0x20,
2496 NULL, HFILL } },
2497 {&hf_v52_reject_cause_type,
2498 { "Reject cause type", "v52.reject_cause_type",
2499 FT_UINT8, BASE_HEX, VALS(reject_cause_type_values), 0x7f,
2500 NULL, HFILL } },
2501 {&hf_v52_bcc_protocol_error_cause,
2502 { "Protocol error cause type", "v52.bcc_protocol_cause",
2503 FT_UINT8, BASE_HEX, VALS(bcc_protocol_error_cause_type_values),0x7f,
2504 NULL, HFILL } },
2505 {&hf_v52_diagnostic_message,
2506 { "Diagnostic message", "v52.diagnoatic_message",
2507 FT_UINT8, BASE_HEX, NULL, 0x7f,
2508 NULL, HFILL } },
2509 {&hf_v52_diagnostic_information,
2510 { "Diagnostic information", "v52.diagnostic_inforation",
2511 FT_UINT8, BASE_HEX, NULL, 0xff,
2512 NULL, HFILL } },
2513 {&hf_v52_connection_incomplete_reason,
2514 { "Reason", "v52.connection_incomplete_reason",
2515 FT_UINT8, BASE_HEX, VALS(connection_incomplete_reason_values), 0x0,
2516 NULL, HFILL } },
2517 {&hf_v52_link_control_function,
2518 { "Link control function","v52.link_control_function",
2519 FT_UINT8, BASE_HEX, VALS(link_control_function_values),0x7f,
2520 NULL, HFILL } },
2521 {&hf_v52_cause_type,
2522 { "Cause type", "v52.cause_type",
2523 FT_UINT8, BASE_HEX, VALS(cause_type_values), 0x7f,
2524 NULL, HFILL } }
2526 static gint *ett[] = {
2527 &ett_v52,
2528 &ett_v52_info,
2531 proto_v52 = proto_register_protocol("V5.2", "V5.2", "v52");
2532 proto_register_field_array (proto_v52, hf, array_length(hf));
2533 proto_register_subtree_array(ett, array_length(ett));
2535 register_dissector("v52", dissect_v52, proto_v52);
2539 void
2540 proto_reg_handoff_v52(void)
2545 * Editor modelines - http://www.wireshark.org/tools/modelines.html
2547 * Local variables:
2548 * c-basic-offset: 4
2549 * tab-width: 8
2550 * indent-tabs-mode: nil
2551 * End:
2553 * vi: set shiftwidth=4 tabstop=8 expandtab:
2554 * :indentSize=4:tabSize=8:noTabs=true: