xref: /titanic_41/usr/src/common/net/wanboot/bootlog.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2002-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _BOOTLOG_H
28 #define	_BOOTLOG_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * bootlog - error notification and progress reporting interface
34  *          for WAN boot components
35  * XXX some of this stuff should be split out into a bootlog_impl.h file.
36  */
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /*
43  * code translation struct for use in processing config file
44  */
45 struct code {
46 	char	*c_name;
47 	int	c_val;
48 };
49 
50 #define	BOOTLOG_CONN_RETRIES	3	/* max http connect retries */
51 #define	BOOTLOG_HTTP_TIMEOUT	10	/* http read timeout */
52 
53 #define	BOOTLOG_MAX_URL 1024		/* max bootlog URL len */
54 #define	BOOTLOG_QS_MAX	1024		/* max unencoded len of query string */
55 
56 #define	BOOTLOG_MSG_MAX_LEN 80		/* maximum message body length */
57 
58 /*
59  * severity codes
60  */
61 typedef enum {
62 	BOOTLOG_EMERG =	1,	/* panic condition */
63 	BOOTLOG_ALERT,		/* condition that should be corrected now */
64 	BOOTLOG_CRIT,		/* critical condition - e.g. network errors */
65 	BOOTLOG_WARNING,	/* warning messages */
66 	BOOTLOG_INFO,		/* informational messages */
67 	BOOTLOG_PROGRESS,	/* progress reports */
68 	BOOTLOG_DEBUG,		/* debug messages */
69 	BOOTLOG_VERBOSE,	/* verbose mode messages */
70 	NOPRI			/* 'no-priority' priority */
71 } bootlog_severity_t;
72 
73 
74 /* PRINTFLIKE3 */
75 extern void bootlog(const char *, bootlog_severity_t, char *, ...);
76 /* PRINTFLIKE2 */
77 extern void libbootlog(bootlog_severity_t, char *, ...);
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif /* _BOOTLOG_H */
84