diff options
author | delphij <delphij@FreeBSD.org> | 2015-07-15 19:21:26 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-07-15 19:21:26 +0000 |
commit | 2a25cee78ab1d37e7d2bc40ae675646974d99f56 (patch) | |
tree | b0302ac4be59e104f4e1e54014561a1389397192 /contrib/ntp/include/ntp_syslog.h | |
parent | a0741a75537b2e0514472ac3b28afc55a7846c30 (diff) | |
download | FreeBSD-src-2a25cee78ab1d37e7d2bc40ae675646974d99f56.zip FreeBSD-src-2a25cee78ab1d37e7d2bc40ae675646974d99f56.tar.gz |
MFC r280849,280915-280916,281015-281016,282097,282408,282415,283542,
284864,285169-285170,285435:
ntp 4.2.8p3.
Relnotes: yes
Approved by: re (?)
Diffstat (limited to 'contrib/ntp/include/ntp_syslog.h')
-rw-r--r-- | contrib/ntp/include/ntp_syslog.h | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/contrib/ntp/include/ntp_syslog.h b/contrib/ntp/include/ntp_syslog.h index 38021e2..a0152b5 100644 --- a/contrib/ntp/include/ntp_syslog.h +++ b/contrib/ntp/include/ntp_syslog.h @@ -5,17 +5,25 @@ #ifndef NTP_SYSLOG_H #define NTP_SYSLOG_H -# ifdef VMS +#include <ntp_types.h> /* u_int32 type */ + +#ifdef VMS extern void msyslog(); -# else -# ifndef SYS_VXWORKS -# include <syslog.h> -# endif -# endif /* VMS */ -# include <stdio.h> +#else +# ifndef SYS_VXWORKS +# include <syslog.h> +# endif +#endif /* VMS */ +#include <stdio.h> -extern int syslogit; -extern FILE *syslog_file; +extern int syslogit; +extern int msyslog_term; /* duplicate to stdout/err */ +extern int msyslog_term_pid; +extern int msyslog_include_timestamp; +extern FILE * syslog_file; /* if syslogit is FALSE, log to + this file and not syslog */ +extern char * syslog_fname; +extern char * syslog_abs_fname; #if defined(VMS) || defined (SYS_VXWORKS) #define LOG_EMERG 0 /* system is unusable */ @@ -37,34 +45,41 @@ extern FILE *syslog_file; #define NLOG_STATIST 0x00000008 #define NLOG_OSYS 0 /* offset for system flags */ -#define NLOG_SYSMASK 0x0000000F /* system log events */ +#define NLOG_SYSMASK 0x0000000F /* system log events */ #define NLOG_SYSINFO 0x00000001 /* system info log events */ #define NLOG_SYSEVENT 0x00000002 /* system events */ #define NLOG_SYSSTATUS 0x00000004 /* system status (sync/unsync) */ #define NLOG_SYSSTATIST 0x00000008 /* system statistics output */ #define NLOG_OPEER 4 /* offset for peer flags */ -#define NLOG_PEERMASK 0x000000F0 /* peer log events */ +#define NLOG_PEERMASK 0x000000F0 /* peer log events */ #define NLOG_PEERINFO 0x00000010 /* peer info log events */ #define NLOG_PEEREVENT 0x00000020 /* peer events */ #define NLOG_PEERSTATUS 0x00000040 /* peer status (sync/unsync) */ #define NLOG_PEERSTATIST 0x00000080 /* peer statistics output */ #define NLOG_OCLOCK 8 /* offset for clock flags */ -#define NLOG_CLOCKMASK 0x00000F00 /* clock log events */ +#define NLOG_CLOCKMASK 0x00000F00 /* clock log events */ #define NLOG_CLOCKINFO 0x00000100 /* clock info log events */ #define NLOG_CLOCKEVENT 0x00000200 /* clock events */ #define NLOG_CLOCKSTATUS 0x00000400 /* clock status (sync/unsync) */ #define NLOG_CLOCKSTATIST 0x00000800 /* clock statistics output */ #define NLOG_OSYNC 12 /* offset for sync flags */ -#define NLOG_SYNCMASK 0x0000F000 /* sync log events */ +#define NLOG_SYNCMASK 0x0000F000 /* sync log events */ #define NLOG_SYNCINFO 0x00001000 /* sync info log events */ #define NLOG_SYNCEVENT 0x00002000 /* sync events */ #define NLOG_SYNCSTATUS 0x00004000 /* sync status (sync/unsync) */ #define NLOG_SYNCSTATIST 0x00008000 /* sync statistics output */ -extern unsigned long ntp_syslogmask; -#define NLOG(_X_) if (ntp_syslogmask & (_X_)) +extern u_int32 ntp_syslogmask; + +#define NLOG(bits) if (ntp_syslogmask & (bits)) + +#define LOGIF(nlog_suffix, msl_args) \ +do { \ + NLOG(NLOG_##nlog_suffix) /* like "if (...) */ \ + msyslog msl_args; \ +} while (FALSE) #endif /* NTP_SYSLOG_H */ |