| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
tap-rtp-common.h
Go to the documentation of this file.
1
18
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
31 typedef enum {
32 TAP_RTP_NO_ERROR,
33 TAP_RTP_WRONG_CODEC,
34 TAP_RTP_WRONG_LENGTH,
35 TAP_RTP_PADDING_ERROR,
36 TAP_RTP_SHORT_FRAME,
37 TAP_RTP_FILE_OPEN_ERROR,
38 TAP_RTP_FILE_WRITE_ERROR,
39 TAP_RTP_NO_DATA
40} tap_rtp_error_type_t;
41
42
46 typedef struct _tap_rtp_save_info_t {
47 FILE *fp;
48 uint32_t count;
49 tap_rtp_error_type_t error_type;
50 bool saved;
51} tap_rtp_save_info_t;
52
53
57 typedef struct _rtpstream_info_calc {
58 char *src_addr_str;
59 uint16_t src_port;
60 char *dst_addr_str;
61 uint16_t dst_port;
62 uint32_t ssrc;
63 char *all_payload_type_names;
64
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;
71
72 /* --- Inter-packet timing --- */
73 double max_delta;
74 double min_delta;
75 double mean_delta;
76
77 /* --- Jitter --- */
78 double min_jitter;
79 double max_jitter;
80 double mean_jitter;
81 double max_skew;
82
83 /* --- Stream health --- */
84 bool problem;
85
86 /* --- Clock drift --- */
87 double clock_drift_ms;
88 double freq_drift_hz;
89 double freq_drift_perc;
90
91 /* --- Timing and frame extents --- */
92 double duration_ms;
93 uint32_t sequence_err;
94 double start_time_ms;
95 uint32_t first_packet_num;
96 uint32_t last_packet_num;
97} rtpstream_info_calc_t;
98
107 void rtpstream_info_init(rtpstream_info_t* info);
108
114 rtpstream_info_t *rtpstream_info_malloc_and_init(void);
115
122 void rtpstream_info_copy_deep(rtpstream_info_t *dest, const rtpstream_info_t *src);
123
130 rtpstream_info_t *rtpstream_info_malloc_and_copy_deep(const rtpstream_info_t *src);
131
137 void rtpstream_info_free_data(rtpstream_info_t* info);
138
144 void rtpstream_info_free_all(rtpstream_info_t* info);
145
153 int rtpstream_info_cmp(const void *aa, const void *bb);
154
162 bool rtpstream_info_is_reverse(const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b);
163
171 bool rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const uint8_t payload_type);
172
173/****************************************************************************/
174/* INTERFACE */
175
187 void register_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo, const char *fstring, rtpstream_tap_error_cb tap_error);
188
193 void remove_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo);
194
199 void rtpstream_reset(rtpstream_tapinfo_t *tapinfo);
200
205 void rtpstream_reset_cb(void *arg);
206
213 void rtp_write_header(rtpstream_info_t *strinfo, FILE *file);
214
225 tap_packet_status rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *arg2, tap_flags_t flags);
226
232 void rtpstream_info_calculate(const rtpstream_info_t *strinfo, rtpstream_info_calc_t *calc);
233
238 void rtpstream_info_calc_free(rtpstream_info_calc_t *calc);
239
246 void rtpstream_info_analyse_init(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo);
247
254 void rtpstream_info_analyse_process(rtpstream_info_t *stream_info, const packet_info *pinfo, const struct _rtp_info *rtpinfo);
255
261 unsigned rtpstream_to_hash(const void *key);
262
268 void rtpstream_info_multihash_insert(GHashTable *multihash, rtpstream_info_t *new_stream_info);
269
276 rtpstream_info_t *rtpstream_info_multihash_lookup(GHashTable *multihash, rtpstream_id_t *stream_id);
277
284 void 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__ */
epan_dissect_t
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
packet_info
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
rtp_stream.h
rtpstream_info_t
struct _rtpstream_info rtpstream_info_t
Holds all state and statistics accumulated for a single RTP stream.
rtpstream_id_t
struct _rtpstream_id rtpstream_id_t
_rtp_info
Definition packet-rtp.h:29
_rtpstream_info_calc
Computed statistics and metadata for a single RTP stream, ready for display in the UI.
Definition tap-rtp-common.h:57
_rtpstream_info_calc::min_jitter
double min_jitter
Definition tap-rtp-common.h:78
_rtpstream_info_calc::duration_ms
double duration_ms
Definition tap-rtp-common.h:92
_rtpstream_info_calc::min_delta
double min_delta
Definition tap-rtp-common.h:74
_rtpstream_info_calc::src_addr_str
char * src_addr_str
Definition tap-rtp-common.h:58
_rtpstream_info_calc::dst_port
uint16_t dst_port
Definition tap-rtp-common.h:61
_rtpstream_info_calc::freq_drift_hz
double freq_drift_hz
Definition tap-rtp-common.h:88
_rtpstream_info_calc::mean_delta
double mean_delta
Definition tap-rtp-common.h:75
_rtpstream_info_calc::lost_num
int32_t lost_num
Definition tap-rtp-common.h:69
_rtpstream_info_calc::freq_drift_perc
double freq_drift_perc
Definition tap-rtp-common.h:89
_rtpstream_info_calc::sequence_err
uint32_t sequence_err
Definition tap-rtp-common.h:93
_rtpstream_info_calc::src_port
uint16_t src_port
Definition tap-rtp-common.h:59
_rtpstream_info_calc::problem
bool problem
Definition tap-rtp-common.h:84
_rtpstream_info_calc::last_packet_num
uint32_t last_packet_num
Definition tap-rtp-common.h:96
_rtpstream_info_calc::ssrc
uint32_t ssrc
Definition tap-rtp-common.h:62
_rtpstream_info_calc::first_packet_num
uint32_t first_packet_num
Definition tap-rtp-common.h:95
_rtpstream_info_calc::clock_drift_ms
double clock_drift_ms
Definition tap-rtp-common.h:87
_rtpstream_info_calc::mean_jitter
double mean_jitter
Definition tap-rtp-common.h:80
_rtpstream_info_calc::start_time_ms
double start_time_ms
Definition tap-rtp-common.h:94
_rtpstream_info_calc::all_payload_type_names
char * all_payload_type_names
Definition tap-rtp-common.h:63
_rtpstream_info_calc::packet_expected
uint32_t packet_expected
Definition tap-rtp-common.h:68
_rtpstream_info_calc::dst_addr_str
char * dst_addr_str
Definition tap-rtp-common.h:60
_rtpstream_info_calc::max_delta
double max_delta
Definition tap-rtp-common.h:73
_rtpstream_info_calc::max_skew
double max_skew
Definition tap-rtp-common.h:81
_rtpstream_info_calc::packet_count
uint32_t packet_count
Definition tap-rtp-common.h:66
_rtpstream_info_calc::total_nr
uint32_t total_nr
Definition tap-rtp-common.h:67
_rtpstream_info_calc::max_jitter
double max_jitter
Definition tap-rtp-common.h:79
_rtpstream_info_calc::lost_perc
double lost_perc
Definition tap-rtp-common.h:70
_tap_rtp_save_info_t
Tracks the state and outcome of an in-progress RTP stream save operation.
Definition tap-rtp-common.h:46
_tap_rtp_save_info_t::fp
FILE * fp
Definition tap-rtp-common.h:47
_tap_rtp_save_info_t::count
uint32_t count
Definition tap-rtp-common.h:48
_tap_rtp_save_info_t::error_type
tap_rtp_error_type_t error_type
Definition tap-rtp-common.h:49
_tap_rtp_save_info_t::saved
bool saved
Definition tap-rtp-common.h:50
info
Definition file-pcapng.h:57
rtpstream_info_free_data
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
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
@ TAP_RTP_SHORT_FRAME
Definition tap-rtp-common.h:36
TAP_RTP_FILE_OPEN_ERROR
@ TAP_RTP_FILE_OPEN_ERROR
Definition tap-rtp-common.h:37
TAP_RTP_PADDING_ERROR
@ TAP_RTP_PADDING_ERROR
Definition tap-rtp-common.h:35
TAP_RTP_WRONG_LENGTH
@ TAP_RTP_WRONG_LENGTH
Definition tap-rtp-common.h:34
TAP_RTP_NO_DATA
@ TAP_RTP_NO_DATA
Definition tap-rtp-common.h:39
TAP_RTP_FILE_WRITE_ERROR
@ TAP_RTP_FILE_WRITE_ERROR
Definition tap-rtp-common.h:38
TAP_RTP_NO_ERROR
@ TAP_RTP_NO_ERROR
Definition tap-rtp-common.h:32
TAP_RTP_WRONG_CODEC
@ TAP_RTP_WRONG_CODEC
Definition tap-rtp-common.h:33
rtpstream_reset_cb
void rtpstream_reset_cb(void *arg)
Callback function for resetting RTP stream information.
Definition tap-rtp-common.c:171
rtpstream_to_hash
unsigned rtpstream_to_hash(const void *key)
Get hash key for rtpstream_info_t.
Definition tap-rtp-common.c:554
rtpstream_info_copy_deep
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
rtpstream_info_analyse_process
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
rtpstream_info_free_all
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
rtpstream_packet_cb
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.
rtpstream_info_multihash_destroy_value
void rtpstream_info_multihash_destroy_value(void *key, void *value, void *user_data)
GHFunc () for destroying GList in multihash.
rtpstream_info_calc_t
struct _rtpstream_info_calc rtpstream_info_calc_t
Computed statistics and metadata for a single RTP stream, ready for display in the UI.
rtpstream_info_is_reverse
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
rtpstream_info_multihash_insert
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
rtpstream_reset
void rtpstream_reset(rtpstream_tapinfo_t *tapinfo)
Cleans up memory of rtp streams tap.
Definition tap-rtp-common.c:142
rtpstream_info_malloc_and_init
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
rtpstream_info_init
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
rtpstream_info_analyse_init
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
remove_tap_listener_rtpstream
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
register_tap_listener_rtpstream
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_multihash_lookup
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
rtpstream_is_payload_used
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
rtpstream_info_calc_free
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_malloc_and_copy_deep
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
rtp_write_header
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
rtpstream_info_cmp
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
tap_rtp_save_info_t
struct _tap_rtp_save_info_t tap_rtp_save_info_t
Tracks the state and outcome of an in-progress RTP stream save operation.
rtpstream_info_calculate
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
tap_packet_status
Definition tap.h:22