xref: /illumos-gate/usr/src/cmd/fm/fminject/common/inj_event.h (revision 7a6d80f1660abd4755c68cbd094d4a914681d26e)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _INJ_EVENT_H
28 #define	_INJ_EVENT_H
29 
30 #include <inj.h>
31 #include <inj_string.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 extern inj_decl_t *inj_decl_create(inj_declmem_t *);
38 extern void inj_decl_addmem(inj_decl_t *, inj_declmem_t *);
39 extern void inj_decl_finish(inj_decl_t *, const char *, inj_itemtype_t);
40 extern void inj_decl_destroy(inj_decl_t *);
41 extern inj_decl_t *inj_decl_lookup(const char *, inj_itemtype_t);
42 
43 extern inj_declmem_t *inj_decl_mem_create(const char *, inj_memtype_t);
44 extern inj_declmem_t *inj_decl_mem_create_defined(const char *, const char *,
45     inj_itemtype_t);
46 extern inj_declmem_t *inj_decl_mem_create_enum(const char *, inj_hash_t *);
47 extern void inj_decl_mem_destroy(inj_declmem_t *);
48 extern void inj_decl_mem_make_array(inj_declmem_t *, uint_t);
49 
50 extern inj_defn_t *inj_defn_create(inj_defnmem_t *);
51 extern void inj_defn_addmem(inj_defn_t *, inj_defnmem_t *);
52 extern void inj_defn_finish(inj_defn_t *, const char *, const char *,
53     inj_itemtype_t);
54 extern inj_defn_t *inj_defn_lookup(const char *, inj_memtype_t);
55 
56 extern inj_defnmem_t *inj_defn_mem_create(const char *, inj_defnmemtype_t);
57 extern inj_defnmem_t *inj_defn_mem_create_list(inj_defn_t *,
58     inj_defnmemtype_t);
59 
60 extern const char *inj_item2str(inj_itemtype_t);
61 extern inj_memtype_t inj_item2mem(inj_itemtype_t);
62 extern const char *inj_mem2str(inj_memtype_t);
63 extern inj_itemtype_t inj_mem2item(inj_memtype_t);
64 
65 extern inj_randelem_t *inj_rand_create(inj_defn_t *, uint_t);
66 extern inj_randelem_t *inj_rand_add(inj_randelem_t *, inj_randelem_t *);
67 
68 extern void inj_cmds_add(inj_cmd_t *);
69 extern inj_list_t *inj_cmds_get(void);
70 
71 extern inj_cmd_t *inj_cmd_rand(inj_randelem_t *);
72 extern inj_cmd_t *inj_cmd_repeat(inj_cmd_t *, uint_t);
73 extern inj_cmd_t *inj_cmd_send(inj_defn_t *);
74 extern inj_cmd_t *inj_cmd_sleep(uint_t);
75 extern inj_cmd_t *inj_cmd_addhrt(hrtime_t);
76 extern inj_cmd_t *inj_cmd_endhrt(void);
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* _INJ_EVENT_H */
83