xref: /openbsd-src/gnu/usr.bin/perl/cpan/Sys-Syslog/fallback/syslog.h (revision b39c515898423c8d899e35282f4b395f7cad3298)
1*b39c5158Smillert /*
2*b39c5158Smillert  * Copyright (c) 1982, 1986, 1988, 1993
3*b39c5158Smillert  *	The Regents of the University of California.  All rights reserved.
4*b39c5158Smillert  *
5*b39c5158Smillert  * Redistribution and use in source and binary forms, with or without
6*b39c5158Smillert  * modification, are permitted provided that the following conditions
7*b39c5158Smillert  * are met:
8*b39c5158Smillert  * 1. Redistributions of source code must retain the above copyright
9*b39c5158Smillert  *    notice, this list of conditions and the following disclaimer.
10*b39c5158Smillert  * 2. Redistributions in binary form must reproduce the above copyright
11*b39c5158Smillert  *    notice, this list of conditions and the following disclaimer in the
12*b39c5158Smillert  *    documentation and/or other materials provided with the distribution.
13*b39c5158Smillert  * 4. Neither the name of the University nor the names of its contributors
14*b39c5158Smillert  *    may be used to endorse or promote products derived from this software
15*b39c5158Smillert  *    without specific prior written permission.
16*b39c5158Smillert  *
17*b39c5158Smillert  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18*b39c5158Smillert  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*b39c5158Smillert  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*b39c5158Smillert  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21*b39c5158Smillert  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*b39c5158Smillert  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*b39c5158Smillert  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*b39c5158Smillert  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*b39c5158Smillert  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*b39c5158Smillert  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*b39c5158Smillert  * SUCH DAMAGE.
28*b39c5158Smillert  *
29*b39c5158Smillert  *	@(#)syslog.h	8.1 (Berkeley) 6/2/93
30*b39c5158Smillert  */
31*b39c5158Smillert 
32*b39c5158Smillert #ifndef _SYS_SYSLOG_H
33*b39c5158Smillert #define _SYS_SYSLOG_H 1
34*b39c5158Smillert 
35*b39c5158Smillert #define	_PATH_LOG	""
36*b39c5158Smillert 
37*b39c5158Smillert /*
38*b39c5158Smillert  * priorities/facilities are encoded into a single 32-bit quantity, where the
39*b39c5158Smillert  * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
40*b39c5158Smillert  * (0-big number).  Both the priorities and the facilities map roughly
41*b39c5158Smillert  * one-to-one to strings in the syslogd(8) source code.  This mapping is
42*b39c5158Smillert  * included in this file.
43*b39c5158Smillert  *
44*b39c5158Smillert  * priorities (these are ordered)
45*b39c5158Smillert  */
46*b39c5158Smillert #define	LOG_EMERG	0	/* system is unusable */
47*b39c5158Smillert #define	LOG_ALERT	1	/* action must be taken immediately */
48*b39c5158Smillert #define	LOG_CRIT	2	/* critical conditions */
49*b39c5158Smillert #define	LOG_ERR		3	/* error conditions */
50*b39c5158Smillert #define	LOG_WARNING	4	/* warning conditions */
51*b39c5158Smillert #define	LOG_NOTICE	5	/* normal but significant condition */
52*b39c5158Smillert #define	LOG_INFO	6	/* informational */
53*b39c5158Smillert #define	LOG_DEBUG	7	/* debug-level messages */
54*b39c5158Smillert 
55*b39c5158Smillert #define	LOG_PRIMASK	0x07	/* mask to extract priority part (internal) */
56*b39c5158Smillert 				/* extract priority */
57*b39c5158Smillert #define	LOG_PRI(p)	((p) & LOG_PRIMASK)
58*b39c5158Smillert #define	LOG_MAKEPRI(fac, pri)	(((fac) << 3) | (pri))
59*b39c5158Smillert 
60*b39c5158Smillert /* facility codes */
61*b39c5158Smillert #define	LOG_KERN	(0<<3)	/* kernel messages */
62*b39c5158Smillert #define	LOG_USER	(1<<3)	/* random user-level messages */
63*b39c5158Smillert #define	LOG_MAIL	(2<<3)	/* mail system */
64*b39c5158Smillert #define	LOG_DAEMON	(3<<3)	/* system daemons */
65*b39c5158Smillert #define	LOG_AUTH	(4<<3)	/* security/authorization messages */
66*b39c5158Smillert #define	LOG_SYSLOG	(5<<3)	/* messages generated internally by syslogd */
67*b39c5158Smillert #define	LOG_LPR		(6<<3)	/* line printer subsystem */
68*b39c5158Smillert #define	LOG_NEWS	(7<<3)	/* network news subsystem */
69*b39c5158Smillert #define	LOG_UUCP	(8<<3)	/* UUCP subsystem */
70*b39c5158Smillert #define	LOG_CRON	(9<<3)	/* clock daemon */
71*b39c5158Smillert #define	LOG_AUTHPRIV	(10<<3)	/* security/authorization messages (private) */
72*b39c5158Smillert #define	LOG_FTP		(11<<3)	/* ftp daemon */
73*b39c5158Smillert #define	LOG_NETINFO     (12<<3) /* NetInfo */
74*b39c5158Smillert #define	LOG_REMOTEAUTH  (13<<3) /* remote authentication/authorization */
75*b39c5158Smillert #define	LOG_INSTALL     (14<<3) /* installer subsystem */
76*b39c5158Smillert #define	LOG_RAS         (15<<3) /* Remote Access Service (VPN / PPP) */
77*b39c5158Smillert #define	LOG_LOCAL0	(16<<3)	/* reserved for local use */
78*b39c5158Smillert #define	LOG_LOCAL1	(17<<3)	/* reserved for local use */
79*b39c5158Smillert #define	LOG_LOCAL2	(18<<3)	/* reserved for local use */
80*b39c5158Smillert #define	LOG_LOCAL3	(19<<3)	/* reserved for local use */
81*b39c5158Smillert #define	LOG_LOCAL4	(20<<3)	/* reserved for local use */
82*b39c5158Smillert #define	LOG_LOCAL5	(21<<3)	/* reserved for local use */
83*b39c5158Smillert #define	LOG_LOCAL6	(22<<3)	/* reserved for local use */
84*b39c5158Smillert #define	LOG_LOCAL7	(23<<3)	/* reserved for local use */
85*b39c5158Smillert #define	LOG_LAUNCHD     (24<<3) /* launchd - general bootstrap daemon */
86*b39c5158Smillert 
87*b39c5158Smillert #define	LOG_NFACILITIES	25	/* current number of facilities */
88*b39c5158Smillert #define	LOG_FACMASK	0x03f8	/* mask to extract facility part */
89*b39c5158Smillert 				/* facility of pri */
90*b39c5158Smillert #define	LOG_FAC(p)	(((p) & LOG_FACMASK) >> 3)
91*b39c5158Smillert 
92*b39c5158Smillert /*
93*b39c5158Smillert  * arguments to setlogmask.
94*b39c5158Smillert  */
95*b39c5158Smillert #define	LOG_MASK(pri)	(1 << (pri))		/* mask for one priority */
96*b39c5158Smillert #define	LOG_UPTO(pri)	((1 << ((pri)+1)) - 1)	/* all priorities through pri */
97*b39c5158Smillert 
98*b39c5158Smillert /*
99*b39c5158Smillert  * Option flags for openlog.
100*b39c5158Smillert  *
101*b39c5158Smillert  * LOG_ODELAY no longer does anything.
102*b39c5158Smillert  * LOG_NDELAY is the inverse of what it used to be.
103*b39c5158Smillert  */
104*b39c5158Smillert #define	LOG_PID		0x01	/* log the pid with each message */
105*b39c5158Smillert #define	LOG_CONS	0x02	/* log on the console if errors in sending */
106*b39c5158Smillert #define	LOG_ODELAY	0x04	/* delay open until first syslog() (default) */
107*b39c5158Smillert #define	LOG_NDELAY	0x08	/* don't delay open */
108*b39c5158Smillert #define	LOG_NOWAIT	0x10	/* don't wait for console forks: DEPRECATED */
109*b39c5158Smillert #define	LOG_PERROR	0x20	/* log to stderr as well */
110*b39c5158Smillert 
111*b39c5158Smillert #endif /* sys/syslog.h */
112