[Git][NTPsec/ntpsec][master] 10 commits: libisc: rm isc/util.h. move last 2 bits into isc/error.h

Gary E. Miller gitlab at mg.gitlab.com
Tue Jun 6 19:40:37 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
10f375b5 by Gary E. Miller at 2017-06-05T21:02:16-07:00
libisc: rm isc/util.h. move last 2 bits into isc/error.h

- - - - -
9d3187c6 by Gary E. Miller at 2017-06-06T11:51:48-07:00
libisc: merge isc/formatcheck.h into isc/error.h

It just had one macro, and that macro only used where isc/error.h
is used.

- - - - -
cd2ad699 by Gary E. Miller at 2017-06-06T11:58:16-07:00
libisc: move ISC_LINK() into isc/sockaddr.h

isc/sockaddr.h is the only place ISC_LINK() was needed.

- - - - -
aff31961 by Gary E. Miller at 2017-06-06T12:01:36-07:00
libisc: remove isc/list.h and its traces.

Unused header.

- - - - -
58cf1598 by Gary E. Miller at 2017-06-06T12:13:50-07:00
libisc: merge isc/net.h into isc/netaddr.h

isc/netaddr.h included isc/net.h and they were always used together.

- - - - -
f806e83c by Gary E. Miller at 2017-06-06T12:20:12-07:00
libisc: remove unused isc_*_t types.

- - - - -
74112b56 by Gary E. Miller at 2017-06-06T12:28:14-07:00
libisc: move isc_sockaddr_t and isc_netaddr_t into isc/netaddr.h

isc/netaddr.h is where they are used.

- - - - -
a0eebabb by Gary E. Miller at 2017-06-06T12:31:48-07:00
libisc: move isc_interface_t, isc_interfaceiter_t, isc_mem_t

Put them in isc/interfaceiter.h where they are used.

- - - - -
73d791ba by Gary E. Miller at 2017-06-06T12:34:12-07:00
libisc: move isc_result_t into isc/result.h.

isc/reulst.h is where it is used.

- - - - -
c845da3d by Gary E. Miller at 2017-06-06T12:39:24-07:00
libisc: remove unused isc/types.h

The few bits in isc/types.h already move to better places.

- - - - -


22 changed files:

- devel/ifdex-ignores
- include/isc/mem.h
- include/ntp_net.h
- libisc/ifiter_getifaddrs.c
- libisc/include/isc/error.h
- − libisc/include/isc/formatcheck.h
- libisc/include/isc/interfaceiter.h
- − libisc/include/isc/list.h
- − libisc/include/isc/net.h
- libisc/include/isc/netaddr.h
- libisc/include/isc/result.h
- libisc/include/isc/sockaddr.h
- − libisc/include/isc/types.h
- − libisc/include/isc/util.h
- libisc/interfaceiter.c
- libisc/net.c
- libisc/netaddr.c
- libntp/initnetwork.c
- libntp/lib_strbuf.c
- libntp/pymodule.c
- ntpd/ntp_config.c
- ntpd/ntpd.c


Changes:

=====================================
devel/ifdex-ignores
=====================================
--- a/devel/ifdex-ignores
+++ b/devel/ifdex-ignores
@@ -36,7 +36,6 @@ NTPD_PRIO		# Priority to set the daemon to
 
 # Fine-grained debugging and tracing, not presently settable from waf
 DEBUG
-ISC_LIST_CHECKINIT	# Debugging flag
 USEBACKTRACE	        # Use backtrace code, set by --enable-debug-gdb
 DEBUG_PARSELIB		# Enable debugging in the parse library.
 NTP_DEBUG_LISTS		# Debug list handling


=====================================
include/isc/mem.h
=====================================
--- a/include/isc/mem.h
+++ b/include/isc/mem.h
@@ -17,7 +17,7 @@
 
 #include <stdio.h>
 
-#include "isc/types.h"
+#include "isc/result.h"
 
 #include "ntp_stdlib.h"
 


=====================================
include/ntp_net.h
=====================================
--- a/include/ntp_net.h
+++ b/include/ntp_net.h
@@ -10,7 +10,7 @@
 #include <net/if.h>
 #include <netinet/in.h>
 #include <netdb.h>
-#include "isc/net.h"    /* use local copy of isc/net.h, not system copy */
+#include "isc/netaddr.h"  /* use local copy of isc/netddr.h, not system copy */
 
 #include "ntp_malloc.h"
 


=====================================
libisc/ifiter_getifaddrs.c
=====================================
--- a/libisc/ifiter_getifaddrs.c
+++ b/libisc/ifiter_getifaddrs.c
@@ -12,7 +12,8 @@
 
 #include <ifaddrs.h>
 
