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 * SPDX-License-Identifier: GPL-2.0-or-later
14 #ifndef __RTP_STREAM_H__
15 #define __RTP_STREAM_H__
18 * "RTP Streams" dialog box common routines.
19 * @ingroup main_ui_group
24 #endif /* __cplusplus */
26 #include "tap-rtp-analysis.h"
32 #include <epan/address.h>
35 #include "ui/rtp_stream_id.h"
37 /** Defines an rtp stream */
38 typedef struct _rtpstream_info {
41 guint8 first_payload_type; /**< Numeric payload type */
42 const gchar *first_payload_type_name; /**< Payload type name */
43 const gchar *payload_type_names[256]; /**< Seen payload type names. Array index is payload type (byte), filled only during TAP_ANALYSE */
44 gchar *all_payload_type_names; /**< All seen payload names for a stream in one string */
48 gboolean end_stream; /**< Used to track streams across payload types */
51 int call_num; /**< Used to match call_num in voip_calls_info_t */
52 guint32 setup_frame_number; /**< frame number of setup message */
53 /* Start and stop packets needed for .num and .abs_ts */
56 nstime_t start_rel_time; /**< relative start time from pinfo */
57 nstime_t stop_rel_time; /**< relative stop time from pinfo */
59 gboolean tag_vlan_error;
60 gboolean tag_diffserv_error;
62 tap_rtp_stat_t rtp_stats; /**< here goes the RTP statistics info */
63 gboolean problem; /**< if the streams had wrong sequence numbers or wrong timestamps */
64 const gchar *ed137_info; /** pointer to static text, no freeing is required */
75 typedef struct _rtpstream_tapinfo rtpstream_tapinfo_t;
77 typedef void (*rtpstream_tap_reset_cb)(rtpstream_tapinfo_t *tapinfo);
78 typedef void (*rtpstream_tap_draw_cb)(rtpstream_tapinfo_t *tapinfo);
79 typedef void (*tap_mark_packet_cb)(rtpstream_tapinfo_t *tapinfo, frame_data *fd);
80 typedef void (*rtpstream_tap_error_cb)(GString *error_string);
82 /* structure that holds the information about all detected streams */
83 /** struct holding all information of the tap */
84 struct _rtpstream_tapinfo {
85 rtpstream_tap_reset_cb tap_reset; /**< tap reset callback */
86 rtpstream_tap_draw_cb tap_draw; /**< tap draw callback */
87 tap_mark_packet_cb tap_mark_packet; /**< packet marking callback */
88 void *tap_data; /**< data for tap callbacks */
89 int nstreams; /**< number of streams in the list */
90 GList *strinfo_list; /**< list of rtpstream_info_t* */
91 int npackets; /**< total number of rtp packets of all streams */
92 /* used while tapping. user shouldn't modify these */
94 rtpstream_info_t *filter_stream_fwd; /**< used as filter in some tap modes */
95 rtpstream_info_t *filter_stream_rev; /**< used as filter in some tap modes */
97 gboolean is_registered; /**< if the tap listener is currently registered or not */
101 #define RTP_STREAM_DEBUG(...) { \
102 char *RTP_STREAM_DEBUG_MSG = g_strdup_printf(__VA_ARGS__); \
103 g_warning("rtp_stream: %s:%d %s", G_STRFUNC, __LINE__, RTP_STREAM_DEBUG_MSG); \
104 g_free(RTP_STREAM_DEBUG_MSG); \
107 #define RTP_STREAM_DEBUG(...)
110 /****************************************************************************/
113 void show_tap_registration_error(GString *error_string);
116 * Scans all packets for RTP streams and updates the RTP streams list.
117 * (redissects all packets)
119 void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const char *fstring);
122 * Saves an RTP stream as raw data stream with timestamp information for later RTP playback.
123 * (redissects all packets)
125 gboolean rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtpstream_info_t* stream, const gchar *filename);
128 * Marks all packets belonging to either of stream_fwd or stream_rev.
130 * (redissects all packets)
132 void rtpstream_mark(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtpstream_info_t* stream_fwd, rtpstream_info_t* stream_rev);
134 #define MAX_SILENCE_FRAMES 14400000
138 #endif /* __cplusplus */
140 #endif /* __RTP_STREAM_H__ */
143 * Editor modelines - http://www.wireshark.org/tools/modelines.html
148 * indent-tabs-mode: nil
151 * vi: set shiftwidth=4 tabstop=8 expandtab:
152 * :indentSize=4:tabSize=8:noTabs=true: