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