LATER... ei_kerberos_kdc_session_key ...
[wireshark-sm.git] / ui / voip_calls.h
blobc1fa3248caefa980077b2347fb6ccf2485575620
1 /** @file
3 * VoIP calls summary addition for Wireshark
5 * Copyright 2004, Ericsson , Spain
6 * By Francisco Alcoba <francisco.alcoba@ericsson.com>
8 * based on h323_calls.h
9 * Copyright 2004, Iskratel, Ltd, Kranj
10 * By Miha Jemec <m.jemec@iskratel.si>
12 * H323, RTP and Graph Support
13 * By Alejandro Vaquero, alejandro.vaquero@verso.com
14 * Copyright 2005, Verso Technologies Inc.
16 * Wireshark - Network traffic analyzer
17 * By Gerald Combs <gerald@wireshark.org>
18 * Copyright 1998 Gerald Combs
20 * SPDX-License-Identifier: GPL-2.0-or-later
23 #ifndef __VOIP_CALLS_H__
24 #define __VOIP_CALLS_H__
26 #include <glib.h>
28 #include <stdio.h>
30 #include "epan/address.h"
31 #include "epan/packet.h"
32 #include "epan/guid-utils.h"
33 #include "epan/tap.h"
34 #include "epan/tap-voip.h"
35 #include "epan/sequence_analysis.h"
37 /** @file
38 * "VoIP Calls" dialog box common routines.
39 * @ingroup main_ui_group
42 #ifdef __cplusplus
43 extern "C" {
44 #endif /* __cplusplus */
46 /****************************************************************************/
47 extern const char *voip_call_state_name[8];
49 typedef enum _voip_protocol {
50 VOIP_SIP,
51 VOIP_ISUP,
52 VOIP_H323,
53 VOIP_MGCP,
54 VOIP_AC_ISDN,
55 VOIP_AC_CAS,
56 MEDIA_T38,
57 TEL_H248,
58 TEL_SCCP,
59 TEL_BSSMAP,
60 TEL_RANAP,
61 VOIP_UNISTIM,
62 VOIP_SKINNY,
63 VOIP_IAX2,
64 VOIP_COMMON
65 } voip_protocol;
67 typedef enum _hash_indexes {
68 SIP_HASH=0
69 } hash_indexes;
71 extern const char *voip_protocol_name[];
73 typedef enum _flow_show_options
75 FLOW_ALL,
76 FLOW_ONLY_INVITES
77 } flow_show_options;
79 /** defines specific SIP data */
81 typedef enum _sip_call_state {
82 SIP_INVITE_SENT,
83 SIP_200_REC,
84 SIP_CANCEL_SENT
85 } sip_call_state;
87 typedef struct _sip_calls_info {
88 char *call_identifier;
89 uint32_t invite_cseq;
90 sip_call_state sip_state;
91 } sip_calls_info_t;
93 /** defines specific ISUP data */
94 typedef struct _isup_calls_info {
95 uint16_t cic;
96 uint32_t opc, dpc;
97 uint8_t ni;
98 } isup_calls_info_t;
100 /* defines specific H245 data */
101 typedef struct _h245_address {
102 address h245_address;
103 uint16_t h245_port;
104 } h245_address_t;
106 /** defines specific H323 data */
107 typedef struct _h323_calls_info {
108 e_guid_t *guid; /* Call ID to identify a H225 */
109 GList* h245_list; /**< list of H245 Address and ports for tunneling off calls*/
110 address h225SetupAddr; /**< we use the SETUP H225 IP to determine if packets are forward or reverse */
111 bool is_h245;
112 bool is_faststart_Setup; /**< if faststart field is included in Setup*/
113 bool is_faststart_Proc; /**< if faststart field is included in Proce, Alerting, Progress or Connect*/
114 bool is_h245Tunneling;
115 int32_t q931_crv;
116 int32_t q931_crv2;
117 unsigned requestSeqNum;
118 } h323_calls_info_t;
120 /**< defines specific MGCP data */
121 typedef struct _mgcp_calls_info {
122 char *endpointId;
123 bool fromEndpoint; /**< true if the call was originated from the Endpoint, false for calls from MGC */
124 } mgcp_calls_info_t;
126 /** defines specific ACTRACE ISDN data */
127 typedef struct _actrace_isdn_calls_info {
128 int32_t crv;
129 int trunk;
130 } actrace_isdn_calls_info_t;
132 /** defines specific ACTRACE CAS data */
133 typedef struct _actrace_cas_calls_info {
134 int32_t bchannel;
135 int trunk;
136 } actrace_cas_calls_info_t;
138 /** defines specific SKINNY data */
139 typedef struct _skinny_calls_info {
140 uint32_t callId;
141 } skinny_calls_info_t;
143 /** defines a voip call */
144 typedef struct _voip_calls_info {
145 voip_call_state call_state;
146 voip_call_active_state call_active_state;
147 char *call_id;
148 char *from_identity;
149 char *to_identity;
150 void * prot_info;
151 void (*free_prot_info)(void *);
152 address initial_speaker;
153 uint32_t npackets;
154 voip_protocol protocol;
155 char *protocol_name;
156 char *call_comment;
157 uint16_t call_num;
158 /**> The frame_data struct holds the frame number and timing information needed. */
159 frame_data *start_fd;
160 nstime_t start_rel_ts;
161 frame_data *stop_fd;
162 nstime_t stop_rel_ts;
163 } voip_calls_info_t;
166 * structure that holds the information about all detected calls */
167 /* struct holding all information of the tap */
169 * XXX Most of these are private to voip_calls.c. We might want to
170 * make them private.
172 struct _h245_labels;
173 typedef struct _voip_calls_tapinfo {
174 tap_reset_cb tap_reset; /**< tap reset callback */
175 tap_packet_cb tap_packet; /**< tap per-packet callback */
176 tap_draw_cb tap_draw; /**< tap draw callback */
177 void *tap_data; /**< data for tap callbacks */
178 int ncalls; /**< number of call */
179 GQueue* callsinfos; /**< queue with all calls (voip_calls_info_t) */
180 GHashTable* callsinfo_hashtable[1]; /**< array of hashes per voip protocol (voip_calls_info_t); currently only the one for SIP is used */
181 int npackets; /**< total number of packets of all calls */
182 voip_calls_info_t *filter_calls_fwd; /**< used as filter in some tap modes */
183 int start_packets;
184 int completed_calls;
185 int rejected_calls;
186 seq_analysis_info_t *graph_analysis;
187 epan_t *session; /**< epan session */
188 int nrtpstreams; /**< number of rtp streams */
189 GList* rtpstream_list; /**< list of rtpstream_info_t */
190 uint32_t rtp_evt_frame_num;
191 uint8_t rtp_evt;
192 bool rtp_evt_end;
193 char *sdp_summary;
194 uint32_t sdp_frame_num;
195 uint32_t mtp3_opc;
196 uint32_t mtp3_dpc;
197 uint8_t mtp3_ni;
198 uint32_t mtp3_frame_num;
199 struct _h245_labels *h245_labels; /**< H.245 labels */
200 char *q931_calling_number;
201 char *q931_called_number;
202 uint8_t q931_cause_value;
203 int32_t q931_crv;
204 uint32_t q931_frame_num;
205 uint32_t h225_frame_num;
206 uint16_t h225_call_num;
207 int h225_cstype; /* XXX actually an enum */
208 bool h225_is_faststart;
209 uint32_t sip_frame_num;
210 uint32_t actrace_frame_num;
211 int32_t actrace_trunk;
212 int32_t actrace_direction;
213 flow_show_options fs_option;
214 uint32_t redraw;
215 bool apply_display_filter;
216 } voip_calls_tapinfo_t;
218 #if 0
219 #define VOIP_CALLS_DEBUG(...) { \
220 char *VOIP_CALLS_DEBUG_MSG = ws_strdup_printf(__VA_ARGS__); \
221 ws_warning("voip_calls: %s:%d %s", G_STRFUNC, __LINE__, VOIP_CALLS_DEBUG_MSG); \
222 g_free(VOIP_CALLS_DEBUG_MSG); \
224 #else
225 #define VOIP_CALLS_DEBUG(...)
226 #endif
228 /****************************************************************************/
229 /* INTERFACE */
232 * Registers the voip_calls tap listeners (if not already done).
233 * From that point on, the calls list will be updated with every redissection.
234 * This function is also the entry point for the initialization routine of the tap system.
235 * So whenever voip_calls.c is added to the list of WIRESHARK_TAP_SRCs, the tap will be registered on startup.
236 * If not, it will be registered on demand by the voip_calls functions that need it.
238 void voip_calls_init_all_taps(voip_calls_tapinfo_t *tap_id_base);
241 * Removes the voip_calls tap listener (if not already done)
242 * From that point on, the voip calls list won't be updated any more.
244 void voip_calls_remove_all_tap_listeners(voip_calls_tapinfo_t *tap_id_base);
247 * Cleans up memory of voip calls tap.
249 void voip_calls_reset_all_taps(voip_calls_tapinfo_t *tapinfo);
252 * Frees one callsinfo
254 void
255 voip_calls_free_callsinfo(voip_calls_info_t *callsinfo);
257 #ifdef __cplusplus
259 #endif /* __cplusplus */
261 #endif /* __VOIP_CALLS_H__ */