3 * Copyright 2006, Iskratel , Slovenia
4 * By Jakob Bratkovic <j.bratkovic@iskratel.si> and
5 * Miha Jemec <m.jemec@iskratel.si>
9 * based on rtp_stream.h
10 * Copyright 2003, Alcatel Business Systems
11 * By Lars Ruoff <lars.ruoff@gmx.net>
13 * Wireshark - Network traffic analyzer
14 * By Gerald Combs <gerald@wireshark.org>
15 * Copyright 1998 Gerald Combs
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version 2
20 * of the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 #ifndef __MCAST_STREAM_H__
33 #define __MCAST_STREAM_H__
35 #define MAX_SPEED 200000
37 /* typedefs for sliding window and buffer size */
38 typedef struct buffer
{
39 struct timeval
*buff
; /* packet times */
40 gint32 first
; /* pointer to the first element */
41 gint32 last
; /* pointer to the last element */
42 gint32 burstsize
; /* current burst */
43 gint32 topburstsize
; /* maximum burst in the refresh interval*/
44 gint32 count
; /* packet counter */
45 gint32 burststatus
; /* burst status */
46 gint32 numbursts
; /* number of bursts */
47 gint32 buffusage
; /* buffer usage */
48 gint32 buffstatus
; /* buffer status */
49 gint32 numbuffalarms
; /* number of alarms triggered by buffer underruns */
50 gint32 topbuffusage
; /* top buffer usage in refresh interval */
51 float maxbw
; /* maximum bandwidth usage */
55 /* defines an mcast stream */
56 typedef struct _mcast_stream_info
{
66 guint32 first_frame_num
; /* frame number of first frame */
67 /* start of recording (GMT) of this stream */
68 guint32 start_sec
; /* seconds */
69 guint32 start_usec
; /* microseconds */
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 */
76 /*for the sliding window */
79 } mcast_stream_info_t
;
82 /* structure that holds the information about all detected streams */
83 /* struct holding all information of the tap */
84 typedef struct _mcaststream_tapinfo
{
85 int nstreams
; /* number of streams in the list */
86 GList
* strinfo_list
; /* list with all streams */
87 guint32 npackets
; /* total number of mcast packets of all streams */
88 mcast_stream_info_t
* allstreams
; /* structure holding information common for all streams */
90 guint32 launch_count
; /* number of times the tap has been run */
91 gboolean is_registered
; /* if the tap listener is currently registered or not */
92 } mcaststream_tapinfo_t
;
95 extern gint32 mcast_stream_trigger
;
96 extern gint32 mcast_stream_bufferalarm
;
97 extern guint16 mcast_stream_burstint
;
98 extern gint32 mcast_stream_emptyspeed
;
99 extern gint32 mcast_stream_cumulemptyspeed
;
101 /****************************************************************************/
105 * Registers the mcast_streams tap listener (if not already done).
106 * From that point on, the Mcast streams list will be updated with every redissection.
107 * This function is also the entry point for the initialization routine of the tap system.
108 * So whenever mcast_stream.c is added to the list of WIRESHARK_TAP_SRCs, the tap will be registered on startup.
109 * If not, it will be registered on demand by the mcast_streams and mcast_analysis functions that need it.
111 void register_tap_listener_mcast_stream(void);
114 * Removes the mcast_streams tap listener (if not already done)
115 * From that point on, the Mcast streams list won't be updated any more.
117 void remove_tap_listener_mcast_stream(void);
120 * Retrieves a constant reference to the unique info structure of the mcast_streams tap listener.
121 * The user should not modify the data pointed to.
123 const mcaststream_tapinfo_t
* mcaststream_get_info(void);
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(void);
136 #endif /* __MCAST_STREAM_H__ */