xref: /freebsd/contrib/ntp/include/ntp_syslog.h (revision 2be1a816b9ff69588e55be0a84cbe2a31efc0f2f)
1 /*
2  * A hack for platforms which require specially built syslog facilities
3  */
4 
5 #ifndef NTP_SYSLOG_H
6 #define NTP_SYSLOG_H
7 
8 # ifdef VMS
9 extern void msyslog();
10 # else
11 #   ifndef SYS_VXWORKS
12 #   include <syslog.h>
13 #   endif
14 # endif /* VMS */
15 # include <stdio.h>
16 
17 extern int syslogit;
18 extern FILE *syslog_file;
19 
20 #if defined(VMS) || defined (SYS_VXWORKS)
21 #define	LOG_EMERG	0	/* system is unusable */
22 #define	LOG_ALERT	1	/* action must be taken immediately */
23 #define	LOG_CRIT	2	/* critical conditions */
24 #define	LOG_ERR		3	/* error conditions */
25 #define	LOG_WARNING	4	/* warning conditions */
26 #define	LOG_NOTICE	5	/* normal but signification condition */
27 #define	LOG_INFO	6	/* informational */
28 #define	LOG_DEBUG	7	/* debug-level messages */
29 #endif /* VMS || VXWORKS */
30 
31 /*
32  * syslog output control
33  */
34 #define NLOG_INFO		0x00000001
35 #define NLOG_EVENT		0x00000002
36 #define NLOG_STATUS		0x00000004
37 #define NLOG_STATIST		0x00000008
38 
39 #define NLOG_OSYS			 0 /* offset for system flags */
40 #define NLOG_SYSMASK    	0x0000000F /* system log events */
41 #define NLOG_SYSINFO		0x00000001 /* system info log events */
42 #define NLOG_SYSEVENT		0x00000002 /* system events */
43 #define NLOG_SYSSTATUS		0x00000004 /* system status (sync/unsync) */
44 #define NLOG_SYSSTATIST		0x00000008 /* system statistics output */
45 
46 #define NLOG_OPEER			 4 /* offset for peer flags */
47 #define NLOG_PEERMASK    	0x000000F0 /* peer log events */
48 #define NLOG_PEERINFO		0x00000010 /* peer info log events */
49 #define NLOG_PEEREVENT		0x00000020 /* peer events */
50 #define NLOG_PEERSTATUS		0x00000040 /* peer status (sync/unsync) */
51 #define NLOG_PEERSTATIST	0x00000080 /* peer statistics output */
52 
53 #define NLOG_OCLOCK			 8 /* offset for clock flags */
54 #define NLOG_CLOCKMASK    	0x00000F00 /* clock log events */
55 #define NLOG_CLOCKINFO		0x00000100 /* clock info log events */
56 #define NLOG_CLOCKEVENT		0x00000200 /* clock events */
57 #define NLOG_CLOCKSTATUS	0x00000400 /* clock status (sync/unsync) */
58 #define NLOG_CLOCKSTATIST	0x00000800 /* clock statistics output */
59 
60 #define NLOG_OSYNC			12 /* offset for sync flags */
61 #define NLOG_SYNCMASK    	0x0000F000 /* sync log events */
62 #define NLOG_SYNCINFO		0x00001000 /* sync info log events */
63 #define NLOG_SYNCEVENT		0x00002000 /* sync events */
64 #define NLOG_SYNCSTATUS		0x00004000 /* sync status (sync/unsync) */
65 #define NLOG_SYNCSTATIST	0x00008000 /* sync statistics output */
66 
67 extern unsigned long ntp_syslogmask;
68 #define NLOG(_X_)	if (ntp_syslogmask & (_X_))
69 
70 #endif /* NTP_SYSLOG_H */
71