xref: /titanic_52/usr/src/lib/libresolv2/common/isc/logging_p.h (revision efd4c9b63ad77503c101fc6c2ed8ba96c9d52964)
1 /*
2  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (c) 1996-1999 by Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 #ifndef LOGGING_P_H
19 #define LOGGING_P_H
20 
21 typedef struct log_file_desc {
22 	char *name;
23 	size_t name_size;
24 	FILE *stream;
25 	unsigned int versions;
26 	unsigned long max_size;
27 	uid_t owner;
28 	gid_t group;
29 } log_file_desc;
30 
31 typedef union log_output {
32 	int facility;
33 	log_file_desc file;
34 } log_output;
35 
36 struct log_channel {
37 	int level;			/*%< don't log messages > level */
38 	log_channel_type type;
39 	log_output out;
40 	unsigned int flags;
41 	int references;
42 };
43 
44 typedef struct log_channel_list {
45 	log_channel channel;
46 	struct log_channel_list *next;
47 } *log_channel_list;
48 
49 #define LOG_BUFFER_SIZE 20480
50 
51 struct log_context {
52 	int num_categories;
53 	char **category_names;
54 	log_channel_list *categories;
55 	int flags;
56 	int level;
57 	char buffer[LOG_BUFFER_SIZE];
58 };
59 
60 #endif /* !LOGGING_P_H */
61 /*! \file */
62