2 * VoIP calls summary addition for ethereal
6 * Copyright 2004, Ericsson , Spain
7 * By Francisco Alcoba <francisco.alcoba@ericsson.com>
9 * based on h323_calls.h
10 * Copyright 2004, Iskratel, Ltd, Kranj
11 * By Miha Jemec <m.jemec@iskratel.si>
13 * H323, RTP and Graph Support
14 * By Alejandro Vaquero, alejandro.vaquero@verso.com
15 * Copyright 2005, Verso Technologies Inc.
17 * Ethereal - Network traffic analyzer
18 * By Gerald Combs <gerald@ethereal.com>
19 * Copyright 1998 Gerald Combs
21 * This program is free software; you can redistribute it and/or
22 * modify it under the terms of the GNU General Public License
23 * as published by the Free Software Foundation; either version 2
24 * of the License, or (at your option) any later version.
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License
32 * along with this program; if not, write to the Free Software
33 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36 #ifndef VOIP_CALLS_H_INCLUDED
37 #define VOIP_CALLS_H_INCLUDED
41 #include <epan/address.h>
43 /****************************************************************************/
44 /* defines voip call state */
45 typedef enum _voip_call_state {
54 extern char *voip_call_state_name[6];
56 typedef enum _voip_call_active_state {
59 } voip_call_active_state;
61 typedef enum _voip_protocol {
67 extern char *voip_protocol_name[3];
69 /* defines specific SIP data */
71 typedef enum _sip_call_state {
77 typedef struct _sip_calls_info {
78 gchar *call_identifier;
80 sip_call_state sip_state;
83 /* defines specific ISUP data */
85 typedef struct _isup_calls_info {
91 typedef struct _h245_address {
96 /* defines specific H323 data */
97 typedef struct _h323_calls_info {
98 guint8 *guid; /* Call ID to identify a H225 */
99 GList* h245_list; /* list of H245 Address and ports for tunneling off calls*/
100 guint32 h225SetupAddr; /* we use the SETUP H225 IP to determine if packets are forward or reverse */
102 gboolean is_faststart_Setup; /* if faststart field is included in Setup*/
103 gboolean is_faststart_Proc; /* if faststart field is included in Proce, Alerting, Progress or Connect*/
104 gboolean is_h245Tunneling;
109 /* defines a voip call */
110 typedef struct _voip_calls_info {
111 voip_call_state call_state;
112 voip_call_active_state call_active_state;
113 gchar *from_identity;
116 guint32 initial_speaker;
118 guint32 first_frame_num; /* frame number of first frame */
119 guint32 last_frame_num;
120 voip_protocol protocol;
122 gint32 start_sec, start_usec, stop_sec, stop_usec;
127 /* structure that holds the information about all detected calls */
128 /* struct holding all information of the tap */
130 typedef struct _voip_calls_tapinfo {
131 int ncalls; /* number of calls in the list */
132 GList* strinfo_list; /* list with all calls */
133 int npackets; /* total number of packets of all calls */
134 voip_calls_info_t* filter_calls_fwd; /* used as filter in some tap modes */
135 guint32 launch_count; /* number of times the tap has been run */
139 graph_analysis_info_t* graph_analysis;
141 * Now add dummy variables, one for each tap listener.
142 * Their address will be used to distinguish between them.
151 } voip_calls_tapinfo_t;
154 /* defines a RTP stream */
155 typedef struct _voip_rtp_stream_info {
164 guint32 first_frame_num; /* frame number of first frame */
165 guint32 setup_frame_number; /* frame number of setup message */
166 /* start of recording (GMT) of this stream */
167 guint32 start_rel_sec; /* start stream rel seconds */
168 guint32 start_rel_usec; /* start stream rel microseconds */
169 guint32 stop_rel_sec; /* stop stream rel seconds */
170 guint32 stop_rel_usec; /* stop stream rel microseconds */
171 } voip_rtp_stream_info_t;
173 /* structure that holds the information about all RTP streams associated with the calls */
174 /* struct holding all information of the RTP tap */
175 typedef struct _voip_rtp_tapinfo {
176 int nstreams; /* number of rtp streams */
177 GList* list; /* list with the rtp streams */
179 } voip_rtp_tapinfo_t;
181 /****************************************************************************/
185 * Registers the voip_calls tap listeners (if not already done).
186 * From that point on, the calls list will be updated with every redissection.
187 * This function is also the entry point for the initialization routine of the tap system.
188 * So whenever voip_calls.c is added to the list of ETHEREAL_TAP_SRCs, the tap will be registered on startup.
189 * If not, it will be registered on demand by the voip_calls functions that need it.
191 void sip_calls_init_tap(void);
192 void isup_calls_init_tap(void);
193 void mtp3_calls_init_tap(void);
194 void h225_calls_init_tap(void);
195 void h245dg_calls_init_tap(void);
196 void q931_calls_init_tap(void);
197 void sdp_calls_init_tap(void);
198 void rtp_init_tap(void);
202 * Removes the voip_calls tap listener (if not already done)
203 * From that point on, the voip calls list won't be updated any more.
205 void remove_tap_listener_sip_calls(void);
206 void remove_tap_listener_isup_calls(void);
207 void remove_tap_listener_mtp3_calls(void);
208 void remove_tap_listener_h225_calls(void);
209 void remove_tap_listener_h245dg_calls(void);
210 void remove_tap_listener_q931_calls(void);
211 void remove_tap_listener_sdp_calls(void);
212 void remove_tap_listener_rtp(void);
215 * Retrieves a constant reference to the unique info structure of the voip_calls tap listener.
216 * The user should not modify the data pointed to.
218 const voip_calls_tapinfo_t* voip_calls_get_info(void);
221 * Cleans up memory of voip calls tap.
223 void voip_calls_reset(voip_calls_tapinfo_t *tapinfo);
224 void isup_calls_reset(voip_calls_tapinfo_t *tapinfo);
225 void mtp3_calls_reset(voip_calls_tapinfo_t *tapinfo);
226 void q931_calls_reset(voip_calls_tapinfo_t *tapinfo);
228 void graph_analysis_data_init(void);
230 #endif /*VOIP_CALLS_H_INCLUDED*/