4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
25 * itree.h -- public definitions for itree module
36 /* the "fault" field in the event struct requires the definition of nvlist_t */
37 #include <sys/fm/protocol.h>
38 #include <fm/fmd_api.h>
40 /* Numerical representation of propagation N value (A), short for All */
44 * effects_test event cached_state bits
45 * - reset on each call to effects_test()
47 #define CREDIBLE_EFFECT 1
52 * arrow mark bits (for K-count)
54 #define EFFECTS_COUNTER 8
55 #define REQMNTS_COUNTER 16
58 * requirements_test event cached_state bits
60 #define REQMNTS_CREDIBLE 32
61 #define REQMNTS_DISPROVED 64
62 #define REQMNTS_WAIT 128
65 * requirements_test bubble mark bits
67 #define BUBBLE_ELIDED 256
71 * causes_test event cached_state bits
73 #define CAUSES_TESTED 1024
76 struct event
*suspects
;
77 struct event
*psuspects
;
78 struct event
*observations
; /* for lists like suspect list */
80 nvlist_t
*nvp
; /* payload nvp for ereports */
81 struct node
*enode
; /* event node in parse tree */
82 const struct ipath
*ipp
; /* instanced version of event */
83 const struct ipath
*ipp_un
; /* full version for Usednames */
84 struct lut
*props
; /* instanced version of nvpairs */
85 struct lut
*payloadprops
; /* nvpairs for problem payload */
86 struct lut
*serdprops
; /* nvpairs for dynamic serd args */
87 int count
; /* for reports, number seen */
88 enum nametype t
:3; /* defined in tree.h */
89 int is_suspect
:1; /* true if on suspect list */
92 unsigned long long cached_delay
;
95 struct event
*myevent
;
96 int gen
; /* generation # */
105 struct arrowlist
*next
;
109 /* prop node in parse tree */
111 struct constraintlist
{
112 struct constraintlist
*next
;
113 /* deferred constraints */
120 unsigned long long mindelay
;
121 unsigned long long maxdelay
;
128 * struct iterinfo is the stuff we store in the dictionary of iterators
129 * when we assign a value to an iterator. it not only contains the value
130 * we assigned to the iterator, it contains a node pointer which we use to
131 * determine if we're the one that defined the value when popping [vh]match()
139 struct lut
*itree_create(struct config
*croot
);
140 void itree_free(struct lut
*itp
);
141 void itree_prune(struct lut
*itp
);
142 struct event
*itree_lookup(struct lut
*itp
,
143 const char *ename
, const struct ipath
*ipp
);
145 struct arrowlist
*itree_next_arrow(struct bubble
*bubblep
,
146 struct arrowlist
*last
);
147 struct bubble
*itree_next_bubble(struct event
*eventp
, struct bubble
*last
);
148 struct constraintlist
*itree_next_constraint(struct arrow
*arrowp
,
149 struct constraintlist
*last
);
151 void itree_pevent_brief(int flags
, struct event
*eventp
);
152 void itree_ptree(int flags
, struct lut
*itp
);
154 const char *itree_bubbletype2str(enum bubbletype t
);
156 void itree_fini(void);
162 #endif /* _EFT_ITREE_H */