-#include "isc/util.h"	/* for IGNORE */
+#include "ntp_assert.h"
+#include "isc/error.h"
 
 /*% Iterator Magic */
 #define IFITER_MAGIC		ISC_MAGIC('I', 'F', 'I', 'G')


=====================================
libisc/include/isc/error.h
=====================================
--- a/libisc/include/isc/error.h
+++ b/libisc/include/isc/error.h
@@ -12,7 +12,21 @@
 
 #include <stdarg.h>
 
-#include "isc/formatcheck.h"
+/*
+ * ISC_FORMAT_PRINTF().
+ *
+ * fmt is the location of the format string parameter.
+ * args is the location of the first argument (or 0 for no argument checking).
+ * 
+ * Note:
+ * The first parameter is 1, not 0.
+ */
+#ifdef __GNUC__
+#define ISC_FORMAT_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
+#else
+#define ISC_FORMAT_PRINTF(fmt, args)
+#endif
+
 
 typedef void (*isc_errorcallback_t)(const char *, int, const char *, va_list);
 
@@ -29,6 +43,12 @@ void
 isc_error_unexpected(const char *, int, const char *, ...)
      ISC_FORMAT_PRINTF(3, 4);
 
+/*% Unexpected Error */
+#define UNEXPECTED_ERROR		isc_error_unexpected
+
+/* hack to ignore GCC Unused Result */
+#define ISC_IGNORE(r) do{if(r){}}while(0)
+
 /*% fatal error */
 void
 isc_error_fatal(const char *, int, const char *, ...)


=====================================
libisc/include/isc/formatcheck.h deleted
=====================================
--- a/libisc/include/isc/formatcheck.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001  Internet Software Consortium.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-#ifndef GUARD_ISC_FORMATCHECK_H
-#define GUARD_ISC_FORMATCHECK_H 1
-
-/*! \file isc/formatcheck.h */
-
-/*%
- * ISC_FORMAT_PRINTF().
- *
- * \li fmt is the location of the format string parameter.
- * \li args is the location of the first argument (or 0 for no argument checking).
- * 
- * Note:
- * \li The first parameter is 1, not 0.
- */
-#ifdef __GNUC__
-#define ISC_FORMAT_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
-#else
-#define ISC_FORMAT_PRINTF(fmt, args)
-#endif
-
-#endif /* GUARD_ISC_FORMATCHECK_H */


=====================================
libisc/include/isc/interfaceiter.h
=====================================
--- a/libisc/include/isc/interfaceiter.h
+++ b/libisc/include/isc/interfaceiter.h
@@ -29,7 +29,11 @@
  ***/
 
 #include "isc/netaddr.h"
-#include "isc/types.h"
+#include "isc/result.h"
+
+typedef struct isc_interface	 isc_interface_t;      /* Interface */
+typedef struct isc_interfaceiter isc_interfaceiter_t;  /* Interface Iterator */
+typedef struct isc_mem           isc_mem_t;	       /* Memory */
 
 /*!
  * \brief Public structure describing a network interface.


=====================================
libisc/include/isc/list.h deleted
=====================================
--- a/libisc/include/isc/list.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright (C) 2004, 2006, 2007, 2011, 2012  Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1997-2002  Internet Software Consortium.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-#ifndef GUARD_ISC_LIST_H
-#define GUARD_ISC_LIST_H 1
-
-#define ISC_LIST(type) struct { type *head, *tail; }
-
-#define ISC_LINK(type) struct { type *prev, *next; }
-
-#endif /* GUARD_ISC_LIST_H */


