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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #ifndef Mcast_STREAM_H_INCLUDED
31 #define Mcast_STREAM_H_INCLUDED
35 #include <epan/address.h>
39 * @ingroup dialog_group
47 #define REFRESHTIMER 6
50 #define CUMULEMPTYSPEED 9
52 #define MAX_SPEED 200000
54 /* typedefs for sliding window and buffer size */
55 typedef struct buffer{
56 struct timeval *buff; /* packet times */
57 gint32 first; /* pointer to the first element */
58 gint32 last; /* pointer to the last element */
59 gint32 burstsize; /* current burst */
60 gint32 topburstsize; /* maximum burst in the refresh interval*/
61 gint32 count; /* packet counter */
62 gint32 burststatus; /* burst status */
63 gint32 numbursts; /* number of bursts */
64 gint32 buffusage; /* buffer usage */
65 gint32 buffstatus; /* buffer status */
66 gint32 numbuffalarms; /* number of alarms triggered by buffer underruns */
67 gint32 topbuffusage; /* top buffer usage in refresh interval */
68 float maxbw; /* maximum bandwidth usage */
72 /* defines an mcast stream */
73 typedef struct _mcast_stream_info {
83 guint32 first_frame_num; /* frame number of first frame */
84 /* start of recording (GMT) of this stream */
85 guint32 start_sec; /* seconds */
86 guint32 start_usec; /* microseconds */
87 guint32 start_rel_sec; /* start stream rel seconds */
88 guint32 start_rel_usec; /* start stream rel microseconds */
89 guint32 stop_rel_sec; /* stop stream rel seconds */
90 guint32 stop_rel_usec; /* stop stream rel microseconds */
93 /*for the sliding window */
96 } mcast_stream_info_t;
99 /* structure that holds the information about all detected streams */
100 /* struct holding all information of the tap */
101 typedef struct _mcaststream_tapinfo {
102 int nstreams; /* number of streams in the list */
103 GList* strinfo_list; /* list with all streams */
104 guint32 npackets; /* total number of mcast packets of all streams */
105 mcast_stream_info_t* allstreams; /* structure holding information common for all streams */
107 guint32 launch_count; /* number of times the tap has been run */
108 gboolean is_registered; /* if the tap listener is currently registered or not */
109 } mcaststream_tapinfo_t;
111 /****************************************************************************/
115 * Registers the mcast_streams tap listener (if not already done).
116 * From that point on, the Mcast streams list will be updated with every redissection.
117 * This function is also the entry point for the initialization routine of the tap system.
118 * So whenever mcast_stream.c is added to the list of ETHEREAL_TAP_SRCs, the tap will be registered on startup.
119 * If not, it will be registered on demand by the mcast_streams and mcast_analysis functions that need it.
121 void register_tap_listener_mcast_stream(void);
124 * Removes the mcast_streams tap listener (if not already done)
125 * From that point on, the Mcast streams list won't be updated any more.
127 void remove_tap_listener_mcast_stream(void);
130 * Retrieves a constant reference to the unique info structure of the mcast_streams tap listener.
131 * The user should not modify the data pointed to.
133 const mcaststream_tapinfo_t* mcaststream_get_info(void);
136 * Cleans up memory of mcast streams tap.
138 void mcaststream_reset(mcaststream_tapinfo_t *tapinfo);
141 * Scans all packets for Mcast streams and updates the Mcast streams list.
142 * (redissects all packets)
144 void mcaststream_scan(void);
146 #endif /*Mcast_STREAM_H_INCLUDED*/