Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
rtp_stream.h
Go to the documentation of this file.
1 /* rtp_stream.h
2  * RTP streams summary addition for Wireshark
3  *
4  * Copyright 2003, Alcatel Business Systems
5  * By Lars Ruoff <lars.ruoff@gmx.net>
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * SPDX-License-Identifier: GPL-2.0-or-later
12  */
13 
14 #ifndef __RTP_STREAM_H__
15 #define __RTP_STREAM_H__
16 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
25 
26 #include "tap-rtp-analysis.h"
27 #include <glib.h>
28 #include <stdio.h>
29 
30 #include "cfile.h"
31 
32 #include <epan/address.h>
33 #include <epan/tap.h>
34 
36 typedef struct _rtp_stream_info {
37  address src_addr;
38  guint32 src_port;
39  address dest_addr;
40  guint32 dest_port;
41  guint32 ssrc;
42 
43  guint8 payload_type;
45  gboolean is_srtp;
46 
47  guint32 packet_count;
48  gboolean end_stream;
49  int rtp_event;
50 
51  int call_num;
53  /* Start and stop packets needed for .num and .abs_ts */
54  frame_data *start_fd;
55  frame_data *stop_fd;
58  guint16 vlan_id;
59  gboolean tag_vlan_error;
60  gboolean tag_diffserv_error;
61 
63  gboolean problem;
64  gchar *ed137_info;
66 
68 typedef enum
69 {
70  TAP_ANALYSE,
71  TAP_SAVE,
72  TAP_MARK
73 } tap_mode_t;
74 
75 typedef struct _rtpstream_tapinfo rtpstream_tapinfo_t;
76 
77 typedef void (*rtpstream_tap_reset_cb)(rtpstream_tapinfo_t *tapinfo);
78 typedef void (*rtpstream_tap_draw_cb)(rtpstream_tapinfo_t *tapinfo);
79 typedef void (*tap_mark_packet_cb)(rtpstream_tapinfo_t *tapinfo, frame_data *fd);
80 
81 /* structure that holds the information about all detected streams */
84  rtpstream_tap_reset_cb tap_reset;
85  rtpstream_tap_draw_cb tap_draw;
86  tap_mark_packet_cb tap_mark_packet;
87  void *tap_data;
88  int nstreams;
89  GList *strinfo_list;
90  int npackets;
91  /* used while tapping. user shouldn't modify these */
92  tap_mode_t mode;
95  FILE *save_file;
96  gboolean is_registered;
97 };
98 
99 #if 0
100 #define RTP_STREAM_DEBUG(...) { \
101  char *RTP_STREAM_DEBUG_MSG = g_strdup_printf(__VA_ARGS__); \
102  g_warning("rtp_stream: %s:%d %s", G_STRFUNC, __LINE__, RTP_STREAM_DEBUG_MSG); \
103  g_free(RTP_STREAM_DEBUG_MSG); \
104 }
105 #else
106 #define RTP_STREAM_DEBUG(...)
107 #endif
108 
109 /****************************************************************************/
110 /* INTERFACE */
111 
119 void register_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo, const char *fstring);
120 
125 void remove_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo);
126 
130 void rtpstream_reset(rtpstream_tapinfo_t *tapinfo);
131 
136 void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const char *fstring);
137 
142 gboolean rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtp_stream_info_t* stream, const gchar *filename);
143 
149 gboolean rtp_stream_info_is_reverse(const rtp_stream_info_t *stream_a, rtp_stream_info_t *stream_b);
150 
156 void rtpstream_mark(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtp_stream_info_t* stream_fwd, rtp_stream_info_t* stream_rev);
157 
158 #define MAX_SILENCE_FRAMES 14400000
159 
160 #ifdef __cplusplus
161 }
162 #endif /* __cplusplus */
163 
164 #endif /* __RTP_STREAM_H__ */
165 
166 /*
167  * Editor modelines - http://www.wireshark.org/tools/modelines.html
168  *
169  * Local variables:
170  * c-basic-offset: 4
171  * tab-width: 8
172  * indent-tabs-mode: nil
173  * End:
174  *
175  * vi: set shiftwidth=4 tabstop=8 expandtab:
176  * :indentSize=4:tabSize=8:noTabs=true:
177  */
rtp_stream_info_t * filter_stream_fwd
Definition: rtp_stream.h:93
gboolean rtp_stream_info_is_reverse(const rtp_stream_info_t *stream_a, rtp_stream_info_t *stream_b)
Definition: rtp_stream.c:125
guint8 payload_type
Definition: rtp_stream.h:43
void remove_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo)
Definition: rtp_stream.c:171
gboolean rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtp_stream_info_t *stream, const gchar *filename)
Definition: rtp_stream.c:75
GList * strinfo_list
Definition: rtp_stream.h:89
nstime_t stop_rel_time
Definition: rtp_stream.h:57
Definition: nstime.h:27
gboolean is_registered
Definition: rtp_stream.h:96
tap_rtp_stat_t rtp_stats
Definition: rtp_stream.h:62
void register_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo, const char *fstring)
Definition: rtp_stream.c:182
nstime_t start_rel_time
Definition: rtp_stream.h:56
int nstreams
Definition: rtp_stream.h:88
int call_num
Definition: rtp_stream.h:51
Definition: tap-rtp-analysis.h:55
void rtpstream_mark(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtp_stream_info_t *stream_fwd, rtp_stream_info_t *stream_rev)
Definition: rtp_stream.c:141
Definition: frame_data.h:53
void rtpstream_reset(rtpstream_tapinfo_t *tapinfo)
Definition: tap-rtp-common.c:70
Definition: rtp_stream.h:83
guint32 setup_frame_number
Definition: rtp_stream.h:52
Definition: stream.c:40
gchar * payload_type_name
Definition: rtp_stream.h:44
void * tap_data
Definition: rtp_stream.h:87
int npackets
Definition: rtp_stream.h:90
void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const char *fstring)
Definition: rtp_stream.c:52
rtp_stream_info_t * filter_stream_rev
Definition: rtp_stream.h:94
gboolean problem
Definition: rtp_stream.h:63
struct _rtp_stream_info rtp_stream_info_t
Definition: cfile.h:58
rtpstream_tap_reset_cb tap_reset
Definition: rtp_stream.h:84
Definition: rtp_stream.h:36
Definition: address.h:47
gboolean end_stream
Definition: rtp_stream.h:48
tap_mode_t
Definition: rtp_stream.h:68
rtpstream_tap_draw_cb tap_draw
Definition: rtp_stream.h:85
tap_mark_packet_cb tap_mark_packet
Definition: rtp_stream.h:86