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
41
42
52
53
57typedef struct _rtpstream_info_calc {
59 uint16_t src_port;
61 uint16_t dst_port;
62 uint32_t ssrc;
65 /* --- Packet counts --- */
66 uint32_t packet_count;
67 uint32_t total_nr;
68 uint32_t packet_expected;
69 int32_t lost_num;
70 double lost_perc;
72 /* --- Inter-packet timing --- */
73 double max_delta;
74 double min_delta;
75 double mean_delta;
77 /* --- Jitter --- */
78 double min_jitter;
79 double max_jitter;
80 double mean_jitter;
81 double max_skew;
83 /* --- Stream health --- */
84 bool problem;
86 /* --- Clock drift --- */
91 /* --- Timing and frame extents --- */
92 double duration_ms;
93 uint32_t sequence_err;
96 uint32_t last_packet_num;
98
108
115
123
131
138
145
153int rtpstream_info_cmp(const void *aa, const void *bb);
154
162bool rtpstream_info_is_reverse(const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b);
163
171bool rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const uint8_t payload_type);
172
173/****************************************************************************/
174/* INTERFACE */
175
187void register_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo, const char *fstring, rtpstream_tap_error_cb tap_error);
188
194
200
205void rtpstream_reset_cb(void *arg);
206
213void rtp_write_header(rtpstream_info_t *strinfo, FILE *file);
214
225tap_packet_status rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *arg2, tap_flags_t flags);
226
233
239
246void rtpstream_info_analyse_init(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo);
247
254void rtpstream_info_analyse_process(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo);
255
261unsigned rtpstream_to_hash(const void *key);
262
268void rtpstream_info_multihash_insert(GHashTable *multihash, rtpstream_info_t *new_stream_info);
269
276rtpstream_info_t *rtpstream_info_multihash_lookup(GHashTable *multihash, rtpstream_id_t *stream_id);
277
284void rtpstream_info_multihash_destroy_value(void *key, void *value, void *user_data);
285
286#ifdef __cplusplus
287}
288#endif /* __cplusplus */
289
290#endif /* __TAP_RTP_COMMON_H__ */
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Definition packet-rtp.h:29
Definition rtp_stream_id.h:33
Computed statistics and metadata for a single RTP stream, ready for display in the UI.
Definition tap-rtp-common.h:57
double min_jitter
Definition tap-rtp-common.h:78
double duration_ms
Definition tap-rtp-common.h:92
double min_delta
Definition tap-rtp-common.h:74
char * src_addr_str
Definition tap-rtp-common.h:58
uint16_t dst_port
Definition tap-rtp-common.h:61
double freq_drift_hz
Definition tap-rtp-common.h:88
double mean_delta
Definition tap-rtp-common.h:75
int32_t lost_num
Definition tap-rtp-common.h:69
double freq_drift_perc
Definition tap-rtp-common.h:89
uint32_t sequence_err
Definition tap-rtp-common.h:93
uint16_t src_port
Definition tap-rtp-common.h:59
bool problem
Definition tap-rtp-common.h:84
uint32_t last_packet_num
Definition tap-rtp-common.h:96
uint32_t ssrc
Definition tap-rtp-common.h:62
uint32_t first_packet_num
Definition tap-rtp-common.h:95
double clock_drift_ms
Definition tap-rtp-common.h:87
double mean_jitter
Definition tap-rtp-common.h:80
double start_time_ms
Definition tap-rtp-common.h:94
char * all_payload_type_names
Definition tap-rtp-common.h:63
uint32_t packet_expected
Definition tap-rtp-common.h:68
char * dst_addr_str
Definition tap-rtp-common.h:60
double max_delta
Definition tap-rtp-common.h:73
double max_skew
Definition tap-rtp-common.h:81
uint32_t packet_count
Definition tap-rtp-common.h:66
uint32_t total_nr
Definition tap-rtp-common.h:67
double max_jitter
Definition tap-rtp-common.h:79
double lost_perc
Definition tap-rtp-common.h:70
Holds all state and statistics accumulated for a single RTP stream.
Definition rtp_stream.h:42
Definition rtp_stream.h:98
Tracks the state and outcome of an in-progress RTP stream save operation.
Definition tap-rtp-common.h:46
FILE * fp
Definition tap-rtp-common.h:47
uint32_t count
Definition tap-rtp-common.h:48
tap_rtp_error_type_t error_type
Definition tap-rtp-common.h:49
bool saved
Definition tap-rtp-common.h:50
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
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
tap_rtp_error_type_t
Error code indicating the outcome of an attempt to save RTP voice data to a file.
Definition tap-rtp-common.h:31
@ TAP_RTP_SHORT_FRAME
Definition tap-rtp-common.h:36
@ TAP_RTP_FILE_OPEN_ERROR
Definition tap-rtp-common.h:37
@ TAP_RTP_PADDING_ERROR
Definition tap-rtp-common.h:35
@ TAP_RTP_WRONG_LENGTH
Definition tap-rtp-common.h:34
@ TAP_RTP_NO_DATA
Definition tap-rtp-common.h:39
@ TAP_RTP_FILE_WRITE_ERROR
Definition tap-rtp-common.h:38
@ TAP_RTP_NO_ERROR
Definition tap-rtp-common.h:32
@ TAP_RTP_WRONG_CODEC
Definition tap-rtp-common.h:33
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.
struct _rtpstream_info_calc rtpstream_info_calc_t
Computed statistics and metadata for a single RTP stream, ready for display in the UI.
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)
Registers the rtp_streams tap listener (if not already done).
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
struct _tap_rtp_save_info_t tap_rtp_save_info_t
Tracks the state and outcome of an in-progress RTP stream save operation.
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