X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/edb0e92cdcaf06168a38e632847b8fd2c0a62a2d..8f94d68a09e1103353cc7d1133d6dfdf7d5a920d:/print-timed.c diff --git a/print-timed.c b/print-timed.c index d6fc3b0f..3448865c 100644 --- a/print-timed.c +++ b/print-timed.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.5 2002-09-05 00:00:23 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.7 2002-12-11 07:14:10 guy Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -35,6 +35,7 @@ static const char rcsid[] = #include "timed.h" #include "interface.h" +#include "extract.h" static const char *tsptype[TSPTYPENUMBER] = { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP", @@ -43,7 +44,7 @@ static const char *tsptype[TSPTYPENUMBER] = "TEST", "SETDATE", "SETDATEREQ", "LOOP" }; void -timed_print(register const u_char *bp, u_int length) +timed_print(register const u_char *bp) { #define endof(x) ((u_char *)&(x) + sizeof (x)) struct tsp *tsp = (struct tsp *)bp; @@ -85,8 +86,8 @@ timed_print(register const u_char *bp, u_int length) fputs(" [|timed]", stdout); return; } - sec = ntohl((long)tsp->tsp_time.tv_sec); - usec = ntohl((long)tsp->tsp_time.tv_usec); + sec = EXTRACT_32BITS(&tsp->tsp_time.tv_sec); + usec = EXTRACT_32BITS(&tsp->tsp_time.tv_usec); if (usec < 0) /* corrupt, skip the rest of the packet */ return;