2 * Routines for Message Transfer Part Level 3 dissection
4 * It is (hopefully) compliant to:
7 * GF 001-9001 (Chinese ITU variant)
9 * Copyright 2001, Michael Tuexen <tuexen [AT] fh-muenster.de>
10 * Updated for ANSI and Chinese ITU support by Jeff Morriss <jeff.morriss[AT]ulticom.com>
12 * $Id: packet-mtp3.c,v 1.26 2004/02/29 08:30:10 guy Exp $
14 * Ethereal - Network traffic analyzer
15 * By Gerald Combs <gerald@ethereal.com>
16 * Copyright 1998 Gerald Combs
18 * Copied from README.developer
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version 2
23 * of the License, or (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41 #ifdef NEED_SNPRINTF_H
45 #include <epan/packet.h>
48 /* Initialize the protocol and registered fields */
49 static int proto_mtp3 = -1;
50 static module_t *mtp3_module;
52 static int hf_mtp3_service_indicator = -1;
53 static int hf_mtp3_network_indicator = -1;
54 static int hf_mtp3_itu_spare = -1;
55 static int hf_mtp3_ansi_priority = -1;
56 static int hf_mtp3_itu_opc = -1;
57 static int hf_mtp3_24bit_opc = -1;
58 static int hf_mtp3_ansi_opc = -1;
59 static int hf_mtp3_chinese_opc = -1;
60 static int hf_mtp3_opc_network = -1;
61 static int hf_mtp3_opc_cluster = -1;
62 static int hf_mtp3_opc_member = -1;
63 static int hf_mtp3_itu_dpc = -1;
64 static int hf_mtp3_24bit_dpc = -1;
65 static int hf_mtp3_ansi_dpc = -1;
66 static int hf_mtp3_chinese_dpc = -1;
67 static int hf_mtp3_dpc_network = -1;
68 static int hf_mtp3_dpc_cluster = -1;
69 static int hf_mtp3_dpc_member = -1;
70 static int hf_mtp3_itu_sls = -1;
71 static int hf_mtp3_ansi_5_bit_sls = -1;
72 static int hf_mtp3_ansi_8_bit_sls = -1;
73 static int hf_mtp3_chinese_itu_sls = -1;
75 /* Initialize the subtree pointers */
76 static gint ett_mtp3 = -1;
77 static gint ett_mtp3_sio = -1;
78 static gint ett_mtp3_label = -1;
79 static gint ett_mtp3_label_dpc = -1;
80 static gint ett_mtp3_label_opc = -1;
82 static dissector_table_t mtp3_sio_dissector_table;
84 #include <packet-mtp3.h>
85 Standard_Type mtp3_standard = ITU_STANDARD;
87 static gboolean mtp3_use_ansi_5_bit_sls = FALSE;
88 static mtp3_net_addr_fmt_e mtp3_net_addr_fmt = MTP3_NET_ADDR_FMT_DASHED;
89 static mtp3_addr_pc_t mtp3_addr_dpc, mtp3_addr_opc;
93 #define ITU_ROUTING_LABEL_LENGTH 4
94 #define ITU_HEADER_LENGTH (SIO_LENGTH + ITU_ROUTING_LABEL_LENGTH)
95 #define ITU_SLS_LENGTH 1
98 #define ITU_SLS_OFFSET (SIO_OFFSET + ITU_HEADER_LENGTH - ITU_SLS_LENGTH)
99 #define ITU_ROUTING_LABEL_OFFSET (SIO_OFFSET + SIO_LENGTH)
100 #define ITU_MTP_PAYLOAD_OFFSET (SIO_OFFSET + ITU_HEADER_LENGTH)
102 #define ANSI_SLS_LENGTH 1
103 #define ANSI_ROUTING_LABEL_LENGTH (ANSI_PC_LENGTH + ANSI_PC_LENGTH + ANSI_SLS_LENGTH)
104 #define ANSI_HEADER_LENGTH (SIO_LENGTH + ANSI_ROUTING_LABEL_LENGTH)
106 #define ANSI_ROUTING_LABEL_OFFSET (SIO_OFFSET + SIO_LENGTH)
107 #define ANSI_DPC_OFFSET ANSI_ROUTING_LABEL_OFFSET
108 #define ANSI_OPC_OFFSET (ANSI_DPC_OFFSET + ANSI_PC_LENGTH)
109 #define ANSI_SLS_OFFSET (ANSI_OPC_OFFSET + ANSI_PC_LENGTH)
110 #define ANSI_MTP_PAYLOAD_OFFSET (SIO_OFFSET + ANSI_HEADER_LENGTH)
112 #define SERVICE_INDICATOR_MASK 0x0F
113 #define SPARE_MASK 0x30
114 #define ANSI_PRIORITY_MASK SPARE_MASK
115 #define NETWORK_INDICATOR_MASK 0xC0
116 #define ITU_DPC_MASK 0x00003FFF
117 #define ITU_OPC_MASK 0x0FFFC000
118 #define ITU_SLS_MASK 0xF0000000
120 #define ANSI_NETWORK_MASK 0x0000FF
121 #define ANSI_CLUSTER_MASK 0x00FF00
122 #define ANSI_MEMBER_MASK 0xFF0000
123 #define ANSI_5BIT_SLS_MASK 0x1F
124 #define ANSI_8BIT_SLS_MASK 0xFF
125 #define CHINESE_ITU_SLS_MASK 0xF
127 static const value_string service_indicator_code_vals[] = {
128 { 0x0, "Signalling Network Management Message (SNM)" },
129 { 0x1, "Maintenance Regular Message (MTN)" },
130 { 0x2, "Maintenance Special Message (MTNS)" },
134 { 0x6, "DUP (call and circuit related messages)" },
135 { 0x7, "DUP (facility registration and cancellation message)" },
136 { 0x8, "MTP testing user part" },
147 static const value_string network_indicator_vals[] = {
148 { 0x0, "International network" },
149 { 0x1, "Spare (for international use only)" },
150 { 0x2, "National network" },
151 { 0x3, "Reserved for national use" },
155 static dissector_handle_t data_handle;
159 * helper routine to format address to string
162 mtp3_addr_to_str_buf(
166 mtp3_addr_pc_t *addr_pc_p = (mtp3_addr_pc_t *) data;
168 switch (mtp3_net_addr_fmt)
170 case MTP3_NET_ADDR_FMT_DEC:
171 switch (addr_pc_p->type)
174 sprintf(buf, "%u", addr_pc_p->pc & ITU_PC_MASK);
177 /* assuming 24-bit */
178 sprintf(buf, "%u", addr_pc_p->pc & ANSI_PC_MASK);
183 case MTP3_NET_ADDR_FMT_HEX:
184 switch (addr_pc_p->type)
187 sprintf(buf, "%x", addr_pc_p->pc & ITU_PC_MASK);
190 /* assuming 24-bit */
191 sprintf(buf, "%x", addr_pc_p->pc & ANSI_PC_MASK);
196 case MTP3_NET_ADDR_FMT_NI_DEC:
197 switch (addr_pc_p->type)
200 sprintf(buf, "%u:%u", addr_pc_p->ni, addr_pc_p->pc & ITU_PC_MASK);
203 /* assuming 24-bit */
204 sprintf(buf, "%u:%u", addr_pc_p->ni, addr_pc_p->pc & ANSI_PC_MASK);
209 case MTP3_NET_ADDR_FMT_NI_HEX:
210 switch (addr_pc_p->type)
213 sprintf(buf, "%u:%x", addr_pc_p->ni, addr_pc_p->pc & ITU_PC_MASK);
216 /* assuming 24-bit */
217 sprintf(buf, "%u:%x", addr_pc_p->ni, addr_pc_p->pc & ANSI_PC_MASK);
225 case MTP3_NET_ADDR_FMT_DASHED:
226 switch (addr_pc_p->type)
229 sprintf(buf, "%u-%u-%u",
230 (addr_pc_p->pc & 0x3800) >> 11,
231 ((addr_pc_p->pc & 0x7f8) >> 3),
232 (addr_pc_p->pc & 0x07));
235 /* assuming 24-bit */
236 sprintf(buf, "%u-%u-%u",
237 (addr_pc_p->pc & ANSI_NETWORK_MASK),
238 ((addr_pc_p->pc & ANSI_CLUSTER_MASK) >> 8),
239 ((addr_pc_p->pc & ANSI_MEMBER_MASK) >> 16));
247 dissect_mtp3_sio(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mtp3_tree)
250 proto_item *sio_item;
251 proto_tree *sio_tree;
253 sio_item = proto_tree_add_text(mtp3_tree, tvb, SIO_OFFSET, SIO_LENGTH,
254 "Service information octet");
255 sio_tree = proto_item_add_subtree(sio_item, ett_mtp3_sio);
257 sio = tvb_get_guint8(tvb, SIO_OFFSET);
258 proto_tree_add_uint(sio_tree, hf_mtp3_network_indicator, tvb, SIO_OFFSET,
261 mtp3_addr_opc.ni = (sio & NETWORK_INDICATOR_MASK) >> 6;
262 mtp3_addr_dpc.ni = (sio & NETWORK_INDICATOR_MASK) >> 6;
264 switch(mtp3_standard){
266 proto_tree_add_uint(sio_tree, hf_mtp3_ansi_priority, tvb, SIO_OFFSET,
270 case CHINESE_ITU_STANDARD:
271 proto_tree_add_uint(sio_tree, hf_mtp3_itu_spare, tvb, SIO_OFFSET,
276 proto_tree_add_uint(sio_tree, hf_mtp3_service_indicator, tvb, SIO_OFFSET,
279 /* Store the SI so that subidissectors know what SI this msg is */
280 pinfo->private_data = (void *)(sio & SERVICE_INDICATOR_MASK);
284 dissect_mtp3_routing_label(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mtp3_tree)
286 guint32 label, dpc = 0, opc = 0;
288 proto_item *label_item, *label_dpc_item, *label_opc_item;
289 proto_tree *label_tree, *label_dpc_tree, *label_opc_tree;
290 char pc[ANSI_PC_STRING_LENGTH];
295 switch (mtp3_standard) {
297 label_item = proto_tree_add_text(mtp3_tree, tvb, ITU_ROUTING_LABEL_OFFSET,
298 ITU_ROUTING_LABEL_LENGTH, "Routing label");
299 label_tree = proto_item_add_subtree(label_item, ett_mtp3_label);
301 label = tvb_get_letohl(tvb, ITU_ROUTING_LABEL_OFFSET);
302 sls = tvb_get_guint8(tvb, ITU_SLS_OFFSET);
304 opc = (label & ITU_OPC_MASK) >> 14;
305 dpc = label & ITU_DPC_MASK;
308 proto_tree_add_uint(label_tree, hf_mtp3_itu_dpc, tvb,
309 ITU_ROUTING_LABEL_OFFSET, ITU_ROUTING_LABEL_LENGTH,
311 proto_item_append_text(label_dpc_item, " (%u-%u-%u)",
312 (dpc & 0x3800) >> 11,
313 ((dpc & 0x7f8) >> 3),
317 proto_tree_add_uint(label_tree, hf_mtp3_itu_opc, tvb,
318 ITU_ROUTING_LABEL_OFFSET, ITU_ROUTING_LABEL_LENGTH,
320 proto_item_append_text(label_opc_item, " (%u-%u-%u)",
321 (opc & 0x3800) >> 11,
322 ((opc & 0x7f8) >> 3),
325 proto_tree_add_uint(label_tree, hf_mtp3_itu_sls, tvb, ITU_SLS_OFFSET,
326 ITU_SLS_LENGTH, sls);
330 case CHINESE_ITU_STANDARD:
331 if (mtp3_standard == ANSI_STANDARD)
333 hf_dpc_string = &hf_mtp3_ansi_dpc;
334 hf_opc_string = &hf_mtp3_ansi_opc;
335 } else /* CHINESE_ITU_STANDARD */ {
336 hf_dpc_string = &hf_mtp3_chinese_dpc;
337 hf_opc_string = &hf_mtp3_chinese_opc;
340 /* Create the Routing Label Tree */
341 label_item = proto_tree_add_text(mtp3_tree, tvb, ANSI_ROUTING_LABEL_OFFSET,
342 ANSI_ROUTING_LABEL_LENGTH,
344 label_tree = proto_item_add_subtree(label_item, ett_mtp3_label);
346 /* create the DPC tree */
347 dpc = tvb_get_ntoh24(tvb, ANSI_DPC_OFFSET);
348 snprintf(pc, sizeof(pc), "%d-%d-%d", (dpc & ANSI_NETWORK_MASK),
349 ((dpc & ANSI_CLUSTER_MASK) >> 8),
350 ((dpc & ANSI_MEMBER_MASK) >> 16));
352 label_dpc_item = proto_tree_add_string_format(label_tree, *hf_dpc_string,
353 tvb, ANSI_DPC_OFFSET,
355 "DPC (%s) (%u)", pc, dpc);
357 label_dpc_tree = proto_item_add_subtree(label_dpc_item, ett_mtp3_label_dpc);
359 proto_tree_add_uint(label_dpc_tree, hf_mtp3_dpc_member, tvb,
360 ANSI_DPC_OFFSET + ANSI_MEMBER_OFFSET, ANSI_NCM_LENGTH,
362 proto_tree_add_uint(label_dpc_tree, hf_mtp3_dpc_cluster,tvb,
363 ANSI_DPC_OFFSET + ANSI_CLUSTER_OFFSET, ANSI_NCM_LENGTH,
365 proto_tree_add_uint(label_dpc_tree, hf_mtp3_dpc_network,tvb,
366 ANSI_DPC_OFFSET + ANSI_NETWORK_OFFSET, ANSI_NCM_LENGTH,
370 /* add full integer values of DPC as hidden for filtering purposes */
371 proto_tree_add_uint_hidden(label_dpc_tree, hf_mtp3_24bit_dpc, tvb, ANSI_DPC_OFFSET,
372 ANSI_PC_LENGTH, dpc);
374 /* create the OPC tree */
375 opc = tvb_get_ntoh24(tvb, ANSI_OPC_OFFSET);
376 snprintf(pc, sizeof(pc), "%d-%d-%d", (opc & ANSI_NETWORK_MASK),
377 ((opc & ANSI_CLUSTER_MASK) >> 8),
378 ((opc & ANSI_MEMBER_MASK) >> 16));
379 label_opc_item = proto_tree_add_string_format(label_tree, *hf_opc_string,
380 tvb, ANSI_OPC_OFFSET,
382 "OPC (%s) (%u)", pc, opc);
384 label_opc_tree = proto_item_add_subtree(label_opc_item, ett_mtp3_label_opc);
386 proto_tree_add_uint(label_opc_tree, hf_mtp3_opc_member, tvb,
387 ANSI_OPC_OFFSET + ANSI_MEMBER_OFFSET, ANSI_NCM_LENGTH,
389 proto_tree_add_uint(label_opc_tree, hf_mtp3_opc_cluster, tvb,
390 ANSI_OPC_OFFSET + ANSI_CLUSTER_OFFSET, ANSI_NCM_LENGTH,
392 proto_tree_add_uint(label_opc_tree, hf_mtp3_opc_network,tvb,
393 ANSI_OPC_OFFSET + ANSI_NETWORK_OFFSET, ANSI_NCM_LENGTH,
396 /* add full integer values of OPC as hidden for filtering purposes */
397 proto_tree_add_uint_hidden(label_opc_tree, hf_mtp3_24bit_opc, tvb, ANSI_OPC_OFFSET,
398 ANSI_PC_LENGTH, opc);
401 if (mtp3_standard == ANSI_STANDARD)
403 if (mtp3_use_ansi_5_bit_sls)
404 proto_tree_add_item(label_tree, hf_mtp3_ansi_5_bit_sls, tvb,
405 ANSI_SLS_OFFSET, ANSI_SLS_LENGTH, TRUE);
407 proto_tree_add_item(label_tree, hf_mtp3_ansi_8_bit_sls, tvb,
408 ANSI_SLS_OFFSET, ANSI_SLS_LENGTH, TRUE);
409 } else /* CHINESE_ITU_STANDARD */ {
410 proto_tree_add_item(label_tree, hf_mtp3_chinese_itu_sls, tvb,
411 ANSI_SLS_OFFSET, ITU_SLS_LENGTH, FALSE);
417 mtp3_addr_opc.type = mtp3_standard;
418 mtp3_addr_opc.pc = opc;
419 SET_ADDRESS(&pinfo->net_src, AT_SS7PC, sizeof(mtp3_addr_opc), (guint8 *) &mtp3_addr_opc);
421 mtp3_addr_dpc.type = mtp3_standard;
422 mtp3_addr_dpc.pc = dpc;
423 SET_ADDRESS(&pinfo->net_dst, AT_SS7PC, sizeof(mtp3_addr_dpc), (guint8 *) &mtp3_addr_dpc);
427 dissect_mtp3_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
430 guint8 service_indicator;
431 tvbuff_t *payload_tvb = NULL;
433 sio = tvb_get_guint8(tvb, SIO_OFFSET);
434 service_indicator = sio & SERVICE_INDICATOR_MASK;
436 switch (mtp3_standard) {
438 payload_tvb = tvb_new_subset(tvb, ITU_MTP_PAYLOAD_OFFSET, -1, -1);
441 case CHINESE_ITU_STANDARD:
442 payload_tvb = tvb_new_subset(tvb, ANSI_MTP_PAYLOAD_OFFSET, -1, -1);
446 if (check_col(pinfo->cinfo, COL_INFO))
447 col_set_str(pinfo->cinfo, COL_INFO, "DATA ");
449 if (!dissector_try_port(mtp3_sio_dissector_table, service_indicator,
450 payload_tvb, pinfo, tree))
451 call_dissector(data_handle, payload_tvb, pinfo, tree);
454 /* Code to actually dissect the packets */
456 dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
459 /* Set up structures needed to add the protocol subtree and manage it */
460 proto_item *mtp3_item = NULL;
461 proto_tree *mtp3_tree = NULL;
463 /* Make entries in Protocol column on summary display */
464 if (check_col(pinfo->cinfo, COL_PROTOCOL))
465 switch(mtp3_standard) {
467 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (Int. ITU)");
470 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (ANSI)");
472 case CHINESE_ITU_STANDARD:
473 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (Chin. ITU)");
478 /* create display subtree for the protocol */
479 switch (mtp3_standard) {
481 mtp3_item = proto_tree_add_item(tree, proto_mtp3, tvb, 0,
482 ITU_HEADER_LENGTH, TRUE);
485 case CHINESE_ITU_STANDARD:
486 mtp3_item = proto_tree_add_item(tree, proto_mtp3, tvb, 0,
487 ANSI_HEADER_LENGTH, TRUE);
490 mtp3_tree = proto_item_add_subtree(mtp3_item, ett_mtp3);
494 /* Dissect the packet (even if !tree so can call sub-dissectors and update
495 * the source and destination address columns) */
496 dissect_mtp3_sio(tvb, pinfo, mtp3_tree);
497 dissect_mtp3_routing_label(tvb, pinfo, mtp3_tree);
498 dissect_mtp3_payload(tvb, pinfo, tree);
502 proto_register_mtp3(void)
505 /* Setup list of header fields See Section 1.6.1 for details*/
506 static hf_register_info hf[] = {
507 { &hf_mtp3_service_indicator,
508 { "Service indicator", "mtp3.service_indicator",
509 FT_UINT8, BASE_HEX, VALS(service_indicator_code_vals), SERVICE_INDICATOR_MASK,
511 { &hf_mtp3_network_indicator,
512 { "Network indicator", "mtp3.network_indicator",
513 FT_UINT8, BASE_HEX, VALS(network_indicator_vals), NETWORK_INDICATOR_MASK,
515 { &hf_mtp3_itu_spare,
516 { "Spare", "mtp3.spare",
517 FT_UINT8, BASE_HEX, NULL, SPARE_MASK,
519 { &hf_mtp3_ansi_priority,
520 { "Priority", "mtp3.priority",
521 FT_UINT8, BASE_HEX, NULL, ANSI_PRIORITY_MASK,
525 FT_UINT32, BASE_DEC, NULL, ITU_OPC_MASK,
527 { &hf_mtp3_24bit_opc,
529 FT_UINT32, BASE_DEC, NULL, ANSI_PC_MASK,
532 { "DPC", "mtp3.ansi_opc",
533 FT_STRING, BASE_NONE, NULL, 0x0,
535 { &hf_mtp3_chinese_opc,
536 { "DPC", "mtp3.chinese_opc",
537 FT_STRING, BASE_NONE, NULL, 0x0,
539 { &hf_mtp3_opc_network,
540 { "OPC Network", "mtp3.opc.network",
541 FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK,
543 { &hf_mtp3_opc_cluster,
544 { "OPC Cluster", "mtp3.opc.cluster",
545 FT_UINT24, BASE_DEC, NULL, ANSI_CLUSTER_MASK,
547 { &hf_mtp3_opc_member,
548 { "OPC Member", "mtp3.opc.member",
549 FT_UINT24, BASE_DEC, NULL, ANSI_MEMBER_MASK,
553 FT_UINT32, BASE_DEC, NULL, ITU_DPC_MASK,
555 { &hf_mtp3_24bit_dpc,
557 FT_UINT32, BASE_DEC, NULL, ANSI_PC_MASK,
560 { "DPC", "mtp3.ansi_dpc",
561 FT_STRING, BASE_NONE, NULL, 0x0,
563 { &hf_mtp3_chinese_dpc,
564 { "DPC", "mtp3.chinese_dpc",
565 FT_STRING, BASE_NONE, NULL, 0x0,
567 { &hf_mtp3_dpc_network,
568 { "DPC Network", "mtp3.dpc.network",
569 FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK,
571 { &hf_mtp3_dpc_cluster,
572 { "DPC Cluster", "mtp3.dpc.cluster",
573 FT_UINT24, BASE_DEC, NULL, ANSI_CLUSTER_MASK,
575 { &hf_mtp3_dpc_member,
576 { "DPC Member", "mtp3.dpc.member",
577 FT_UINT24, BASE_DEC, NULL, ANSI_MEMBER_MASK,
580 { "Signalling Link Selector", "mtp3.sls",
581 FT_UINT32, BASE_DEC, NULL, ITU_SLS_MASK,
583 { &hf_mtp3_ansi_5_bit_sls,
584 { "Signalling Link Selector", "mtp3.sls",
585 FT_UINT8, BASE_DEC, NULL, ANSI_5BIT_SLS_MASK,
587 { &hf_mtp3_ansi_8_bit_sls,
588 { "Signalling Link Selector", "mtp3.sls",
589 FT_UINT8, BASE_DEC, NULL, ANSI_8BIT_SLS_MASK,
591 { &hf_mtp3_chinese_itu_sls,
592 { "Signalling Link Selector", "mtp3.sls",
593 FT_UINT8, BASE_DEC, NULL, CHINESE_ITU_SLS_MASK,
597 /* Setup protocol subtree array */
598 static gint *ett[] = {
606 static enum_val_t mtp3_options[] = {
607 { "ITU", ITU_STANDARD },
608 { "ANSI", ANSI_STANDARD },
609 { "Chinese ITU", CHINESE_ITU_STANDARD },
613 static enum_val_t mtp3_net_addr_fmt_str_e[] = {
614 { "Decimal", MTP3_NET_ADDR_FMT_DEC },
615 { "Hexadecimal", MTP3_NET_ADDR_FMT_HEX },
616 { "NI-Decimal", MTP3_NET_ADDR_FMT_NI_DEC },
617 { "NI-Hexadecimal", MTP3_NET_ADDR_FMT_NI_HEX },
618 { "Dashed", MTP3_NET_ADDR_FMT_DASHED },
622 /* Register the protocol name and description */
623 proto_mtp3 = proto_register_protocol("Message Transfer Part Level 3",
625 register_dissector("mtp3", dissect_mtp3, proto_mtp3);
627 /* Required function calls to register the header fields and subtrees used */
628 proto_register_field_array(proto_mtp3, hf, array_length(hf));
629 proto_register_subtree_array(ett, array_length(ett));
631 mtp3_sio_dissector_table = register_dissector_table("mtp3.service_indicator",
632 "MTP3 Service indicator",
635 mtp3_module = prefs_register_protocol(proto_mtp3, NULL);
637 prefs_register_enum_preference(mtp3_module, "standard", "MTP3 standard",
638 "The SS7 standard used in MTP3 packets",
639 (gint *)&mtp3_standard, mtp3_options, FALSE);
641 prefs_register_bool_preference(mtp3_module, "ansi_5_bit_sls",
642 "Use 5-bit SLS (ANSI only)",
643 "Use 5-bit (instead of 8-bit) SLS in ANSI MTP3 packets",
644 &mtp3_use_ansi_5_bit_sls);
646 prefs_register_enum_preference(mtp3_module, "net_addr_format", "Network Address Format",
647 "Format for point code in the network address columns",
648 (gint *)&mtp3_net_addr_fmt, mtp3_net_addr_fmt_str_e, FALSE);
652 proto_reg_handoff_mtp3(void)
654 dissector_handle_t mtp3_handle;
656 mtp3_handle = create_dissector_handle(dissect_mtp3, proto_mtp3);
658 dissector_add("wtap_encap", WTAP_ENCAP_MTP3, mtp3_handle);
660 data_handle = find_dissector("data");