[Git][NTPsec/ntpsec][master] 3 commits: PEVNT_* and PEER_EVENT are defined in ntp.ntp_magic, not ntp.packet

Eric S. Raymond gitlab at mg.gitlab.com
Wed Nov 30 01:33:15 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
36160048 by Matt Selsky at 2016-11-29T20:33:04-05:00
PEVNT_* and PEER_EVENT are defined in ntp.ntp_magic, not ntp.packet

- - - - -
fab65471 by Matt Selsky at 2016-11-29T20:33:04-05:00
Rename loop variable to fix shadowing of class name

pyflakes reported:
ntpq/ntpq:1642: import 'cmd' from line 14 shadowed by loop variable

- - - - -
96f394ee by Eric S. Raymond at 2016-11-29T20:33:04-05:00
Some improved instrumentation.

- - - - -


2 changed files:

- ntpdig/main.c
- ntpq/ntpq


Changes:

=====================================
ntpdig/main.c
=====================================
--- a/ntpdig/main.c
+++ b/ntpdig/main.c
@@ -1509,20 +1509,21 @@ offset_calculation(
 
 #ifdef DEBUG
 	if (debug > 3) {
+		double ftime;
+		pkt_output(rpkt, rpktl, stdout);
 		printf("ntpdig rootdelay: %f\n", FPTOD(p_rdly));
 		printf("ntpdig rootdisp: %f\n", FPTOD(p_rdsp));
 		printf("ntpdig syncdist: %f\n", *synch_distance);
-
-		pkt_output(rpkt, rpktl, stdout);
-
-		printf("ntpdig offset_calculation: rpkt->reftime:\n");
+		printf("ntpdig offset_calculation: reftime: ");
 		l_fp_output(&p_ref, stdout);
-		printf("ntpdig offset_calculation: rpkt->org: ");
+		printf("ntpdig offset_calculation: org: ");
 		l_fp_output(&p_org, stdout);
-		printf("ntpdig offset_calculation: rpkt->rec: ");
+		printf("ntpdig offset_calculation: rec: ");
 		l_fp_output(&p_rec, stdout);
-		printf("ntpdig offset_calculation: rpkt->xmt: ");
+		printf("ntpdig offset_calculation: xmt: ");
 		l_fp_output(&p_xmt, stdout);
+		ftime = tv_dst->tv_sec + tv_dst->tv_usec / 1000.0;
+		printf("ntpdig dst %f\n", ftime);
 	}
 #endif
 


=====================================
ntpq/ntpq
=====================================
--- a/ntpq/ntpq
+++ b/ntpq/ntpq
@@ -317,19 +317,19 @@ usage: help [ command ]
                 elif (statval & 0x3) == OLD_CTL_PST_SEL_SYSPEER:
                     condition = "sys_peer"
             event_dict = {
-                ntp.packet.PEVNT_MOBIL: "mobilize",
-                ntp.packet.PEVNT_DEMOBIL: "demobilize",
-                ntp.packet.PEVNT_REACH: "reachable",
-                ntp.packet.PEVNT_UNREACH: "unreachable",
-                ntp.packet.PEVNT_RESTART: "restart",
-                ntp.packet.PEVNT_REPLY: "no_reply",
-                ntp.packet.PEVNT_RATE: "rate_exceeded",
-                ntp.packet.PEVNT_DENY: "access_denied",
-                ntp.packet.PEVNT_ARMED: "leap_armed",
-                ntp.packet.PEVNT_NEWPEER: "sys_peer",
-                ntp.packet.PEVNT_CLOCK: "clock_alarm",
+                ntp.ntp_magic.PEVNT_MOBIL: "mobilize",
+                ntp.ntp_magic.PEVNT_DEMOBIL: "demobilize",
+                ntp.ntp_magic.PEVNT_REACH: "reachable",
+                ntp.ntp_magic.PEVNT_UNREACH: "unreachable",
+                ntp.ntp_magic.PEVNT_RESTART: "restart",
+                ntp.ntp_magic.PEVNT_REPLY: "no_reply",
+                ntp.ntp_magic.PEVNT_RATE: "rate_exceeded",
+                ntp.ntp_magic.PEVNT_DENY: "access_denied",
+                ntp.ntp_magic.PEVNT_ARMED: "leap_armed",
+                ntp.ntp_magic.PEVNT_NEWPEER: "sys_peer",
+                ntp.ntp_magic.PEVNT_CLOCK: "clock_alarm",
                 }
-            last_event = event_dict.get(ntp.packet.PEER_EVENT|event, "")
+            last_event = event_dict.get(ntp.ntp_magic.PEER_EVENT|event, "")
             display = \
                      "%3d %5u  %04x   %3.3s  %4s  %4.4s %9.9s %11s %2lu" % \
                      (i + 1, peer.associd,
@@ -1637,8 +1637,8 @@ if __name__ == '__main__':
         else:
             for ihost in interpreter.chosts:
                 if session.openhost(*ihost):
-                    for cmd in interpreter.ccmds:
-                        interpreter.onecmd(cmd)
+                    for command in interpreter.ccmds:
+                        interpreter.onecmd(command)
                     session.close()
         raise SystemExit(0)
     except KeyboardInterrupt:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/5b693ea63d18523a776bf67f2cd90f53e2cd6726...96f394ee9e6d1459f6ec7c1a621f15b52c86654f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161130/e78fbba0/attachment.html>


More information about the vc mailing list