summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-timed.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tcpdump/print-timed.c')
-rw-r--r--contrib/tcpdump/print-timed.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/tcpdump/print-timed.c b/contrib/tcpdump/print-timed.c
index af73ddb..9ad7668 100644
--- a/contrib/tcpdump/print-timed.c
+++ b/contrib/tcpdump/print-timed.c
@@ -20,31 +20,31 @@
*/
#ifndef lint
-static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.3 2001/05/17 18:33:23 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 <sys/param.h>
-#include <sys/time.h>
-#include <netinet/in.h>
+#include <tcpdump-stdinc.h>
+
#include <stdio.h>
#include <string.h>
#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;
@@ -86,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;
OpenPOWER on IntegriCloud