zinject.h revision ea8dc4b6d2251b437950c0056bc626b311c73c27
1ea8dc4beschrock/*
2ea8dc4beschrock * CDDL HEADER START
3ea8dc4beschrock *
4ea8dc4beschrock * The contents of this file are subject to the terms of the
5ea8dc4beschrock * Common Development and Distribution License (the "License").
6ea8dc4beschrock * You may not use this file except in compliance with the License.
7ea8dc4beschrock *
8ea8dc4beschrock * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9ea8dc4beschrock * or http://www.opensolaris.org/os/licensing.
10ea8dc4beschrock * See the License for the specific language governing permissions
11ea8dc4beschrock * and limitations under the License.
12ea8dc4beschrock *
13ea8dc4beschrock * When distributing Covered Code, include this CDDL HEADER in each
14ea8dc4beschrock * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15ea8dc4beschrock * If applicable, add the following below this CDDL HEADER, with the
16ea8dc4beschrock * fields enclosed by brackets "[]" replaced with your own identifying
17ea8dc4beschrock * information: Portions Copyright [yyyy] [name of copyright owner]
18ea8dc4beschrock *
19ea8dc4beschrock * CDDL HEADER END
20ea8dc4beschrock */
21ea8dc4beschrock/*
22ea8dc4beschrock * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23ea8dc4beschrock * Use is subject to license terms.
24ea8dc4beschrock */
25ea8dc4beschrock
26ea8dc4beschrock#ifndef	_ZINJECT_H
27ea8dc4beschrock#define	_ZINJECT_H
28ea8dc4beschrock
29ea8dc4beschrock#pragma ident	"%Z%%M%	%I%	%E% SMI"
30ea8dc4beschrock
31ea8dc4beschrock#include <sys/zfs_ioctl.h>
32ea8dc4beschrock
33ea8dc4beschrock#ifdef	__cplusplus
34ea8dc4beschrockextern "C" {
35ea8dc4beschrock#endif
36ea8dc4beschrock
37ea8dc4beschrocktypedef enum {
38ea8dc4beschrock	TYPE_DATA,		/* plain file contents		*/
39ea8dc4beschrock	TYPE_DNODE,		/* metadnode contents		*/
40ea8dc4beschrock	TYPE_MOS,		/* all MOS data			*/
41ea8dc4beschrock	TYPE_MOSDIR,		/* MOS object directory		*/
42ea8dc4beschrock	TYPE_METASLAB,		/* metaslab objects		*/
43ea8dc4beschrock	TYPE_CONFIG,		/* MOS config			*/
44ea8dc4beschrock	TYPE_BPLIST,		/* block pointer list		*/
45ea8dc4beschrock	TYPE_SPACEMAP,		/* space map objects		*/
46ea8dc4beschrock	TYPE_ERRLOG,		/* persistent error log		*/
47ea8dc4beschrock	TYPE_INVAL
48ea8dc4beschrock} err_type_t;
49ea8dc4beschrock
50ea8dc4beschrock#define	MOS_TYPE(t)	\
51ea8dc4beschrock	((t) >= TYPE_MOS && (t) < TYPE_INVAL)
52ea8dc4beschrock
53ea8dc4beschrockint translate_record(err_type_t type, const char *object, const char *range,
54ea8dc4beschrock    int level, zinject_record_t *record, char *poolname, char *dataset);
55ea8dc4beschrockint translate_raw(const char *raw, zinject_record_t *record);
56ea8dc4beschrockint translate_device(const char *pool, const char *device,
57ea8dc4beschrock    zinject_record_t *record);
58ea8dc4beschrockvoid usage(void);
59ea8dc4beschrock
60ea8dc4beschrock#ifdef	__cplusplus
61ea8dc4beschrock}
62ea8dc4beschrock#endif
63ea8dc4beschrock
64ea8dc4beschrock#endif	/* _ZINJECT_H */
65