]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-timed.c
Use more the ND_TTEST_1() macro
[tcpdump] / print-timed.c
index a1cd89e3f1a7a8aa05eebcc0a3c64faab5feed61..34eb61683744f87ababaabc584adc401413487ec 100644 (file)
@@ -19,6 +19,8 @@
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+/* \summary: BSD time daemon protocol printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -94,7 +96,7 @@ static const char *tsptype[TSPTYPENUMBER] =
 
 void
 timed_print(netdissect_options *ndo,
-            register const u_char *bp)
+            const u_char *bp)
 {
        const struct tsp *tsp = (const struct tsp *)bp;
        long sec, usec;
@@ -121,8 +123,8 @@ timed_print(netdissect_options *ndo,
        case TSP_SETDATE:
        case TSP_SETDATEREQ:
                ND_TCHECK(tsp->tsp_time);
-               sec = EXTRACT_32BITS(&tsp->tsp_time.tv_sec);
-               usec = EXTRACT_32BITS(&tsp->tsp_time.tv_usec);
+               sec = EXTRACT_BE_U_4(&tsp->tsp_time.tv_sec);
+               usec = EXTRACT_BE_U_4(&tsp->tsp_time.tv_usec);
                /* XXX The comparison below is always false? */
                if (usec < 0)
                        /* invalid, skip the rest of the packet */