5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __PACKET_MTP3_H_
24 #define __PACKET_MTP3_H_
29 CHINESE_ITU_STANDARD = 3,
32 #define HEURISTIC_FAILED_STANDARD 0xffff
34 extern gint mtp3_standard;
35 extern gboolean mtp3_heuristic_standard;
37 WS_VAR_IMPORT const value_string mtp3_standard_vals[];
40 MTP3_ADDR_FMT_DEC = 1,
41 MTP3_ADDR_FMT_HEX = 2,
42 MTP3_ADDR_FMT_NI_DEC = 3,
43 MTP3_ADDR_FMT_NI_HEX = 4,
44 MTP3_ADDR_FMT_DASHED = 5
45 } mtp3_net_addr_fmt_e;
47 typedef struct _mtp3_addr_pc_t {
53 typedef struct _mtp3_tap_rec_t {
54 mtp3_addr_pc_t addr_opc;
55 mtp3_addr_pc_t addr_dpc;
60 #define ITU_PC_LENGTH 2
61 #define ITU_PC_MASK 0x3FFF
63 #define ANSI_PC_LENGTH 3
64 #define ANSI_NCM_LENGTH 1
65 #define ANSI_NETWORK_OFFSET 2
66 #define ANSI_CLUSTER_OFFSET 1
67 #define ANSI_MEMBER_OFFSET 0
68 #define ANSI_PC_MASK 0xFFFFFF
69 #define ANSI_NETWORK_MASK 0xFF0000
70 #define ANSI_CLUSTER_MASK 0x00FF00
71 #define ANSI_MEMBER_MASK 0x0000FF
72 #define ANSI_PC_STRING_LENGTH 16
74 #define JAPAN_PC_LENGTH 2
75 #define JAPAN_PC_MASK 0xffff
77 extern void mtp3_addr_to_str_buf(const mtp3_addr_pc_t *addr_pc_p, gchar *buf, int buf_len);
78 extern void mtp3_pc_to_str_buf(const guint32 pc, gchar *buf, int buf_len);
79 extern gchar* mtp3_pc_to_str(const guint32 pc);
80 extern gboolean mtp3_pc_structured(void);
81 extern guint32 mtp3_pc_hash(const mtp3_addr_pc_t *addr_pc_p);
84 /* epan/to_str.c includes this file, but it does not include proto.h so
85 * it doesn't know about things like proto_tree. This function is not
86 * needed by to_str.c, so just don't prototype it there (or anywhere
89 extern void dissect_mtp3_3byte_pc(tvbuff_t *tvb, guint offset,
90 proto_tree *tree, gint ett_pc,
91 int hf_pc, int hf_pc_network,
92 int hf_pc_cluster, int hf_pc_member,
97 * the following allows TAP code access to the messages
98 * without having to duplicate it. With MSVC and a
99 * libwireshark.dll, we need a special declaration.
101 WS_VAR_IMPORT const value_string mtp3_service_indicator_code_short_vals[];
103 #define MTP_SI_SNM 0x0
104 #define MTP_SI_MTN 0x1
105 #define MTP_SI_MTNS 0x2
106 #define MTP_SI_SCCP 0x3
107 #define MTP_SI_TUP 0x4
108 #define MTP_SI_ISUP 0x5
109 #define MTP_SI_DUP_CC 0x6
110 #define MTP_SI_DUP_FAC 0x7
111 #define MTP_SI_MTP_TEST 0x8
112 #define MTP_SI_ISUP_B 0x9
113 #define MTP_SI_ISUP_S 0xa
114 #define MTP_SI_AAL2 0xc
115 #define MTP_SI_BICC 0xd
116 #define MTP_SI_GCP 0xe
119 * I only want to gather stats for non-spare SI codes
121 #define MTP3_NUM_SI_CODE 9
123 #define MTP3_NI_INT0 0x0
124 #define MTP3_NI_INT1 0x1
125 #define MTP3_NI_NAT0 0x2
126 #define MTP3_NI_NAT1 0x3
127 WS_VAR_IMPORT const value_string mtp3_network_indicator_vals[];