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
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.
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]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <libnvpair.h>
33 #include <config_admin.h>
39 #define PCIDR_MALLOC_CNT 5
40 #define PCIDR_MALLOC_TIME 1000000
42 /* .._SYM and .._SYMSTR must match */
43 #define PCIDR_PLUGIN_SYM pcidr_event_handler
44 #define PCIDR_PLUGIN_SYMSTR "pcidr_event_handler"
45 #define PCIDR_PLUGIN_NAME "pcidr_plugin.so"
49 * these ATTRNM_* correspond to the built-in sysevent.conf macros
50 * Note that the "publisher" macro used by syseventd is only a subset (third
51 * colon-delimited field) of the full publisher-id string specified in an
52 * event buffer/message.
54 #define ATTRNM_CLASS "class"
55 #define ATTRNM_SUBCLASS "subclass"
56 #define ATTRNM_PUB_NAME "publisher"
58 /* be sure to match with dpritab! */
59 typedef enum {DNONE
= 0, DWARN
, DINFO
, DDEBUG
} dlvl_t
;
60 #define MIN_DLVL DNONE
61 #define MAX_DLVL DDEBUG
63 /* default set of DR attributes */
81 pcidr_logopt_t logopt
;
84 typedef int(*pcidr_plugin_t
)(nvlist_t
*, pcidr_opt_t
*);
85 #define PCIDR_PLUGIN_PROTO(a, b) \
86 int PCIDR_PLUGIN_SYM(nvlist_t *a, pcidr_opt_t *b)
89 void *pcidr_malloc(size_t);
90 void dprint(dlvl_t
, char *, ...);
91 int pcidr_name2type(char *, data_type_t
*);
92 void pcidr_print_attrlist(dlvl_t
, nvlist_t
*, char *);
93 int pcidr_check_string(char *, ...);
94 int pcidr_get_attrs(nvlist_t
*, pcidr_attrs_t
*);
95 int pcidr_check_attrs(pcidr_attrs_t
*);
96 void pcidr_set_logopt(pcidr_logopt_t
*);
103 extern int dpritab_len
;
109 #endif /* _PCIDR_H */