Prepare print-ntp.c for NTP Control Messages

Add shift constants LEAPSHIFT(6) and MODESHIFT(0).
Rename MODE_RES1 to MODE_CONTROL, adjusting ntp_mode_values[].
This commit is contained in:
Ulrich Windl 2017-08-23 14:55:27 +02:00 committed by Denis Ovsienko
parent b1ee9bac52
commit 1136bb5c53

View 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 }
};