Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
mcast_stream.h
Go to the documentation of this file.
1
18#ifndef __MCAST_STREAM_H__
19#define __MCAST_STREAM_H__
20
21#include <epan/tap.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif /* __cplusplus */
26
27#define MAX_SPEED 200000
28
29/* typedefs for sliding window and buffer size */
30typedef struct buffer{
31 nstime_t *buff; /* packet times */
32 int32_t first; /* pointer to the first element */
33 int32_t last; /* pointer to the last element */
34 int32_t burstsize; /* current burst */
35 int32_t topburstsize; /* maximum burst in the refresh interval*/
36 int32_t count; /* packet counter */
37 int32_t burststatus; /* burst status */
38 int32_t numbursts; /* number of bursts */
39 int32_t buffusage; /* buffer usage */
40 int32_t buffstatus; /* buffer status */
41 int32_t numbuffalarms; /* number of alarms triggered by buffer underruns */
42 int32_t topbuffusage; /* top buffer usage in refresh interval */
43 double maxbw; /* Maximum bandwidth usage. Bits/s */
44} t_buffer;
45
46
47/* defines an mcast stream */
48/* XXX - Not all of these seem to be used? */
49typedef struct _mcast_stream_info {
50 address src_addr;
51 uint16_t src_port;
52 address dest_addr;
53 uint16_t dest_port;
54 uint32_t npackets;
55 double apackets;
56 uint64_t total_bytes;
57 double average_bw; /* Bits/s */
58
59 uint32_t first_frame_num; /* frame number of first frame */
60 /* start of recording (GMT) of this stream */
61 nstime_t start_abs; /* absolute stream start time */
62 nstime_t start_rel; /* stream start time relative to first packet in capture */
63 nstime_t stop_rel; /* stream stop time relative to first packet in capture */
64
65 /*for the sliding window */
66 t_buffer element;
67
69
71
72typedef void (*mcaststream_tap_reset_cb)(mcaststream_tapinfo_t *tapinfo);
73typedef void (*mcaststream_tap_draw_cb)(mcaststream_tapinfo_t *tapinfo);
74
75/* structure that holds the information about all detected streams */
76/* struct holding all information of the tap */
78 void *user_data; /* User data pointer */
79 mcaststream_tap_reset_cb tap_reset;
80 mcaststream_tap_draw_cb tap_draw;
81 GList* strinfo_list; /* list of mcast_stream_info_t */
82 uint32_t npackets; /* total number of mcast packets of all streams */
83 mcast_stream_info_t* allstreams; /* structure holding information common for all streams */
84
85 bool is_registered; /* if the tap listener is currently registered or not */
86};
87
88
89extern int32_t mcast_stream_trigger;
90extern int32_t mcast_stream_bufferalarm;
91extern uint16_t mcast_stream_burstint;
92extern int32_t mcast_stream_emptyspeed;
93extern int32_t mcast_stream_cumulemptyspeed;
94
95/****************************************************************************/
96/* INTERFACE */
97
111
112
120
127
144tap_packet_status mcaststream_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data, tap_flags_t flags);
145
146#ifdef __cplusplus
147}
148#endif /* __cplusplus */
149
150#endif /* __MCAST_STREAM_H__ */
void mcaststream_reset(mcaststream_tapinfo_t *tapinfo)
Free all accumulated mcast stream tap data.
Definition mcast_stream.c:76
tap_packet_status mcaststream_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data, tap_flags_t flags)
Tap packet callback for the mcast_streams tap.
void remove_tap_listener_mcast_stream(mcaststream_tapinfo_t *tapinfo)
Remove the mcast_streams tap listener.
Definition mcast_stream.c:283
GString * register_tap_listener_mcast_stream(mcaststream_tapinfo_t *tapinfo)
Registers the mcast_streams tap listener (if not already done).
Definition mcast_stream.c:294
Holds a network or link-layer address of any supported type.
Definition address.h:62
Definition mcast_stream.h:49
Definition mcast_stream.h:77
mcaststream_tap_draw_cb tap_draw
Definition mcast_stream.h:80
mcaststream_tap_reset_cb tap_reset
Definition mcast_stream.h:79
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Definition mcast_stream.h:30
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
Definition nstime.h:26
tap_packet_status
Definition tap.h:22