X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/cbd4cbb99cf9e68c67af16b5b20a050ef8819af6..refs/heads/tcpdump-3.8:/print-timed.c diff --git a/print-timed.c b/print-timed.c index 7d246ed7..1be1348b 100644 --- a/print-timed.c +++ b/print-timed.c @@ -20,30 +20,31 @@ */ #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.2 2001-05-09 01:21:43 fenner Exp $"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.7.2.2 2003-11-16 08:51:51 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include +#include + #include #include #include "timed.h" #include "interface.h" +#include "extract.h" -static char *tsptype[TSPTYPENUMBER] = +static const char *tsptype[TSPTYPENUMBER] = { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP", "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT", "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ", "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;