1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 3*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 4*7c478bd9Sstevel@tonic-gate */ 5*7c478bd9Sstevel@tonic-gate 6*7c478bd9Sstevel@tonic-gate /* Copyright (c) 1988 AT&T */ 7*7c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 8*7c478bd9Sstevel@tonic-gate 9*7c478bd9Sstevel@tonic-gate /* 10*7c478bd9Sstevel@tonic-gate * University Copyright- Copyright (c) 1982, 1986, 1988 11*7c478bd9Sstevel@tonic-gate * The Regents of the University of California 12*7c478bd9Sstevel@tonic-gate * All Rights Reserved 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * University Acknowledgment- Portions of this document are derived from 15*7c478bd9Sstevel@tonic-gate * software developed by the University of California, Berkeley, and its 16*7c478bd9Sstevel@tonic-gate * contributors. 17*7c478bd9Sstevel@tonic-gate */ 18*7c478bd9Sstevel@tonic-gate 19*7c478bd9Sstevel@tonic-gate #ifndef _SYS_SYSLOG_H 20*7c478bd9Sstevel@tonic-gate #define _SYS_SYSLOG_H 21*7c478bd9Sstevel@tonic-gate 22*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 23*7c478bd9Sstevel@tonic-gate 24*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 25*7c478bd9Sstevel@tonic-gate extern "C" { 26*7c478bd9Sstevel@tonic-gate #endif 27*7c478bd9Sstevel@tonic-gate 28*7c478bd9Sstevel@tonic-gate /* 29*7c478bd9Sstevel@tonic-gate * Facility codes 30*7c478bd9Sstevel@tonic-gate */ 31*7c478bd9Sstevel@tonic-gate #define LOG_KERN (0<<3) /* kernel messages */ 32*7c478bd9Sstevel@tonic-gate #define LOG_USER (1<<3) /* random user-level messages */ 33*7c478bd9Sstevel@tonic-gate #define LOG_MAIL (2<<3) /* mail system */ 34*7c478bd9Sstevel@tonic-gate #define LOG_DAEMON (3<<3) /* system daemons */ 35*7c478bd9Sstevel@tonic-gate #define LOG_AUTH (4<<3) /* security/authorization messages */ 36*7c478bd9Sstevel@tonic-gate #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ 37*7c478bd9Sstevel@tonic-gate #define LOG_LPR (6<<3) /* line printer subsystem */ 38*7c478bd9Sstevel@tonic-gate #define LOG_NEWS (7<<3) /* netnews subsystem */ 39*7c478bd9Sstevel@tonic-gate #define LOG_UUCP (8<<3) /* uucp subsystem */ 40*7c478bd9Sstevel@tonic-gate #define LOG_AUDIT (13<<3) /* audit subsystem */ 41*7c478bd9Sstevel@tonic-gate #define LOG_CRON (15<<3) /* cron/at subsystem */ 42*7c478bd9Sstevel@tonic-gate /* other codes through 15 reserved for system use */ 43*7c478bd9Sstevel@tonic-gate #define LOG_LOCAL0 (16<<3) /* reserved for local use */ 44*7c478bd9Sstevel@tonic-gate #define LOG_LOCAL1 (17<<3) /* reserved for local use */ 45*7c478bd9Sstevel@tonic-gate #define LOG_LOCAL2 (18<<3) /* reserved for local use */ 46*7c478bd9Sstevel@tonic-gate #define LOG_LOCAL3 (19<<3) /* reserved for local use */ 47*7c478bd9Sstevel@tonic-gate #define LOG_LOCAL4 (20<<3) /* reserved for local use */ 48*7c478bd9Sstevel@tonic-gate #define LOG_LOCAL5 (21<<3) /* reserved for local use */ 49*7c478bd9Sstevel@tonic-gate #define LOG_LOCAL6 (22<<3) /* reserved for local use */ 50*7c478bd9Sstevel@tonic-gate #define LOG_LOCAL7 (23<<3) /* reserved for local use */ 51*7c478bd9Sstevel@tonic-gate 52*7c478bd9Sstevel@tonic-gate #define LOG_NFACILITIES 24 /* maximum number of facilities */ 53*7c478bd9Sstevel@tonic-gate #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ 54*7c478bd9Sstevel@tonic-gate 55*7c478bd9Sstevel@tonic-gate /* 56*7c478bd9Sstevel@tonic-gate * Priorities (these are ordered) 57*7c478bd9Sstevel@tonic-gate */ 58*7c478bd9Sstevel@tonic-gate #define LOG_EMERG 0 /* system is unusable */ 59*7c478bd9Sstevel@tonic-gate #define LOG_ALERT 1 /* action must be taken immediately */ 60*7c478bd9Sstevel@tonic-gate #define LOG_CRIT 2 /* critical conditions */ 61*7c478bd9Sstevel@tonic-gate #define LOG_ERR 3 /* error conditions */ 62*7c478bd9Sstevel@tonic-gate #define LOG_WARNING 4 /* warning conditions */ 63*7c478bd9Sstevel@tonic-gate #define LOG_NOTICE 5 /* normal but signification condition */ 64*7c478bd9Sstevel@tonic-gate #define LOG_INFO 6 /* informational */ 65*7c478bd9Sstevel@tonic-gate #define LOG_DEBUG 7 /* debug-level messages */ 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate #define LOG_PRIMASK 0x0007 /* mask to extract priority part (internal) */ 68*7c478bd9Sstevel@tonic-gate 69*7c478bd9Sstevel@tonic-gate /* 70*7c478bd9Sstevel@tonic-gate * arguments to setlogmask. 71*7c478bd9Sstevel@tonic-gate */ 72*7c478bd9Sstevel@tonic-gate #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ 73*7c478bd9Sstevel@tonic-gate #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ 74*7c478bd9Sstevel@tonic-gate 75*7c478bd9Sstevel@tonic-gate /* 76*7c478bd9Sstevel@tonic-gate * Option flags for openlog. 77*7c478bd9Sstevel@tonic-gate * 78*7c478bd9Sstevel@tonic-gate * LOG_ODELAY no longer does anything; LOG_NDELAY is the 79*7c478bd9Sstevel@tonic-gate * inverse of what it used to be. 80*7c478bd9Sstevel@tonic-gate */ 81*7c478bd9Sstevel@tonic-gate #define LOG_PID 0x01 /* log the pid with each message */ 82*7c478bd9Sstevel@tonic-gate #define LOG_CONS 0x02 /* log on the console if errors in sending */ 83*7c478bd9Sstevel@tonic-gate #define LOG_ODELAY 0x04 /* delay open until syslog() is called */ 84*7c478bd9Sstevel@tonic-gate #define LOG_NDELAY 0x08 /* don't delay open */ 85*7c478bd9Sstevel@tonic-gate #define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */ 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 88*7c478bd9Sstevel@tonic-gate } 89*7c478bd9Sstevel@tonic-gate #endif 90*7c478bd9Sstevel@tonic-gate 91*7c478bd9Sstevel@tonic-gate #endif /* _SYS_SYSLOG_H */ 92