1*f6e214c7SGavin Maltby /*
2*f6e214c7SGavin Maltby  * CDDL HEADER START
3*f6e214c7SGavin Maltby  *
4*f6e214c7SGavin Maltby  * The contents of this file are subject to the terms of the
5*f6e214c7SGavin Maltby  * Common Development and Distribution License (the "License").
6*f6e214c7SGavin Maltby  * You may not use this file except in compliance with the License.
7*f6e214c7SGavin Maltby  *
8*f6e214c7SGavin Maltby  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*f6e214c7SGavin Maltby  * or http://www.opensolaris.org/os/licensing.
10*f6e214c7SGavin Maltby  * See the License for the specific language governing permissions
11*f6e214c7SGavin Maltby  * and limitations under the License.
12*f6e214c7SGavin Maltby  *
13*f6e214c7SGavin Maltby  * When distributing Covered Code, include this CDDL HEADER in each
14*f6e214c7SGavin Maltby  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*f6e214c7SGavin Maltby  * If applicable, add the following below this CDDL HEADER, with the
16*f6e214c7SGavin Maltby  * fields enclosed by brackets "[]" replaced with your own identifying
17*f6e214c7SGavin Maltby  * information: Portions Copyright [yyyy] [name of copyright owner]
18*f6e214c7SGavin Maltby  *
19*f6e214c7SGavin Maltby  * CDDL HEADER END
20*f6e214c7SGavin Maltby  */
21*f6e214c7SGavin Maltby 
22*f6e214c7SGavin Maltby /*
23*f6e214c7SGavin Maltby  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24*f6e214c7SGavin Maltby  */
25*f6e214c7SGavin Maltby 
26*f6e214c7SGavin Maltby #ifndef _LIBFMEVENT_RULESET_H
27*f6e214c7SGavin Maltby #define	_LIBFMEVENT_RULESET_H
28*f6e214c7SGavin Maltby 
29*f6e214c7SGavin Maltby /*
30*f6e214c7SGavin Maltby  * Event Rulesets.  A ruleset is selected by a (namespace, subsystem)
31*f6e214c7SGavin Maltby  * combination, which together we call a "ruleset" selection for that
32*f6e214c7SGavin Maltby  * namespace.  The strings can be any ascii string not including
33*f6e214c7SGavin Maltby  * control characters or DEL.
34*f6e214c7SGavin Maltby  *
35*f6e214c7SGavin Maltby  * Selection of a ruleset determines how a "raw" event that we publish
36*f6e214c7SGavin Maltby  * using the libfmevent publication interfaces is post-processed into
37*f6e214c7SGavin Maltby  * a full protocol event.
38*f6e214c7SGavin Maltby  *
39*f6e214c7SGavin Maltby  * New rulesets must follow the FMA Event Registry and Portfolio Review
40*f6e214c7SGavin Maltby  * process.  At this time only FMEV_RULESET_SMF and FMEV_RULESET_ON_SUNOS
41*f6e214c7SGavin Maltby  * rulesets are adopted by that process - the others listed here are
42*f6e214c7SGavin Maltby  * experimental.
43*f6e214c7SGavin Maltby  */
44*f6e214c7SGavin Maltby 
45*f6e214c7SGavin Maltby #define	FMEV_MAX_RULESET_LEN	31
46*f6e214c7SGavin Maltby 
47*f6e214c7SGavin Maltby #define	FMEV_RS_SEPARATOR		"\012"
48*f6e214c7SGavin Maltby #define	FMEV_MKRS(v, s)			FMEV_V_##v FMEV_RS_SEPARATOR s
49*f6e214c7SGavin Maltby 
50*f6e214c7SGavin Maltby /*
51*f6e214c7SGavin Maltby  * Namespaces
52*f6e214c7SGavin Maltby  */
53*f6e214c7SGavin Maltby #define	FMEV_V_ALL		"*"
54*f6e214c7SGavin Maltby #define	FMEV_V_SOLARIS_ON	"solaris-osnet"	/* Solaris ON Consolidation */
55*f6e214c7SGavin Maltby 
56*f6e214c7SGavin Maltby /*
57*f6e214c7SGavin Maltby  * Generic and namespace-agnostic rulesets
58*f6e214c7SGavin Maltby  */
59*f6e214c7SGavin Maltby #define	FMEV_RULESET_UNREGISTERED	FMEV_MKRS(ALL, "unregistered")
60*f6e214c7SGavin Maltby #define	FMEV_RULESET_DEFAULT		FMEV_RULESET_UNREGISTERED
61*f6e214c7SGavin Maltby #define	FMEV_RULESET_SMF		FMEV_MKRS(ALL, "smf")
62*f6e214c7SGavin Maltby 
63*f6e214c7SGavin Maltby /*
64*f6e214c7SGavin Maltby  * Solaris ON rulesets
65*f6e214c7SGavin Maltby  */
66*f6e214c7SGavin Maltby #define	FMEV_RULESET_ON_EREPORT		FMEV_MKRS(SOLARIS_ON, "ereport")
67*f6e214c7SGavin Maltby #define	FMEV_RULESET_ON_SUNOS		FMEV_MKRS(SOLARIS_ON, "sunos")
68*f6e214c7SGavin Maltby #define	FMEV_RULESET_ON_PRIVATE		FMEV_MKRS(SOLARIS_ON, "private")
69*f6e214c7SGavin Maltby 
70*f6e214c7SGavin Maltby #ifdef __cplusplus
71*f6e214c7SGavin Maltby extern "C" {
72*f6e214c7SGavin Maltby #endif
73*f6e214c7SGavin Maltby 
74*f6e214c7SGavin Maltby #ifdef __cplusplus
75*f6e214c7SGavin Maltby }
76*f6e214c7SGavin Maltby #endif
77*f6e214c7SGavin Maltby 
78*f6e214c7SGavin Maltby #endif /* _LIBFMEVENT_RULESET_H */
79