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