=====================================
libisc/include/isc/net.h deleted
=====================================
--- a/libisc/include/isc/net.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2007, 2008, 2012  Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003  Internet Software Consortium.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-#ifndef GUARD_ISC_NET_H
-#define GUARD_ISC_NET_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file
- * \brief
- * Basic Networking Types
- *
- * This module is responsible for defining the following basic networking
- * types:
- *
- *\li		struct in_addr
- *\li		struct in6_addr
- *\li		struct in6_pktinfo
- *\li		struct sockaddr
- *\li		struct sockaddr_in
- *\li		struct sockaddr_in6
- *\li		in_port_t
- *
- * It declares ntoh[sl]() and hton[sl]().
- *
- * MP:
- *\li	No impact.
- *
- * Reliability:
- *\li	No anticipated impact.
- *
- * Resources:
- *\li	N/A.
- *
- * Security:
- *\li	No anticipated impact.
- *
- * Standards:
- *\li	BSD Socket API
- *\li	RFC 2553
- */
-
-/***
- *** Imports.
- ***/
-
-/* for struct sockaddr on *BSD */
-#include <sys/socket.h>                /* Contractual promise. */
-
-#include <netinet/in.h>		/* Contractual promise. */
-#include "isc/types.h"
-
-/***
- *** Functions.
- ***/
-
-bool isc_net_probeipv4_bool(void);
-
-isc_result_t
-isc_net_probeipv4(void);
-/*%<
- * Check if the system's kernel supports IPv4.
- *
- * Returns:
- *
- *\li	#ISC_R_SUCCESS		IPv4 is supported.
- *\li	#ISC_R_NOTFOUND		IPv4 is not supported.
- *\li	#ISC_R_DISABLED		IPv4 is disabled.
- *\li	#ISC_R_UNEXPECTED
- */
-
-bool isc_net_probeipv6_bool(void);
-
-isc_result_t
-isc_net_probeipv6(void);
-/*%<
- * Check if the system's kernel supports IPv6.
- *
- * Returns:
- *
- *\li	#ISC_R_SUCCESS		IPv6 is supported.
- *\li	#ISC_R_NOTFOUND		IPv6 is not supported.
- *\li	#ISC_R_DISABLED		IPv6 is disabled.
- *\li	#ISC_R_UNEXPECTED
- */
-
-bool
-isc_net_probe_ipv6only_bool(void);
-isc_result_t
-isc_net_probe_ipv6only(void);
-
-/*
- * Check if the system's kernel supports the IPV6_(RECV)PKTINFO socket option
- * for UDP sockets.
- *
- * Returns:
- *
- * \li	#ISC_R_SUCCESS		the option is supported.
- * \li	#ISC_R_NOTFOUND		IPv6 itself or the option is not supported.
- * \li	#ISC_R_UNEXPECTED
- */
-
-#endif /* GUARD_ISC_NET_H */


=====================================
libisc/include/isc/netaddr.h
=====================================
--- a/libisc/include/isc/netaddr.h
+++ b/libisc/include/isc/netaddr.h
@@ -11,8 +11,98 @@
 /*! \file isc/netaddr.h */
 
 #include <stdbool.h>
