]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-timed.c
don't pass on src & dst MAC adresses to the isoclns decoder as MAC adresses
[tcpdump] / print-timed.c
index d6fc3b0f8792bab90b4850e3cf33b811fc25afb2..3448865c31fbe2c493bf93c47efdb643114e72c3 100644 (file)
@@ -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;