MSWSP: add parse_CNatLanguageRestriction()
[wireshark-wip.git] / ui / rtp_stream.h
blob14c484bbd9b2fc75951a22a24d5f6eeb96cd7ecb
1 /* rtp_stream.h
2 * RTP streams summary addition for Wireshark
4 * $Id$
6 * Copyright 2003, Alcatel Business Systems
7 * By Lars Ruoff <lars.ruoff@gmx.net>
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #ifndef __RTP_STREAM_H__
29 #define __RTP_STREAM_H__
31 #include "rtp_analysis.h"
32 #include <glib.h>
33 #include <stdio.h>
34 #include <epan/address.h>
37 /****************************************************************************/
38 /* type for storing rtp frame information */
39 typedef struct st_rtp_sample_header {
40 guint32 rec_time; /**< milliseconds since start of recording */
41 guint16 frame_length; /**< number of bytes in *frame */
42 } rtp_sample_header_t;
44 /** type for storing rtp frame information */
45 typedef struct st_rtp_sample {
46 rtp_sample_header_t header; /**< date and size */
47 const guint8 *frame; /**< data bytes */
48 } rtp_sample_t;
50 typedef rtp_sample_t* rtp_sample_p;
53 /** Defines an rtp stream */
54 typedef struct _rtp_stream_info {
55 address src_addr;
56 guint32 src_port;
57 address dest_addr;
58 guint32 dest_port;
59 guint32 ssrc;
60 guint8 pt;
61 const gchar *info_payload_type_str;
62 guint32 npackets;
64 guint32 first_frame_num; /**< frame number of first frame */
65 guint32 setup_frame_number; /**< frame number of setup message */
66 /* start of recording (GMT) of this stream */
67 guint32 start_sec; /**< seconds */
68 guint32 start_usec; /**< microseconds */
69 gboolean tag_vlan_error;
70 guint32 start_rel_sec; /**< start stream rel seconds */
71 guint32 start_rel_usec; /**< start stream rel microseconds */
72 guint32 stop_rel_sec; /**< stop stream rel seconds */
73 guint32 stop_rel_usec; /**< stop stream rel microseconds */
74 gboolean tag_diffserv_error;
75 guint16 vlan_id;
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 timerstamps */
79 } rtp_stream_info_t;
82 /** tapping modes */
83 typedef enum
85 TAP_ANALYSE,
86 TAP_SAVE,
87 TAP_MARK
88 } tap_mode_t;
91 /* structure that holds the information about all detected streams */
92 /** struct holding all information of the tap */
93 typedef struct _rtpstream_tapinfo {
94 int nstreams; /**< number of streams in the list */
95 GList* strinfo_list; /**< list with all streams */
96 int npackets; /**< total number of rtp packets of all streams */
97 /* used while tapping. user shouldnt modify these */
98 tap_mode_t mode;
99 rtp_stream_info_t* filter_stream_fwd; /**< used as filter in some tap modes */
100 rtp_stream_info_t* filter_stream_rev; /**< used as filter in some tap modes */
101 FILE* save_file;
102 guint32 launch_count; /**< number of times the tap has been run */
103 gboolean is_registered; /**< if the tap listener is currently registered or not */
104 } rtpstream_tapinfo_t;
106 /****************************************************************************/
107 /* INTERFACE */
110 * Registers the rtp_streams tap listener (if not already done).
111 * From that point on, the RTP streams list will be updated with every redissection.
112 * This function is also the entry point for the initialization routine of the tap system.
113 * So whenever rtp_stream.c is added to the list of WIRESHARK_TAP_SRCs, the tap will be registered on startup.
114 * If not, it will be registered on demand by the rtp_streams and rtp_analysis functions that need it.
116 void register_tap_listener_rtp_stream(void);
119 * Removes the rtp_streams tap listener (if not already done)
120 * From that point on, the RTP streams list won't be updated any more.
122 void remove_tap_listener_rtp_stream(void);
125 * Retrieves a constant reference to the unique info structure of the rtp_streams tap listener.
126 * The user should not modify the data pointed to.
128 const rtpstream_tapinfo_t* rtpstream_get_info(void);
131 * Cleans up memory of rtp streams tap.
133 void rtpstream_reset(rtpstream_tapinfo_t *tapinfo);
136 * Scans all packets for RTP streams and updates the RTP streams list.
137 * (redissects all packets)
139 void rtpstream_scan(void);
142 * Saves an RTP stream as raw data stream with timestamp information for later RTP playback.
143 * (redissects all packets)
145 gboolean rtpstream_save(rtp_stream_info_t* stream, const gchar *filename);
148 * Marks all packets belonging to either of stream_fwd or stream_rev.
149 * (both can be NULL)
150 * (redissects all packets)
152 void rtpstream_mark(rtp_stream_info_t* stream_fwd, rtp_stream_info_t* stream_rev);
155 #endif /* __RTP_STREAM_H__ */