[Git][NTPsec/ntpsec][util-pep263] 4 commits: mrulist: Fix "kod" and "limited" error "Unknown parameter"
Ian Bruene
gitlab at mg.gitlab.com
Wed May 3 01:20:19 UTC 2017
Ian Bruene pushed to branch util-pep263 at NTPsec / ntpsec
Commits:
7d1fb2d0 by Matt Nordhoff at 2017-05-02T20:17:11-05:00
mrulist: Fix "kod" and "limited" error "Unknown parameter"
- - - - -
50adba96 by Matt Nordhoff at 2017-05-02T20:17:12-05:00
mrulist: Make "resall" and "resany" hex instead of decimal
- - - - -
f0a6cea2 by Gary E. Miller at 2017-05-02T20:17:12-05:00
ntptime: fix dumb macro name: NS_PER_MS_FLOAT -> NS_PER_US_FLOAT
- - - - -
c3bff366 by Ian Bruene at 2017-05-02T20:17:12-05:00
Added utf-8 encoding declaration to python files.
- - - - -
19 changed files:
- ntpclients/ntpdig
- ntpclients/ntpkeygen
- ntpclients/ntploggps
- ntpclients/ntplogtemp
- ntpclients/ntpmon
- ntpclients/ntpq
- ntpclients/ntpsweep
- ntpclients/ntptrace
- ntpclients/ntpviz
- ntpclients/ntpwait
- ntptime/ntptime.c
- pylib/__init__.py
- pylib/packet.py
- pylib/statfiles.py
- pylib/util.py
- tests/pylib/test_statfiles.py
- tests/pylib/test_util.py
- wafhelpers/autorevision.sh
- wafhelpers/pythonize-header
Changes:
=====================================
ntpclients/ntpdig
=====================================
--- a/ntpclients/ntpdig
+++ b/ntpclients/ntpdig
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
"""
ntpdig - simple SNTP client
=====================================
ntpclients/ntpkeygen
=====================================
--- a/ntpclients/ntpkeygen
+++ b/ntpclients/ntpkeygen
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
#
# ntpkeygen - generate cryptographic keys for NTP clients and servers
#
=====================================
ntpclients/ntploggps
=====================================
--- a/ntpclients/ntploggps
+++ b/ntpclients/ntploggps
@@ -1,5 +1,6 @@
#!/usr/bin/env python
-# coding: utf-8
+# -*- coding: utf-8 -*-
+
"""\
usage: ntploggps [-h] [-o] [-l LOGFILE] [-v] [-V]
=====================================
ntpclients/ntplogtemp
=====================================
--- a/ntpclients/ntplogtemp
+++ b/ntpclients/ntplogtemp
@@ -1,4 +1,6 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
"""\
usage: ntplogtemp [-h] [-l LOGFILE] [-o] [-q] [-v] [-w WAIT] [-V]
=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -1,4 +1,6 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
# SPDX-License-Identifier: BSD-2-clause
'''\
Any keystroke causes a poll and update. Keystroke commands:
=====================================
ntpclients/ntpq
=====================================
--- a/ntpclients/ntpq
+++ b/ntpclients/ntpq
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
#
# ntpq - query an NTP server using mode 6 commands
#
=====================================
ntpclients/ntpsweep
=====================================
--- a/ntpclients/ntpsweep
+++ b/ntpclients/ntpsweep
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
"""
ntpsweep - print various information about given NTP servers
USAGE: ntpsweep [-<flag> [<val>] | --<name>[{=| }<val>]]... [hostfile]
=====================================
ntpclients/ntptrace
=====================================
--- a/ntpclients/ntptrace
+++ b/ntpclients/ntptrace
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
"""
ntptrace - trace peers of an NTP server
=====================================
ntpclients/ntpviz
=====================================
--- a/ntpclients/ntpviz
+++ b/ntpclients/ntpviz
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# coding: utf-8
+# -*- coding: utf-8 -*-
"""\
ntpviz - logfile visualizer for NTP log files
=====================================
ntpclients/ntpwait
=====================================
--- a/ntpclients/ntpwait
+++ b/ntpclients/ntpwait
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
"""\
ntpwait - Wait for ntpd to stabilize the system clock.
USAGE: ntpwait [-n tries] [-s sleeptime] [-v] [-h]
=====================================
ntptime/ntptime.c
=====================================
--- a/ntptime/ntptime.c
+++ b/ntptime/ntptime.c
@@ -32,7 +32,8 @@
# define TVUTOTSF(tvu) \
(uint32_t)((((uint64_t)(tvu) << 32) + US_PER_S / 2) / US_PER_S)
-#define NS_PER_MS_FLOAT 1000.0
+/* nano seconds per micro second */
+#define NS_PER_US_FLOAT 1000.0
/* MUSL port shim */
#ifndef HAVE_NTP_GETTIME
@@ -366,7 +367,7 @@ main(
printf(json ? jfmt7 : ofmt7, status, timex_state(status));
printf(json ? jfmt8 : ofmt8,
snprintb(sizeof(binbuf), binbuf, ntx.modes, TIMEX_MOD_BITS));
- ftemp = (double)ntx.offset/NS_PER_MS_FLOAT;
+ ftemp = (double)ntx.offset/NS_PER_US_FLOAT;
printf(json ? jfmt9 : ofmt9, ftemp);
ftemp = FP_UNSCALE(ntx.freq);
printf(json ? jfmt10 : ofmt10, ftemp, 1 << ntx.shift);
@@ -389,7 +390,7 @@ main(
if (ntx.shift != 0) {
ftemp = FP_UNSCALE(ntx.ppsfreq);
gtemp = FP_UNSCALE(ntx.stabil);
- htemp = (double)ntx.jitter/NS_PER_MS_FLOAT;
+ htemp = (double)ntx.jitter/NS_PER_US_FLOAT;
printf(json ? jfmt14 : ofmt14,
ftemp, gtemp, htemp);
printf(json ? jfmt15 : ofmt15,
=====================================
pylib/__init__.py
=====================================
--- a/pylib/__init__.py
+++ b/pylib/__init__.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
# SPDX-License-Identifier: BSD-2-clause
#
# This code runs compatibly under Python 2 and 3.x for x >= 2.
=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
"""
packet.py - definitions and classes for Python querying of NTP
@@ -1382,7 +1384,7 @@ Receive a nonce that can be replayed - combats source address spoofing
if sorter is None:
raise ControlException(SERR_BADSORT % sortkey)
for k in list(variables.keys()):
- if k in ("mincount", "resall", "resany",
+ if k in ("mincount", "resall", "resany", "kod", "limited",
"maxlstint", "laddr", "recent", "sort",
"frags", "limit"):
continue
@@ -1408,6 +1410,10 @@ Receive a nonce that can be replayed - combats source address spoofing
limit = min(3 * MAXFRAGS, self.ntpd_row_limit)
req_buf = "%s, frags=%d" % (nonce, frags)
if variables:
+ if 'resall' in variables:
+ variables['resall'] = hex(variables['resall'])
+ if 'resany' in variables:
+ variables['resany'] = hex(variables['resany'])
parms = ", " + ",".join([("%s=%s" % it)
for it in list(variables.items())])
else:
=====================================
pylib/statfiles.py
=====================================
--- a/pylib/statfiles.py
+++ b/pylib/statfiles.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
"""
statfiles.py - class for digesting and plotting NTP logfiles
=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -1,4 +1,4 @@
-# coding: utf-8
+# -*- coding: utf-8 -*-
# Common utility functions
# SPDX-License-Identifier: BSD-2-clause
=====================================
tests/pylib/test_statfiles.py
=====================================
--- a/tests/pylib/test_statfiles.py
+++ b/tests/pylib/test_statfiles.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# coding: utf-8
+# -*- coding: utf-8 -*-
import unittest
import ntp.statfiles
=====================================
tests/pylib/test_util.py
=====================================
--- a/tests/pylib/test_util.py
+++ b/tests/pylib/test_util.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# coding: utf-8
+# -*- coding: utf-8 -*-
import unittest
import ntp.util
=====================================
wafhelpers/autorevision.sh
=====================================
--- a/wafhelpers/autorevision.sh
+++ b/wafhelpers/autorevision.sh
@@ -609,6 +609,7 @@ pyOutput() {
1) PY_VCS_WC_MODIFIED="True" ;;
esac
tee << EOF
+# -*- coding: utf-8 -*-
# ${GENERATED_HEADER}
VCS_TYPE = "${VCS_TYPE}"
=====================================
wafhelpers/pythonize-header
=====================================
--- a/wafhelpers/pythonize-header
+++ b/wafhelpers/pythonize-header
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
"""
Generate a Python module from a C file of macro definitions.
@@ -35,6 +36,7 @@ impossibles = ("sizeof", "offsetof")
def pythonize(rfp, wfp):
"Pythonize a specified C header file."
+ wfp.write("# -*- coding: utf-8 -*-\n")
wfp.write("# This file was generated by pythonize-header;\n")
wfp.write("# DO NOT HAND-HACK IT!\n")
skipto = False
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/46b6eaca5923a01e3263e066d8706056653f3b7d...c3bff366f393c8815c7926c4f655da28da3d14bc
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/46b6eaca5923a01e3263e066d8706056653f3b7d...c3bff366f393c8815c7926c4f655da28da3d14bc
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170503/b6097419/attachment.html>
More information about the vc
mailing list