[Automatic update for 2016-03-13]
[metze/wireshark/wip.git] / asn1 / camel / packet-camel-template.h
1 /* packet-camel-template.h
2  * Routines for Camel
3  * Copyright 2004, Tim Endean <endeant@hotmail.com>
4  * Copyright 2005, Olivier Jacques <olivier.jacques@hp.com>
5  * Built from the gsm-map dissector Copyright 2004, Anders Broman <anders.broman@ericsson.com>
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  * References: ETSI 300 374
25  */
26 /*
27  * Indentation logic: this file is indented with 2 spaces indentation.
28  *                    there are no tabs.
29  */
30
31
32 #ifndef PACKET_CAMEL_H
33 #define PACKET_CAMEL_H
34
35 #include "ws_symbol_export.h"
36
37 void proto_reg_handoff_camel(void);
38 void proto_register_camel(void);
39
40 /* Defines for the camel taps */
41 #define camel_MAX_NUM_OPR_CODES 256
42
43 WS_DLL_PUBLIC const value_string camel_opr_code_strings[];
44 /* #include "packet-camel-exp.h"*/
45
46 /** @file
47 */
48 #define NB_CAMELSRT_CATEGORY 9+1 /**< Number of type of message */
49 /* for example TC_BEGIN with InitalDP, and TC_CONT with RequestReportBCSMEvent
50    is a category, we want to measure the delay between the two messages */
51
52 #define CAMELSRT_SESSION 1
53
54 #define CAMELSRT_VOICE_INITIALDP 2
55 #define CAMELSRT_VOICE_ACR1 3
56 #define CAMELSRT_VOICE_ACR2 4
57 #define CAMELSRT_VOICE_ACR3 5
58 #define CAMELSRT_VOICE_DISC 6
59
60 #define CAMELSRT_GPRS_INITIALDP 7
61 #define CAMELSRT_GPRS_REPORT 8
62
63 #define CAMELSRT_SMS_INITIALDP 9
64
65 WS_DLL_PUBLIC const value_string  camelSRTtype_naming[];
66
67 /** If we have a request message and its response,
68    (eg: ApplyCharging, ApplyChargingReport)
69    the frames numbers are stored in this structure */
70
71 struct camelsrt_category_t {
72   guint32 req_num;              /**< frame number request seen */
73   guint32 rsp_num;              /**< frame number response seen */
74   nstime_t req_time;    /**< arrival time of request */
75   gboolean responded;   /**< true, if request has been responded */
76 };
77
78 /** List of stored parameters for a Camel dialogue
79    All this parameters are linked to the hash table key below (use of Tid)
80    In case of same Tid reused, the Camel parameters are chained.
81    The right dialogue will be identified with the arrival time of the InitialDP */
82
83 struct camelsrt_call_t {
84   guint32 session_id;    /**< Identify the session, with an internal number */
85   struct tcaphash_context_t * tcap_context;
86   struct camelsrt_category_t category[NB_CAMELSRT_CATEGORY];
87 };
88
89
90 /** The Key for the hash table is the TCAP origine transaction identifier
91    of the TC_BEGIN containing the InitialDP */
92
93 struct camelsrt_call_info_key_t {
94   guint32 SessionIdKey;
95 };
96
97 /** Info for a couple of messages (or category)
98    The request must be available, not duplicated,
99    and once the corresponding response received,
100    we can deduce the Delta Time between Request/response */
101
102 struct camelsrt_msginfo_t {
103   gboolean request_available;
104   gboolean is_duplicate;
105   gboolean is_delta_time;
106   nstime_t req_time;
107   nstime_t delta_time;
108 };
109
110 /** List of infos to store for the analyse */
111
112 struct camelsrt_info_t {
113   guint32 tcap_session_id;
114   void * tcap_context;
115   guint8 opcode; /**< operation code of message received */
116   guint8 bool_msginfo[NB_CAMELSRT_CATEGORY]; /**< category for the received message */
117   struct camelsrt_msginfo_t msginfo[NB_CAMELSRT_CATEGORY];
118 };
119
120 /**
121  * Initialize the Message Info used by the main dissector
122  * Data are linked to a TCAP transaction
123  */
124 struct camelsrt_info_t * camelsrt_razinfo(void);
125
126 /**
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
131  */
132 void camelsrt_call_matching(tvbuff_t *tvb,
133                             packet_info * pinfo _U_,
134                             proto_tree *tree,
135                             struct camelsrt_info_t * p_camel_info);
136
137 WS_DLL_PUBLIC gboolean gcamel_StatSRT;
138
139 #endif  /* PACKET_camel_H */