]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-timed.c
More nd_ification of structures.
[tcpdump] / print-timed.c
index 395ab4bb7762947fe21664e5deb870018ff3c587..33397c0d20de9ac8e5d6e07c8da6d41458d7cba7 100644 (file)
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+/* \summary: BSD time daemon protocol printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "extract.h"
 
 /*
  * Time Synchronization Protocol
+ *
+ * http://docs.freebsd.org/44doc/smm/12.timed/paper.pdf
  */
 
 struct tsp_timeval {
@@ -119,11 +123,11 @@ 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)
-                       /* corrupt, skip the rest of the packet */
+                       /* invalid, skip the rest of the packet */
                        return;
                ND_PRINT((ndo, " time "));
                if (sec < 0 && usec != 0) {