X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/0e40e56ff0942b9abf4fef2505fce40783fcdd5b..48ecdd0e0bb33d17852063fbf839b593f1dfc8bf:/print-timed.c diff --git a/print-timed.c b/print-timed.c index 35ab4b0b..55fbb39e 100644 --- a/print-timed.c +++ b/print-timed.c @@ -20,39 +20,31 @@ */ #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.1 2000-10-06 05:35:37 guy Exp $"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.9 2003-11-16 09:36:40 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include - -#include -#include "ip.h" -#include "udp.h" -#include "tcp.h" - -#include "timed.h" +#include #include #include +#include "timed.h" #include "interface.h" -#include "addrtoname.h" -#include "extract.h" /* must come after 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; @@ -94,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;