| Wireshark 4.7.3 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
| Tracks the state and outcome of an in-progress RTP stream save operation. More...
struct | _rtpstream_info_calc
| Computed statistics and metadata for a single RTP stream, ready for display in the UI. More...

## Typedefs
typedef struct _tap_rtp_save_info_t | tap_rtp_save_info_t
| Tracks the state and outcome of an in-progress RTP stream save operation.
typedef struct _rtpstream_info_calc | rtpstream_info_calc_t
| Computed statistics and metadata for a single RTP stream, ready for display in the UI.

## 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 }
| Error code indicating the outcome of an attempt to save RTP voice data to a file. More...

## 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_t * | rtpstream_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_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.
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)
| Registers the rtp_streams tap listener (if not already done).
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_t * | rtpstream_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

## Enumeration Type Documentation

## ◆ tap_rtp_error_type_t

enum tap_rtp_error_type_t

Error code indicating the outcome of an attempt to save RTP voice data to a file.

Enumerator
TAP_RTP_NO_ERROR | Save operation completed successfully
TAP_RTP_WRONG_CODEC | Codec is unsupported or incompatible with the output format
TAP_RTP_WRONG_LENGTH | Payload length is invalid or inconsistent for the codec
TAP_RTP_PADDING_ERROR | RTP padding byte specifies a length exceeding the payload
TAP_RTP_SHORT_FRAME | Payload is too short to contain valid codec data
TAP_RTP_FILE_OPEN_ERROR | Output file could not be opened
TAP_RTP_FILE_WRITE_ERROR | A write operation to the output file failed
TAP_RTP_NO_DATA | No RTP payload data was available to save

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

Parameters

  tapinfo | Pointer to the RTP streams tap info structure.
  fstring | The filter string to apply to the tap listener.
  tap_error | Callback function to be called if an error occurs during tap registration.

## ◆ remove_tap_listener_rtpstream()

void remove_tap_listener_rtpstream | ( | rtpstream_tapinfo_t * | tapinfo | ) |

Removes the rtp_streams tap listener (if not already done).

Parameters

  tapinfo | Pointer 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

  strinfo | Pointer to the rtpstream_info_t structure containing the stream information.
  file | File 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_info | Pointer to the RTP stream info structure.
  pinfo | Pointer to the packet info structure.
  rtpinfo | Pointer 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_info | Pointer to the RTP stream info structure.
  pinfo | Pointer to the packet info structure.
  rtpinfo | Pointer 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

  calc | Pointer 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

  strinfo | Pointer to the RTP stream info structure.
  calc | Pointer 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

  aa | Pointer to the first RTP stream info.
  bb | Pointer 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

  dest | Pointer to the destination RTP stream info structure.
  src | Pointer 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

  info | Pointer 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

  info | Pointer 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

  info | Pointer 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_a | Pointer to the first RTP stream info.
  stream_b | Pointer 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

  src | Pointer 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

  key | Pointer to the key.
  value | Pointer to the value.
  user_data | Pointer 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

  multihash | Pointer to the multihash.
  new_stream_info | Pointer 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

  multihash | Pointer to the multihash.
  stream_id | Pointer 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_info | Pointer to the RTP stream info structure.
  payload_type | The 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

  arg | Pointer to user data (not used).
  pinfo | Packet information structure.
  edt | Epan dissector context.
  arg2 | Pointer to additional data (not used).
  flags | Tap flags.

Returns
  Status of the packet processing.

## ◆ rtpstream_reset()

void rtpstream_reset | ( | rtpstream_tapinfo_t * | tapinfo | ) |

Cleans up memory of rtp streams tap.

Parameters

  tapinfo | Pointer to the RTP streams tap info structure.

## ◆ rtpstream_reset_cb()

void rtpstream_reset_cb | ( | void * | arg | ) |

Callback function for resetting RTP stream information.

Parameters

  arg | Pointer to user data.

## ◆ rtpstream_to_hash()

unsigned rtpstream_to_hash | ( | const void * | key | ) |

Get hash key for rtpstream_info_t.

Parameters

  key | Pointer to the key.

Returns
  Hash value.