xref: /titanic_50/usr/src/cmd/fm/fminject/common/inj_event.h (revision 3db86aab554edbb4244c8d1a1c90f152eee768af)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <inj.h>
33 #include <inj_string.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 extern inj_decl_t *inj_decl_create(inj_declmem_t *);
40 extern void inj_decl_addmem(inj_decl_t *, inj_declmem_t *);
41 extern void inj_decl_finish(inj_decl_t *, const char *, inj_itemtype_t);
42 extern void inj_decl_destroy(inj_decl_t *);
43 extern inj_decl_t *inj_decl_lookup(const char *, inj_itemtype_t);
44 
45 extern inj_declmem_t *inj_decl_mem_create(const char *, inj_memtype_t);
46 extern inj_declmem_t *inj_decl_mem_create_defined(const char *, const char *,
47     inj_itemtype_t);
48 extern inj_declmem_t *inj_decl_mem_create_enum(const char *, inj_hash_t *);
49 extern void inj_decl_mem_destroy(inj_declmem_t *);
50 extern void inj_decl_mem_make_array(inj_declmem_t *, uint_t);
51 
52 extern inj_defn_t *inj_defn_create(inj_defnmem_t *);
53 extern void inj_defn_addmem(inj_defn_t *, inj_defnmem_t *);
54 extern void inj_defn_finish(inj_defn_t *, const char *, const char *,
55     inj_itemtype_t);
56 extern inj_defn_t *inj_defn_lookup(const char *, inj_memtype_t);
57 
58 extern inj_defnmem_t *inj_defn_mem_create(const char *, inj_defnmemtype_t);
59 extern inj_defnmem_t *inj_defn_mem_create_list(inj_defn_t *,
60     inj_defnmemtype_t);
61 
62 extern const char *inj_item2str(inj_itemtype_t);
63 extern inj_memtype_t inj_item2mem(inj_itemtype_t);
64 extern const char *inj_mem2str(inj_memtype_t);
65 extern inj_itemtype_t inj_mem2item(inj_memtype_t);
66 
67 extern inj_randelem_t *inj_rand_create(inj_defn_t *, uint_t);
68 extern inj_randelem_t *inj_rand_add(inj_randelem_t *, inj_randelem_t *);
69 
70 extern void inj_cmds_add(inj_cmd_t *);
71 extern inj_list_t *inj_cmds_get(void);
72 
73 extern inj_cmd_t *inj_cmd_rand(inj_randelem_t *);
74 extern inj_cmd_t *inj_cmd_repeat(inj_cmd_t *, uint_t);
75 extern inj_cmd_t *inj_cmd_send(inj_defn_t *);
76 extern inj_cmd_t *inj_cmd_sleep(uint_t);
77 extern inj_cmd_t *inj_cmd_addhrt(hrtime_t);
78 extern inj_cmd_t *inj_cmd_endhrt(void);
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif /* _INJ_EVENT_H */
85