/* save rtp dump of stream_fwd */ gboolean rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtp_stream_info_t* stream, const gchar *filename) { gboolean was_registered; if (!tapinfo) { return FALSE; } was_registered = tapinfo->is_registered; /* open file for saving */ tapinfo->save_file = ws_fopen(filename, "wb"); if (tapinfo->save_file==NULL) { open_failure_alert_box(filename, errno, TRUE); return FALSE; } rtp_write_header(stream, tapinfo->save_file); if (ferror(tapinfo->save_file)) { write_failure_alert_box(filename, errno); fclose(tapinfo->save_file); return FALSE; } if (!tapinfo->is_registered) register_tap_listener_rtp_stream(tapinfo); tapinfo->mode = TAP_SAVE; tapinfo->filter_stream_fwd = stream; cf_retap_packets(cap_file); tapinfo->mode = TAP_ANALYSE; if (!was_registered) remove_tap_listener_rtp_stream(tapinfo); if (ferror(tapinfo->save_file)) { write_failure_alert_box(filename, errno); fclose(tapinfo->save_file); return FALSE; } if (fclose(tapinfo->save_file) == EOF) { write_failure_alert_box(filename, errno); return FALSE; } return TRUE; }
/* scan for RTP streams */ void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file) { gboolean was_registered; if (!tapinfo || !cap_file) { return; } was_registered = tapinfo->is_registered; if (!tapinfo->is_registered) register_tap_listener_rtp_stream(tapinfo); tapinfo->mode = TAP_ANALYSE; cf_retap_packets(cap_file); if (!was_registered) remove_tap_listener_rtp_stream(tapinfo); }
/* scan for RTP streams */ void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const char *fstring) { gboolean was_registered; if (!tapinfo || !cap_file) { return; } was_registered = tapinfo->is_registered; if (!tapinfo->is_registered) register_tap_listener_rtp_stream(tapinfo, fstring); /* RTP_STREAM_DEBUG("scanning %s, filter: %s", cap_file->filename, fstring); */ tapinfo->mode = TAP_ANALYSE; cf_retap_packets(cap_file); if (!was_registered) remove_tap_listener_rtp_stream(tapinfo); }
/* mark packets in stream_fwd or stream_rev */ void rtpstream_mark(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtp_stream_info_t* stream_fwd, rtp_stream_info_t* stream_rev) { gboolean was_registered; if (!tapinfo) { return; } was_registered = tapinfo->is_registered; if (!tapinfo->is_registered) register_tap_listener_rtp_stream(tapinfo); tapinfo->mode = TAP_MARK; tapinfo->filter_stream_fwd = stream_fwd; tapinfo->filter_stream_rev = stream_rev; cf_retap_packets(cap_file); tapinfo->mode = TAP_ANALYSE; if (!was_registered) remove_tap_listener_rtp_stream(tapinfo); }