Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
tap-rtp-common.h File Reference
#include "ui/rtp_stream.h"

Go to the source code of this file.

Classes

struct  _tap_rtp_save_info_t
 
struct  _rtpstream_info_calc
 

Typedefs

typedef struct _tap_rtp_save_info_t tap_rtp_save_info_t
 
typedef struct _rtpstream_info_calc rtpstream_info_calc_t
 

Enumerations

enum  tap_rtp_error_type_t {
  TAP_RTP_NO_ERROR , TAP_RTP_WRONG_CODEC , TAP_RTP_WRONG_LENGTH , TAP_RTP_PADDING_ERROR ,
  TAP_RTP_SHORT_FRAME , TAP_RTP_FILE_OPEN_ERROR , TAP_RTP_FILE_WRITE_ERROR , TAP_RTP_NO_DATA
}
 

Functions

void rtpstream_info_init (rtpstream_info_t *info)
 Initializes an rtpstream_info_t structure by setting all its fields to zero or NULL.
 
rtpstream_info_trtpstream_info_malloc_and_init (void)
 Allocates memory for a new RTP stream info and initializes it.
 
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.
 
rtpstream_info_trtpstream_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.
 
void rtpstream_info_free_data (rtpstream_info_t *info)
 Frees the data associated with an RTP stream info structure.
 
void rtpstream_info_free_all (rtpstream_info_t *info)
 Frees all memory associated with an RTP stream info structure.
 
int rtpstream_info_cmp (const void *aa, const void *bb)
 Compares two RTP stream infos (GCompareFunc style comparison function)
 
bool rtpstream_info_is_reverse (const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b)
 Compares the endpoints of two RTP streams.
 
bool rtpstream_is_payload_used (const rtpstream_info_t *stream_info, const uint8_t payload_type)
 Checks if payload_type is used in rtpstream.
 
void register_tap_listener_rtpstream (rtpstream_tapinfo_t *tapinfo, const char *fstring, rtpstream_tap_error_cb tap_error)
 
void remove_tap_listener_rtpstream (rtpstream_tapinfo_t *tapinfo)
 Removes the rtp_streams tap listener (if not already done)
 
void rtpstream_reset (rtpstream_tapinfo_t *tapinfo)
 Cleans up memory of rtp streams tap.
 
void rtpstream_reset_cb (void *arg)
 Callback function for resetting RTP stream information.
 
void rtp_write_header (rtpstream_info_t *strinfo, FILE *file)
 Write the RTP header for a given stream information to a file.
 
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_calculate (const rtpstream_info_t *strinfo, rtpstream_info_calc_t *calc)
 Evaluate rtpstream_info_t calculations.
 
void rtpstream_info_calc_free (rtpstream_info_calc_t *calc)
 Free rtpstream_info_calc_t structure (internal items)
 
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.
 
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.
 
unsigned rtpstream_to_hash (const void *key)
 Get hash key for rtpstream_info_t.
 
void rtpstream_info_multihash_insert (GHashTable *multihash, rtpstream_info_t *new_stream_info)
 Insert new_stream_info into multihash.
 
rtpstream_info_trtpstream_info_multihash_lookup (GHashTable *multihash, rtpstream_id_t *stream_id)
 Lookup stream_info in stream_info multihash.
 
void rtpstream_info_multihash_destroy_value (void *key, void *value, void *user_data)
 GHFunc () for destroying GList in multihash.
 

Detailed Description

RTP streams handler functions used by tshark and wireshark

Copyright 2008, Ericsson AB By Balint Reczey balin.nosp@m.t.re.nosp@m.czey@.nosp@m.eric.nosp@m.sson..nosp@m.com

most functions are copied from ui/gtk/rtp_stream.c and ui/gtk/rtp_analysis.c Copyright 2003, Alcatel Business Systems By Lars Ruoff lars..nosp@m.ruof.nosp@m.f@gmx.nosp@m..net

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ 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). From that point on, the RTP streams list will be updated with every redissection. This function is also the entry point for the initialization routine of the tap system. So whenever rtp_stream.c is added to the list of WIRESHARK_TAP_SRCs, the tap will be registered on startup. If not, it will be registered on demand by the rtp_streams and rtp_analysis functions that need it.

◆ remove_tap_listener_rtpstream()

void remove_tap_listener_rtpstream ( rtpstream_tapinfo_t tapinfo)

