2 * camel-persistentdata.h
3 * Definitions for lists and hash tables used in wireshark's camel dissector
4 * for calculation of delays in camel-transactions
5 * Copyright 2006 Florent Drouin
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #ifndef __CAMEL_PERSISTENTDATA_H__
29 #define __CAMEL_PERSISTENTDATA_H__
31 #include <epan/packet.h>
32 #include <epan/conversation.h>
33 #include <epan/dissectors/packet-camel.h>
34 #include <epan/tcap-persistentdata.h>
38 #endif /* __cplusplus */
42 #define NB_CAMELSRT_CATEGORY 9+1 /**< Number of type of message */
43 /* for example TC_BEGIN with InitalDP, and TC_CONT with RequestReportBCSMEvent
44 is a category, we want to measure the delay between the two messages */
46 #define CAMELSRT_SESSION 1
48 #define CAMELSRT_VOICE_INITIALDP 2
49 #define CAMELSRT_VOICE_ACR1 3
50 #define CAMELSRT_VOICE_ACR2 4
51 #define CAMELSRT_VOICE_ACR3 5
52 #define CAMELSRT_VOICE_DISC 6
54 #define CAMELSRT_GPRS_INITIALDP 7
55 #define CAMELSRT_GPRS_REPORT 8
57 #define CAMELSRT_SMS_INITIALDP 9
59 WS_VAR_IMPORT const value_string camelSRTtype_naming[];
61 /** If we have a request message and its response,
62 (eg: ApplyCharging, ApplyChargingReport)
63 the frames numbers are stored in this structure */
65 struct camelsrt_category_t {
66 guint32 req_num; /**< frame number request seen */
67 guint32 rsp_num; /**< frame number response seen */
68 nstime_t req_time; /**< arrival time of request */
69 gboolean responded; /**< true, if request has been responded */
72 /** List of stored parameters for a Camel dialogue
73 All this parameters are linked to the hash table key below (use of Tid)
74 In case of same Tid reused, the Camel parameters are chained.
75 The right dialogue will be identified with the arrival time of the InitialDP */
77 struct camelsrt_call_t {
78 guint32 session_id; /**< Identify the session, with an internal number */
79 struct tcaphash_context_t * tcap_context;
80 struct camelsrt_category_t category[NB_CAMELSRT_CATEGORY];
84 /** The Key for the hash table is the TCAP origine transaction identifier
85 of the TC_BEGIN containing the InitialDP */
87 struct camelsrt_call_info_key_t {
91 /** Info for a couple of messages (or category)
92 The request must be available, not duplicated,
93 and once the corresponding response received,
94 we can deduce the Delta Time between Request/response */
96 struct camelsrt_msginfo_t {
97 gboolean request_available;
98 gboolean is_duplicate;
99 gboolean is_delta_time;
104 /** List of infos to store for the analyse */
106 struct camelsrt_info_t {
107 guint32 tcap_session_id;
109 guint8 opcode; /**< operation code of message received */
110 guint8 bool_msginfo[NB_CAMELSRT_CATEGORY]; /**< category for the received message */
111 struct camelsrt_msginfo_t msginfo[NB_CAMELSRT_CATEGORY];
115 * Routine called when the TAP is initialized.
116 * so hash table are (re)created
118 void camelsrt_init_routine(void);
121 * Initialize the Message Info used by the main dissector
122 * Data are linked to a TCAP transaction
124 struct camelsrt_info_t * camelsrt_razinfo(void);
127 * Service Response Time analyze, called just after the camel dissector
128 * According to the camel operation, we
129 * - open/close a context for the camel session
130 * - look for a request, or look for the corresponding response
132 void camelsrt_call_matching(tvbuff_t *tvb,
133 packet_info * pinfo _U_,
135 struct camelsrt_info_t * p_camel_info);
137 WS_VAR_IMPORT gboolean gcamel_StatSRT;
141 #endif /* __cplusplus */
143 #endif /* camel-persistentdata.h */