enum AuthPwdEnc {
AUTHPWD_UNSPEC, /* format unspecified, length used for discrimination */
AUTHPWD_PLAIN, /* plain text, used as is */
AUTHPWD_HEX /* hex-encoded string */
};
extern void auth_delkeys (void);
extern int auth_havekey (keyid_t);
extern size_t authdecodepw (u_char *dst, size_t dstlen, const char *src, enum AuthPwdEnc);
extern int authdecrypt (keyid_t, u_int32 *, size_t, size_t);
extern size_t authencrypt (keyid_t, u_int32 *, size_t);
extern int authhavekey (keyid_t);
extern int authistrusted (keyid_t);
extern int authistrustedip (keyid_t, sockaddr_u *);
extern int authreadkeys (const char *);
extern void authtrust (keyid_t, u_long);
extern int authusekey (keyid_t, int, const u_char *);
/*
* Based on the NTP timestamp, calculate the NTP timestamp of
* the corresponding calendar unit. Use the pivot time to unfold
* the NTP timestamp properly, or the current system time if the
* pivot pointer is NULL.
*/
extern u_int32 calyearstart (u_int32 ntptime, const time_t *pivot);
extern u_int32 calmonthstart (u_int32 ntptime, const time_t *pivot);
extern u_int32 calweekstart (u_int32 ntptime, const time_t *pivot);
extern u_int32 caldaystart (u_int32 ntptime, const time_t *pivot);
/* ssl_init.c */
#ifdef OPENSSL
extern void ssl_init (void);
extern void ssl_check_version (void);
extern EVP_MD_CTX* digest_ctx; /* also ssl_init_done */
#define INIT_SSL() \
do { \
if (NULL == digest_ctx) { \
ssl_init(); \
} \
} while (FALSE)
#else /* !OPENSSL follows */
#define ssl_check_version() do {} while (0)
#define INIT_SSL() do {} while (0)
#endif
extern int keytype_from_text (const char *text,
size_t *pdigest_len);
extern const char *keytype_name (int type);
extern char * getpass_keytype (int type);
/* strl-obsd.c */
#ifndef HAVE_STRLCPY /* + */
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
extern size_t strlcpy(char *dst, const char *src, size_t siz);
#endif
#ifndef HAVE_STRLCAT /* + */
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
* If retval >= siz, truncation occurred.
*/
extern size_t strlcat(char *dst, const char *src, size_t siz);
#endif
/* lib/isc/win32/strerror.c
*
* To minimize Windows-specific changes to the rest of the NTP code,
* particularly reference clocks, we hijack calls to strerror() to deal
* with our mixture of error codes from the C runtime (open, write)
* and Windows (sockets, serial ports). This is an ugly hack because
* both use the lowest values differently, but particularly for ntpd,
* it's not a problem.
*/
#ifdef NTP_REDEFINE_STRERROR
#define strerror(e) ntp_strerror(e)
extern char * ntp_strerror (int e);
#endif
/* systime.c */
extern double sys_tick; /* tick size or time to read */
extern double measured_tick; /* non-overridable sys_tick */
extern double sys_fuzz; /* min clock read latency */
extern int trunc_os_clock; /* sys_tick > measured_tick */