Kerberos: add kerberos_inject_longterm_key() helper function
[wireshark-sm.git] / ui / rtp_stream.h
blob43e9ef28f725595af8e053aac71dfdeee874cfca
1 /** @file
3 * RTP streams summary addition for Wireshark
5 * Copyright 2003, Alcatel Business Systems
6 * By Lars Ruoff <lars.ruoff@gmx.net>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
15 #ifndef __RTP_STREAM_H__
16 #define __RTP_STREAM_H__
18 #include <glib.h>
20 #include "tap-rtp-analysis.h"
21 #include <stdio.h>
23 #include "cfile.h"
25 #include <epan/address.h>
26 #include <epan/tap.h>
28 #include "ui/rtp_stream_id.h"
30 /** @file
31 * "RTP Streams" dialog box common routines.
32 * @ingroup main_ui_group
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
39 /** Defines an rtp stream */
40 typedef struct _rtpstream_info {
41 rtpstream_id_t id;
43 uint8_t first_payload_type; /**< Numeric payload type */
44 const char *first_payload_type_name; /**< Payload type name */
45 const char *payload_type_names[256]; /**< Seen payload type names. Array index is payload type (byte), filled only during TAP_ANALYSE */
46 char *all_payload_type_names; /**< All seen payload names for a stream in one string */
48 bool is_srtp;
49 uint32_t packet_count;
50 bool end_stream; /**< Used to track streams across payload types */
51 int rtp_event;
53 int call_num; /**< Used to match call_num in voip_calls_info_t */
54 uint32_t setup_frame_number; /**< frame number of setup message */
55 /* Start and stop packets needed for .num and .abs_ts */
56 frame_data *start_fd;
57 frame_data *stop_fd;
58 nstime_t start_rel_time; /**< relative start time from pinfo */
59 nstime_t stop_rel_time; /**< relative stop time from pinfo */
60 nstime_t start_abs_time; /**< abs start time from pinfo */
61 uint16_t vlan_id;
62 bool tag_vlan_error;
63 bool tag_diffserv_error;
65 tap_rtp_stat_t rtp_stats; /**< here goes the RTP statistics info */
66 bool problem; /**< if the streams had wrong sequence numbers or wrong timestamps */
67 const char *ed137_info; /** pointer to static text, no freeing is required */
68 } rtpstream_info_t;
70 /** tapping modes */
71 typedef enum
73 TAP_ANALYSE,
74 TAP_SAVE,
75 TAP_MARK
76 } tap_mode_t;
78 typedef struct _rtpstream_tapinfo rtpstream_tapinfo_t;
80 typedef void (*rtpstream_tap_reset_cb)(rtpstream_tapinfo_t *tapinfo);
81 typedef void (*rtpstream_tap_draw_cb)(rtpstream_tapinfo_t *tapinfo);
82 typedef void (*tap_mark_packet_cb)(rtpstream_tapinfo_t *tapinfo, frame_data *fd);
83 typedef void (*rtpstream_tap_error_cb)(GString *error_string);
85 /* structure that holds the information about all detected streams */
86 /** struct holding all information of the tap */
87 struct _rtpstream_tapinfo {
88 rtpstream_tap_reset_cb tap_reset; /**< tap reset callback */
89 rtpstream_tap_draw_cb tap_draw; /**< tap draw callback */
90 tap_mark_packet_cb tap_mark_packet; /**< packet marking callback */
91 void *tap_data; /**< data for tap callbacks */
92 int nstreams; /**< number of streams in the list */
93 GList *strinfo_list; /**< list of rtpstream_info_t* */
94 GHashTable *strinfo_hash; /**< multihash of rtpstream_info_t **/
95 /* multihash means that there can be */
96 /* more values related to one hash key */
97 int npackets; /**< total number of rtp packets of all streams */
98 /* used while tapping. user shouldn't modify these */
99 tap_mode_t mode;
100 rtpstream_info_t *filter_stream_fwd; /**< used as filter in some tap modes */
101 rtpstream_info_t *filter_stream_rev; /**< used as filter in some tap modes */
102 FILE *save_file;
103 bool is_registered; /**< if the tap listener is currently registered or not */
104 bool apply_display_filter; /**< if apply display filter during analyse */
107 #if 0
108 #define RTP_STREAM_DEBUG(...) { \
109 char *RTP_STREAM_DEBUG_MSG = ws_strdup_printf(__VA_ARGS__); \
110 ws_warning("rtp_stream: %s:%d %s", G_STRFUNC, __LINE__, RTP_STREAM_DEBUG_MSG); \
111 g_free(RTP_STREAM_DEBUG_MSG); \
113 #else
114 #define RTP_STREAM_DEBUG(...)
115 #endif
117 /****************************************************************************/
118 /* INTERFACE */
120 void show_tap_registration_error(GString *error_string);
123 * Scans all packets for RTP streams and updates the RTP streams list.
124 * (redissects all packets)
126 void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const char *fstring);
129 * Saves an RTP stream as raw data stream with timestamp information for later RTP playback.
130 * (redissects all packets)
132 bool rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtpstream_info_t* stream, const char *filename);
135 * Marks all packets belonging to either of stream_fwd or stream_rev.
136 * (both can be NULL)
137 * (redissects all packets)
139 void rtpstream_mark(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtpstream_info_t* stream_fwd, rtpstream_info_t* stream_rev);
141 /* Constant based on fix for bug 4119/5902: don't insert too many silence
142 * frames.
144 #define MAX_SILENCE_FRAMES 14400000
146 #ifdef __cplusplus
148 #endif /* __cplusplus */
150 #endif /* __RTP_STREAM_H__ */