Mark an unused parameter as such
[metze/wireshark/wip.git] / epan / tcap-persistentdata.h
1 /*
2  * tcap-persistentdata.h
3  * Definitions for lists and hash tables used in wireshark's tcap dissector
4  * for calculation of delays in tcap-transactions
5  * Copyright 2006 Florent Drouin (based on h225-persistentdata from Lars Roland)
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * $Id$
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26  */
27
28 #ifndef __tcapsrt_HASH__
29 #define __tcapsrt_HASH__
30
31 #include <epan/packet.h>
32 #include <epan/conversation.h>
33 #include <epan/dissectors/packet-tcap.h>
34 #include "ws_symbol_export.h"
35
36 /** @file
37  * lists and hash tables used in wireshark's tcap dissector
38  * for calculation of delays in tcap-calls
39  */
40
41 #define LENGTH_OID 23
42 struct tcaphash_context_t {
43   struct tcaphash_context_key_t * key;
44   guint32 session_id;
45   guint32 first_frame;
46   guint32 last_frame;
47   nstime_t begin_time;  /**< time of arrival of TC_BEGIN */
48   nstime_t end_time;    /**< time of closing message */
49   gboolean responded;   /**< true, if request has been responded */
50   gboolean closed;
51   gboolean upper_dissector;
52   gboolean oid_present;
53   gchar oid[LENGTH_OID+1];
54   gboolean subdissector_present;
55   dissector_handle_t subdissector_handle;
56   void (* callback) (tvbuff_t *,packet_info *, proto_tree *, struct tcaphash_context_t *);
57   struct tcaphash_begincall_t * begincall;
58   struct tcaphash_contcall_t * contcall;
59   struct tcaphash_endcall_t * endcall;
60   struct tcaphash_ansicall_t * ansicall;
61 };
62
63 struct tcaphash_begincall_t {
64   struct tcaphash_begin_info_key_t * beginkey;
65   struct tcaphash_context_t * context;
66   gboolean father;
67   struct tcaphash_begincall_t * next_begincall;
68   struct tcaphash_begincall_t * previous_begincall;
69 };
70
71 struct tcaphash_contcall_t {
72   struct tcaphash_cont_info_key_t * contkey;
73   struct tcaphash_context_t * context;
74   gboolean father;
75   struct tcaphash_contcall_t * next_contcall;
76   struct tcaphash_contcall_t * previous_contcall;
77 };
78
79 struct tcaphash_endcall_t {
80   struct tcaphash_end_info_key_t * endkey;
81   struct tcaphash_context_t * context;
82   gboolean father;
83   struct tcaphash_endcall_t * next_endcall;
84   struct tcaphash_endcall_t * previous_endcall;
85 };
86
87 struct tcaphash_ansicall_t {
88   struct tcaphash_ansi_info_key_t * ansikey;
89   struct tcaphash_context_t * context;
90   gboolean father;
91   struct tcaphash_ansicall_t * next_ansicall;
92   struct tcaphash_ansicall_t * previous_ansicall;
93 };
94
95 /** The Key for the hash table is the TCAP origine transaction identifier
96    of the TC_BEGIN containing the InitialDP */
97
98 struct tcaphash_context_key_t {
99   guint32 session_id;
100 };
101
102 struct tcaphash_begin_info_key_t {
103   guint32 hashKey;
104   guint32 tid;
105   guint32 opc_hash;
106   guint32 dpc_hash;
107 };
108
109 struct tcaphash_cont_info_key_t {
110   guint32 hashKey;
111   guint32 src_tid;
112   guint32 dst_tid;
113   guint32 opc_hash;
114   guint32 dpc_hash;
115 };
116
117 struct tcaphash_end_info_key_t {
118   guint32 hashKey;
119   guint32 tid;
120   guint32 opc_hash;
121   guint32 dpc_hash;
122 };
123
124 struct tcaphash_ansi_info_key_t {
125   guint32 hashKey;
126   guint32 tid;
127   guint32 opc_hash;
128   guint32 dpc_hash;
129 };
130
131
132 /** List of infos to store for the analyse */
133 struct tcapsrt_info_t {
134   guint32 tcap_session_id;
135   guint32 src_tid;
136   guint32 dst_tid;
137   guint8 ope;
138 };
139
140 /**
141  * Routine called when the TAP is initialized.
142  * so hash table are (re)created
143  */
144 void tcapsrt_init_routine(void);
145
146 /**
147  * Initialize the Message Info used by the main dissector
148  * Data are linked to a TCAP transaction
149  */
150 struct tcapsrt_info_t * tcapsrt_razinfo(void);
151
152 void tcapsrt_close(struct tcaphash_context_t * p_tcaphash_context,
153                    packet_info * pinfo _U_);
154
155 /**
156  * Service Response Time analyze
157  * Called just after dissector call
158  * Associate a TCAP context to a tcap session and display session related infomations
159  * like the first frame, the last, the session duration,
160  * and a uniq session identifier for the filtering
161  *
162  * For ETSI tcap, the TCAP context can be reached through three keys
163  * - a key (BEGIN) identifying the session according to the tcap source identifier
164  * - a key (CONT) identifying the established session (src_id and dst_id)
165  * - a key (END) identifying the session according to the tcap destination identifier
166  *
167  * For ANSI tcap, the TCAP context is reached through a uniq key
168  * - a key (ANSI) identifying the session according to the tcap identifier
169 */
170 struct tcaphash_context_t * tcapsrt_call_matching(tvbuff_t *tvb,
171                                                   packet_info * pinfo _U_,
172                                                   proto_tree *tree,
173                                                   struct tcapsrt_info_t * p_tcap_info);
174
175 WS_DLL_PUBLIC gboolean gtcap_StatSRT;
176
177 #endif /* __tcapsrt_HASH__*/