aboutsummaryrefslogtreecommitdiffstats
path: root/tap-smbstat.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-08-20 02:15:02 +0000
committerGuy Harris <guy@alum.mit.edu>2005-08-20 02:15:02 +0000
commite5c09b21aaecfab7b37d041065d65a5f8cb1cbda (patch)
treea9ba8e6470498037cf645b67d7b36fdbeb7ecaf1 /tap-smbstat.c
parent53b54d11ed45c44aac2d45d81580a40fb5b00a0f (diff)
Use get_timedelta() to get the difference between two times.
svn path=/trunk/; revision=15455
Diffstat (limited to 'tap-smbstat.c')
-rw-r--r--tap-smbstat.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/tap-smbstat.c b/tap-smbstat.c
index a2e2a32e0d..9c7d707349 100644
--- a/tap-smbstat.c
+++ b/tap-smbstat.c
@@ -56,7 +56,7 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
{
smbstat_t *ss=(smbstat_t *)pss;
const smb_info_t *si=psi;
- nstime_t delta;
+ nstime_t t, deltat;
timestat_t *sp=NULL;
/* we are only interested in reply packets */
@@ -87,15 +87,12 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
}
/* calculate time delta between request and reply */
- delta.secs=pinfo->fd->abs_secs-si->sip->req_time.secs;
- delta.nsecs=pinfo->fd->abs_usecs*1000-si->sip->req_time.nsecs;
- if(delta.nsecs<0){
- delta.nsecs+=1000000000;
- delta.secs--;
- }
+ t.secs=pinfo->fd->abs_secs;
+ t.nsecs=pinfo->fd->abs_usecs*1000;
+ get_timedelta(&deltat, &t, &si->sip->req_time);
if(sp){
- time_stat_update(sp,&delta, pinfo);
+ time_stat_update(sp,&deltat, pinfo);
}
return 1;