3 * RTP stream id functions 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_ID_H__
16 #define __RTP_STREAM_ID_H__
19 * "RTP Streams" dialog box common routines.
20 * @ingroup main_ui_group
23 #include <epan/address.h>
27 #endif /* __cplusplus */
32 /** Defines an rtp stream identification */
33 typedef struct _rtpstream_id
{
42 * Get hash of rtpstream_id
44 unsigned rtpstream_id_to_hash(const rtpstream_id_t
*id
);
47 * Copy rtpstream_id_t structure
49 void rtpstream_id_copy(const rtpstream_id_t
*src
, rtpstream_id_t
*dest
);
52 * Deep copy addresses and ports from pinfo
54 void rtpstream_id_copy_pinfo(const packet_info
*pinfo
, rtpstream_id_t
*dest
, bool swap_src_dst
);
57 * Shallow copy addresses and ports from pinfo
58 * Do not call rtpstream_id_free if you use this function.
60 void rtpstream_id_copy_pinfo_shallow(const packet_info
*pinfo
, rtpstream_id_t
*dest
, bool swap_src_dst
);
63 * Free memory allocated for id
64 * it releases address items only, do not release whole structure!
66 void rtpstream_id_free(rtpstream_id_t
*id
);
69 * Check if two rtpstream_id_t are equal
70 * - compare src_addr, dest_addr, src_port, dest_port
71 * - compare other items when requested
72 * Note: ssrc is the only other item now, but it is expected it will be extended later
74 #define RTPSTREAM_ID_EQUAL_NONE 0x0000
75 #define RTPSTREAM_ID_EQUAL_SSRC 0x0001
76 bool rtpstream_id_equal(const rtpstream_id_t
*id1
, const rtpstream_id_t
*id2
, unsigned flags
);
79 * Check if rtpstream_id_t is equal to pinfo
80 * - compare src_addr, dest_addr, src_port, dest_port with pinfo
81 * - if swap_src_dst is true, compare src to dst and vice versa
83 bool rtpstream_id_equal_pinfo(const rtpstream_id_t
*id
, const packet_info
*pinfo
, bool swap_src_dst
);
86 * Check if rtpstream_id_t is equal to pinfo and rtp_info
87 * - compare src_addr, dest_addr, src_port, dest_port with pinfo
88 * - compare ssrc with rtp_info
90 bool rtpstream_id_equal_pinfo_rtp_info(const rtpstream_id_t
*id
, const packet_info
*pinfo
, const struct _rtp_info
*rtp_info
);
93 * Get hash of rtpstream_id extracted from packet_info and _rtp_info
95 unsigned pinfo_rtp_info_to_hash(const packet_info
*pinfo
, const struct _rtp_info
*rtp_info
);
99 #endif /* __cplusplus */
101 #endif /* __RTP_STREAM_ID_H__ */