-#include "isc/net.h"
-#include "isc/types.h"
+/* for struct sockaddr on *BSD */
+#include <sys/socket.h>                /* Contractual promise. */
+
+#include <netinet/in.h>		/* Contractual promise. */
+#include "isc/result.h"
+
+/*
+ * Basic Networking Types
+ *
+ * This module is responsible for defining the following basic networking
+ * types:
+ *
+ *		struct in_addr
+ *		struct in6_addr
+ *		struct in6_pktinfo
+ *		struct sockaddr
+ *		struct sockaddr_in
+ *		struct sockaddr_in6
+ *i		in_port_t
+ *
+ * It declares ntoh[sl]() and hton[sl]().
+ *
+ * MP:
+ *	No impact.
+ *
+ * Reliability:
+ *	No anticipated impact.
+ *
+ * Resources:
+ *	N/A.
+ *
+ * Security:
+ *	No anticipated impact.
+ *
+ * Standards:
+ *	BSD Socket API
+ *	RFC 2553
+ */
+
+typedef struct isc_sockaddr	isc_sockaddr_t;		/* Socket Address */
+typedef struct isc_netaddr	isc_netaddr_t;		/* Net Address */
+
+/***
+ *** Functions.
+ ***/
+
+bool isc_net_probeipv4_bool(void);
+
+isc_result_t
+isc_net_probeipv4(void);
+/*
+ * Check if the system's kernel supports IPv4.
+ *
+ * Returns:
+ *
+ *	#ISC_R_SUCCESS		IPv4 is supported.
+ *	#ISC_R_NOTFOUND		IPv4 is not supported.
+ *	#ISC_R_DISABLED		IPv4 is disabled.
+ *	#ISC_R_UNEXPECTED
+ */
+
+bool isc_net_probeipv6_bool(void);
+
+isc_result_t
+isc_net_probeipv6(void);
+/*
+ * Check if the system's kernel supports IPv6.
+ *
+ * Returns:
+ *
+ *	#ISC_R_SUCCESS		IPv6 is supported.
+ *	#ISC_R_NOTFOUND		IPv6 is not supported.
+ *	#ISC_R_DISABLED		IPv6 is disabled.
+ *	#ISC_R_UNEXPECTED
+ */
+
+bool
+isc_net_probe_ipv6only_bool(void);
+isc_result_t
+isc_net_probe_ipv6only(void);
+
+/*
+ * Check if the system's kernel supports the IPV6_(RECV)PKTINFO socket option
+ * for UDP sockets.
+ *
+ * Returns:
+ *
+ * 	#ISC_R_SUCCESS		the option is supported.
+ * 	#ISC_R_NOTFOUND		IPv6 itself or the option is not supported.
+ * 	#ISC_R_UNEXPECTED
+ */
+
 
 struct isc_netaddr {
 	unsigned int family;


=====================================
libisc/include/isc/result.h
=====================================
--- a/libisc/include/isc/result.h
+++ b/libisc/include/isc/result.h
@@ -8,15 +8,17 @@
 #ifndef GUARD_ISC_RESULT_H
 #define GUARD_ISC_RESULT_H 1
 
-/*! \file isc/result.h */
+/* isc/result.h */
 
-#define ISC_R_SUCCESS			0	/*%< success */
-#define ISC_R_NOMEMORY			1	/*%< out of memory */
-#define ISC_R_NOTFOUND			23	/*%< not found */
-#define ISC_R_FAILURE			25	/*%< generic failure */
-#define ISC_R_NOTIMPLEMENTED		27	/*%< not implemented */
-#define ISC_R_NOMORE			29	/*%< no more */
-#define ISC_R_UNEXPECTED		34	/*%< unexpected error */
-#define ISC_R_IGNORE			36	/*%< ignore */
+typedef unsigned int			isc_result_t;	/* Result */
+
+#define ISC_R_SUCCESS			0	/* success */
+#define ISC_R_NOMEMORY			1	/* out of memory */
+#define ISC_R_NOTFOUND			23	/* not found */
+#define ISC_R_FAILURE			25	/* generic failure */
+#define ISC_R_NOTIMPLEMENTED		27	/* not implemented */
+#define ISC_R_NOMORE			29	/* no more */
+#define ISC_R_UNEXPECTED		34	/* unexpected error */
+#define ISC_R_IGNORE			36	/* ignore */
 
 #endif /* GUARD_ISC_RESULT_H */


=====================================
libisc/include/isc/sockaddr.h
=====================================
--- a/libisc/include/isc/sockaddr.h
+++ b/libisc/include/isc/sockaddr.h
@@ -10,8 +10,10 @@
 
 /*! \file isc/sockaddr.h */
 
-#include "isc/net.h"
-#include "isc/types.h"
+#include "isc/netaddr.h"
+#include "isc/result.h"
+
+#define ISC_LINK(type) struct { type *prev, *next; }
 
 struct isc_sockaddr {
 	union {


=====================================
libisc/include/isc/types.h deleted
=====================================
--- a/libisc/include/isc/types.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2004-2009, 2012  Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003  Internet Software Consortium.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-#ifndef GUARD_ISC_TYPES_H
-#define GUARD_ISC_TYPES_H 1
-
-/*! \file isc/types.h
- */
-#include <stdint.h>
-#include <stdbool.h>
-/*
- * XXXDCL This is just for ISC_LIST and ISC_LINK, but gets all of the other
- * list macros too.
- */
-#include "isc/list.h"
-
-/* Core Types.  Alphabetized by defined type. */
-
-typedef struct isc_backtrace_symmap	isc_backtrace_symmap_t; /*%< Symbol Table Entry */
-typedef struct isc_buffer		isc_buffer_t;		/*%< Buffer */
-typedef struct isc_interface		isc_interface_t;	/*%< Interface */
-typedef struct isc_interfaceiter	isc_interfaceiter_t;	/*%< Interface Iterator */
-typedef struct isc_log 			isc_log_t;		/*%< Log */
-typedef struct isc_logcategory		isc_logcategory_t;	/*%< Log Category */
-typedef struct isc_interval		isc_interval_t;		/*%< Interval */
-typedef struct isc_logconfig		isc_logconfig_t;	/*%< Log Configuration */
-typedef struct isc_logmodule		isc_logmodule_t;	/*%< Log Module */
-typedef struct isc_mem			isc_mem_t;		/*%< Memory */
-typedef struct isc_msgcat		isc_msgcat_t;		/*%< Message Catalog */
-typedef struct isc_netaddr		isc_netaddr_t;		/*%< Net Address */
-typedef unsigned int			isc_result_t;		/*%< Result */
-typedef struct isc_sockaddr		isc_sockaddr_t;		/*%< Socket Address */
-typedef struct isc_socket		isc_socket_t;		/*%< Socket */
-typedef struct isc_time			isc_time_t;		/*%< Time */
-
-#endif /* GUARD_ISC_TYPES_H */


=====================================
libisc/include/isc/util.h deleted
=====================================
--- a/libisc/include/isc/util.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2004-2007, 2010-2012  Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001  Internet Software Consortium.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-#ifndef GUARD_ISC_UTIL_H
-#define GUARD_ISC_UTIL_H 1
-
-/*! \file isc/util.h
- * NOTE:
- *
- * This file is not to be included from any <isc/???.h> (or other) library
- * files.
- *
- * \brief
- * Including this file puts several macros in your name space that are
- * not protected (as all the other ISC functions/macros do) by prepending
- * ISC_ or isc_ to the name.
- */
-
-/*%
- * We use macros instead of calling the routines directly because
- * the capital letters make the locking stand out.
- */
-
-#include "isc/result.h"		/* Contractual promise. */
-
-/*
- * Assertions
- */
-#include "ntp_assert.h"	/* Contractual promise. */
-
-/*
- * Errors
- */
-#include "isc/error.h"		/* Contractual promise. */
-
-/*% Unexpected Error */
-#define UNEXPECTED_ERROR		isc_error_unexpected
-
-/* hack to ignore GCC Unused Result */
-#define ISC_IGNORE(r) do{if(r){}}while(0)
-
-#endif /* GUARD_ISC_UTIL_H */


=====================================
libisc/interfaceiter.c
=====================================
--- a/libisc/interfaceiter.c
+++ b/libisc/interfaceiter.c
@@ -20,13 +20,12 @@
 #include <unistd.h>
 #include <errno.h>
 
+#include "ntp_assert.h"
 #include "isc/interfaceiter.h"
 #include "isc/magic.h"
 #include "isc/mem.h"
-#include "isc/net.h"
+#include "isc/netaddr.h"
 #include "isc/result.h"
-#include "isc/types.h"
-#include "isc/util.h"
 
 /* Must follow <isc/net.h>. */
 #ifdef HAVE_NET_IF6_H


=====================================
libisc/net.c
=====================================
--- a/libisc/net.c
+++ b/libisc/net.c
@@ -18,8 +18,9 @@
 #include <unistd.h>
 #include <string.h>
 
-#include "isc/net.h"
-#include "isc/util.h"
+#include "isc/netaddr.h"
+#include "isc/error.h"
+#include "isc/result.h"
 
 static bool 	once_ipv6only = false;
 


=====================================
libisc/netaddr.c
=====================================
--- a/libisc/netaddr.c
+++ b/libisc/netaddr.c
@@ -11,10 +11,9 @@
 
 #include <stdio.h>
 
-#include "isc/net.h"
 #include "isc/netaddr.h"
 #include "isc/sockaddr.h"
-#include "isc/util.h"
+#include "ntp_assert.h"
 #include "ntp_stdlib.h"		/* NTP change for strlcpy, strlcat */
 
 #define ISC_TF(x) ((x) ? true : false)


=====================================
libntp/initnetwork.c
=====================================
--- a/libntp/initnetwork.c
+++ b/libntp/initnetwork.c
@@ -3,7 +3,7 @@
  */
 #include "config.h"
 
-#include "isc/net.h"
+#include "isc/netaddr.h"
 #include "ntp_stdlib.h"
 
 /*


=====================================
libntp/lib_strbuf.c
=====================================
--- a/libntp/lib_strbuf.c
+++ b/libntp/lib_strbuf.c
@@ -3,7 +3,7 @@
  */
 #include "config.h"
 
-#include "isc/net.h"
+#include "isc/netaddr.h"
 
 #include "ntp_fp.h"
 #include "ntp_stdlib.h"


=====================================
libntp/pymodule.c
=====================================
--- a/libntp/pymodule.c
+++ b/libntp/pymodule.c
@@ -19,7 +19,6 @@
 #include "ntp_config.h"
 #include "ntp_assert.h"
 #include "isc/error.h"
-#include "isc/formatcheck.h"
 
 #include "ntp_control.h"
 


=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -22,7 +22,7 @@
 #include <signal.h>
 #include <sys/wait.h>
 
-#include "isc/net.h"
+#include "isc/netaddr.h"
 
 #include "ntp.h"
 #include "ntpd.h"


=====================================
ntpd/ntpd.c
=====================================
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -16,7 +16,6 @@
 #include "ntp_dns.h"
 #endif
 #include "isc/error.h"
-#include "isc/formatcheck.h"
 
 #include <unistd.h>
 #include <sys/stat.h>



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/759eaded7240cb3094ca818063d449c8f2e2deeb...c845da3db793b596664106b74417f89ef5e74e4b

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/759eaded7240cb3094ca818063d449c8f2e2deeb...c845da3db793b596664106b74417f89ef5e74e4b
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/20170606/f9ac1cf5/attachment.html>


More information about the vc mailing list