1219089Spjd/*
2219089Spjd * CDDL HEADER START
3219089Spjd *
4219089Spjd * The contents of this file are subject to the terms of the
5219089Spjd * Common Development and Distribution License (the "License").
6219089Spjd * You may not use this file except in compliance with the License.
7219089Spjd *
8219089Spjd * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9219089Spjd * or http://www.opensolaris.org/os/licensing.
10219089Spjd * See the License for the specific language governing permissions
11219089Spjd * and limitations under the License.
12219089Spjd *
13219089Spjd * When distributing Covered Code, include this CDDL HEADER in each
14219089Spjd * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15219089Spjd * If applicable, add the following below this CDDL HEADER, with the
16219089Spjd * fields enclosed by brackets "[]" replaced with your own identifying
17219089Spjd * information: Portions Copyright [yyyy] [name of copyright owner]
18219089Spjd *
19219089Spjd * CDDL HEADER END
20219089Spjd */
21219089Spjd/*
22219089Spjd * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23219089Spjd * Use is subject to license terms.
24219089Spjd */
25219089Spjd
26219089Spjd#ifndef _ZUT_H
27219089Spjd#define	_ZUT_H
28219089Spjd
29219089Spjd/*
30219089Spjd * IOCTLs for the zfs unit test driver
31219089Spjd */
32219089Spjd
33219089Spjd#ifdef __cplusplus
34219089Spjdextern "C" {
35219089Spjd#endif
36219089Spjd
37219089Spjd#include <sys/param.h>
38219089Spjd#include <sys/types.h>
39219089Spjd#include <sys/stat.h>
40219089Spjd
41219089Spjd#define	ZUT_DRIVER	"zut"
42219089Spjd#define	ZUT_DEV		"/dev/zut"
43219089Spjd
44219089Spjd#define	ZUT_VERSION_STRING		"1"
45219089Spjd
46219089Spjd/*
47219089Spjd * /dev/zut ioctl numbers.
48219089Spjd */
49219089Spjd#define	ZUT_IOC		('U' << 8)
50219089Spjd
51219089Spjd/* Request flags */
52219089Spjd#define	ZUT_IGNORECASE		0x01
53219089Spjd#define	ZUT_ACCFILTER		0x02
54219089Spjd#define	ZUT_XATTR		0x04
55219089Spjd#define	ZUT_EXTRDDIR		0x08
56219089Spjd#define	ZUT_GETSTAT		0x10
57219089Spjd
58219089Spjdtypedef struct zut_lookup {
59219089Spjd	int	zl_reqflags;
60219089Spjd	int	zl_deflags;		/* output */
61219089Spjd	int	zl_retcode;		/* output */
62219089Spjd	char	zl_dir[MAXPATHLEN];
63219089Spjd	char	zl_file[MAXNAMELEN];
64219089Spjd	char	zl_xfile[MAXNAMELEN];
65219089Spjd	char	zl_real[MAXPATHLEN];	/* output */
66219089Spjd	uint64_t zl_xvattrs;		/* output */
67219089Spjd	struct stat64 zl_statbuf;	/* output */
68219089Spjd} zut_lookup_t;
69219089Spjd
70219089Spjdtypedef struct zut_readdir {
71219089Spjd	uint64_t zr_buf;		/* pointer to output buffer */
72219089Spjd	uint64_t zr_loffset;		/* output */
73219089Spjd	char	zr_dir[MAXPATHLEN];
74219089Spjd	char	zr_file[MAXNAMELEN];
75219089Spjd	int	zr_reqflags;
76219089Spjd	int	zr_retcode;		/* output */
77219089Spjd	int	zr_eof;			/* output */
78219089Spjd	uint_t	zr_bytes;		/* output */
79219089Spjd	uint_t	zr_buflen;
80219089Spjd} zut_readdir_t;
81219089Spjd
82219089Spjdtypedef enum zut_ioc {
83219089Spjd	ZUT_IOC_MIN_CMD = ZUT_IOC - 1,
84219089Spjd	ZUT_IOC_LOOKUP = ZUT_IOC,
85219089Spjd	ZUT_IOC_READDIR,
86219089Spjd	ZUT_IOC_MAX_CMD
87219089Spjd} zut_ioc_t;
88219089Spjd
89219089Spjd#ifdef __cplusplus
90219089Spjd}
91219089Spjd#endif
92219089Spjd
93219089Spjd#endif /* _ZUT_H */
94