X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/c19f2e8f2b2bfd57a9582552bf0eab769a0e19b1..25d016f61a3b38e9c048090980c6921b30d047f3:/util.c diff --git a/util.c b/util.c index a2ef36d7..d7aa1fa7 100644 --- a/util.c +++ b/util.c @@ -19,11 +19,6 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#ifndef lint -static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.109 2007-01-29 09:59:42 hannes Exp $ (LBL)"; -#endif - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -188,12 +183,12 @@ ts_print(register const struct timeval *tvp) if (b_sec == 0) { /* init timestamp for first packet */ b_usec = tvp->tv_usec; - b_sec = tvp->tv_sec; + b_sec = tvp->tv_sec; } d_usec = tvp->tv_usec - b_usec; d_sec = tvp->tv_sec - b_sec; - + while (d_usec < 0) { d_usec += 1000000; d_sec--; @@ -259,21 +254,21 @@ relts_print(int secs) */ int -print_unknown_data(const u_char *cp,const char *ident,int len) +print_unknown_data(netdissect_options *ndo, const u_char *cp,const char *ident,int len) { if (len < 0) { - printf("%sDissector error: print_unknown_data called with negative length", - ident); + ND_PRINT((ndo,"%sDissector error: print_unknown_data called with negative length", + ident)); return(0); } if (snapend - cp < len) len = snapend - cp; if (len < 0) { - printf("%sDissector error: print_unknown_data called with pointer past end of packet", - ident); + ND_PRINT((ndo,"%sDissector error: print_unknown_data called with pointer past end of packet", + ident)); return(0); } - hex_print(ident,cp,len); + hex_print(ndo, ident,cp,len); return(1); /* everything is ok */ }