Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
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
25extern "C" {
26#endif /* __cplusplus */
27
28/* type of error when saving voice in a file didn't succeed */
29typedef 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
40typedef struct _tap_rtp_save_info_t {
41 FILE *fp;
42 uint32_t count;
43 tap_rtp_error_type_t error_type;
44 bool saved;
46
47typedef struct _rtpstream_info_calc {
48 char *src_addr_str;
49 uint16_t src_port;
50 char *dst_addr_str;
51 uint16_t dst_port;
52 uint32_t ssrc;
53 char *all_payload_type_names; /* Name of codec derived from fixed or dynamic codec names */
54 uint32_t packet_count;
55 uint32_t total_nr;
56 uint32_t packet_expected; /* Count of expected packets, derived from length of RTP stream */
57 int32_t 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 bool 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 uint32_t sequence_err;
73 uint32_t first_packet_num;
74 uint32_t last_packet_num;
76
86
93
101
109
116
123
131int rtpstream_info_cmp(const void *aa, const void *bb);
132
140bool rtpstream_info_is_reverse(const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b);
141
149bool rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const uint8_t payload_type);
150
151/****************************************************************************/
152/* INTERFACE */
153
161void register_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo, const char *fstring, rtpstream_tap_error_cb tap_error);
162
168
174
179void rtpstream_reset_cb(void *arg);
180
187void rtp_write_header(rtpstream_info_t *strinfo, FILE *file);
188
199tap_packet_status rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *arg2, tap_flags_t flags);
200
207
213
220void rtpstream_info_analyse_init(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo);
221
228void rtpstream_info_analyse_process(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo);
229
235unsigned rtpstream_to_hash(const void *key);
236
242void rtpstream_info_multihash_insert(GHashTable *multihash, rtpstream_info_t *new_stream_info);
243
250rtpstream_info_t *rtpstream_info_multihash_lookup(GHashTable *multihash, rtpstream_id_t *stream_id);
251
258void rtpstream_info_multihash_destroy_value(void *key, void *value, void *user_data);
259
260#ifdef __cplusplus
261}
262#endif /* __cplusplus */
263
264#endif /* __TAP_RTP_COMMON_H__ */
Definition packet_info.h:40
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:25
Definition file-pcapng.h:57
void rtpstream_info_free_data(rtpstream_info_t *info)
Frees the data associated with an RTP stream info structure.
Definition tap-rtp-common.c:90
void rtpstream_reset_cb(void *arg)
Callback function for resetting RTP stream information.
Definition tap-rtp-common.c:171
unsigned rtpstream_to_hash(const void *key)
Get hash key for rtpstream_info_t.
Definition tap-rtp-common.c:554
void rtpstream_info_copy_deep(rtpstream_info_t *dest, const rtpstream_info_t *src)
Copies the contents of an RTP stream info structure to another.
Definition tap-rtp-common.c:67
void rtpstream_info_analyse_process(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo)
Update analyse counters in rtpstream_info_t from pinfo.
Definition tap-rtp-common.c:535
void rtpstream_info_free_all(rtpstream_info_t *info)
Frees all memory associated with an RTP stream info structure.
Definition tap-rtp-common.c:101
tap_packet_status rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *arg2, tap_flags_t flags)
Callback function for processing RTP packets.
void rtpstream_info_multihash_destroy_value(void *key, void *value, void *user_data)
GHFunc () for destroying GList in multihash.
bool rtpstream_info_is_reverse(const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b)
Compares the endpoints of two RTP streams.
Definition tap-rtp-common.c:126
void rtpstream_info_multihash_insert(GHashTable *multihash, rtpstream_info_t *new_stream_info)
Insert new_stream_info into multihash.
Definition tap-rtp-common.c:566
void rtpstream_reset(rtpstream_tapinfo_t *tapinfo)
Cleans up memory of rtp streams tap.
Definition tap-rtp-common.c:142
rtpstream_info_t * rtpstream_info_malloc_and_init(void)
Allocates memory for a new RTP stream info and initializes it.
Definition tap-rtp-common.c:55
void rtpstream_info_init(rtpstream_info_t *info)
Initializes an rtpstream_info_t structure by setting all its fields to zero or NULL.
Definition tap-rtp-common.c:48
void rtpstream_info_analyse_init(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo)
Init analyse counters in rtpstream_info_t from pinfo.
Definition tap-rtp-common.c:510
void remove_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo)
Removes the rtp_streams tap listener (if not already done)
Definition tap-rtp-common.c:204
void register_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo, const char *fstring, rtpstream_tap_error_cb tap_error)
Definition tap-rtp-common.c:214
rtpstream_info_t * rtpstream_info_multihash_lookup(GHashTable *multihash, rtpstream_id_t *stream_id)
Lookup stream_info in stream_info multihash.
Definition tap-rtp-common.c:595
bool rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const uint8_t payload_type)
Checks if payload_type is used in rtpstream.
Definition tap-rtp-common.c:291
void rtpstream_info_calc_free(rtpstream_info_calc_t *calc)
Free rtpstream_info_calc_t structure (internal items)
Definition tap-rtp-common.c:501
rtpstream_info_t * rtpstream_info_malloc_and_copy_deep(const rtpstream_info_t *src)
Allocates memory for a new RTP stream info and copies data from an existing one.
Definition tap-rtp-common.c:78
void rtp_write_header(rtpstream_info_t *strinfo, FILE *file)
Write the RTP header for a given stream information to a file.
Definition tap-rtp-common.c:303
int rtpstream_info_cmp(const void *aa, const void *bb)
Compares two RTP stream infos (GCompareFunc style comparison function)
Definition tap-rtp-common.c:109
void rtpstream_info_calculate(const rtpstream_info_t *strinfo, rtpstream_info_calc_t *calc)
Evaluate rtpstream_info_t calculations.
Definition tap-rtp-common.c:438
tap_packet_status
Definition tap.h:22