* Copyright 2008, Ericsson AB
* By Balint Reczey <balint.reczey@ericsson.com>
*
- * most functions are copied from gtk/rtp_stream.c and gtk/rtp_analisys.c
+ * most functions are copied from ui/gtk/rtp_stream.c and ui/gtk/rtp_analisys.c
* Copyright 2003, Alcatel Business Systems
* By Lars Ruoff <lars.ruoff@gmx.net>
*
#include "globals.h"
#include <epan/tap.h>
-#include "register.h"
#include <string.h>
#include <epan/rtp_pt.h>
#include <epan/addr_resolv.h>
#include <epan/dissectors/packet-rtp.h>
-#include "gtk/rtp_stream.h"
+#include "ui/gtk/rtp_stream.h"
#include "tap-rtp-common.h"
-
+/* XXX: are changes needed to properly handle situations where
+ info_all_data_present == FALSE ?
+ E.G., when captured frames are truncated.
+ */
/****************************************************************************/
/* GCompareFunc style comparison function for _rtp_stream_info */
rtp_write_sample(&sample, tapinfo->save_file);
}
}
- /* TODO: This doesn't belong here. We really shouldn't refer to cf_mark_frame()
- * which only make sense if we're using the GTK UI backend. This effectively forces
- * tshark/rawshark to implement a cf_mark_frame() stub */
+#ifdef __GTK_H__
else if (tapinfo->mode == TAP_MARK) {
if (rtp_stream_info_cmp(&tmp_strinfo, tapinfo->filter_stream_fwd)==0
|| rtp_stream_info_cmp(&tmp_strinfo, tapinfo->filter_stream_rev)==0)
cf_mark_frame(&cfile, pinfo->fd);
}
}
-
+#endif
return 0;
}
statinfo->sumtTS += 1.0 * current_time * nominaltime;
}
- /* Calculate the BW in Kbps adding the IP+UDP header to the RTP -> 20bytes(IP)+8bytes(UDP) = 28bytes */
- statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + 28;
+ /* Calculate the BW in Kbps adding the IP+UDP header to the RTP -> IP header+8bytes(UDP) */
+ statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + pinfo->iphdrlen + 8;
statinfo->bw_history[statinfo->bw_index].time = current_time;
/* Check if there are more than 1sec in the history buffer to calculate BW in bps. If so, remove those for the calculation */
statinfo->bw_start_index++;
if (statinfo->bw_start_index == BUFF_BW) statinfo->bw_start_index=0;
};
- statinfo->total_bytes += rtpinfo->info_data_len + 28;
+ /* IP hdr + UDP + RTP */
+ statinfo->total_bytes += rtpinfo->info_data_len + pinfo->iphdrlen + 8;
statinfo->bandwidth = (double)(statinfo->total_bytes*8)/1000;
statinfo->bw_index++;
if (statinfo->bw_index == BUFF_BW) statinfo->bw_index = 0;