3 * Copyright 2006, Iskratel , Slovenia
4 * By Jakob Bratkovic <j.bratkovic@iskratel.si> and
5 * Miha Jemec <m.jemec@iskratel.si>
7 * based on rtp_stream.h
8 * Copyright 2003, Alcatel Business Systems
9 * By Lars Ruoff <lars.ruoff@gmx.net>
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1998 Gerald Combs
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #ifndef __MCAST_STREAM_H__
31 #define __MCAST_STREAM_H__
35 #endif /* __cplusplus */
39 #define MAX_SPEED 200000
41 /* typedefs for sliding window and buffer size */
42 typedef struct buffer{
43 nstime_t *buff; /* packet times */
44 gint32 first; /* pointer to the first element */
45 gint32 last; /* pointer to the last element */
46 gint32 burstsize; /* current burst */
47 gint32 topburstsize; /* maximum burst in the refresh interval*/
48 gint32 count; /* packet counter */
49 gint32 burststatus; /* burst status */
50 gint32 numbursts; /* number of bursts */
51 gint32 buffusage; /* buffer usage */
52 gint32 buffstatus; /* buffer status */
53 gint32 numbuffalarms; /* number of alarms triggered by buffer underruns */
54 gint32 topbuffusage; /* top buffer usage in refresh interval */
55 double maxbw; /* Maximum bandwidth usage. Bits/s */
59 /* defines an mcast stream */
60 typedef struct _mcast_stream_info {
68 double average_bw; /* Bits/s */
70 guint32 first_frame_num; /* frame number of first frame */
71 /* start of recording (GMT) of this stream */
72 nstime_t start_abs; /* absolute stream start time */
73 nstime_t start_rel; /* stream start time relative to first packet in capture */
74 nstime_t stop_rel; /* stream stop time relative to first packet in capture */
77 /*for the sliding window */
80 } mcast_stream_info_t;
82 typedef struct _mcaststream_tapinfo mcaststream_tapinfo_t;
84 typedef void (*mcaststream_tap_reset_cb)(mcaststream_tapinfo_t *tapinfo);
85 typedef void (*mcaststream_tap_draw_cb)(mcaststream_tapinfo_t *tapinfo);
87 /* structure that holds the information about all detected streams */
88 /* struct holding all information of the tap */
89 struct _mcaststream_tapinfo {
90 gpointer user_data; /* User data pointer */
91 mcaststream_tap_reset_cb tap_reset; /**< tap reset callback */
92 mcaststream_tap_draw_cb tap_draw; /**< tap draw callback */
93 GList* strinfo_list; /* list of mcast_stream_info_t */
94 guint32 npackets; /* total number of mcast packets of all streams */
95 mcast_stream_info_t* allstreams; /* structure holding information common for all streams */
97 gboolean is_registered; /* if the tap listener is currently registered or not */
101 extern gint32 mcast_stream_trigger;
102 extern gint32 mcast_stream_bufferalarm;
103 extern guint16 mcast_stream_burstint;
104 extern gint32 mcast_stream_emptyspeed;
105 extern gint32 mcast_stream_cumulemptyspeed;
107 /****************************************************************************/
111 * Registers the mcast_streams tap listener (if not already done).
112 * From that point on, the Mcast streams list will be updated with every redissection.
113 * This function is also the entry point for the initialization routine of the tap system.
114 * So whenever mcast_stream.c is added to the list of WIRESHARK_TAP_SRCs, the tap will be registered on startup.
115 * If not, it will be registered on demand by the mcast_streams and mcast_analysis functions that need it.
117 void register_tap_listener_mcast_stream(mcaststream_tapinfo_t *tapinfo);
120 * Removes the mcast_streams tap listener (if not already done)
121 * From that point on, the Mcast streams list won't be updated any more.
123 void remove_tap_listener_mcast_stream(mcaststream_tapinfo_t *tapinfo);
126 * Cleans up memory of mcast streams tap.
128 void mcaststream_reset(mcaststream_tapinfo_t *tapinfo);
131 * Scans all packets for Mcast streams and updates the Mcast streams list.
132 * (redissects all packets)
134 void mcaststream_scan(mcaststream_tapinfo_t *tapinfo, capture_file *cap_file);
138 #endif /* __cplusplus */
140 #endif /* __MCAST_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: