3 * Copyright 2004, Tim Endean <endeant@hotmail.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include "ws_symbol_export.h"
18 /* TCAP component type */
19 #define TCAP_COMP_INVOKE 0xa1
20 #define TCAP_COMP_RRL 0xa2
21 #define TCAP_COMP_RE 0xa3
22 #define TCAP_COMP_REJECT 0xa4
23 #define TCAP_COMP_RRN 0xa7
26 #define ANSI_TC_INVOKE_L 0xe9
27 #define ANSI_TC_RRL 0xea
28 #define ANSI_TC_RE 0xeb
29 #define ANSI_TC_REJECT 0xec
30 #define ANSI_TC_INVOKE_N 0xed
31 #define ANSI_TC_RRN 0xee
34 #define TCAP_SEQ_TAG 0x30
35 #define TCAP_SET_TAG 0x31
37 #define TCAP_INVOKE_ID_TAG 0x02
38 #define TCAP_LINKED_ID_TAG 0x80
40 #define TCAP_EOC_LEN 2
42 #define TCAP_CONSTRUCTOR(TCtag) (TCtag & 0x20)
48 #define TC_ANSI_ABORT 5
51 struct tcap_private_t
{
52 bool acv
; /* Is the Application Context Version present */
56 char *TransactionID_str
;
62 * lists and hash tables used in wireshark's tcap dissector
63 * for calculation of delays in tcap-calls
67 struct tcaphash_context_t
{
68 struct tcaphash_context_key_t
* key
;
72 nstime_t begin_time
; /**< time of arrival of TC_BEGIN */
73 nstime_t end_time
; /**< time of closing message */
74 bool responded
; /**< true, if request has been responded */
78 char oid
[LENGTH_OID
+1];
79 bool subdissector_present
;
80 dissector_handle_t subdissector_handle
;
81 void (* callback
) (tvbuff_t
*,packet_info
*, proto_tree
*, struct tcaphash_context_t
*);
82 struct tcaphash_begincall_t
* begincall
;
83 struct tcaphash_contcall_t
* contcall
;
84 struct tcaphash_endcall_t
* endcall
;
85 struct tcaphash_ansicall_t
* ansicall
;
88 struct tcaphash_begincall_t
{
89 struct tcaphash_begin_info_key_t
* beginkey
;
90 struct tcaphash_context_t
* context
;
92 struct tcaphash_begincall_t
* next_begincall
;
93 struct tcaphash_begincall_t
* previous_begincall
;
96 struct tcaphash_contcall_t
{
97 struct tcaphash_cont_info_key_t
* contkey
;
98 struct tcaphash_context_t
* context
;
100 struct tcaphash_contcall_t
* next_contcall
;
101 struct tcaphash_contcall_t
* previous_contcall
;
104 struct tcaphash_endcall_t
{
105 struct tcaphash_end_info_key_t
* endkey
;
106 struct tcaphash_context_t
* context
;
108 struct tcaphash_endcall_t
* next_endcall
;
109 struct tcaphash_endcall_t
* previous_endcall
;
112 struct tcaphash_ansicall_t
{
113 struct tcaphash_ansi_info_key_t
* ansikey
;
114 struct tcaphash_context_t
* context
;
116 struct tcaphash_ansicall_t
* next_ansicall
;
117 struct tcaphash_ansicall_t
* previous_ansicall
;
120 /** The Key for the hash table is the TCAP origine transaction identifier
121 of the TC_BEGIN containing the InitialDP */
123 struct tcaphash_context_key_t
{
127 struct tcaphash_begin_info_key_t
{
133 struct tcaphash_cont_info_key_t
{
141 struct tcaphash_end_info_key_t
{
148 struct tcaphash_ansi_info_key_t
{
156 /** List of infos to store for the analyse */
157 struct tcapsrt_info_t
{
158 uint32_t tcap_session_id
;
165 * Initialize the Message Info used by the main dissector
166 * Data are linked to a TCAP transaction
168 struct tcapsrt_info_t
* tcapsrt_razinfo(void);
170 void tcapsrt_close(struct tcaphash_context_t
* p_tcaphash_context
,
171 packet_info
* pinfo _U_
);
174 * Service Response Time analyze
175 * Called just after dissector call
176 * Associate a TCAP context to a tcap session and display session related infomations
177 * like the first frame, the last, the session duration,
178 * and a uniq session identifier for the filtering
180 * For ETSI tcap, the TCAP context can be reached through three keys
181 * - a key (BEGIN) identifying the session according to the tcap source identifier
182 * - a key (CONT) identifying the established session (src_id and dst_id)
183 * - a key (END) identifying the session according to the tcap destination identifier
185 * For ANSI tcap, the TCAP context is reached through a uniq key
186 * - a key (ANSI) identifying the session according to the tcap identifier
188 struct tcaphash_context_t
* tcapsrt_call_matching(tvbuff_t
*tvb
,
189 packet_info
* pinfo _U_
,
191 struct tcapsrt_info_t
* p_tcap_info
);
193 WS_DLL_PUBLIC
bool gtcap_StatSRT
;
195 extern int tcap_standard
;
197 extern const value_string tcap_component_type_str
[];
198 void proto_reg_handoff_tcap(void);
199 void proto_register_tcap(void);
201 extern dissector_handle_t
get_itu_tcap_subdissector(uint32_t ssn
);
202 dissector_handle_t
get_ansi_tcap_subdissector(uint32_t ssn
);
204 extern void add_ansi_tcap_subdissector(uint32_t ssn
, dissector_handle_t dissector
);
205 WS_DLL_PUBLIC
void add_itu_tcap_subdissector(uint32_t ssn
, dissector_handle_t dissector
);
207 extern void delete_ansi_tcap_subdissector(uint32_t ssn
, dissector_handle_t dissector
);
208 WS_DLL_PUBLIC
void delete_itu_tcap_subdissector(uint32_t ssn
, dissector_handle_t dissector
);
210 extern void call_tcap_dissector(dissector_handle_t
, tvbuff_t
*, packet_info
*, proto_tree
*);
212 #include "packet-tcap-exp.h"
214 #endif /* PACKET_tcap_H */