Removes the rtp_streams tap listener (if not already done)

Parameters
tapinfoPointer to the RTP streams tap info structure.

◆ 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.

Parameters
strinfoPointer to the rtpstream_info_t structure containing the stream information.
fileFile pointer where the RTP header will be written.

◆ 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.

Parameters
stream_infoPointer to the RTP stream info structure.
pinfoPointer to the packet info structure.
rtpinfoPointer to the RTP info structure.

◆ 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.

Parameters
stream_infoPointer to the RTP stream info structure.
pinfoPointer to the packet info structure.
rtpinfoPointer to the RTP info structure.

◆ rtpstream_info_calc_free()

void rtpstream_info_calc_free ( rtpstream_info_calc_t calc)

Free rtpstream_info_calc_t structure (internal items)

Parameters
calcPointer to the calculation structure.

◆ rtpstream_info_calculate()

void rtpstream_info_calculate ( const rtpstream_info_t strinfo,
rtpstream_info_calc_t calc 
)

Evaluate rtpstream_info_t calculations.

Parameters
strinfoPointer to the RTP stream info structure.
calcPointer to the calculation structure.

◆ rtpstream_info_cmp()

int rtpstream_info_cmp ( const void *  aa,
const void *  bb 
)

Compares two RTP stream infos (GCompareFunc style comparison function)

Parameters
aaPointer to the first RTP stream info.
bbPointer to the second RTP stream info.
Returns
-1,0,1

◆ 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.

Parameters
destPointer to the destination RTP stream info structure.
srcPointer to the source RTP stream info structure.

◆ rtpstream_info_free_all()

void rtpstream_info_free_all ( rtpstream_info_t info)

Frees all memory associated with an RTP stream info structure.

Parameters
infoPointer to the rtpstream_info_t structure whose memory is to be freed.

◆ rtpstream_info_free_data()

void rtpstream_info_free_data ( rtpstream_info_t info)

Frees the data associated with an RTP stream info structure.

Parameters
infoPointer to the rtpstream_info_t structure whose data is to be freed.

◆ 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.

Functions for init and destroy of rtpstream_info_t and attached structures

Parameters
infoPointer to the rtpstream_info_t structure to be initialized.

◆ 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.

Parameters
stream_aPointer to the first RTP stream info.
stream_bPointer to the second RTP stream info.
Returns
true if the streams are reverse of each other, false otherwise.

◆ 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.

Parameters
srcPointer to the source RTP stream info.
Returns
Pointer to the newly allocated and copied RTP stream info.

◆ 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.

Returns
Pointer to the newly allocated and initialized RTP stream info.

◆ rtpstream_info_multihash_destroy_value()

void rtpstream_info_multihash_destroy_value ( void *  key,
void *  value,
void *  user_data 
)

GHFunc () for destroying GList in multihash.

Parameters
keyPointer to the key.
valuePointer to the value.
user_dataPointer to user data.

◆ rtpstream_info_multihash_insert()

void rtpstream_info_multihash_insert ( GHashTable *  multihash,
rtpstream_info_t new_stream_info 
)

Insert new_stream_info into multihash.

Parameters
multihashPointer to the multihash.
new_stream_infoPointer to the new RTP stream info structure.

◆ 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.

Parameters
multihashPointer to the multihash.
stream_idPointer to the RTP stream ID.
Returns
Pointer to the found RTP stream info structure or NULL if not found.

◆ 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.

Parameters
stream_infoPointer to the RTP stream info structure.
payload_typeThe payload type to check.
Returns
true if the payload type is used, false otherwise.

◆ 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.

Parameters
argPointer to user data (not used).
pinfoPacket information structure.
edtEpan dissector context.
arg2Pointer to additional data (not used).
flagsTap flags.
Returns
Status of the packet processing.

◆ rtpstream_reset()

void rtpstream_reset ( rtpstream_tapinfo_t tapinfo)

Cleans up memory of rtp streams tap.

Parameters
tapinfoPointer to the RTP streams tap info structure.

◆ rtpstream_reset_cb()

void rtpstream_reset_cb ( void *  arg)

Callback function for resetting RTP stream information.

Parameters
argPointer to user data.

◆ rtpstream_to_hash()

unsigned rtpstream_to_hash ( const void *  key)

Get hash key for rtpstream_info_t.

Parameters
keyPointer to the key.
Returns
Hash value.