[Git][NTPsec/ntpsec][master] ifdex cleanup.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Nov 10 02:28:20 UTC 2016


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


Commits:
4b308fd9 by Eric S. Raymond at 2016-11-09T21:27:47-05:00
ifdex cleanup.

- - - - -


4 changed files:

- devel/ifdex-ignores
- libntp/python_compatibility.h
- ntpd/ntp_control.c
- wscript


Changes:

=====================================
devel/ifdex-ignores
=====================================
--- a/devel/ifdex-ignores
+++ b/devel/ifdex-ignores
@@ -11,7 +11,6 @@
 # No output from this command means all symbols are accounted for
 
 # These are potential feature configuration symbols
-ENABLE_ASYMMETRIC	# Enable deep-space asymmetric mode in the protocol 
 ENABLE_ONCORE_SHMEM	# Should OnCore report via shmem?
 ENABLE_KILL_ON_TRAP	# Die on seccomp trap
 MSSNTP_PATH		# Set a default path for the MSSNTP feature.
@@ -50,6 +49,12 @@ DEBUG_PPS720		# Only in refclock_true.c
 # waf logic.
 ISC_PLATFORM_BRACEPTHREADONCEINIT
 
+# This is from a Python compatibility hack
+PY_MAJOR_VERSION
+
+# This is from a library header
+MOD_TIMETICK
+
 # Things WAF sets that don't get #undefs if they're not set
 ENABLE_EARLY_DROPROOT
 ENABLE_LEAP_SMEAR
@@ -170,6 +175,7 @@ USE_IPV6_MULTICAST_SUPPORT
 USE_LIFC_FAMILY
 USE_LIFC_FLAGS
 USE_OPENSSL_HASH
+USE_RANDOMIZE_RESPONSES
 USE_PCM_STYLE_SOUND
 USE_ROUTING_SOCKET
 YY_YY_NTP_PARSER_TAB_H_INCLUDED


=====================================
libntp/python_compatibility.h
=====================================
--- a/libntp/python_compatibility.h
+++ b/libntp/python_compatibility.h
@@ -8,8 +8,8 @@
  *     http://python3porting.com/cextensions.html
  */
 
-#ifndef _PYTHON_COMPATIBILITY_H_
-#define _PYTHON_COMPATIBILITY_H_
+#ifndef GUARD_PYTHON_COMPATIBILITY_H
+#define GUARD_PYTHON_COMPATIBILITY_H
 
 #include <Python.h>
 
@@ -41,4 +41,4 @@
 
 #endif /* !Python 3 */
 
-#endif /* _PYTHON_COMPATIBILITY_H_ */
+#endif /* GUARD_PYTHON_COMPATIBILITY_H */


=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -26,7 +26,7 @@
 #include "ntp_syscall.h"
 
 /* undefine to suppress random tags and get fixed emission order */
-#define RANDOMIZE_RESPONSES
+#define USE_RANDOMIZE_RESPONSES
 
 /*
  * Structure to hold request procedure information
@@ -85,9 +85,9 @@ static	void	read_clockstatus(struct recvbuf *, int);
 static	void	write_clockstatus(struct recvbuf *, int);
 static	void	configure	(struct recvbuf *, int);
 static	void	send_mru_entry	(mon_entry *, int);
-#ifdef RANDOMIZE_RESPONSES
+#ifdef USE_RANDOMIZE_RESPONSES
 static	void	send_random_tag_value(int);
-#endif /* RANDOMIZE_RESPONSES */
+#endif /* USE_RANDOMIZE_RESPONSES */
 static	void	read_mru_list	(struct recvbuf *, int);
 static	void	send_ifstats_entry(endpt *, u_int);
 static	void	read_ifstats	(struct recvbuf *);
@@ -3061,7 +3061,7 @@ static int validate_nonce(
 }
 
 
