Fix the types of some multi-bit bitfields - they're not Booleans. Give
[metze/wireshark/wip.git] / epan / camel-persistentdata.h
1 /*
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
6  *
7  * $Id$
8  *
9  * Wireshark - Network traffic analyzer
10  * By Gerald Combs <gerald@wireshark.org>
11  * Copyright 1998 Gerald Combs
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 __CAMEL_PERSISTENTDATA_H__
29 #define __CAMEL_PERSISTENTDATA_H__
30
31 #include <epan/packet.h>
32 #include <epan/conversation.h>
33 #include <epan/dissectors/packet-camel.h>
34 #include <epan/tcap-persistentdata.h>
35 #include "ws_symbol_export.h"
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41 /** @file
42 */
43 #define NB_CAMELSRT_CATEGORY 9+1 /**< Number of type of message */
44 /* for example TC_BEGIN with InitalDP, and TC_CONT with RequestReportBCSMEvent
45    is a category, we want to measure the delay between the two messages */ 
46
47 #define CAMELSRT_SESSION 1
48
49 #define CAMELSRT_VOICE_INITIALDP 2
50 #define CAMELSRT_VOICE_ACR1 3
51 #define CAMELSRT_VOICE_ACR2 4
52 #define CAMELSRT_VOICE_ACR3 5
53 #define CAMELSRT_VOICE_DISC 6
54
55 #define CAMELSRT_GPRS_INITIALDP 7
56 #define CAMELSRT_GPRS_REPORT 8
57
58 #define CAMELSRT_SMS_INITIALDP 9
59
60 WS_DLL_PUBLIC const value_string  camelSRTtype_naming[];
61
62 /** If we have a request message and its response,
63    (eg: ApplyCharging, ApplyChargingReport)
64    the frames numbers are stored in this structure */ 
65
66 struct camelsrt_category_t {
67   guint32 req_num;              /**< frame number request seen */
68   guint32 rsp_num;              /**< frame number response seen */
69   nstime_t req_time;    /**< arrival time of request */
70   gboolean responded;   /**< true, if request has been responded */
71 };
72
73 /** List of stored parameters for a Camel dialogue
74    All this parameters are linked to the hash table key below (use of Tid)
75    In case of same Tid reused, the Camel parameters are chained.
76    The right dialogue will be identified with the arrival time of the InitialDP */
77
78 struct camelsrt_call_t {
79   guint32 session_id;    /**< Identify the session, with an internal number */
80   struct tcaphash_context_t * tcap_context;
81   struct camelsrt_category_t category[NB_CAMELSRT_CATEGORY];
82 };
83
84
85 /** The Key for the hash table is the TCAP origine transaction identifier 
86    of the TC_BEGIN containing the InitialDP */
87
88 struct camelsrt_call_info_key_t {
89   guint32 SessionIdKey;
90 };
91
92 /** Info for a couple of messages (or category)
93    The request must be available, not duplicated, 
94    and once the corresponding response received, 
95    we can deduce the Delta Time between Request/response */
96
97 struct camelsrt_msginfo_t {
98   gboolean request_available;
99   gboolean is_duplicate;
100   gboolean is_delta_time;
101   nstime_t req_time;
102   nstime_t delta_time;
103 };
104
105 /** List of infos to store for the analyse */
106
107 struct camelsrt_info_t { 
108   guint32 tcap_session_id;
109   void * tcap_context;
110   guint8 opcode; /**< operation code of message received */
111   guint8 bool_msginfo[NB_CAMELSRT_CATEGORY]; /**< category for the received message */
112   struct camelsrt_msginfo_t msginfo[NB_CAMELSRT_CATEGORY];
113 };
114
115 /**
116  * Routine called when the TAP is initialized.
117  * so hash table are (re)created
118  */
119 void camelsrt_init_routine(void);
120
121 /**
122  * Initialize the Message Info used by the main dissector
123  * Data are linked to a TCAP transaction
124  */
125 struct camelsrt_info_t * camelsrt_razinfo(void);
126
127 /**
128  * Service Response Time analyze, called just after the camel dissector
129  * According to the camel operation, we
130  * - open/close a context for the camel session
131  * - look for a request, or look for the corresponding response
132  */
133 void camelsrt_call_matching(tvbuff_t *tvb,
134                             packet_info * pinfo _U_,
135                             proto_tree *tree,
136                             struct camelsrt_info_t * p_camel_info);
137
138 WS_DLL_PUBLIC gboolean gcamel_StatSRT;
139
140 #ifdef __cplusplus
141 }
142 #endif /* __cplusplus */
143
144 #endif /* camel-persistentdata.h */