Wireshark  4.3.0
The Wireshark network protocol analyzer
tap-rtp-common.h
Go to the documentation of this file.
1 
19 #ifndef __TAP_RTP_COMMON_H__
20 #define __TAP_RTP_COMMON_H__
21 
22 #include "ui/rtp_stream.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* __cplusplus */
27 
28 /* type of error when saving voice in a file didn't succeed */
29 typedef enum {
30  TAP_RTP_NO_ERROR,
31  TAP_RTP_WRONG_CODEC,
32  TAP_RTP_WRONG_LENGTH,
33  TAP_RTP_PADDING_ERROR,
34  TAP_RTP_SHORT_FRAME,
35  TAP_RTP_FILE_OPEN_ERROR,
36  TAP_RTP_FILE_WRITE_ERROR,
37  TAP_RTP_NO_DATA
38 } tap_rtp_error_type_t;
39 
40 typedef struct _tap_rtp_save_info_t {
41  FILE *fp;
42  guint32 count;
43  tap_rtp_error_type_t error_type;
44  gboolean saved;
46 
47 typedef struct _rtpstream_info_calc {
48  gchar *src_addr_str;
49  guint16 src_port;
50  gchar *dst_addr_str;
51  guint16 dst_port;
52  guint32 ssrc;
53  gchar *all_payload_type_names; /* Name of codec derived from fixed or dynamic codec names */
54  guint32 packet_count;
55  guint32 total_nr;
56  guint32 packet_expected; /* Count of expected packets, derived from length of RTP stream */
57  gint32 lost_num;
58  double lost_perc;
59  double max_delta;
60  double min_delta;
61  double mean_delta;
62  double min_jitter;
63  double max_jitter;
64  double max_skew;
65  double mean_jitter;
66  gboolean problem; /* Indication that RTP stream contains something unusual -GUI should indicate it somehow */
67  double clock_drift_ms;
68  double freq_drift_hz;
69  double freq_drift_perc;
70  double duration_ms;
71  guint32 sequence_err;
72  double start_time_ms;
73  guint32 first_packet_num;
74  guint32 last_packet_num;
76 
81 rtpstream_info_t *rtpstream_info_malloc_and_init(void);
82 void rtpstream_info_copy_deep(rtpstream_info_t *dest, const rtpstream_info_t *src);
83 rtpstream_info_t *rtpstream_info_malloc_and_copy_deep(const rtpstream_info_t *src);
84 void rtpstream_info_free_data(rtpstream_info_t* info);
85 void rtpstream_info_free_all(rtpstream_info_t* info);
86 
92 gint rtpstream_info_cmp(gconstpointer aa, gconstpointer bb);
93 
99 gboolean rtpstream_info_is_reverse(const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b);
100 
106 gboolean rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const guint8 payload_type);
107 
108 /****************************************************************************/
109 /* INTERFACE */
110 
118 void register_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo, const char *fstring, rtpstream_tap_error_cb tap_error);
119 
125 
129 void rtpstream_reset(rtpstream_tapinfo_t *tapinfo);
130 
131 void rtpstream_reset_cb(void*);
132 void rtp_write_header(rtpstream_info_t*, FILE*);
133 tap_packet_status rtpstream_packet_cb(void*, packet_info*, epan_dissect_t *, const void *, tap_flags_t);
134 
139 
144 
148 void rtpstream_info_analyse_init(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo);
149 
153 void rtpstream_info_analyse_process(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo);
154 
158 guint rtpstream_to_hash(gconstpointer key);
159 
163 void rtpstream_info_multihash_insert(GHashTable *multihash, rtpstream_info_t *new_stream_info);
164 
168 rtpstream_info_t *rtpstream_info_multihash_lookup(GHashTable *multihash, rtpstream_id_t *stream_id);
169 
173 void rtpstream_info_multihash_destroy_value(gpointer key, gpointer value, gpointer user_data);
174 
175 #ifdef __cplusplus
176 }
177 #endif /* __cplusplus */
178 
179 #endif /* __TAP_RTP_COMMON_H__ */
Definition: packet_info.h:44
Definition: packet-rtp.h:29
Definition: rtp_stream_id.h:33
Definition: tap-rtp-common.h:47
double start_time_ms
Definition: tap-rtp-common.h:72
Definition: rtp_stream.h:40
Definition: rtp_stream.h:87
Definition: tap-rtp-common.h:40
Definition: epan_dissect.h:28
Definition: file-pcapng.h:57
gint rtpstream_info_cmp(gconstpointer aa, gconstpointer bb)
Definition: tap-rtp-common.c:110
void rtpstream_info_analyse_process(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo)
Definition: tap-rtp-common.c:543
guint rtpstream_to_hash(gconstpointer key)
Definition: tap-rtp-common.c:562
void rtpstream_info_multihash_destroy_value(gpointer key, gpointer value, gpointer user_data)
Definition: tap-rtp-common.c:625
void rtpstream_info_multihash_insert(GHashTable *multihash, rtpstream_info_t *new_stream_info)
Definition: tap-rtp-common.c:574
void rtpstream_reset(rtpstream_tapinfo_t *tapinfo)
Definition: tap-rtp-common.c:143
void rtpstream_info_init(rtpstream_info_t *info)
Definition: tap-rtp-common.c:49
void rtpstream_info_analyse_init(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo)
Definition: tap-rtp-common.c:518
void remove_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo)
Definition: tap-rtp-common.c:205
void register_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo, const char *fstring, rtpstream_tap_error_cb tap_error)
Definition: tap-rtp-common.c:215
void rtpstream_info_calc_free(rtpstream_info_calc_t *calc)
Definition: tap-rtp-common.c:509
gboolean rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const guint8 payload_type)
Definition: tap-rtp-common.c:293
gboolean rtpstream_info_is_reverse(const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b)
Definition: tap-rtp-common.c:127
rtpstream_info_t * rtpstream_info_multihash_lookup(GHashTable *multihash, rtpstream_id_t *stream_id)
Definition: tap-rtp-common.c:603
void rtpstream_info_calculate(const rtpstream_info_t *strinfo, rtpstream_info_calc_t *calc)
Definition: tap-rtp-common.c:445
tap_packet_status
Definition: tap.h:25