[Git][NTPsec/ntpsec][master] 6 commits: parse_conf: remove redundant externs.
Gary E. Miller
gitlab at mg.gitlab.com
Fri Apr 7 20:07:41 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
dbfafacf by Gary E. Miller at 2017-04-07T11:52:40-07:00
parse_conf: remove redundant externs.
- - - - -
4df63898 by Gary E. Miller at 2017-04-07T12:32:11-07:00
Remove redundant externs.
- - - - -
d9c639c7 by Gary E. Miller at 2017-04-07T12:34:46-07:00
remove two redundant externs.
- - - - -
7011cb1f by Gary E. Miller at 2017-04-07T12:37:14-07:00
remove two more redundant externs.
- - - - -
c166ca47 by Gary E. Miller at 2017-04-07T12:39:36-07:00
Remove one redundant extern.
- - - - -
8e91ef5e by Gary E. Miller at 2017-04-07T13:06:20-07:00
Remove a bunch of redundant externs.
- - - - -
6 changed files:
- include/ntp_io.h
- include/ntp_refclock.h
- include/ntpd.h
- libparse/parse.c
- libparse/parse_conf.c
- ntpd/refclock_conf.c
Changes:
=====================================
include/ntp_io.h
=====================================
--- a/include/ntp_io.h
+++ b/include/ntp_io.h
@@ -38,7 +38,6 @@ typedef enum {
extern int qos;
-SOCKET move_fd(SOCKET fd);
extern bool is_ip_address(const char *, u_short, sockaddr_u *);
extern void sau_from_netaddr(sockaddr_u *, const isc_netaddr_t *);
extern void add_nic_rule(nic_rule_match match_type,
=====================================
include/ntp_refclock.h
=====================================
--- a/include/ntp_refclock.h
+++ b/include/ntp_refclock.h
@@ -174,6 +174,10 @@ extern bool io_addclock (struct refclockio *);
extern void io_closeclock (struct refclockio *);
#ifdef REFCLOCK
+extern bool refclock_newpeer (uint8_t, int, struct peer *);
+extern void refclock_unpeer (struct peer *);
+extern void refclock_receive (struct peer *);
+extern void init_refclock (void);
extern void refclock_control(sockaddr_u *,
const struct refclockstat *,
struct refclockstat *);
@@ -192,20 +196,116 @@ extern size_t refclock_gtraw (struct recvbuf *, char *, size_t, l_fp *);
extern bool indicate_refclock_packet(struct refclockio *,
struct recvbuf *);
extern void process_refclock_packet(struct recvbuf *);
-extern struct refclock refclock_arbiter;
-extern struct refclock refclock_gpsdjson;
-extern struct refclock refclock_hpgps;
-extern struct refclock refclock_jjy;
-extern struct refclock refclock_local;
-extern struct refclock refclock_modem;
-extern struct refclock refclock_neoclock4x;
-extern struct refclock refclock_nmea;
-extern struct refclock refclock_parse;
-extern struct refclock refclock_shm;
-extern struct refclock refclock_spectracom;
-extern struct refclock refclock_trimble;
-extern struct refclock refclock_true;
-extern struct refclock refclock_zyfer;
+
+extern struct refclock refclock_none;
+
+#ifdef CLOCK_ARBITER
+extern struct refclock refclock_arbiter;
+#else
+#define refclock_arbiter refclock_none
+#endif
+
+#ifdef CLOCK_GENERIC
+extern struct refclock refclock_parse;
+#else
+#define refclock_parse refclock_none
+#endif
+
+#if defined(CLOCK_GPSDJSON)
+extern struct refclock refclock_gpsdjson;
+#else
+#define refclock_gpsdjson refclock_none
+#endif
+
+#ifdef CLOCK_HPGPS
+extern struct refclock refclock_hpgps;
+#else
+#define refclock_hpgps refclock_none
+#endif
+
+#ifdef CLOCK_JJY
+extern struct refclock refclock_jjy;
+#else
+#define refclock_jjy refclock_none
+#endif
+
+#if defined(CLOCK_JUPITER) && defined(HAVE_PPSAPI)
+extern struct refclock refclock_jupiter;
+#else
+#define refclock_jupiter refclock_none
+#endif
+
+#ifdef CLOCK_LOCAL
+extern struct refclock refclock_local;
+#else
+#define refclock_local refclock_none
+#endif
+
+#if defined(CLOCK_MAGNAVOX) && defined(HAVE_PPSAPI)
+extern struct refclock refclock_magnavox;
+#else
+#define refclock_magnavox refclock_none
+#endif
+
+#ifdef CLOCK_MODEM
+extern struct refclock refclock_modem;
+#else
+#define refclock_modem refclock_none
+#endif
+
+#ifdef CLOCK_NEOCLOCK
+extern struct refclock refclock_neoclock4x;
+#else
+#define refclock_neoclock4x refclock_none
+#endif
+
+#ifdef CLOCK_NMEA
+extern struct refclock refclock_nmea;
+#else
+#define refclock_nmea refclock_none
+#endif
+
+#if defined(CLOCK_ONCORE)
+extern struct refclock refclock_oncore;
+#else
+#define refclock_oncore refclock_none
+#endif
+
+#if defined (CLOCK_PPS) && defined(HAVE_PPSAPI)
+extern struct refclock refclock_pps;
+#else
+#define refclock_pps refclock_none
+#endif
+
+#ifdef CLOCK_SPECTRACOM
+extern struct refclock refclock_spectracom;
+#else
+#define refclock_spectracom refclock_none
+#endif
+
+#ifdef CLOCK_TRUETIME
+extern struct refclock refclock_true;
+#else
+#define refclock_true refclock_none
+#endif
+
+#ifdef CLOCK_SHM
+extern struct refclock refclock_shm;
+#else
+#define refclock_shm refclock_none
+#endif
+
+#ifdef CLOCK_TRIMBLE
+extern struct refclock refclock_trimble;
+#else
+#define refclock_trimble refclock_none
+#endif
+
+#ifdef CLOCK_ZYFER
+extern struct refclock refclock_zyfer;
+#else
+#define refclock_zyfer refclock_none
+#endif
#endif /* REFCLOCK */
=====================================
include/ntpd.h
=====================================
--- a/include/ntpd.h
+++ b/include/ntpd.h
@@ -188,15 +188,6 @@ extern void set_sys_tick_precision(double);
extern void proto_config (int, u_long, double);
extern void proto_clr_stats (void);
-/* ntp_refclock.c */
-#ifdef REFCLOCK
-extern bool refclock_newpeer (uint8_t, int, struct peer *);
-extern void refclock_unpeer (struct peer *);
-extern void refclock_receive (struct peer *);
-extern void refclock_transmit (struct peer *);
-extern void init_refclock (void);
-#endif /* REFCLOCK */
-
/* ntp_request.c */
extern void reset_auth_stats(void);
extern u_long auth_timereset;
@@ -403,7 +394,6 @@ extern l_fp sys_authdelay; /* authentication delay */
extern u_long sys_epoch; /* last clock update time */
extern keyid_t sys_private; /* private value for session seed */
extern int sys_manycastserver; /* respond to manycast client pkts */
-extern int sys_minclock; /* minimum survivors */
extern int sys_minsane; /* minimum candidates */
extern int sys_floor; /* cluster stratum floor */
extern int sys_ceiling; /* cluster stratum ceiling */
@@ -417,7 +407,6 @@ extern u_long sys_processed; /* packets for this host */
extern u_long sys_restricted; /* restricted packets */
extern u_long sys_newversion; /* current version */
extern u_long sys_oldversion; /* old version */
-extern u_long sys_restricted; /* access denied */
extern u_long sys_badlength; /* bad length or format */
extern u_long sys_badauth; /* bad authentication */
extern u_long sys_declined; /* declined */
=====================================
libparse/parse.c
=====================================
--- a/libparse/parse.c
+++ b/libparse/parse.c
@@ -24,9 +24,6 @@
*/
#define SYNC_ONE 0x01
-extern clockformat_t *clockformats[];
-extern unsigned short nformats;
-
static unsigned long timepacket (parse_t *);
bool
=====================================
libparse/parse_conf.c
=====================================
--- a/libparse/parse_conf.c
+++ b/libparse/parse_conf.c
@@ -12,50 +12,6 @@
#include "parse.h"
-#ifdef CLOCK_SCHMID
-extern clockformat_t clock_schmid;
-#endif
-
-#ifdef CLOCK_DCF7000
-extern clockformat_t clock_dcf7000;
-#endif
-
-#ifdef CLOCK_MEINBERG
-extern clockformat_t clock_meinberg[];
-#endif
-
-#ifdef CLOCK_RAWDCF
-extern clockformat_t clock_rawdcf;
-#endif
-
-#ifdef CLOCK_TRIMTAIP
-extern clockformat_t clock_trimtaip;
-#endif
-
-#ifdef CLOCK_TRIMTSIP
-extern clockformat_t clock_trimtsip;
-#endif
-
-#ifdef CLOCK_RCC8000
-extern clockformat_t clock_rcc8000;
-#endif
-
-#ifdef CLOCK_HOPF6021
-extern clockformat_t clock_hopf6021;
-#endif
-
-#ifdef CLOCK_WHARTON_400A
-extern clockformat_t clock_wharton_400a;
-#endif
-
-#ifdef CLOCK_VARITEXT
-extern clockformat_t clock_varitext;
-#endif
-
-#ifdef CLOCK_SEL240X
-extern clockformat_t clock_sel240x;
-#endif
-
/*
* format definitions
*/
=====================================
ntpd/refclock_conf.c
=====================================
--- a/ntpd/refclock_conf.c
+++ b/ntpd/refclock_conf.c
@@ -13,7 +13,7 @@
#include "ntp_refclock.h"
#include "ntp_stdlib.h"
-static struct refclock refclock_none = {
+struct refclock refclock_none = {
NULL, /* basename of driver */
NULL, /* start up driver */
NULL, /* shut down driver */
@@ -23,114 +23,6 @@ static struct refclock refclock_none = {
NULL, /* timer - not used */
};
-#ifdef CLOCK_LOCAL
-extern struct refclock refclock_local;
-#else
-#define refclock_local refclock_none
-#endif
-
-#ifdef CLOCK_SPECTRACOM
-extern struct refclock refclock_spectracom;
-#else
-#define refclock_spectracom refclock_none
-#endif
-
-#ifdef CLOCK_GENERIC
-extern struct refclock refclock_parse;
-#else
-#define refclock_parse refclock_none
-#endif
-
-#if defined(CLOCK_MAGNAVOX) && defined(HAVE_PPSAPI)
-extern struct refclock refclock_magnavox;
-#else
-#define refclock_magnavox refclock_none
-#endif
-
-#ifdef CLOCK_ARBITER
-extern struct refclock refclock_arbiter;
-#else
-#define refclock_arbiter refclock_none
-#endif
-
-#ifdef CLOCK_TRUETIME
-extern struct refclock refclock_true;
-#else
-#define refclock_true refclock_none
-#endif
-
-#ifdef CLOCK_MODEM
-extern struct refclock refclock_modem;
-#else
-#define refclock_modem refclock_none
-#endif
-
-#ifdef CLOCK_NMEA
-extern struct refclock refclock_nmea;
-#else
-#define refclock_nmea refclock_none
-#endif
-
-#if defined (CLOCK_PPS) && defined(HAVE_PPSAPI)
-extern struct refclock refclock_pps;
-#else
-#define refclock_pps refclock_none
-#endif
-
-#ifdef CLOCK_HPGPS
-extern struct refclock refclock_hpgps;
-#else
-#define refclock_hpgps refclock_none
-#endif
-
-#ifdef CLOCK_SHM
-extern struct refclock refclock_shm;
-#else
-#define refclock_shm refclock_none
-#endif
-
-#ifdef CLOCK_TRIMBLE
-extern struct refclock refclock_trimble;
-#else
-#define refclock_trimble refclock_none
-#endif
-
-#if defined(CLOCK_ONCORE)
-extern struct refclock refclock_oncore;
-#else
-#define refclock_oncore refclock_none
-#endif
-
-#if defined(CLOCK_JUPITER) && defined(HAVE_PPSAPI)
-extern struct refclock refclock_jupiter;
-#else
-#define refclock_jupiter refclock_none
-#endif
-
-#ifdef CLOCK_JJY
-extern struct refclock refclock_jjy;
-#else
-#define refclock_jjy refclock_none
-#endif
-
-#ifdef CLOCK_ZYFER
-extern struct refclock refclock_zyfer;
-#else
-#define refclock_zyfer refclock_none
-#endif
-
-#ifdef CLOCK_NEOCLOCK
-extern struct refclock refclock_neoclock4x;
-#else
-#define refclock_neoclock4x refclock_none
-#endif
-
-#if defined(CLOCK_GPSDJSON)
-extern struct refclock refclock_gpsdjson;
-#else
-#define refclock_gpsdjson refclock_none
-#endif
-
/*
* This is the only place in the code that knows about the mapping between
* old-style numeric driver types and the drivers.
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/f62be6ad016b42ad2f1a6a01a3ddbccbca2b58b7...8e91ef5edc40d3996d766f9cf90fb110f4c95fbb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170407/01abdbb7/attachment.html>
More information about the vc
mailing list