2 * RTP streams summary addition for Wireshark
4 * Copyright 2003, Alcatel Business Systems
5 * By Lars Ruoff <lars.ruoff@gmx.net>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
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.
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.
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.
26 #ifndef __RTP_STREAM_H__
27 #define __RTP_STREAM_H__
30 * "RTP Streams" dialog box common routines.
31 * @ingroup main_ui_group
36 #endif /* __cplusplus */
38 #include "tap-rtp-analysis.h"
44 #include <epan/address.h>
47 /** Defines an rtp stream */
48 typedef struct _rtp_stream_info {
55 guint8 payload_type; /**< Numeric payload type */
56 gchar *payload_type_name; /**< Payload type name */
60 gboolean end_stream; /**< Used to track streams across payload types */
63 int call_num; /**< Used to match call_num in voip_calls_info_t */
64 guint32 setup_frame_number; /**< frame number of setup message */
65 /* Start and stop packets needed for .num and .abs_ts */
68 nstime_t start_rel_time; /**< relative start time from pinfo */
69 nstime_t stop_rel_time; /**< relative stop time from pinfo */
71 gboolean tag_vlan_error;
72 gboolean tag_diffserv_error;
74 gboolean decode; /**< Decode this stream. GTK+ only? */
75 GList *rtp_packet_list; /**< List of RTP rtp_packet_t. GTK+ only */
77 tap_rtp_stat_t rtp_stats; /**< here goes the RTP statistics info */
78 gboolean problem; /**< if the streams had wrong sequence numbers or wrong timestamps */
90 typedef struct _rtpstream_tapinfo rtpstream_tapinfo_t;
92 typedef void (*rtpstream_tap_reset_cb)(rtpstream_tapinfo_t *tapinfo);
93 typedef void (*rtpstream_tap_draw_cb)(rtpstream_tapinfo_t *tapinfo);
94 typedef void (*tap_mark_packet_cb)(rtpstream_tapinfo_t *tapinfo, frame_data *fd);
96 /* structure that holds the information about all detected streams */
97 /** struct holding all information of the tap */
98 struct _rtpstream_tapinfo {
99 rtpstream_tap_reset_cb tap_reset; /**< tap reset callback */
100 rtpstream_tap_draw_cb tap_draw; /**< tap draw callback */
101 tap_mark_packet_cb tap_mark_packet; /**< packet marking callback */
102 void *tap_data; /**< data for tap callbacks */
103 int nstreams; /**< number of streams in the list */
104 GList *strinfo_list; /**< list of rtp_stream_info_t* */
105 int npackets; /**< total number of rtp packets of all streams */
106 /* used while tapping. user shouldn't modify these */
108 rtp_stream_info_t *filter_stream_fwd; /**< used as filter in some tap modes */
109 rtp_stream_info_t *filter_stream_rev; /**< used as filter in some tap modes */
111 gboolean is_registered; /**< if the tap listener is currently registered or not */
115 #define RTP_STREAM_DEBUG(...) { \
116 char *RTP_STREAM_DEBUG_MSG = g_strdup_printf(__VA_ARGS__); \
117 g_warning("rtp_stream: %s:%d %s", G_STRFUNC, __LINE__, RTP_STREAM_DEBUG_MSG); \
118 g_free(RTP_STREAM_DEBUG_MSG); \
121 #define RTP_STREAM_DEBUG(...)
124 /****************************************************************************/
128 * Registers the rtp_streams tap listener (if not already done).
129 * From that point on, the RTP streams list will be updated with every redissection.
130 * This function is also the entry point for the initialization routine of the tap system.
131 * So whenever rtp_stream.c is added to the list of WIRESHARK_TAP_SRCs, the tap will be registered on startup.
132 * If not, it will be registered on demand by the rtp_streams and rtp_analysis functions that need it.
134 void register_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo, const char *fstring);
137 * Removes the rtp_streams tap listener (if not already done)
138 * From that point on, the RTP streams list won't be updated any more.
140 void remove_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo);
143 * Cleans up memory of rtp streams tap.
145 void rtpstream_reset(rtpstream_tapinfo_t *tapinfo);
148 * Scans all packets for RTP streams and updates the RTP streams list.
149 * (redissects all packets)
151 void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const char *fstring);
154 * Saves an RTP stream as raw data stream with timestamp information for later RTP playback.
155 * (redissects all packets)
157 gboolean rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtp_stream_info_t* stream, const gchar *filename);
160 * Compares the endpoints of two RTP streams.
162 * @return TRUE if the
164 gboolean rtp_stream_info_is_reverse(const rtp_stream_info_t *stream_a, rtp_stream_info_t *stream_b);
167 * Marks all packets belonging to either of stream_fwd or stream_rev.
169 * (redissects all packets)
171 void rtpstream_mark(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtp_stream_info_t* stream_fwd, rtp_stream_info_t* stream_rev);
173 #define MAX_SILENCE_FRAMES 14400000
177 #endif /* __cplusplus */
179 #endif /* __RTP_STREAM_H__ */
182 * Editor modelines - http://www.wireshark.org/tools/modelines.html
187 * indent-tabs-mode: nil
190 * vi: set shiftwidth=4 tabstop=8 expandtab:
191 * :indentSize=4:tabSize=8:noTabs=true: