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