2 * RTP streams summary addition for ethereal
6 * Copyright 2003, Alcatel Business Systems
7 * By Lars Ruoff <lars.ruoff@gmx.net>
9 * Ethereal - Network traffic analyzer
10 * By Gerald Combs <gerald@ethereal.com>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #ifndef RTP_STREAM_H_INCLUDED
29 #define RTP_STREAM_H_INCLUDED
33 #include <epan/address.h>
37 * @ingroup dialog_group
41 /****************************************************************************/
42 /* type for storing rtp frame information */
43 typedef struct st_rtp_sample_header {
44 guint32 rec_time; /* miliseconds since start of recording */
45 guint16 frame_length; /* number of bytes in *frame */
46 } rtp_sample_header_t;
48 /* type for storing rtp frame information */
49 typedef struct st_rtp_sample {
50 rtp_sample_header_t header; /* date and size */
51 const guint8 *frame; /* data bytes */
54 typedef rtp_sample_t* rtp_sample_p;
57 /* defines an rtp stream */
58 typedef struct _rtp_stream_info {
67 guint32 first_frame_num; /* frame number of first frame */
68 guint32 setup_frame_number; /* frame number of setup message */
69 /* start of recording (GMT) of this stream */
70 guint32 start_sec; /* seconds */
71 guint32 start_usec; /* microseconds */
72 gboolean tag_vlan_error;
73 guint32 start_rel_sec; /* start stream rel seconds */
74 guint32 start_rel_usec; /* start stream rel microseconds */
75 guint32 stop_rel_sec; /* stop stream rel seconds */
76 guint32 stop_rel_usec; /* stop stream rel microseconds */
77 gboolean tag_diffserv_error;
92 /* structure that holds the information about all detected streams */
93 /* struct holding all information of the tap */
94 typedef struct _rtpstream_tapinfo {
95 int nstreams; /* number of streams in the list */
96 GList* strinfo_list; /* list with all streams */
97 int npackets; /* total number of rtp packets of all streams */
98 /* used while tapping. user shouldnt modify these */
100 rtp_stream_info_t* filter_stream_fwd; /* used as filter in some tap modes */
101 rtp_stream_info_t* filter_stream_rev; /* used as filter in some tap modes */
103 guint32 launch_count; /* number of times the tap has been run */
104 gboolean is_registered; /* if the tap listener is currently registered or not */
105 } rtpstream_tapinfo_t;
107 gchar* address_to_str_w_none(address *addr);
109 /****************************************************************************/
113 * Registers the rtp_streams tap listener (if not already done).
114 * From that point on, the RTP streams list will be updated with every redissection.
115 * This function is also the entry point for the initialization routine of the tap system.
116 * So whenever rtp_stream.c is added to the list of ETHEREAL_TAP_SRCs, the tap will be registered on startup.
117 * If not, it will be registered on demand by the rtp_streams and rtp_analysis functions that need it.
119 void register_tap_listener_rtp_stream(void);
122 * Removes the rtp_streams tap listener (if not already done)
123 * From that point on, the RTP streams list won't be updated any more.
125 void remove_tap_listener_rtp_stream(void);
128 * Retrieves a constant reference to the unique info structure of the rtp_streams tap listener.
129 * The user should not modify the data pointed to.
131 const rtpstream_tapinfo_t* rtpstream_get_info(void);
134 * Cleans up memory of rtp streams tap.
136 void rtpstream_reset(rtpstream_tapinfo_t *tapinfo);
139 * Scans all packets for RTP streams and updates the RTP streams list.
140 * (redissects all packets)
142 void rtpstream_scan(void);
145 * Saves an RTP stream as raw data stream with timestamp information for later RTP playback.
146 * (redissects all packets)
148 gboolean rtpstream_save(rtp_stream_info_t* stream, const gchar *filename);
151 * Marks all packets belonging to either of stream_fwd or stream_rev.
153 * (redissects all packets)
155 void rtpstream_mark(rtp_stream_info_t* stream_fwd, rtp_stream_info_t* stream_rev);
158 #endif /*RTP_STREAM_H_INCLUDED*/