[Git][NTPsec/ntpsec][master] OLD_CTL_PST_* constants were used, but never defined
Eric S. Raymond
gitlab at mg.gitlab.com
Sun Nov 27 17:34:49 UTC 2016
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
73c8e850 by Matt Selsky at 2016-11-27T12:28:00-05:00
OLD_CTL_PST_* constants were used, but never defined
ntp classic stored them in ntpq/ntpq-subs.c since they were never used anywhere
else
- - - - -
1 changed file:
- ntpq/ntpq
Changes:
=====================================
ntpq/ntpq
=====================================
--- a/ntpq/ntpq
+++ b/ntpq/ntpq
@@ -136,6 +136,19 @@ NTP_MODE = 0x8 # peer mode
NTP_2BIT = 0x9 # leap bits
NTP_FLOAT = 0xa # Float value
+# Old CTL_PST defines for version 2.
+OLD_CTL_PST_CONFIG = 0x80
+OLD_CTL_PST_AUTHENABLE = 0x40
+OLD_CTL_PST_AUTHENTIC = 0x20
+OLD_CTL_PST_REACH = 0x10
+OLD_CTL_PST_SANE = 0x08
+OLD_CTL_PST_DISP = 0x04
+
+OLD_CTL_PST_SEL_REJECT = 0
+OLD_CTL_PST_SEL_SELCAND = 1
+OLD_CTL_PST_SEL_SYNCCAND = 2
+OLD_CTL_PST_SEL_SYSPEER = 3
+
class Ntpq(cmd.Cmd):
"ntpq command interpreter"
def __init__(self, session):
@@ -251,18 +264,18 @@ usage: help [ command ]
}
condition = seldict[statval & 0x7]
else:
- if (statval & 0x3) == ntp.packet.OLD_CTL_PST_SEL_REJECT:
- if (statval & ntp.packet.OLD_CTL_PST_SANE) == 0:
+ if (statval & 0x3) == OLD_CTL_PST_SEL_REJECT:
+ if (statval & OLD_CTL_PST_SANE) == 0:
condition = "insane"
- elif (statval & ntp.packet.OLD_CTL_PST_DISP) == 0:
+ elif (statval & OLD_CTL_PST_DISP) == 0:
condition = "hi_disp"
else:
condition = ""
- elif (statval & 0x3) == ntp.packet.OLD_CTL_PST_SEL_SELCAND:
+ elif (statval & 0x3) == OLD_CTL_PST_SEL_SELCAND:
condition = "sel_cand"
- elif (statval & 0x3) == ntp.packet.OLD_CTL_PST_SEL_SYNCCAND:
+ elif (statval & 0x3) == OLD_CTL_PST_SEL_SYNCCAND:
condition = "sync_cand"
- elif (statval & 0x3) == ntp.packet.OLD_CTL_PST_SEL_SYSPEER:
+ elif (statval & 0x3) == OLD_CTL_PST_SEL_SYSPEER:
condition = "sys_peer"
event_dict = {
ntp.packet.PEVNT_MOBIL: "mobilize",
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/73c8e850b328ef79ce92ac011c4bba241ba3601d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161127/65f11bae/attachment.html>
More information about the vc
mailing list