Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / network / common / include / sys / syslog.h
blobb083557db6a66316059de922c6c567a2693c7844
1 /*
2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
4 * All rights reserved.
5 * Copyright (C) 2005 Neil Cafferkey
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Library General Public License
9 * version 2 as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this file; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 * MA 02111-1307, USA.
24 * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
25 * All rights reserved.
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. All advertising materials mentioning features or use of this software
36 * must display the following acknowledgement:
37 * This product includes software developed by the University of
38 * California, Berkeley and its contributors.
39 * 4. Neither the name of the University nor the names of its contributors
40 * may be used to endorse or promote products derived from this software
41 * without specific prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 * SUCH DAMAGE.
55 * @(#)syslog.h 7.20 (Berkeley) 2/23/91
58 #ifndef SYS_SYSLOG_H
59 #define SYS_SYSLOG_H
61 #define _PATH_LOG "t:bsdsocket.log"
62 #define _PATH_CON "con:0/0/600/100/bsdsocket.library log/AUTO/INACTIVE"
66 * priorities/facilities are encoded into a single 32-bit quantity, where the
67 * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
68 * (0-big number). Both the priorities and the facilities map roughly
69 * one-to-one to strings in the syslogd(8) source code. This mapping is
70 * included in this file.
72 * priorities (these are ordered)
74 #define LOG_EMERG 0 /* system is unusable */
75 #define LOG_ALERT 1 /* action must be taken immediately */
76 #define LOG_CRIT 2 /* critical conditions */
77 #define LOG_ERR 3 /* error conditions */
78 #define LOG_WARNING 4 /* warning conditions */
79 #define LOG_NOTICE 5 /* normal but significant condition */
80 #define LOG_INFO 6 /* informational */
81 #define LOG_DEBUG 7 /* debug-level messages */
83 #define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
84 /* extract priority */
85 #define LOG_PRI(p) ((p) & LOG_PRIMASK)
86 #define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
88 #ifdef SYSLOG_NAMES
89 #define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
90 /* mark "facility" */
91 #define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0)
92 typedef struct _code {
93 char *c_name;
94 int c_val;
95 } CODE;
97 CODE prioritynames[] = {
98 "alert", LOG_ALERT,
99 "crit", LOG_CRIT,
100 "debug", LOG_DEBUG,
101 "emerg", LOG_EMERG,
102 "err", LOG_ERR,
103 "error", LOG_ERR, /* DEPRECATED */
104 "info", LOG_INFO,
105 "none", INTERNAL_NOPRI, /* INTERNAL */
106 "notice", LOG_NOTICE,
107 "panic", LOG_EMERG, /* DEPRECATED */
108 "warn", LOG_WARNING, /* DEPRECATED */
109 "warning", LOG_WARNING,
110 NULL, -1,
112 #endif
114 /* facility codes */
115 #define LOG_KERN (0<<3) /* kernel messages */
116 #define LOG_USER (1<<3) /* random user-level messages */
117 #define LOG_MAIL (2<<3) /* mail system */
118 #define LOG_DAEMON (3<<3) /* system daemons */
119 #define LOG_AUTH (4<<3) /* security/authorization messages */
120 #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
121 #define LOG_LPR (6<<3) /* line printer subsystem */
122 #define LOG_NEWS (7<<3) /* network news subsystem */
123 #define LOG_UUCP (8<<3) /* UUCP subsystem */
124 #define LOG_CRON (9<<3) /* clock daemon */
125 #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
127 /* other codes through 15 reserved for system use */
128 #define LOG_LOCAL0 (16<<3) /* reserved for local use */
129 #define LOG_LOCAL1 (17<<3) /* reserved for local use */
130 #define LOG_LOCAL2 (18<<3) /* reserved for local use */
131 #define LOG_LOCAL3 (19<<3) /* reserved for local use */
132 #define LOG_LOCAL4 (20<<3) /* reserved for local use */
133 #define LOG_LOCAL5 (21<<3) /* reserved for local use */
134 #define LOG_LOCAL6 (22<<3) /* reserved for local use */
135 #define LOG_LOCAL7 (23<<3) /* reserved for local use */
137 #define LOG_NFACILITIES 24 /* current number of facilities */
138 #define LOG_FACMASK 0x03f8 /* mask to extract facility part */
139 /* facility of pri */
140 #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
143 #ifdef SYSLOG_NAMES
144 CODE facilitynames[] = {
145 "auth", LOG_AUTH,
146 "authpriv", LOG_AUTHPRIV,
147 "cron", LOG_CRON,
148 "daemon", LOG_DAEMON,
149 "kern", LOG_KERN,
150 "lpr", LOG_LPR,
151 "mail", LOG_MAIL,
152 "mark", INTERNAL_MARK, /* INTERNAL */
153 "news", LOG_NEWS,
154 "security", LOG_AUTH, /* DEPRECATED */
155 "syslog", LOG_SYSLOG,
156 "user", LOG_USER,
157 "uucp", LOG_UUCP,
158 "local0", LOG_LOCAL0,
159 "local1", LOG_LOCAL1,
160 "local2", LOG_LOCAL2,
161 "local3", LOG_LOCAL3,
162 "local4", LOG_LOCAL4,
163 "local5", LOG_LOCAL5,
164 "local6", LOG_LOCAL6,
165 "local7", LOG_LOCAL7,
166 NULL, -1,
168 #endif
170 #ifdef KERNEL
171 #define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */
172 #endif
175 * arguments to setlogmask.
177 #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
178 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
181 * Option flags for openlog.
183 * LOG_ODELAY no longer does anything.
184 * LOG_NDELAY is the inverse of what it used to be.
186 #define LOG_PID 0x01 /* log the pid with each message */
187 #define LOG_CONS 0x02 /* log on the console if errors in sending */
188 #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
189 #define LOG_NDELAY 0x08 /* don't delay open */
190 #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
191 #define LOG_PERROR 0x20 /* log to stderr as well */
193 #ifndef KERNEL
194 void openlog(const char *, int, int);
195 void closelog(void);
196 int setlogmask(int);
198 * Include protos/inlines/pragmas for the syslog()
199 * (+ all other AmiTCP functions)
201 #if !defined(__AROS__)
202 #ifndef BSDSOCKET_H
203 #include <bsdsocket.h>
204 #endif
205 #endif
206 #endif /* !KERNEL */
208 #endif /* !SYS_SYSLOG_H */