#include "alert_box.h"
#include "simple_dialog.h"
+#include "file_util.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
/****************************************************************************/
/* GCompareFunc style comparison function for _rtp_stream_info */
-gint rtp_stream_info_cmp(gconstpointer aa, gconstpointer bb)
+static gint rtp_stream_info_cmp(gconstpointer aa, gconstpointer bb)
{
const struct _rtp_stream_info* a = aa;
const struct _rtp_stream_info* b = bb;
/****************************************************************************/
/* redraw the output */
-void rtpstream_draw(void *arg _U_)
+static void rtpstream_draw(void *arg _U_)
{
/* XXX: see rtpstream_on_update in rtp_streams_dlg.c for comments
gtk_signal_emit_by_name(top_level, "signal_rtpstream_update");
if (!strinfo) {
tmp_strinfo.npackets = 0;
tmp_strinfo.first_frame_num = pinfo->fd->num;
- tmp_strinfo.start_sec = pinfo->fd->abs_secs;
- tmp_strinfo.start_usec = pinfo->fd->abs_usecs;
- tmp_strinfo.start_rel_sec = pinfo->fd->rel_secs;
- tmp_strinfo.start_rel_usec = pinfo->fd->rel_usecs;
+ tmp_strinfo.start_sec = pinfo->fd->abs_ts.secs;
+ tmp_strinfo.start_usec = pinfo->fd->abs_ts.nsecs/1000;
+ tmp_strinfo.start_rel_sec = pinfo->fd->rel_ts.secs;
+ tmp_strinfo.start_rel_usec = pinfo->fd->rel_ts.nsecs/1000;
tmp_strinfo.tag_vlan_error = 0;
tmp_strinfo.tag_diffserv_error = 0;
tmp_strinfo.vlan_id = 0;
/* increment the packets counter for this stream */
++(strinfo->npackets);
- strinfo->stop_rel_sec = pinfo->fd->rel_secs;
- strinfo->stop_rel_usec = pinfo->fd->rel_usecs;
+ strinfo->stop_rel_sec = pinfo->fd->rel_ts.secs;
+ strinfo->stop_rel_usec = pinfo->fd->rel_ts.nsecs/1000;
/* increment the packets counter of all streams */
++(tapinfo->npackets);
/* XXX - what if rtpinfo->info_all_data_present is
FALSE, so that we don't *have* all the data? */
sample.header.rec_time =
- (pinfo->fd->abs_usecs + 1000000 - tapinfo->filter_stream_fwd->start_usec)/1000
- + (pinfo->fd->abs_secs - tapinfo->filter_stream_fwd->start_sec - 1)*1000;
+ (pinfo->fd->abs_ts.nsecs/1000 + 1000000 - tapinfo->filter_stream_fwd->start_usec)/1000
+ + (pinfo->fd->abs_ts.secs - tapinfo->filter_stream_fwd->start_sec - 1)*1000;
sample.header.frame_length = rtpinfo->info_data_len;
sample.frame = rtpinfo->info_data;
rtp_write_sample(&sample, tapinfo->save_file);
register_tap_listener_rtp_stream();
the_tapinfo_struct.mode = TAP_ANALYSE;
- cf_retap_packets(&cfile);
+ cf_retap_packets(&cfile, FALSE);
if (!was_registered)
remove_tap_listener_rtp_stream();
{
gboolean was_registered = the_tapinfo_struct.is_registered;
/* open file for saving */
- the_tapinfo_struct.save_file = fopen(filename, "wb");
+ the_tapinfo_struct.save_file = eth_fopen(filename, "wb");
if (the_tapinfo_struct.save_file==NULL) {
open_failure_alert_box(filename, errno, TRUE);
return FALSE;
the_tapinfo_struct.mode = TAP_SAVE;
the_tapinfo_struct.filter_stream_fwd = stream;
- cf_retap_packets(&cfile);
+ cf_retap_packets(&cfile, FALSE);
the_tapinfo_struct.mode = TAP_ANALYSE;
if (!was_registered)
the_tapinfo_struct.mode = TAP_MARK;
the_tapinfo_struct.filter_stream_fwd = stream_fwd;
the_tapinfo_struct.filter_stream_rev = stream_rev;
- cf_retap_packets(&cfile);
+ cf_retap_packets(&cfile, FALSE);
the_tapinfo_struct.mode = TAP_ANALYSE;
if (!was_registered)
/* TAP INTERFACE */
/****************************************************************************/
-/****************************************************************************/
-static void
-rtpstream_init_tap(char *dummy _U_)
-{
- /* XXX: never called? */
-}
-
-
/* XXX just copied from gtk/rpc_stat.c */
void protect_thread_critical_region(void);
void unprotect_thread_critical_region(void);
GString *error_string;
if (!the_tapinfo_struct.is_registered) {
- register_ethereal_tap("rtp", rtpstream_init_tap);
-
error_string = register_tap_listener("rtp", &the_tapinfo_struct,
NULL, rtpstream_reset_cb, rtpstream_packet,
rtpstream_draw);