xref: /titanic_51/usr/src/uts/common/sys/syslog.h (revision ba91f08b676cdb873326906656bad68790a01301)
17c478bd9Sstevel@tonic-gate /*
2*ba91f08bSGary Mills  * Copyright (c) 2013 Gary Mills
37c478bd9Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
47c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
57c478bd9Sstevel@tonic-gate  */
67c478bd9Sstevel@tonic-gate 
77c478bd9Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
87c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
97c478bd9Sstevel@tonic-gate 
107c478bd9Sstevel@tonic-gate /*
117c478bd9Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
127c478bd9Sstevel@tonic-gate  * The Regents of the University of California
137c478bd9Sstevel@tonic-gate  * All Rights Reserved
147c478bd9Sstevel@tonic-gate  *
157c478bd9Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
167c478bd9Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
177c478bd9Sstevel@tonic-gate  * contributors.
187c478bd9Sstevel@tonic-gate  */
197c478bd9Sstevel@tonic-gate 
207c478bd9Sstevel@tonic-gate #ifndef	_SYS_SYSLOG_H
217c478bd9Sstevel@tonic-gate #define	_SYS_SYSLOG_H
227c478bd9Sstevel@tonic-gate 
237c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
247c478bd9Sstevel@tonic-gate extern "C" {
257c478bd9Sstevel@tonic-gate #endif
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*
287c478bd9Sstevel@tonic-gate  *  Facility codes
297c478bd9Sstevel@tonic-gate  */
307c478bd9Sstevel@tonic-gate #define	LOG_KERN	(0<<3)	/* kernel messages */
317c478bd9Sstevel@tonic-gate #define	LOG_USER	(1<<3)	/* random user-level messages */
327c478bd9Sstevel@tonic-gate #define	LOG_MAIL	(2<<3)	/* mail system */
337c478bd9Sstevel@tonic-gate #define	LOG_DAEMON	(3<<3)	/* system daemons */
347c478bd9Sstevel@tonic-gate #define	LOG_AUTH	(4<<3)	/* security/authorization messages */
357c478bd9Sstevel@tonic-gate #define	LOG_SYSLOG	(5<<3)	/* messages generated internally by syslogd */
367c478bd9Sstevel@tonic-gate #define	LOG_LPR		(6<<3)	/* line printer subsystem */
377c478bd9Sstevel@tonic-gate #define	LOG_NEWS	(7<<3)	/* netnews subsystem */
387c478bd9Sstevel@tonic-gate #define	LOG_UUCP	(8<<3)	/* uucp subsystem */
39*ba91f08bSGary Mills #define	LOG_ALTCRON	(9<<3)	/* BSD cron/at subsystem */
40*ba91f08bSGary Mills #define	LOG_AUTHPRIV	(10<<3)	/* BSD security/authorization messages */
41*ba91f08bSGary Mills #define	LOG_FTP		(11<<3)	/* file transfer subsystem */
42*ba91f08bSGary Mills #define	LOG_NTP		(12<<3)	/* network time subsystem */
437c478bd9Sstevel@tonic-gate #define	LOG_AUDIT	(13<<3) /* audit subsystem */
44*ba91f08bSGary Mills #define	LOG_CONSOLE	(14<<3) /* BSD console messages */
457c478bd9Sstevel@tonic-gate #define	LOG_CRON	(15<<3)	/* cron/at subsystem */
467c478bd9Sstevel@tonic-gate #define	LOG_LOCAL0	(16<<3)	/* reserved for local use */
477c478bd9Sstevel@tonic-gate #define	LOG_LOCAL1	(17<<3)	/* reserved for local use */
487c478bd9Sstevel@tonic-gate #define	LOG_LOCAL2	(18<<3)	/* reserved for local use */
497c478bd9Sstevel@tonic-gate #define	LOG_LOCAL3	(19<<3)	/* reserved for local use */
507c478bd9Sstevel@tonic-gate #define	LOG_LOCAL4	(20<<3)	/* reserved for local use */
517c478bd9Sstevel@tonic-gate #define	LOG_LOCAL5	(21<<3)	/* reserved for local use */
527c478bd9Sstevel@tonic-gate #define	LOG_LOCAL6	(22<<3)	/* reserved for local use */
537c478bd9Sstevel@tonic-gate #define	LOG_LOCAL7	(23<<3)	/* reserved for local use */
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #define	LOG_NFACILITIES	24	/* maximum number of facilities */
567c478bd9Sstevel@tonic-gate #define	LOG_FACMASK	0x03f8	/* mask to extract facility part */
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate /*
597c478bd9Sstevel@tonic-gate  *  Priorities (these are ordered)
607c478bd9Sstevel@tonic-gate  */
617c478bd9Sstevel@tonic-gate #define	LOG_EMERG	0	/* system is unusable */
627c478bd9Sstevel@tonic-gate #define	LOG_ALERT	1	/* action must be taken immediately */
637c478bd9Sstevel@tonic-gate #define	LOG_CRIT	2	/* critical conditions */
647c478bd9Sstevel@tonic-gate #define	LOG_ERR		3	/* error conditions */
657c478bd9Sstevel@tonic-gate #define	LOG_WARNING	4	/* warning conditions */
667c478bd9Sstevel@tonic-gate #define	LOG_NOTICE	5	/* normal but signification condition */
677c478bd9Sstevel@tonic-gate #define	LOG_INFO	6	/* informational */
687c478bd9Sstevel@tonic-gate #define	LOG_DEBUG	7	/* debug-level messages */
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate #define	LOG_PRIMASK	0x0007	/* mask to extract priority part (internal) */
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate /*
737c478bd9Sstevel@tonic-gate  * arguments to setlogmask.
747c478bd9Sstevel@tonic-gate  */
757c478bd9Sstevel@tonic-gate #define	LOG_MASK(pri)	(1 << (pri))		/* mask for one priority */
767c478bd9Sstevel@tonic-gate #define	LOG_UPTO(pri)	((1 << ((pri)+1)) - 1)	/* all priorities through pri */
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate /*
797c478bd9Sstevel@tonic-gate  *  Option flags for openlog.
807c478bd9Sstevel@tonic-gate  *
817c478bd9Sstevel@tonic-gate  *	LOG_ODELAY no longer does anything; LOG_NDELAY is the
827c478bd9Sstevel@tonic-gate  *	inverse of what it used to be.
837c478bd9Sstevel@tonic-gate  */
847c478bd9Sstevel@tonic-gate #define	LOG_PID		0x01	/* log the pid with each message */
857c478bd9Sstevel@tonic-gate #define	LOG_CONS	0x02	/* log on the console if errors in sending */
867c478bd9Sstevel@tonic-gate #define	LOG_ODELAY	0x04	/* delay open until syslog() is called */
877c478bd9Sstevel@tonic-gate #define	LOG_NDELAY	0x08	/* don't delay open */
887c478bd9Sstevel@tonic-gate #define	LOG_NOWAIT	0x10	/* if forking to log on console, don't wait() */
897c478bd9Sstevel@tonic-gate 
907c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
917c478bd9Sstevel@tonic-gate }
927c478bd9Sstevel@tonic-gate #endif
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate #endif	/* _SYS_SYSLOG_H */
95