-#ifdef RANDOMIZE_RESPONSES
+#ifdef USE_RANDOMIZE_RESPONSES
 /*
  * send_random_tag_value - send a randomly-generated three character
  *			   tag prefix, a '.', an index, a '=' and a
@@ -3093,7 +3093,7 @@ send_random_tag_value(
 	snprintf(&buf[4], sizeof(buf) - 4, "%d", indx);
 	ctl_putuint(buf, noise);
 }
-#endif /* RANDOMIZE_RESPONSE */
+#endif /* USE_RANDOMIZE_RESPONSE */
 
 
 /*
@@ -3125,9 +3125,9 @@ send_mru_entry(
 	ZERO(sent);
 	noise = ntp_random();
 	while (remaining > 0) {
-#ifdef RANDOMIZE_RESPONSES
+#ifdef USE_RANDOMIZE_RESPONSES
 	 	which = (noise & 7) % COUNTOF(sent);
-#endif /* RANDOMIZE_RESPONSES */
+#endif /* USE_RANDOMIZE_RESPONSES */
 		noise >>= 3;
 		while (sent[which])
 			which = (which + 1) % COUNTOF(sent);
@@ -3498,10 +3498,10 @@ static void read_mru_list(
 			continue;
 
 		send_mru_entry(mon, count);
-#ifdef RANDOMIZE_RESPONSES
+#ifdef USE_RANDOMIZE_RESPONSES
 		if (!count)
 			send_random_tag_value(0);
-#endif /* RANDOMIZE_RESPONSES */
+#endif /* USE_RANDOMIZE_RESPONSES */
 		count++;
 		prior_mon = mon;
 	}
@@ -3511,10 +3511,10 @@ static void read_mru_list(
 	 * a now= l_fp timestamp.
 	 */
 	if (NULL == mon) {
-#ifdef RANDOMIZE_RESPONSES
+#ifdef USE_RANDOMIZE_RESPONSES
 		if (count > 1)
 			send_random_tag_value(count - 1);
-#endif /* RANDOMIZE_RESPONSES */
+#endif /* USE_RANDOMIZE_RESPONSES */
 		ctl_putts("now", &now);
 		/* if any entries were returned confirm the last */
 		if (prior_mon != NULL)
@@ -3567,9 +3567,9 @@ send_ifstats_entry(
 			noise = ntp_random();
 			noisebits = 31;
 		}
-#ifdef RANDOMIZE_RESPONSES
+#ifdef USE_RANDOMIZE_RESPONSES
 		which = (noise & 0xf) % COUNTOF(sent);
-#endif /* RANDOMIZE_RESPONSES */
+#endif /* USE_RANDOMIZE_RESPONSES */
 		noise >>= 4;
 		noisebits -= 4;
 
@@ -3646,9 +3646,9 @@ send_ifstats_entry(
 		sent[which] = true;
 		remaining--;
 	}
-#ifdef RANDOMIZE_RESPONSES
+#ifdef USE_RANDOMIZE_RESPONSES
 	send_random_tag_value((int)ifnum);
-#endif /* RANDOMIZE_RESPONSES */
+#endif /* USE_RANDOMIZE_RESPONSES */
 }
 
 
@@ -3750,9 +3750,9 @@ send_restrict_entry(
 			noise = ntp_random();
 			noisebits = 31;
 		}
-#ifdef RANDOMIZE_RESPONSES
+#ifdef USE_RANDOMIZE_RESPONSES
 		which = (noise & 0x3) % COUNTOF(sent);
-#endif /* RANDOMIZE_RESPONSES */
+#endif /* USE_RANDOMIZE_RESPONSES */
 		noise >>= 2;
 		noisebits -= 2;
 
@@ -3796,9 +3796,9 @@ send_restrict_entry(
 		sent[which] = true;
 		remaining--;
 	}
-#ifdef RANDOMIZE_RESPONSES
+#ifdef USE_RANDOMIZE_RESPONSES
 	send_random_tag_value((int)idx);
-#endif /* RANDOMIZE_RESPONSES */
+#endif /* USE_RANDOMIZE_RESPONSES */
 }
 
 


=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -225,6 +225,14 @@ def build(ctx):
 		from waflib import Options
 		Options.options.no_tests = True
 
+#
+# Miscellaneous utility productions
+#
+
+def ifdex(ctx):
+    "Get a report on configuration symbols not accounted for."
+    ctx.exec_command("ifdex -X build/config.h -X devel/ifdex-ignores .")
+
 # The following sets edit modes for GNU EMACS
 # Local Variables:
 # mode:python



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4b308fd93fccb005d7ae2e6ee6be0605522cf7cf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161110/ba236de1/attachment.html>


More information about the vc mailing list