xref: /onnv-gate/usr/src/lib/libresolv2/common/isc/logging_p.h (revision 11038:74b12212b8a2)
10Sstevel@tonic-gate /*
2*11038SRao.Shoaib@Sun.COM  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
30Sstevel@tonic-gate  * Copyright (c) 1996-1999 by Internet Software Consortium.
40Sstevel@tonic-gate  *
50Sstevel@tonic-gate  * Permission to use, copy, modify, and distribute this software for any
60Sstevel@tonic-gate  * purpose with or without fee is hereby granted, provided that the above
70Sstevel@tonic-gate  * copyright notice and this permission notice appear in all copies.
80Sstevel@tonic-gate  *
9*11038SRao.Shoaib@Sun.COM  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
10*11038SRao.Shoaib@Sun.COM  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*11038SRao.Shoaib@Sun.COM  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
12*11038SRao.Shoaib@Sun.COM  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*11038SRao.Shoaib@Sun.COM  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*11038SRao.Shoaib@Sun.COM  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15*11038SRao.Shoaib@Sun.COM  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
160Sstevel@tonic-gate  */
170Sstevel@tonic-gate 
180Sstevel@tonic-gate #ifndef LOGGING_P_H
190Sstevel@tonic-gate #define LOGGING_P_H
200Sstevel@tonic-gate 
210Sstevel@tonic-gate typedef struct log_file_desc {
220Sstevel@tonic-gate 	char *name;
230Sstevel@tonic-gate 	size_t name_size;
240Sstevel@tonic-gate 	FILE *stream;
250Sstevel@tonic-gate 	unsigned int versions;
260Sstevel@tonic-gate 	unsigned long max_size;
270Sstevel@tonic-gate 	uid_t owner;
280Sstevel@tonic-gate 	gid_t group;
290Sstevel@tonic-gate } log_file_desc;
300Sstevel@tonic-gate 
310Sstevel@tonic-gate typedef union log_output {
320Sstevel@tonic-gate 	int facility;
330Sstevel@tonic-gate 	log_file_desc file;
340Sstevel@tonic-gate } log_output;
350Sstevel@tonic-gate 
360Sstevel@tonic-gate struct log_channel {
37*11038SRao.Shoaib@Sun.COM 	int level;			/*%< don't log messages > level */
380Sstevel@tonic-gate 	log_channel_type type;
390Sstevel@tonic-gate 	log_output out;
400Sstevel@tonic-gate 	unsigned int flags;
410Sstevel@tonic-gate 	int references;
420Sstevel@tonic-gate };
430Sstevel@tonic-gate 
440Sstevel@tonic-gate typedef struct log_channel_list {
450Sstevel@tonic-gate 	log_channel channel;
460Sstevel@tonic-gate 	struct log_channel_list *next;
470Sstevel@tonic-gate } *log_channel_list;
480Sstevel@tonic-gate 
490Sstevel@tonic-gate #define LOG_BUFFER_SIZE 20480
500Sstevel@tonic-gate 
510Sstevel@tonic-gate struct log_context {
520Sstevel@tonic-gate 	int num_categories;
530Sstevel@tonic-gate 	char **category_names;
540Sstevel@tonic-gate 	log_channel_list *categories;
550Sstevel@tonic-gate 	int flags;
560Sstevel@tonic-gate 	int level;
570Sstevel@tonic-gate 	char buffer[LOG_BUFFER_SIZE];
580Sstevel@tonic-gate };
590Sstevel@tonic-gate 
600Sstevel@tonic-gate #endif /* !LOGGING_P_H */
61*11038SRao.Shoaib@Sun.COM /*! \file */
62