epan/dissectors/pidl/ C99 drsuapi
[wireshark-sm.git] / epan / dissectors / asn1 / tcap / packet-tcap-template.h
blobabd2faeff9047c86f1d26adc5d22c11de64c6f17
1 /* packet-tcap.h
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
13 #ifndef PACKET_tcap_H
14 #define PACKET_tcap_H
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)
44 #define TC_BEGIN 1
45 #define TC_CONT 2
46 #define TC_END 3
47 #define TC_ABORT 4
48 #define TC_ANSI_ABORT 5
49 #define TC_ANSI_ALL 6
51 struct tcap_private_t {
52 bool acv; /* Is the Application Context Version present */
53 const void * oid;
54 uint32_t session_id;
55 void * context;
56 char *TransactionID_str;
57 uint32_t src_tid;
58 uint32_t dst_tid;
61 /** @file
62 * lists and hash tables used in wireshark's tcap dissector
63 * for calculation of delays in tcap-calls
66 #define LENGTH_OID 23
67 struct tcaphash_context_t {
68 struct tcaphash_context_key_t * key;
69 uint32_t session_id;
70 uint32_t first_frame;
71 uint32_t last_frame;
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 */
75 bool closed;
76 bool upper_dissector;
77 bool oid_present;
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;
91 bool father;
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;
99 bool father;
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;
107 bool father;
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;
115 bool father;
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 {
124 uint32_t session_id;
127 struct tcaphash_begin_info_key_t {
128 uint32_t hashKey;
129 uint32_t tid;
130 uint32_t pc_hash;
133 struct tcaphash_cont_info_key_t {
134 uint32_t hashKey;
135 uint32_t src_tid;
136 uint32_t dst_tid;
137 uint32_t opc_hash;
138 uint32_t dpc_hash;
141 struct tcaphash_end_info_key_t {
142 uint32_t hashKey;
143 uint32_t tid;
144 uint32_t opc_hash;
145 uint32_t dpc_hash;
148 struct tcaphash_ansi_info_key_t {
149 uint32_t hashKey;
150 uint32_t tid;
151 uint32_t opc_hash;
152 uint32_t dpc_hash;
156 /** List of infos to store for the analyse */
157 struct tcapsrt_info_t {
158 uint32_t tcap_session_id;
159 uint32_t src_tid;
160 uint32_t dst_tid;
161 uint8_t ope;
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_,
190 proto_tree *tree,
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 */