diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.in | 4 | ||||
-rw-r--r-- | include/isc/Makefile.in | 4 | ||||
-rw-r--r-- | include/ntp_calendar.h | 24 | ||||
-rw-r--r-- | include/ntp_stdlib.h | 3 | ||||
-rw-r--r-- | include/ntpd.h | 4 | ||||
-rw-r--r-- | include/parse.h | 1 |
6 files changed, 30 insertions, 10 deletions
diff --git a/include/Makefile.in b/include/Makefile.in index 15a1e869996d..2e1ed92c8899 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/include/isc/Makefile.in b/include/isc/Makefile.in index 192fe0867c12..c730b3a03cff 100644 --- a/include/isc/Makefile.in +++ b/include/isc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/include/ntp_calendar.h b/include/ntp_calendar.h index 41c58797b2c7..0b1f20d6bd7b 100644 --- a/include/ntp_calendar.h +++ b/include/ntp_calendar.h @@ -93,6 +93,7 @@ extern systime_func_ptr ntpcal_set_timefunc(systime_func_ptr); #define SECSPERLEAPYEAR (366 * SECSPERDAY) /* leap year */ #define SECSPERAVGYEAR 31556952 /* mean year length over 400yrs */ +#define GPSWEEKS 1024 /* GPS week cycle */ /* * Gross hacks. I have illicit knowlege that there won't be overflows * here, the compiler often can't tell this. @@ -404,14 +405,21 @@ basedate_get_eracenter(void); extern time_t basedate_get_erabase(void); +extern uint32_t +basedate_get_gpsweek(void); + +extern uint32_t +basedate_expand_gpsweek(unsigned short weekno); /* * Additional support stuff for Ed Rheingold's calendrical calculations */ /* - * Start day of NTP time as days past the imaginary date 12/1/1 BC. - * (This is the beginning of the Christian Era, or BCE.) + * Start day of NTP time as days past 0000-12-31 in the proleptic + * Gregorian calendar. (So 0001-01-01 is day number 1; this is the Rata + * Die counting scheme used by Ed Rheingold in his book "Calendrical + * Calculations".) */ #define DAY_NTP_STARTS 693596 @@ -421,14 +429,24 @@ basedate_get_erabase(void); #define DAY_UNIX_STARTS 719163 /* + * Start day of the GPS epoch. This is the Rata Die of 1980-01-06 + */ +#define DAY_GPS_STARTS 722819 + +/* * Difference between UN*X and NTP epoch (25567). */ #define NTP_TO_UNIX_DAYS (DAY_UNIX_STARTS - DAY_NTP_STARTS) /* + * Difference between GPS and NTP epoch (29224) + */ +#define NTP_TO_GPS_DAYS (DAY_GPS_STARTS - DAY_NTP_STARTS) + +/* * Days in a normal 4 year leap year calendar cycle (1461). */ -#define GREGORIAN_NORMAL_LEAP_CYCLE_DAYS (3 * 365 + 366) +#define GREGORIAN_NORMAL_LEAP_CYCLE_DAYS (4 * 365 + 1) /* * Days in a normal 100 year leap year calendar (36524). We lose a diff --git a/include/ntp_stdlib.h b/include/ntp_stdlib.h index 889c3b25ef42..c0bc71b09f5b 100644 --- a/include/ntp_stdlib.h +++ b/include/ntp_stdlib.h @@ -40,6 +40,9 @@ extern void setup_logfile (const char *); extern void errno_to_str(int, char *, size_t); #endif +extern int xvsbprintf(char**, char* const, char const*, va_list) NTP_PRINTF(3, 0); +extern int xsbprintf(char**, char* const, char const*, ...) NTP_PRINTF(3, 4); + /* * When building without OpenSSL, use a few macros of theirs to * minimize source differences in NTP. diff --git a/include/ntpd.h b/include/ntpd.h index 6a5128ce0832..ead0c2cf8171 100644 --- a/include/ntpd.h +++ b/include/ntpd.h @@ -275,8 +275,8 @@ extern u_long orphwait; /* orphan wait time */ extern char *sys_hostname; /* host name */ extern char *sys_groupname; /* group name */ extern char *group_name; /* group name */ -extern u_long sys_revoke; /* keys revoke timeout */ -extern u_long sys_automax; /* session key timeout */ +extern u_char sys_revoke; /* keys revoke timeout */ +extern u_char sys_automax; /* session key timeout */ #endif /* AUTOKEY */ /* ntp_util.c */ diff --git a/include/parse.h b/include/parse.h index 02dbb3021904..e2caa52ea28f 100644 --- a/include/parse.h +++ b/include/parse.h @@ -108,7 +108,6 @@ extern unsigned int splclock (void); * some constants useful for GPS time conversion */ #define GPSORIGIN 2524953600UL /* NTP origin - GPS origin in seconds */ -#define GPSWRAP 990 /* assume week count less than this in the previous epoch */ #define GPSWEEKS 1024 /* number of weeks until the GPS epch rolls over */ /* |