aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-08-24 21:31:56 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-08-24 21:31:56 +0000
commit6f43fbb2f088438dae20d4007df830863391b1c6 (patch)
tree7be99a00405385c14e1606c31906463d60107655 /gtk
parentef81f7d060f39b43cc8eadf86c8e965a3e820225 (diff)
EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ... What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere. As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon. Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way... As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number... svn path=/trunk/; revision=15520
Diffstat (limited to 'gtk')
-rw-r--r--gtk/file_dlg.c12
-rw-r--r--gtk/flow_graph.c4
-rw-r--r--gtk/io_stat.c5
-rw-r--r--gtk/main.c2
-rw-r--r--gtk/mgcp_stat.c7
-rw-r--r--gtk/packet_list.c22
-rw-r--r--gtk/rpc_progs.c7
-rw-r--r--gtk/rtp_analysis.c8
-rw-r--r--gtk/rtp_stream.c16
-rw-r--r--gtk/sctp_stat.c8
-rw-r--r--gtk/service_response_time_table.c5
-rw-r--r--gtk/tcp_graph.c16
-rw-r--r--gtk/voip_calls.c60
13 files changed, 77 insertions, 95 deletions
diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c
index 4cdcd7faa4..7288dc8396 100644
--- a/gtk/file_dlg.c
+++ b/gtk/file_dlg.c
@@ -118,12 +118,6 @@ static GtkWidget *range_tb;
#define PREVIEW_STR_MAX 200
-static double
-secs_usecs( guint32 s, guint32 us)
-{
- return (us / 1000000.0) + (double)s;
-}
-
/* set a new filename for the preview widget */
static wtap *
@@ -207,8 +201,8 @@ preview_do(GtkWidget *prev, wtap *wth)
gchar *err_info;
long data_offset;
const struct wtap_pkthdr *phdr;
- double start_time = 0; /* seconds, with msec resolution */
- double stop_time = 0; /* seconds, with msec resolution */
+ double start_time = 0; /* seconds, with nsec resolution */
+ double stop_time = 0; /* seconds, with nsec resolution */
double cur_time;
unsigned int packets = 0;
gboolean is_breaked = FALSE;
@@ -220,7 +214,7 @@ preview_do(GtkWidget *prev, wtap *wth)
time(&time_preview);
while ( (wtap_read(wth, &err, &err_info, &data_offset)) ) {
phdr = wtap_phdr(wth);
- cur_time = secs_usecs(phdr->ts.tv_sec, phdr->ts.tv_usec);
+ cur_time = nstime_to_sec( (const nstime_t *) &phdr->ts );
if(packets == 0) {
start_time = cur_time;
stop_time = cur_time;
diff --git a/gtk/flow_graph.c b/gtk/flow_graph.c
index cdd92c2f56..dbdfbe4b56 100644
--- a/gtk/flow_graph.c
+++ b/gtk/flow_graph.c
@@ -194,7 +194,7 @@ static int flow_graph_frame_add_to_graph(packet_info *pinfo)
gai = g_malloc(sizeof(graph_analysis_item_t));
gai->frame_num = pinfo->fd->num;
- gai->time= (double)pinfo->fd->rel_secs + (double) pinfo->fd->rel_usecs/1000000;
+ gai->time= nstime_to_sec(&pinfo->fd->rel_ts);
COPY_ADDRESS(&(gai->src_addr),&(pinfo->src));
COPY_ADDRESS(&(gai->dst_addr),&(pinfo->dst));
gai->port_src=pinfo->srcport;
@@ -250,7 +250,7 @@ static int flow_graph_tcp_add_to_graph(packet_info *pinfo, const struct tcpheade
gai = g_malloc(sizeof(graph_analysis_item_t));
gai->frame_num = pinfo->fd->num;
- gai->time= (double)pinfo->fd->rel_secs + (double) pinfo->fd->rel_usecs/1000000;
+ gai->time= nstime_to_sec(&pinfo->fd->rel_ts);
COPY_ADDRESS(&(gai->src_addr),&(pinfo->src));
COPY_ADDRESS(&(gai->dst_addr),&(pinfo->dst));
gai->port_src=pinfo->srcport;
diff --git a/gtk/io_stat.c b/gtk/io_stat.c
index 42274c9e15..1afabdd9bf 100644
--- a/gtk/io_stat.c
+++ b/gtk/io_stat.c
@@ -240,8 +240,7 @@ gtk_iostat_packet(void *g, packet_info *pinfo, epan_dissect_t *edt, const void *
* Find which interval this is supposed to to in and store the
* interval index as idx
*/
- time_delta.secs=pinfo->fd->rel_secs;
- time_delta.nsecs=pinfo->fd->rel_usecs*1000;
+ time_delta=pinfo->fd->rel_ts;
if(time_delta.nsecs<0){
time_delta.secs--;
time_delta.nsecs+=1000000000;
@@ -328,7 +327,7 @@ gtk_iostat_packet(void *g, packet_info *pinfo, epan_dissect_t *edt, const void *
t=t*1000000+new_time->nsecs/1000;
i=idx;
/* handle current interval */
- pt=pinfo->fd->rel_secs*1000000+pinfo->fd->rel_usecs;
+ pt=pinfo->fd->rel_ts.secs*1000000+pinfo->fd->rel_ts.nsecs/1000;
pt=pt%(git->io->interval*1000);
if(pt>t){
pt=t;
diff --git a/gtk/main.c b/gtk/main.c
index 9d782b5966..a9b18b4d51 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1221,7 +1221,7 @@ set_display_filename(capture_file *cf)
/* statusbar */
status_msg = g_strdup_printf(" File: \"%s\" %s %02u:%02u:%02u",
(cf->filename) ? cf->filename : "", size_str,
- cf->esec/3600, cf->esec%3600/60, cf->esec%60);
+ cf->elapsed_time.secs/3600, cf->elapsed_time.secs%3600/60, cf->elapsed_time.secs%60);
g_free(size_str);
statusbar_push_file_msg(status_msg);
g_free(status_msg);
diff --git a/gtk/mgcp_stat.c b/gtk/mgcp_stat.c
index 398f52639f..999d1f8af2 100644
--- a/gtk/mgcp_stat.c
+++ b/gtk/mgcp_stat.c
@@ -143,12 +143,7 @@ mgcpstat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
else {
ms->open_req_num--;
/* calculate time delta between request and response */
- delta.secs=pinfo->fd->abs_secs-mi->req_time.secs;
- delta.nsecs=pinfo->fd->abs_usecs*1000-mi->req_time.nsecs;
- if(delta.nsecs<0){
- delta.nsecs+=1000000000;
- delta.secs--;
- }
+ nstime_delta(&delta, &pinfo->fd->abs_ts, &mi->req_time);
if (strncasecmp(mi->code, "EPCF", 4) == 0 ) {
time_stat_update(&(ms->rtd[0]),&delta, pinfo);
diff --git a/gtk/packet_list.c b/gtk/packet_list.c
index 2b00695d8f..880860bb60 100644
--- a/gtk/packet_list.c
+++ b/gtk/packet_list.c
@@ -121,13 +121,13 @@ GtkWidget *packet_list;
a lower time stamp than any frame with a non-reference time;
if both packets' times are reference times, we compare the
times of the packets. */
-#define COMPARE_TS(secs, usecs) \
+#define COMPARE_TS(ts) \
((fdata1->flags.ref_time && !fdata2->flags.ref_time) ? -1 : \
(!fdata1->flags.ref_time && fdata2->flags.ref_time) ? 1 : \
- (fdata1->secs < fdata2->secs) ? -1 : \
- (fdata1->secs > fdata2->secs) ? 1 : \
- (fdata1->usecs < fdata2->usecs) ? -1 :\
- (fdata1->usecs > fdata2->usecs) ? 1 : \
+ (fdata1->ts.secs < fdata2->ts.secs) ? -1 : \
+ (fdata1->ts.secs > fdata2->ts.secs) ? 1 : \
+ (fdata1->ts.nsecs < fdata2->ts.nsecs) ? -1 :\
+ (fdata1->ts.nsecs > fdata2->ts.nsecs) ? 1 : \
COMPARE_FRAME_NUM())
static gint
packet_list_compare(EthCList *clist, gconstpointer ptr1, gconstpointer ptr2)
@@ -162,25 +162,25 @@ packet_list_compare(EthCList *clist, gconstpointer ptr1, gconstpointer ptr2)
case TS_ABSOLUTE:
case TS_ABSOLUTE_WITH_DATE:
- return COMPARE_TS(abs_secs, abs_usecs);
+ return COMPARE_TS(abs_ts);
case TS_RELATIVE:
- return COMPARE_TS(rel_secs, rel_usecs);
+ return COMPARE_TS(rel_ts);
case TS_DELTA:
- return COMPARE_TS(del_secs, del_usecs);
+ return COMPARE_TS(del_ts);
}
return 0;
case COL_ABS_TIME:
case COL_ABS_DATE_TIME:
- return COMPARE_TS(abs_secs, abs_usecs);
+ return COMPARE_TS(abs_ts);
case COL_REL_TIME:
- return COMPARE_TS(rel_secs, rel_usecs);
+ return COMPARE_TS(rel_ts);
case COL_DELTA_TIME:
- return COMPARE_TS(del_secs, del_usecs);
+ return COMPARE_TS(del_ts);
case COL_PACKET_LENGTH:
return COMPARE_NUM(pkt_len);
diff --git a/gtk/rpc_progs.c b/gtk/rpc_progs.c
index a78095dcbf..8d8d46a8ff 100644
--- a/gtk/rpc_progs.c
+++ b/gtk/rpc_progs.c
@@ -215,12 +215,7 @@ rpcprogs_packet(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
}
/* calculate time delta between request and reply */
- delta.secs=pinfo->fd->abs_secs-ri->req_time.secs;
- delta.nsecs=pinfo->fd->abs_usecs*1000-ri->req_time.nsecs;
- if(delta.nsecs<0){
- delta.nsecs+=1000000000;
- delta.secs--;
- }
+ nstime_delta(&delta, &pinfo->fd->abs_ts, &ri->req_time);
if((rp->max.secs==0)
&& (rp->max.nsecs==0) ){
diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c
index 5b5fad735e..e8310c6fe5 100644
--- a/gtk/rtp_analysis.c
+++ b/gtk/rtp_analysis.c
@@ -442,7 +442,7 @@ static int rtp_packet_add_graph(dialog_graph_graph_t *dgg, tap_rtp_stat_t *stati
if (dgg->ud->dlg.dialog_graph.start_time == -1){ /* it is the first */
dgg->ud->dlg.dialog_graph.start_time = statinfo->start_time;
}
- rtp_time = ((double)pinfo->fd->rel_secs + (double) pinfo->fd->rel_usecs/1000000) - dgg->ud->dlg.dialog_graph.start_time;
+ rtp_time = nstime_to_sec(&pinfo->fd->rel_ts) - dgg->ud->dlg.dialog_graph.start_time;
if(rtp_time<0){
return FALSE;
}
@@ -585,7 +585,7 @@ int rtp_packet_analyse(tap_rtp_stat_t *statinfo,
clock_rate = get_clock_rate(statinfo->pt);
/* store the current time and calculate the current jitter */
- current_time = (double)pinfo->fd->rel_secs + (double) pinfo->fd->rel_usecs/1000000;
+ current_time = nstime_to_sec(&pinfo->fd->rel_ts);
current_diff = fabs (current_time - (statinfo->time) - ((double)(rtpinfo->info_timestamp)-(double)(statinfo->timestamp))/clock_rate);
current_jitter = statinfo->jitter + ( current_diff - statinfo->jitter)/16;
statinfo->delta = current_time-(statinfo->time);
@@ -740,8 +740,8 @@ static int rtp_packet_add_info(GtkCList *clist,
time_t then;
gchar status[40];
GdkColor color = COLOR_DEFAULT;
- then = pinfo->fd->abs_secs;
- msecs = (guint16)(pinfo->fd->abs_usecs/1000);
+ then = pinfo->fd->abs_ts.secs;
+ msecs = (guint16)(pinfo->fd->abs_ts.nsecs/1000000);
tm_tmp = localtime(&then);
g_snprintf(timeStr,sizeof(timeStr),"%02d/%02d/%04d %02d:%02d:%02d.%03d",
tm_tmp->tm_mon + 1,
diff --git a/gtk/rtp_stream.c b/gtk/rtp_stream.c
index a003b24c99..d145639413 100644
--- a/gtk/rtp_stream.c
+++ b/gtk/rtp_stream.c
@@ -229,10 +229,10 @@ static int rtpstream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _
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;
@@ -283,8 +283,8 @@ static int rtpstream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _
/* 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);
@@ -296,8 +296,8 @@ static int rtpstream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _
/* 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);
diff --git a/gtk/sctp_stat.c b/gtk/sctp_stat.c
index 5599ac41b7..30a842b716 100644
--- a/gtk/sctp_stat.c
+++ b/gtk/sctp_stat.c
@@ -917,8 +917,8 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
addr = g_malloc(tmp_info.dst.len);
memcpy(addr, tmp_info.dst.data, tmp_info.dst.len);
sack->dst.data = addr;
- sack->secs=tsn->secs = (guint32)pinfo->fd->rel_secs;
- sack->usecs=tsn->usecs = (guint32)pinfo->fd->rel_usecs;
+ sack->secs=tsn->secs = (guint32)pinfo->fd->rel_ts.secs;
+ sack->usecs=tsn->usecs = (guint32)pinfo->fd->rel_ts.nsecs/1000;
if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) ||
((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID))
{
@@ -1131,8 +1131,8 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
addr = g_malloc(tmp_info.dst.len);
memcpy(addr, tmp_info.dst.data, tmp_info.dst.len);
sack->dst.data = addr;
- sack->secs=tsn->secs = (guint32)pinfo->fd->rel_secs;
- sack->usecs=tsn->usecs = (guint32)pinfo->fd->rel_usecs;
+ sack->secs=tsn->secs = (guint32)pinfo->fd->rel_ts.secs;
+ sack->usecs=tsn->usecs = (guint32)pinfo->fd->rel_ts.nsecs/1000;
if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) ||
((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID))
{
diff --git a/gtk/service_response_time_table.c b/gtk/service_response_time_table.c
index 1f7abb8cec..ca688c7a34 100644
--- a/gtk/service_response_time_table.c
+++ b/gtk/service_response_time_table.c
@@ -483,9 +483,8 @@ add_srt_table_data(srt_stat_table *rst, int index, const nstime_t *req_time, pac
}
/* calculate time delta between request and reply */
- t.secs=pinfo->fd->abs_secs;
- t.nsecs=pinfo->fd->abs_usecs*1000;
- get_timedelta(&delta, &t, req_time);
+ t=pinfo->fd->abs_ts;
+ nstime_delta(&delta, &t, req_time);
time_stat_update(&rp->stats, &delta, pinfo);
}
diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c
index a914c6c084..5c2da9343c 100644
--- a/gtk/tcp_graph.c
+++ b/gtk/tcp_graph.c
@@ -1778,10 +1778,10 @@ tapall_tcpip_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, cons
ts->direction)) {
segment->next = NULL;
segment->num = pinfo->fd->num;
- segment->rel_secs = pinfo->fd->rel_secs;
- segment->rel_usecs = pinfo->fd->rel_usecs;
- segment->abs_secs = pinfo->fd->abs_secs;
- segment->abs_usecs = pinfo->fd->abs_usecs;
+ segment->rel_secs = pinfo->fd->rel_ts.secs;
+ segment->rel_usecs = pinfo->fd->rel_ts.nsecs/1000;
+ segment->abs_secs = pinfo->fd->abs_ts.secs;
+ segment->abs_usecs = pinfo->fd->abs_ts.nsecs/1000;
segment->th_seq=tcphdr->th_seq;
segment->th_ack=tcphdr->th_ack;
segment->th_win=tcphdr->th_win;
@@ -1929,10 +1929,10 @@ static struct tcpheader *select_tcpip_session (capture_file *cf, struct segment
}
hdrs->num = fdata->num;
- hdrs->rel_secs = fdata->rel_secs;
- hdrs->rel_usecs = fdata->rel_usecs;
- hdrs->abs_secs = fdata->abs_secs;
- hdrs->abs_usecs = fdata->abs_usecs;
+ hdrs->rel_secs = fdata->rel_ts.secs;
+ hdrs->rel_usecs = fdata->rel_ts.nsecs/1000;
+ hdrs->abs_secs = fdata->abs_ts.secs;
+ hdrs->abs_usecs = fdata->abs_ts.nsecs/1000;
hdrs->th_seq=th.tcphdr->th_seq;
hdrs->th_ack=th.tcphdr->th_ack;
hdrs->th_win=th.tcphdr->th_win;
diff --git a/gtk/voip_calls.c b/gtk/voip_calls.c
index 5b255b5318..8d7b793fab 100644
--- a/gtk/voip_calls.c
+++ b/gtk/voip_calls.c
@@ -196,7 +196,7 @@ static int add_to_graph(voip_calls_tapinfo_t *tapinfo _U_, packet_info *pinfo, c
gai = g_malloc(sizeof(graph_analysis_item_t));
gai->frame_num = pinfo->fd->num;
- gai->time= (double)pinfo->fd->rel_secs + (double) pinfo->fd->rel_usecs/1000000;
+ gai->time= nstime_to_sec(&pinfo->fd->rel_ts);
COPY_ADDRESS(&(gai->src_addr),src_addr);
COPY_ADDRESS(&(gai->dst_addr),dst_addr);
@@ -479,8 +479,8 @@ RTP_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
if (!strinfo->pt_str) strinfo->pt_str = g_strdup(val_to_str(strinfo->pt, rtp_payload_type_short_vals, "%u"));
strinfo->npackets = 0;
strinfo->first_frame_num = pinfo->fd->num;
- strinfo->start_rel_sec = pinfo->fd->rel_secs;
- strinfo->start_rel_usec = pinfo->fd->rel_usecs;
+ strinfo->start_rel_sec = pinfo->fd->rel_ts.secs;
+ strinfo->start_rel_usec = pinfo->fd->rel_ts.nsecs/1000;
strinfo->setup_frame_number = pi->info_setup_frame_num;
strinfo->rtp_event = -1;
tapinfo->list = g_list_append(tapinfo->list, strinfo);
@@ -489,8 +489,8 @@ RTP_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
if (strinfo!=NULL){
/* Add the info to the existing RTP 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;
}
the_tapinfo_struct.redraw = TRUE;
@@ -661,8 +661,8 @@ SIPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
COPY_ADDRESS(&(strinfo->initial_speaker),&(pinfo->src));
strinfo->first_frame_num=pinfo->fd->num;
strinfo->selected=FALSE;
- strinfo->start_sec=pinfo->fd->rel_secs;
- strinfo->start_usec=pinfo->fd->rel_usecs;
+ strinfo->start_sec=pinfo->fd->rel_ts.secs;
+ strinfo->start_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->protocol=VOIP_SIP;
strinfo->prot_info=g_malloc(sizeof(sip_calls_info_t));
tmp_sipinfo=strinfo->prot_info;
@@ -726,8 +726,8 @@ SIPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
}
}
- strinfo->stop_sec=pinfo->fd->rel_secs;
- strinfo->stop_usec=pinfo->fd->rel_usecs;
+ strinfo->stop_sec=pinfo->fd->rel_ts.secs;
+ strinfo->stop_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->last_frame_num=pinfo->fd->num;
++(strinfo->npackets);
/* increment the packets counter of all calls */
@@ -891,8 +891,8 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
COPY_ADDRESS(&(strinfo->initial_speaker),&(pinfo->src));
strinfo->selected=FALSE;
strinfo->first_frame_num=pinfo->fd->num;
- strinfo->start_sec=pinfo->fd->rel_secs;
- strinfo->start_usec=pinfo->fd->rel_usecs;
+ strinfo->start_sec=pinfo->fd->rel_ts.secs;
+ strinfo->start_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->protocol=VOIP_ISUP;
if (pi->calling_number!=NULL){
strinfo->from_identity=g_strdup(pi->calling_number);
@@ -912,8 +912,8 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
}
if (strinfo!=NULL){
- strinfo->stop_sec=pinfo->fd->rel_secs;
- strinfo->stop_usec=pinfo->fd->rel_usecs;
+ strinfo->stop_sec=pinfo->fd->rel_ts.secs;
+ strinfo->stop_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->last_frame_num=pinfo->fd->num;
++(strinfo->npackets);
@@ -1319,8 +1319,8 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
COPY_ADDRESS(&(strinfo->initial_speaker),actrace_direction?&pstn_add:&(pinfo->src));
strinfo->first_frame_num=pinfo->fd->num;
strinfo->selected=FALSE;
- strinfo->start_sec=pinfo->fd->rel_secs;
- strinfo->start_usec=pinfo->fd->rel_usecs;
+ strinfo->start_sec=pinfo->fd->rel_ts.secs;
+ strinfo->start_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->protocol=VOIP_AC_ISDN;
strinfo->prot_info=g_malloc(sizeof(actrace_isdn_calls_info_t));
tmp_actrace_isdn_info=strinfo->prot_info;
@@ -1331,8 +1331,8 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
tapinfo->strinfo_list = g_list_append(tapinfo->strinfo_list, strinfo);
}
- strinfo->stop_sec=pinfo->fd->rel_secs;
- strinfo->stop_usec=pinfo->fd->rel_usecs;
+ strinfo->stop_sec=pinfo->fd->rel_ts.secs;
+ strinfo->stop_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->last_frame_num=pinfo->fd->num;
++(strinfo->npackets);
/* increment the packets counter of all calls */
@@ -1506,8 +1506,8 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
COPY_ADDRESS(&(strinfo->initial_speaker),&(pinfo->src));
strinfo->selected=FALSE;
strinfo->first_frame_num=pinfo->fd->num;
- strinfo->start_sec=pinfo->fd->rel_secs;
- strinfo->start_usec=pinfo->fd->rel_usecs;
+ strinfo->start_sec=pinfo->fd->rel_ts.secs;
+ strinfo->start_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->protocol=VOIP_H323;
strinfo->prot_info=g_malloc(sizeof(h323_calls_info_t));
tmp_h323info = strinfo->prot_info;
@@ -1538,8 +1538,8 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
COPY_ADDRESS(&(tmp_src),&(pinfo->src));
COPY_ADDRESS(&(tmp_dst),&(pinfo->dst));
- strinfo->stop_sec=pinfo->fd->rel_secs;
- strinfo->stop_usec=pinfo->fd->rel_usecs;
+ strinfo->stop_sec=pinfo->fd->rel_ts.secs;
+ strinfo->stop_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->last_frame_num=pinfo->fd->num;
++(strinfo->npackets);
/* increment the packets counter of all calls */
@@ -2091,7 +2091,7 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
check first if it is an ended call. We consider an ended call after 1sec we don't
get a packet in this Endpoint and the call has been released
*/
- diff_time = (pinfo->fd->rel_secs + (double)pinfo->fd->rel_secs/1000000) - (tmp_listinfo->stop_sec + (double)tmp_listinfo->stop_usec/1000000);
+ diff_time = nstime_to_sec(&pinfo->fd->rel_ts) - tmp_listinfo->stop_sec + (double)tmp_listinfo->stop_usec/1000000;
if ( ((tmp_listinfo->call_state == VOIP_CANCELLED) || (tmp_listinfo->call_state == VOIP_COMPLETED) || (tmp_listinfo->call_state == VOIP_REJECTED)) && (diff_time > 1) ){
tmp_listinfo->call_active_state = VOIP_INACTIVE;
} else {
@@ -2162,8 +2162,8 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
COPY_ADDRESS(&(strinfo->initial_speaker),&(pinfo->src));
strinfo->first_frame_num=pinfo->fd->num;
strinfo->selected=FALSE;
- strinfo->start_sec=pinfo->fd->rel_secs;
- strinfo->start_usec=pinfo->fd->rel_usecs;
+ strinfo->start_sec=pinfo->fd->rel_ts.secs;
+ strinfo->start_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->protocol=VOIP_MGCP;
strinfo->prot_info=g_malloc(sizeof(mgcp_calls_info_t));
tmp_mgcpinfo=strinfo->prot_info;
@@ -2249,8 +2249,8 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
comment = g_strdup_printf("MGCP %s %s%s", tmp_mgcpinfo->endpointId, (pi->mgcp_type == MGCP_REQUEST)?"Request":"Response", pi->is_duplicate?" Duplicate":"");
- strinfo->stop_sec=pinfo->fd->rel_secs;
- strinfo->stop_usec=pinfo->fd->rel_usecs;
+ strinfo->stop_sec=pinfo->fd->rel_ts.secs;
+ strinfo->stop_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->last_frame_num=pinfo->fd->num;
++(strinfo->npackets);
/* increment the packets counter of all calls */
@@ -2373,8 +2373,8 @@ ACTRACEcalls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
COPY_ADDRESS(&(strinfo->initial_speaker),actrace_direction?&pstn_add:&(pinfo->src));
strinfo->first_frame_num=pinfo->fd->num;
strinfo->selected=FALSE;
- strinfo->start_sec=pinfo->fd->rel_secs;
- strinfo->start_usec=pinfo->fd->rel_usecs;
+ strinfo->start_sec=pinfo->fd->rel_ts.secs;
+ strinfo->start_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->protocol=VOIP_AC_CAS;
strinfo->prot_info=g_malloc(sizeof(actrace_cas_calls_info_t));
tmp_actrace_cas_info=strinfo->prot_info;
@@ -2385,8 +2385,8 @@ ACTRACEcalls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
tapinfo->strinfo_list = g_list_append(tapinfo->strinfo_list, strinfo);
}
- strinfo->stop_sec=pinfo->fd->rel_secs;
- strinfo->stop_usec=pinfo->fd->rel_usecs;
+ strinfo->stop_sec=pinfo->fd->rel_ts.secs;
+ strinfo->stop_usec=pinfo->fd->rel_ts.nsecs/1000;
strinfo->last_frame_num=pinfo->fd->num;
++(strinfo->npackets);
/* increment the packets counter of all calls */