]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Prepare print-ntp.c for NTP Control Messages
authorUlrich Windl <[email protected]>
Wed, 23 Aug 2017 12:55:27 +0000 (14:55 +0200)
committerDenis Ovsienko <[email protected]>
Tue, 29 Aug 2017 13:46:03 +0000 (14:46 +0100)
Add shift constants LEAPSHIFT(6) and MODESHIFT(0).
Rename MODE_RES1 to MODE_CONTROL, adjusting ntp_mode_values[].

print-ntp.c

index e2a59240dfc8804391dc400c4fed038a2b3c310d..8edb58fc8e90056030ec73bd8ecace910bbe5f87 100644 (file)
@@ -143,10 +143,12 @@ struct ntpdata {
 #define        VERSIONMASK     0x38
 #define        VERSIONSHIFT    3
 #define LEAPMASK       0xc0
+#define LEAPSHIFT      6
 #ifdef MODEMASK
 #undef MODEMASK                                        /* Solaris sucks */
 #endif
 #define        MODEMASK        0x07
+#define        MODESHIFT       0
 
 /*
  *     Code values
@@ -157,7 +159,7 @@ struct ntpdata {
 #define        MODE_CLIENT     3       /* client */
 #define        MODE_SERVER     4       /* server */
 #define        MODE_BROADCAST  5       /* broadcast */
-#define        MODE_RES1       6       /* reserved */
+#define        MODE_CONTROL    6       /* control message */
 #define        MODE_RES2       7       /* reserved */
 
 /*
@@ -180,7 +182,7 @@ static const struct tok ntp_mode_values[] = {
     { MODE_CLIENT,    "Client" },
     { MODE_SERVER,    "Server" },
     { MODE_BROADCAST, "Broadcast" },
-    { MODE_RES1,      "Reserved" },
+    { MODE_CONTROL,   "Control Message" },
     { MODE_RES2,      "Reserved" },
     { 0, NULL }
 };